0095717254ef7b68c47a416d7741bcf50fc21a62
[dpdk.git] / drivers / net / bnxt / hsi_struct_def_dpdk.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2014-2019 Broadcom Inc.
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-0xFFFC, 0xFFFE - Reserved for internal processors
31          * * 0xFFFD - Reserved for user-space HWRM interface
32          * * 0xFFFF - HWRM
33          */
34         uint16_t        target_id;
35         /*
36          * A physical address pointer pointing to a host buffer that the
37          * command's response data will be written. This can be either a host
38          * physical address (HPA) or a guest physical address (GPA) and must
39          * point to a physically contiguous block of memory.
40          */
41         uint64_t        resp_addr;
42 } __attribute__((packed));
43
44 /* This is the HWRM response header. */
45 /* hwrm_resp_hdr (size:64b/8B) */
46 struct hwrm_resp_hdr {
47         /* The specific error status for the command. */
48         uint16_t        error_code;
49         /* The HWRM command request type. */
50         uint16_t        req_type;
51         /* The sequence ID from the original command. */
52         uint16_t        seq_id;
53         /* The length of the response data in number of bytes. */
54         uint16_t        resp_len;
55 } __attribute__((packed));
56
57 /*
58  * TLV encapsulated message. Use the TLV type field of the
59  * TLV to determine the type of message encapsulated.
60  */
61 #define CMD_DISCR_TLV_ENCAP UINT32_C(0x8000)
62 #define CMD_DISCR_LAST     CMD_DISCR_TLV_ENCAP
63
64
65 /* HWRM request message */
66 #define TLV_TYPE_HWRM_REQUEST                    UINT32_C(0x1)
67 /* HWRM response message */
68 #define TLV_TYPE_HWRM_RESPONSE                   UINT32_C(0x2)
69 /* RoCE slow path command */
70 #define TLV_TYPE_ROCE_SP_COMMAND                 UINT32_C(0x3)
71 /* RoCE slow path command to query CC Gen1 support. */
72 #define TLV_TYPE_QUERY_ROCE_CC_GEN1              UINT32_C(0x4)
73 /* RoCE slow path command to modify CC Gen1 support. */
74 #define TLV_TYPE_MODIFY_ROCE_CC_GEN1             UINT32_C(0x5)
75 /* Engine CKV - The Alias key EC curve and ECC public key information. */
76 #define TLV_TYPE_ENGINE_CKV_ALIAS_ECC_PUBLIC_KEY UINT32_C(0x8001)
77 /* Engine CKV - Initialization vector. */
78 #define TLV_TYPE_ENGINE_CKV_IV                   UINT32_C(0x8003)
79 /* Engine CKV - Authentication tag. */
80 #define TLV_TYPE_ENGINE_CKV_AUTH_TAG             UINT32_C(0x8004)
81 /* Engine CKV - The encrypted data. */
82 #define TLV_TYPE_ENGINE_CKV_CIPHERTEXT           UINT32_C(0x8005)
83 /* Engine CKV - Supported algorithms. */
84 #define TLV_TYPE_ENGINE_CKV_ALGORITHMS           UINT32_C(0x8006)
85 /* Engine CKV - The Host EC curve name and ECC public key information. */
86 #define TLV_TYPE_ENGINE_CKV_HOST_ECC_PUBLIC_KEY  UINT32_C(0x8007)
87 /* Engine CKV - The ECDSA signature. */
88 #define TLV_TYPE_ENGINE_CKV_ECDSA_SIGNATURE      UINT32_C(0x8008)
89 /* Engine CKV - The SRT EC curve name and ECC public key information. */
90 #define TLV_TYPE_ENGINE_CKV_SRT_ECC_PUBLIC_KEY   UINT32_C(0x8009)
91 #define TLV_TYPE_LAST \
92         TLV_TYPE_ENGINE_CKV_SRT_ECC_PUBLIC_KEY
93
94
95 /* tlv (size:64b/8B) */
96 struct tlv {
97         /*
98          * The command discriminator is used to differentiate between various
99          * types of HWRM messages. This includes legacy HWRM and RoCE slowpath
100          * command messages as well as newer TLV encapsulated HWRM commands.
101          *
102          * For TLV encapsulated messages this field must be 0x8000.
103          */
104         uint16_t        cmd_discr;
105         uint8_t reserved_8b;
106         uint8_t flags;
107         /*
108          * Indicates the presence of additional TLV encapsulated data
109          * follows this TLV.
110          */
111         #define TLV_FLAGS_MORE         UINT32_C(0x1)
112         /* Last TLV in a sequence of TLVs. */
113         #define TLV_FLAGS_MORE_LAST      UINT32_C(0x0)
114         /* More TLVs follow this TLV. */
115         #define TLV_FLAGS_MORE_NOT_LAST  UINT32_C(0x1)
116         /*
117          * When an HWRM receiver detects a TLV type that it does not
118          * support with the TLV required flag set, the receiver must
119          * reject the HWRM message with an error code indicating an
120          * unsupported TLV type.
121          */
122         #define TLV_FLAGS_REQUIRED     UINT32_C(0x2)
123         /* No */
124         #define TLV_FLAGS_REQUIRED_NO    (UINT32_C(0x0) << 1)
125         /* Yes */
126         #define TLV_FLAGS_REQUIRED_YES   (UINT32_C(0x1) << 1)
127         #define TLV_FLAGS_REQUIRED_LAST TLV_FLAGS_REQUIRED_YES
128         /*
129          * This field defines the TLV type value which is divided into
130          * two ranges to differentiate between global and local TLV types.
131          * Global TLV types must be unique across all defined TLV types.
132          * Local TLV types are valid only for extensions to a given
133          * HWRM message and may be repeated across different HWRM message
134          * types. There is a direct correlation of each HWRM message type
135          * to a single global TLV type value.
136          *
137          * Global TLV range: `0 - (63k-1)`
138          *
139          * Local TLV range: `63k - (64k-1)`
140          */
141         uint16_t        tlv_type;
142         /*
143          * Length of the message data encapsulated by this TLV in bytes.
144          * This length does not include the size of the TLV header itself
145          * and it must be an integer multiple of 8B.
146          */
147         uint16_t        length;
148 } __attribute__((packed));
149
150 /* Input */
151 /* input (size:128b/16B) */
152 struct input {
153         /*
154          * This value indicates what type of request this is.  The format
155          * for the rest of the command is determined by this field.
156          */
157         uint16_t        req_type;
158         /*
159          * This value indicates the what completion ring the request will
160          * be optionally completed on.  If the value is -1, then no
161          * CR completion will be generated.  Any other value must be a
162          * valid CR ring_id value for this function.
163          */
164         uint16_t        cmpl_ring;
165         /* This value indicates the command sequence number. */
166         uint16_t        seq_id;
167         /*
168          * Target ID of this command.
169          *
170          * 0x0 - 0xFFF8 - Used for function ids
171          * 0xFFF8 - 0xFFFE - Reserved for internal processors
172          * 0xFFFF - HWRM
173          */
174         uint16_t        target_id;
175         /*
176          * This is the host address where the response will be written
177          * when the request is complete.  This area must be 16B aligned
178          * and must be cleared to zero before the request is made.
179          */
180         uint64_t        resp_addr;
181 } __attribute__((packed));
182
183 /* Output */
184 /* output (size:64b/8B) */
185 struct output {
186         /*
187          * Pass/Fail or error type
188          *
189          * Note: receiver to verify the in parameters, and fail the call
190          * with an error when appropriate
191          */
192         uint16_t        error_code;
193         /* This field returns the type of original request. */
194         uint16_t        req_type;
195         /* This field provides original sequence number of the command. */
196         uint16_t        seq_id;
197         /*
198          * This field is the length of the response in bytes.  The
199          * last byte of the response is a valid flag that will read
200          * as '1' when the command has been completely written to
201          * memory.
202          */
203         uint16_t        resp_len;
204 } __attribute__((packed));
205
206 /* Short Command Structure */
207 /* hwrm_short_input (size:128b/16B) */
208 struct hwrm_short_input {
209         /*
210          * This field indicates the type of request in the request buffer.
211          * The format for the rest of the command (request) is determined
212          * by this field.
213          */
214         uint16_t        req_type;
215         /*
216          * This field indicates a signature that is used to identify short
217          * form of the command listed here. This field shall be set to
218          * 17185 (0x4321).
219          */
220         uint16_t        signature;
221         /* Signature indicating this is a short form of HWRM command */
222         #define HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD UINT32_C(0x4321)
223         #define HWRM_SHORT_INPUT_SIGNATURE_LAST \
224                 HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD
225         /* The target ID of the command */
226         uint16_t        target_id;
227         /* Default target_id (0x0) to maintain compatibility with old driver */
228         #define HWRM_SHORT_INPUT_TARGET_ID_DEFAULT UINT32_C(0x0)
229         /* Reserved for user-space HWRM interface */
230         #define HWRM_SHORT_INPUT_TARGET_ID_TOOLS   UINT32_C(0xfffd)
231         #define HWRM_SHORT_INPUT_TARGET_ID_LAST \
232                 HWRM_SHORT_INPUT_TARGET_ID_TOOLS
233         /* This value indicates the length of the request. */
234         uint16_t        size;
235         /*
236          * This is the host address where the request was written.
237          * This area must be 16B aligned.
238          */
239         uint64_t        req_addr;
240 } __attribute__((packed));
241
242 /*
243  * Command numbering
244  * # NOTE - definitions already in hwrm_req_type, in hwrm_types.yaml
245  * #        So only structure definition is provided here.
246  */
247 /* cmd_nums (size:64b/8B) */
248 struct cmd_nums {
249         /*
250          * This version of the specification defines the commands listed in
251          * the table below. The following are general implementation
252          * requirements for these commands:
253          *
254          * # All commands listed below that are marked neither
255          * reserved nor experimental shall be implemented by the HWRM.
256          * # A HWRM client compliant to this specification should not use
257          * commands outside of the list below.
258          * # A HWRM client compliant to this specification should not use
259          * command numbers marked reserved below.
260          * # A command marked experimental below may not be implemented
261          * by the HWRM.
262          * # A command marked experimental may change in the
263          * future version of the HWRM specification.
264          * # A command not listed below may be implemented by the HWRM.
265          * The behavior of commands that are not listed below is outside
266          * the scope of this specification.
267          */
268         uint16_t        req_type;
269         #define HWRM_VER_GET                              UINT32_C(0x0)
270         #define HWRM_ERROR_RECOVERY_QCFG                  UINT32_C(0xc)
271         #define HWRM_FUNC_DRV_IF_CHANGE                   UINT32_C(0xd)
272         #define HWRM_FUNC_BUF_UNRGTR                      UINT32_C(0xe)
273         #define HWRM_FUNC_VF_CFG                          UINT32_C(0xf)
274         /* Reserved for future use. */
275         #define HWRM_RESERVED1                            UINT32_C(0x10)
276         #define HWRM_FUNC_RESET                           UINT32_C(0x11)
277         #define HWRM_FUNC_GETFID                          UINT32_C(0x12)
278         #define HWRM_FUNC_VF_ALLOC                        UINT32_C(0x13)
279         #define HWRM_FUNC_VF_FREE                         UINT32_C(0x14)
280         #define HWRM_FUNC_QCAPS                           UINT32_C(0x15)
281         #define HWRM_FUNC_QCFG                            UINT32_C(0x16)
282         #define HWRM_FUNC_CFG                             UINT32_C(0x17)
283         #define HWRM_FUNC_QSTATS                          UINT32_C(0x18)
284         #define HWRM_FUNC_CLR_STATS                       UINT32_C(0x19)
285         #define HWRM_FUNC_DRV_UNRGTR                      UINT32_C(0x1a)
286         #define HWRM_FUNC_VF_RESC_FREE                    UINT32_C(0x1b)
287         #define HWRM_FUNC_VF_VNIC_IDS_QUERY               UINT32_C(0x1c)
288         #define HWRM_FUNC_DRV_RGTR                        UINT32_C(0x1d)
289         #define HWRM_FUNC_DRV_QVER                        UINT32_C(0x1e)
290         #define HWRM_FUNC_BUF_RGTR                        UINT32_C(0x1f)
291         #define HWRM_PORT_PHY_CFG                         UINT32_C(0x20)
292         #define HWRM_PORT_MAC_CFG                         UINT32_C(0x21)
293         /* Experimental */
294         #define HWRM_PORT_TS_QUERY                        UINT32_C(0x22)
295         #define HWRM_PORT_QSTATS                          UINT32_C(0x23)
296         #define HWRM_PORT_LPBK_QSTATS                     UINT32_C(0x24)
297         /* Experimental */
298         #define HWRM_PORT_CLR_STATS                       UINT32_C(0x25)
299         /* Experimental */
300         #define HWRM_PORT_LPBK_CLR_STATS                  UINT32_C(0x26)
301         #define HWRM_PORT_PHY_QCFG                        UINT32_C(0x27)
302         #define HWRM_PORT_MAC_QCFG                        UINT32_C(0x28)
303         /* Experimental */
304         #define HWRM_PORT_MAC_PTP_QCFG                    UINT32_C(0x29)
305         #define HWRM_PORT_PHY_QCAPS                       UINT32_C(0x2a)
306         #define HWRM_PORT_PHY_I2C_WRITE                   UINT32_C(0x2b)
307         #define HWRM_PORT_PHY_I2C_READ                    UINT32_C(0x2c)
308         #define HWRM_PORT_LED_CFG                         UINT32_C(0x2d)
309         #define HWRM_PORT_LED_QCFG                        UINT32_C(0x2e)
310         #define HWRM_PORT_LED_QCAPS                       UINT32_C(0x2f)
311         #define HWRM_QUEUE_QPORTCFG                       UINT32_C(0x30)
312         #define HWRM_QUEUE_QCFG                           UINT32_C(0x31)
313         #define HWRM_QUEUE_CFG                            UINT32_C(0x32)
314         #define HWRM_FUNC_VLAN_CFG                        UINT32_C(0x33)
315         #define HWRM_FUNC_VLAN_QCFG                       UINT32_C(0x34)
316         #define HWRM_QUEUE_PFCENABLE_QCFG                 UINT32_C(0x35)
317         #define HWRM_QUEUE_PFCENABLE_CFG                  UINT32_C(0x36)
318         #define HWRM_QUEUE_PRI2COS_QCFG                   UINT32_C(0x37)
319         #define HWRM_QUEUE_PRI2COS_CFG                    UINT32_C(0x38)
320         #define HWRM_QUEUE_COS2BW_QCFG                    UINT32_C(0x39)
321         #define HWRM_QUEUE_COS2BW_CFG                     UINT32_C(0x3a)
322         /* Experimental */
323         #define HWRM_QUEUE_DSCP_QCAPS                     UINT32_C(0x3b)
324         /* Experimental */
325         #define HWRM_QUEUE_DSCP2PRI_QCFG                  UINT32_C(0x3c)
326         /* Experimental */
327         #define HWRM_QUEUE_DSCP2PRI_CFG                   UINT32_C(0x3d)
328         #define HWRM_VNIC_ALLOC                           UINT32_C(0x40)
329         #define HWRM_VNIC_FREE                            UINT32_C(0x41)
330         #define HWRM_VNIC_CFG                             UINT32_C(0x42)
331         #define HWRM_VNIC_QCFG                            UINT32_C(0x43)
332         #define HWRM_VNIC_TPA_CFG                         UINT32_C(0x44)
333         /* Experimental */
334         #define HWRM_VNIC_TPA_QCFG                        UINT32_C(0x45)
335         #define HWRM_VNIC_RSS_CFG                         UINT32_C(0x46)
336         #define HWRM_VNIC_RSS_QCFG                        UINT32_C(0x47)
337         #define HWRM_VNIC_PLCMODES_CFG                    UINT32_C(0x48)
338         #define HWRM_VNIC_PLCMODES_QCFG                   UINT32_C(0x49)
339         #define HWRM_VNIC_QCAPS                           UINT32_C(0x4a)
340         #define HWRM_RING_ALLOC                           UINT32_C(0x50)
341         #define HWRM_RING_FREE                            UINT32_C(0x51)
342         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS        UINT32_C(0x52)
343         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS     UINT32_C(0x53)
344         #define HWRM_RING_AGGINT_QCAPS                    UINT32_C(0x54)
345         #define HWRM_RING_RESET                           UINT32_C(0x5e)
346         #define HWRM_RING_GRP_ALLOC                       UINT32_C(0x60)
347         #define HWRM_RING_GRP_FREE                        UINT32_C(0x61)
348         /* Reserved for future use. */
349         #define HWRM_RESERVED5                            UINT32_C(0x64)
350         /* Reserved for future use. */
351         #define HWRM_RESERVED6                            UINT32_C(0x65)
352         #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC            UINT32_C(0x70)
353         #define HWRM_VNIC_RSS_COS_LB_CTX_FREE             UINT32_C(0x71)
354         #define HWRM_CFA_L2_FILTER_ALLOC                  UINT32_C(0x90)
355         #define HWRM_CFA_L2_FILTER_FREE                   UINT32_C(0x91)
356         #define HWRM_CFA_L2_FILTER_CFG                    UINT32_C(0x92)
357         #define HWRM_CFA_L2_SET_RX_MASK                   UINT32_C(0x93)
358         #define HWRM_CFA_VLAN_ANTISPOOF_CFG               UINT32_C(0x94)
359         #define HWRM_CFA_TUNNEL_FILTER_ALLOC              UINT32_C(0x95)
360         #define HWRM_CFA_TUNNEL_FILTER_FREE               UINT32_C(0x96)
361         /* Experimental */
362         #define HWRM_CFA_ENCAP_RECORD_ALLOC               UINT32_C(0x97)
363         /* Experimental */
364         #define HWRM_CFA_ENCAP_RECORD_FREE                UINT32_C(0x98)
365         #define HWRM_CFA_NTUPLE_FILTER_ALLOC              UINT32_C(0x99)
366         #define HWRM_CFA_NTUPLE_FILTER_FREE               UINT32_C(0x9a)
367         #define HWRM_CFA_NTUPLE_FILTER_CFG                UINT32_C(0x9b)
368         /* Experimental */
369         #define HWRM_CFA_EM_FLOW_ALLOC                    UINT32_C(0x9c)
370         /* Experimental */
371         #define HWRM_CFA_EM_FLOW_FREE                     UINT32_C(0x9d)
372         /* Experimental */
373         #define HWRM_CFA_EM_FLOW_CFG                      UINT32_C(0x9e)
374         #define HWRM_TUNNEL_DST_PORT_QUERY                UINT32_C(0xa0)
375         #define HWRM_TUNNEL_DST_PORT_ALLOC                UINT32_C(0xa1)
376         #define HWRM_TUNNEL_DST_PORT_FREE                 UINT32_C(0xa2)
377         #define HWRM_STAT_CTX_ENG_QUERY                   UINT32_C(0xaf)
378         #define HWRM_STAT_CTX_ALLOC                       UINT32_C(0xb0)
379         #define HWRM_STAT_CTX_FREE                        UINT32_C(0xb1)
380         #define HWRM_STAT_CTX_QUERY                       UINT32_C(0xb2)
381         #define HWRM_STAT_CTX_CLR_STATS                   UINT32_C(0xb3)
382         #define HWRM_PORT_QSTATS_EXT                      UINT32_C(0xb4)
383         #define HWRM_PORT_PHY_MDIO_WRITE                  UINT32_C(0xb5)
384         #define HWRM_PORT_PHY_MDIO_READ                   UINT32_C(0xb6)
385         #define HWRM_FW_RESET                             UINT32_C(0xc0)
386         #define HWRM_FW_QSTATUS                           UINT32_C(0xc1)
387         #define HWRM_FW_HEALTH_CHECK                      UINT32_C(0xc2)
388         #define HWRM_FW_SYNC                              UINT32_C(0xc3)
389         #define HWRM_FW_STATE_BUFFER_QCAPS                UINT32_C(0xc4)
390         #define HWRM_FW_STATE_QUIESCE                     UINT32_C(0xc5)
391         #define HWRM_FW_STATE_BACKUP                      UINT32_C(0xc6)
392         #define HWRM_FW_STATE_RESTORE                     UINT32_C(0xc7)
393         /* Experimental */
394         #define HWRM_FW_SET_TIME                          UINT32_C(0xc8)
395         /* Experimental */
396         #define HWRM_FW_GET_TIME                          UINT32_C(0xc9)
397         /* Experimental */
398         #define HWRM_FW_SET_STRUCTURED_DATA               UINT32_C(0xca)
399         /* Experimental */
400         #define HWRM_FW_GET_STRUCTURED_DATA               UINT32_C(0xcb)
401         /* Experimental */
402         #define HWRM_FW_IPC_MAILBOX                       UINT32_C(0xcc)
403         #define HWRM_EXEC_FWD_RESP                        UINT32_C(0xd0)
404         #define HWRM_REJECT_FWD_RESP                      UINT32_C(0xd1)
405         #define HWRM_FWD_RESP                             UINT32_C(0xd2)
406         #define HWRM_FWD_ASYNC_EVENT_CMPL                 UINT32_C(0xd3)
407         #define HWRM_OEM_CMD                              UINT32_C(0xd4)
408         /* Tells the fw to run PRBS test on a given port and lane. */
409         #define HWRM_PORT_PRBS_TEST                       UINT32_C(0xd5)
410         #define HWRM_TEMP_MONITOR_QUERY                   UINT32_C(0xe0)
411         #define HWRM_WOL_FILTER_ALLOC                     UINT32_C(0xf0)
412         #define HWRM_WOL_FILTER_FREE                      UINT32_C(0xf1)
413         #define HWRM_WOL_FILTER_QCFG                      UINT32_C(0xf2)
414         #define HWRM_WOL_REASON_QCFG                      UINT32_C(0xf3)
415         /* Experimental */
416         #define HWRM_CFA_METER_QCAPS                      UINT32_C(0xf4)
417         /* Experimental */
418         #define HWRM_CFA_METER_PROFILE_ALLOC              UINT32_C(0xf5)
419         /* Experimental */
420         #define HWRM_CFA_METER_PROFILE_FREE               UINT32_C(0xf6)
421         /* Experimental */
422         #define HWRM_CFA_METER_PROFILE_CFG                UINT32_C(0xf7)
423         /* Experimental */
424         #define HWRM_CFA_METER_INSTANCE_ALLOC             UINT32_C(0xf8)
425         /* Experimental */
426         #define HWRM_CFA_METER_INSTANCE_FREE              UINT32_C(0xf9)
427         /* Experimental */
428         #define HWRM_CFA_METER_INSTANCE_CFG               UINT32_C(0xfa)
429         /* Experimental */
430         #define HWRM_CFA_VFR_ALLOC                        UINT32_C(0xfd)
431         /* Experimental */
432         #define HWRM_CFA_VFR_FREE                         UINT32_C(0xfe)
433         /* Experimental */
434         #define HWRM_CFA_VF_PAIR_ALLOC                    UINT32_C(0x100)
435         /* Experimental */
436         #define HWRM_CFA_VF_PAIR_FREE                     UINT32_C(0x101)
437         /* Experimental */
438         #define HWRM_CFA_VF_PAIR_INFO                     UINT32_C(0x102)
439         /* Experimental */
440         #define HWRM_CFA_FLOW_ALLOC                       UINT32_C(0x103)
441         /* Experimental */
442         #define HWRM_CFA_FLOW_FREE                        UINT32_C(0x104)
443         /* Experimental */
444         #define HWRM_CFA_FLOW_FLUSH                       UINT32_C(0x105)
445         /* Experimental */
446         #define HWRM_CFA_FLOW_STATS                       UINT32_C(0x106)
447         /* Experimental */
448         #define HWRM_CFA_FLOW_INFO                        UINT32_C(0x107)
449         /* Experimental */
450         #define HWRM_CFA_DECAP_FILTER_ALLOC               UINT32_C(0x108)
451         /* Experimental */
452         #define HWRM_CFA_DECAP_FILTER_FREE                UINT32_C(0x109)
453         #define HWRM_CFA_VLAN_ANTISPOOF_QCFG              UINT32_C(0x10a)
454         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC       UINT32_C(0x10b)
455         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE        UINT32_C(0x10c)
456         /* Experimental */
457         #define HWRM_CFA_PAIR_ALLOC                       UINT32_C(0x10d)
458         /* Experimental */
459         #define HWRM_CFA_PAIR_FREE                        UINT32_C(0x10e)
460         /* Experimental */
461         #define HWRM_CFA_PAIR_INFO                        UINT32_C(0x10f)
462         /* Experimental */
463         #define HWRM_FW_IPC_MSG                           UINT32_C(0x110)
464         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO        UINT32_C(0x111)
465         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE       UINT32_C(0x112)
466         /* Experimental */
467         #define HWRM_CFA_FLOW_AGING_TIMER_RESET           UINT32_C(0x113)
468         /* Experimental */
469         #define HWRM_CFA_FLOW_AGING_CFG                   UINT32_C(0x114)
470         /* Experimental */
471         #define HWRM_CFA_FLOW_AGING_QCFG                  UINT32_C(0x115)
472         /* Experimental */
473         #define HWRM_CFA_FLOW_AGING_QCAPS                 UINT32_C(0x116)
474         /* Experimental */
475         #define HWRM_CFA_CTX_MEM_RGTR                     UINT32_C(0x117)
476         /* Experimental */
477         #define HWRM_CFA_CTX_MEM_UNRGTR                   UINT32_C(0x118)
478         /* Experimental */
479         #define HWRM_CFA_CTX_MEM_QCTX                     UINT32_C(0x119)
480         /* Experimental */
481         #define HWRM_CFA_CTX_MEM_QCAPS                    UINT32_C(0x11a)
482         /* Experimental */
483         #define HWRM_CFA_COUNTER_QCAPS                    UINT32_C(0x11b)
484         /* Experimental */
485         #define HWRM_CFA_COUNTER_CFG                      UINT32_C(0x11c)
486         /* Experimental */
487         #define HWRM_CFA_COUNTER_QCFG                     UINT32_C(0x11d)
488         /* Experimental */
489         #define HWRM_CFA_COUNTER_QSTATS                   UINT32_C(0x11e)
490         /* Experimental */
491         #define HWRM_CFA_TCP_FLAG_PROCESS_QCFG            UINT32_C(0x11f)
492         /* Experimental */
493         #define HWRM_CFA_EEM_QCAPS                        UINT32_C(0x120)
494         /* Experimental */
495         #define HWRM_CFA_EEM_CFG                          UINT32_C(0x121)
496         /* Experimental */
497         #define HWRM_CFA_EEM_QCFG                         UINT32_C(0x122)
498         /* Experimental */
499         #define HWRM_CFA_EEM_OP                           UINT32_C(0x123)
500         /* Experimental */
501         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS              UINT32_C(0x124)
502         /* Experimental */
503         #define HWRM_CFA_TFLIB                            UINT32_C(0x125)
504         /* Engine CKV - Get the current allocation status of keys provisioned in the key vault. */
505         #define HWRM_ENGINE_CKV_STATUS                    UINT32_C(0x12e)
506         /* Engine CKV - Add a new CKEK used to encrypt keys. */
507         #define HWRM_ENGINE_CKV_CKEK_ADD                  UINT32_C(0x12f)
508         /* Engine CKV - Delete a previously added CKEK. */
509         #define HWRM_ENGINE_CKV_CKEK_DELETE               UINT32_C(0x130)
510         /* Engine CKV - Add a new key to the key vault. */
511         #define HWRM_ENGINE_CKV_KEY_ADD                   UINT32_C(0x131)
512         /* Engine CKV - Delete a key from the key vault. */
513         #define HWRM_ENGINE_CKV_KEY_DELETE                UINT32_C(0x132)
514         /* Engine CKV - Delete all keys from the key vault. */
515         #define HWRM_ENGINE_CKV_FLUSH                     UINT32_C(0x133)
516         /* Engine CKV - Get random data. */
517         #define HWRM_ENGINE_CKV_RNG_GET                   UINT32_C(0x134)
518         /* Engine CKV - Generate and encrypt a new AES key. */
519         #define HWRM_ENGINE_CKV_KEY_GEN                   UINT32_C(0x135)
520         /* Engine CKV - Configure a label index with a label value. */
521         #define HWRM_ENGINE_CKV_KEY_LABEL_CFG             UINT32_C(0x136)
522         /* Engine CKV - Query a label */
523         #define HWRM_ENGINE_CKV_KEY_LABEL_QCFG            UINT32_C(0x137)
524         /* Engine - Query the available queue groups configuration. */
525         #define HWRM_ENGINE_QG_CONFIG_QUERY               UINT32_C(0x13c)
526         /* Engine - Query the queue groups assigned to a function. */
527         #define HWRM_ENGINE_QG_QUERY                      UINT32_C(0x13d)
528         /* Engine - Query the available queue group meter profile configuration. */
529         #define HWRM_ENGINE_QG_METER_PROFILE_CONFIG_QUERY UINT32_C(0x13e)
530         /* Engine - Query the configuration of a queue group meter profile. */
531         #define HWRM_ENGINE_QG_METER_PROFILE_QUERY        UINT32_C(0x13f)
532         /* Engine - Allocate a queue group meter profile. */
533         #define HWRM_ENGINE_QG_METER_PROFILE_ALLOC        UINT32_C(0x140)
534         /* Engine - Free a queue group meter profile. */
535         #define HWRM_ENGINE_QG_METER_PROFILE_FREE         UINT32_C(0x141)
536         /* Engine - Query the meters assigned to a queue group. */
537         #define HWRM_ENGINE_QG_METER_QUERY                UINT32_C(0x142)
538         /* Engine - Bind a queue group meter profile to a queue group. */
539         #define HWRM_ENGINE_QG_METER_BIND                 UINT32_C(0x143)
540         /* Engine - Unbind a queue group meter profile from a queue group. */
541         #define HWRM_ENGINE_QG_METER_UNBIND               UINT32_C(0x144)
542         /* Engine - Bind a queue group to a function. */
543         #define HWRM_ENGINE_QG_FUNC_BIND                  UINT32_C(0x145)
544         /* Engine - Query the scheduling group configuration. */
545         #define HWRM_ENGINE_SG_CONFIG_QUERY               UINT32_C(0x146)
546         /* Engine - Query the queue groups assigned to a scheduling group. */
547         #define HWRM_ENGINE_SG_QUERY                      UINT32_C(0x147)
548         /* Engine - Query the configuration of a scheduling group's meter profiles. */
549         #define HWRM_ENGINE_SG_METER_QUERY                UINT32_C(0x148)
550         /* Engine - Configure a scheduling group's meter profiles. */
551         #define HWRM_ENGINE_SG_METER_CONFIG               UINT32_C(0x149)
552         /* Engine - Bind a queue group to a scheduling group. */
553         #define HWRM_ENGINE_SG_QG_BIND                    UINT32_C(0x14a)
554         /* Engine - Unbind a queue group from its scheduling group. */
555         #define HWRM_ENGINE_QG_SG_UNBIND                  UINT32_C(0x14b)
556         /* Engine - Query the Engine configuration. */
557         #define HWRM_ENGINE_CONFIG_QUERY                  UINT32_C(0x154)
558         /* Engine - Configure the statistics accumulator for an Engine. */
559         #define HWRM_ENGINE_STATS_CONFIG                  UINT32_C(0x155)
560         /* Engine - Clear the statistics accumulator for an Engine. */
561         #define HWRM_ENGINE_STATS_CLEAR                   UINT32_C(0x156)
562         /* Engine - Query the statistics accumulator for an Engine. */
563         #define HWRM_ENGINE_STATS_QUERY                   UINT32_C(0x157)
564         /* Engine - Allocate an Engine RQ. */
565         #define HWRM_ENGINE_RQ_ALLOC                      UINT32_C(0x15e)
566         /* Engine - Free an Engine RQ. */
567         #define HWRM_ENGINE_RQ_FREE                       UINT32_C(0x15f)
568         /* Engine - Allocate an Engine CQ. */
569         #define HWRM_ENGINE_CQ_ALLOC                      UINT32_C(0x160)
570         /* Engine - Free an Engine CQ. */
571         #define HWRM_ENGINE_CQ_FREE                       UINT32_C(0x161)
572         /* Engine - Allocate an NQ. */
573         #define HWRM_ENGINE_NQ_ALLOC                      UINT32_C(0x162)
574         /* Engine - Free an NQ. */
575         #define HWRM_ENGINE_NQ_FREE                       UINT32_C(0x163)
576         /* Engine - Set the on-die RQE credit update location. */
577         #define HWRM_ENGINE_ON_DIE_RQE_CREDITS            UINT32_C(0x164)
578         /* Engine - Query the engine function configuration. */
579         #define HWRM_ENGINE_FUNC_QCFG                     UINT32_C(0x165)
580         /* Experimental */
581         #define HWRM_FUNC_RESOURCE_QCAPS                  UINT32_C(0x190)
582         /* Experimental */
583         #define HWRM_FUNC_VF_RESOURCE_CFG                 UINT32_C(0x191)
584         /* Experimental */
585         #define HWRM_FUNC_BACKING_STORE_QCAPS             UINT32_C(0x192)
586         /* Experimental */
587         #define HWRM_FUNC_BACKING_STORE_CFG               UINT32_C(0x193)
588         /* Experimental */
589         #define HWRM_FUNC_BACKING_STORE_QCFG              UINT32_C(0x194)
590         /* Configures the BW of any VF */
591         #define HWRM_FUNC_VF_BW_CFG                       UINT32_C(0x195)
592         /* Queries the BW of any VF */
593         #define HWRM_FUNC_VF_BW_QCFG                      UINT32_C(0x196)
594         /* Queries pf ids belong to specified host(s) */
595         #define HWRM_FUNC_HOST_PF_IDS_QUERY               UINT32_C(0x197)
596         /* Experimental */
597         #define HWRM_SELFTEST_QLIST                       UINT32_C(0x200)
598         /* Experimental */
599         #define HWRM_SELFTEST_EXEC                        UINT32_C(0x201)
600         /* Experimental */
601         #define HWRM_SELFTEST_IRQ                         UINT32_C(0x202)
602         /* Experimental */
603         #define HWRM_SELFTEST_RETRIEVE_SERDES_DATA        UINT32_C(0x203)
604         /* Experimental */
605         #define HWRM_PCIE_QSTATS                          UINT32_C(0x204)
606         /* Experimental */
607         #define HWRM_MFG_FRU_WRITE_CONTROL                UINT32_C(0x205)
608         /* Returns the current value of a free running counter from the device. */
609         #define HWRM_MFG_TIMERS_QUERY                     UINT32_C(0x206)
610         /* Experimental */
611         #define HWRM_MFG_OTP_CFG                          UINT32_C(0x207)
612         /* Experimental */
613         #define HWRM_MFG_OTP_QCFG                         UINT32_C(0x208)
614         /*
615          * Tells the fw to run the DMA read from the host and DMA write
616          * to the host test.
617          */
618         #define HWRM_MFG_HDMA_TEST                        UINT32_C(0x209)
619         /* Experimental */
620         #define HWRM_DBG_READ_DIRECT                      UINT32_C(0xff10)
621         /* Experimental */
622         #define HWRM_DBG_READ_INDIRECT                    UINT32_C(0xff11)
623         /* Experimental */
624         #define HWRM_DBG_WRITE_DIRECT                     UINT32_C(0xff12)
625         /* Experimental */
626         #define HWRM_DBG_WRITE_INDIRECT                   UINT32_C(0xff13)
627         #define HWRM_DBG_DUMP                             UINT32_C(0xff14)
628         /* Experimental */
629         #define HWRM_DBG_ERASE_NVM                        UINT32_C(0xff15)
630         /* Experimental */
631         #define HWRM_DBG_CFG                              UINT32_C(0xff16)
632         /* Experimental */
633         #define HWRM_DBG_COREDUMP_LIST                    UINT32_C(0xff17)
634         /* Experimental */
635         #define HWRM_DBG_COREDUMP_INITIATE                UINT32_C(0xff18)
636         /* Experimental */
637         #define HWRM_DBG_COREDUMP_RETRIEVE                UINT32_C(0xff19)
638         /* Experimental */
639         #define HWRM_DBG_FW_CLI                           UINT32_C(0xff1a)
640         /*  */
641         #define HWRM_DBG_I2C_CMD                          UINT32_C(0xff1b)
642         /*  */
643         #define HWRM_DBG_RING_INFO_GET                    UINT32_C(0xff1c)
644         /* Experimental */
645         #define HWRM_DBG_CRASHDUMP_HEADER                 UINT32_C(0xff1d)
646         /* Experimental */
647         #define HWRM_DBG_CRASHDUMP_ERASE                  UINT32_C(0xff1e)
648         /* Experimental */
649         #define HWRM_NVM_FACTORY_DEFAULTS                 UINT32_C(0xffee)
650         #define HWRM_NVM_VALIDATE_OPTION                  UINT32_C(0xffef)
651         #define HWRM_NVM_FLUSH                            UINT32_C(0xfff0)
652         #define HWRM_NVM_GET_VARIABLE                     UINT32_C(0xfff1)
653         #define HWRM_NVM_SET_VARIABLE                     UINT32_C(0xfff2)
654         #define HWRM_NVM_INSTALL_UPDATE                   UINT32_C(0xfff3)
655         #define HWRM_NVM_MODIFY                           UINT32_C(0xfff4)
656         #define HWRM_NVM_VERIFY_UPDATE                    UINT32_C(0xfff5)
657         #define HWRM_NVM_GET_DEV_INFO                     UINT32_C(0xfff6)
658         #define HWRM_NVM_ERASE_DIR_ENTRY                  UINT32_C(0xfff7)
659         #define HWRM_NVM_MOD_DIR_ENTRY                    UINT32_C(0xfff8)
660         #define HWRM_NVM_FIND_DIR_ENTRY                   UINT32_C(0xfff9)
661         #define HWRM_NVM_GET_DIR_ENTRIES                  UINT32_C(0xfffa)
662         #define HWRM_NVM_GET_DIR_INFO                     UINT32_C(0xfffb)
663         #define HWRM_NVM_RAW_DUMP                         UINT32_C(0xfffc)
664         #define HWRM_NVM_READ                             UINT32_C(0xfffd)
665         #define HWRM_NVM_WRITE                            UINT32_C(0xfffe)
666         #define HWRM_NVM_RAW_WRITE_BLK                    UINT32_C(0xffff)
667         #define HWRM_LAST                                HWRM_NVM_RAW_WRITE_BLK
668         uint16_t        unused_0[3];
669 } __attribute__((packed));
670
671 /* Return Codes */
672 /* ret_codes (size:64b/8B) */
673 struct ret_codes {
674         uint16_t        error_code;
675         /* Request was successfully executed by the HWRM. */
676         #define HWRM_ERR_CODE_SUCCESS                      UINT32_C(0x0)
677         /* The HWRM failed to execute the request. */
678         #define HWRM_ERR_CODE_FAIL                         UINT32_C(0x1)
679         /*
680          * The request contains invalid argument(s) or input
681          * parameters.
682          */
683         #define HWRM_ERR_CODE_INVALID_PARAMS               UINT32_C(0x2)
684         /*
685          * The requester is not allowed to access the requested
686          * resource. This error code shall be provided in a
687          * response to a request to query or modify an existing
688          * resource that is not accessible by the requester.
689          */
690         #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED       UINT32_C(0x3)
691         /*
692          * The HWRM is unable to allocate the requested resource.
693          * This code only applies to requests for HWRM resource
694          * allocations.
695          */
696         #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR         UINT32_C(0x4)
697         /*
698          * Invalid combination of flags is specified in the
699          * request.
700          */
701         #define HWRM_ERR_CODE_INVALID_FLAGS                UINT32_C(0x5)
702         /*
703          * Invalid combination of enables fields is specified in
704          * the request.
705          */
706         #define HWRM_ERR_CODE_INVALID_ENABLES              UINT32_C(0x6)
707         /*
708          * Request contains a required TLV that is not supported by
709          * the installed version of firmware.
710          */
711         #define HWRM_ERR_CODE_UNSUPPORTED_TLV              UINT32_C(0x7)
712         /*
713          * No firmware buffer available to accept the request. Driver
714          * should retry the request.
715          */
716         #define HWRM_ERR_CODE_NO_BUFFER                    UINT32_C(0x8)
717         /*
718          * This error code is only reported by firmware when some
719          * sub-option of a supported HWRM command is unsupported.
720          */
721         #define HWRM_ERR_CODE_UNSUPPORTED_OPTION_ERR       UINT32_C(0x9)
722         /*
723          * This error code is only reported by firmware when the specific
724          * request is not able to process when the HOT reset in progress.
725          */
726         #define HWRM_ERR_CODE_HOT_RESET_PROGRESS           UINT32_C(0xa)
727         /*
728          * This error code is only reported by firmware when the registered
729          * driver instances are not capable of hot reset.
730          */
731         #define HWRM_ERR_CODE_HOT_RESET_FAIL               UINT32_C(0xb)
732         /*
733          * This error code is only reported by the firmware when during
734          * flow allocation when a requeest for a flow counter fails because
735          * the number of flow counters are exhausted.
736          */
737         #define HWRM_ERR_CODE_NO_FLOW_COUNTER_DURING_ALLOC UINT32_C(0xc)
738         /*
739          * This error code is only reported by firmware when the registered
740          * driver instances requested to offloaded a flow but was unable to because
741          * the requested key's hash collides with the installed keys.
742          */
743         #define HWRM_ERR_CODE_KEY_HASH_COLLISION           UINT32_C(0xd)
744         /*
745          * This error code is only reported by firmware when the registered
746          * driver instances requested to offloaded a flow but was unable to because
747          * the same key has already been installed.
748          */
749         #define HWRM_ERR_CODE_KEY_ALREADY_EXISTS           UINT32_C(0xe)
750         /*
751          * Generic HWRM execution error that represents an
752          * internal error.
753          */
754         #define HWRM_ERR_CODE_HWRM_ERROR                   UINT32_C(0xf)
755         /*
756          * This value indicates that the HWRM response is in TLV format and
757          * should be interpreted as one or more TLVs starting with the
758          * hwrm_resp_hdr TLV. This value is not an indicatation of any error
759          * by itself, just an indicatation that the response should be parsed
760          * as TLV and the actual error code will be in the hwrm_resp_hdr TLV.
761          */
762         #define HWRM_ERR_CODE_TLV_ENCAPSULATED_RESPONSE    UINT32_C(0x8000)
763         /* Unknown error */
764         #define HWRM_ERR_CODE_UNKNOWN_ERR                  UINT32_C(0xfffe)
765         /* Unsupported or invalid command */
766         #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED            UINT32_C(0xffff)
767         #define HWRM_ERR_CODE_LAST \
768                 HWRM_ERR_CODE_CMD_NOT_SUPPORTED
769         uint16_t        unused_0[3];
770 } __attribute__((packed));
771
772 /* Output */
773 /* hwrm_err_output (size:128b/16B) */
774 struct hwrm_err_output {
775         /*
776          * Pass/Fail or error type
777          *
778          * Note: receiver to verify the in parameters, and fail the call
779          * with an error when appropriate
780          */
781         uint16_t        error_code;
782         /* This field returns the type of original request. */
783         uint16_t        req_type;
784         /* This field provides original sequence number of the command. */
785         uint16_t        seq_id;
786         /*
787          * This field is the length of the response in bytes.  The
788          * last byte of the response is a valid flag that will read
789          * as '1' when the command has been completely written to
790          * memory.
791          */
792         uint16_t        resp_len;
793         /* debug info for this error response. */
794         uint32_t        opaque_0;
795         /* debug info for this error response. */
796         uint16_t        opaque_1;
797         /*
798          * In the case of an error response, command specific error
799          * code is returned in this field.
800          */
801         uint8_t cmd_err;
802         /*
803          * This field is used in Output records to indicate that the output
804          * is completely written to RAM.  This field should be read as '1'
805          * to indicate that the output has been completely written.
806          * When writing a command completion or response to an internal processor,
807          * the order of writes has to be such that this field is written last.
808          */
809         uint8_t valid;
810 } __attribute__((packed));
811 /*
812  * Following is the signature for HWRM message field that indicates not
813  * applicable (All F's). Need to cast it the size of the field if needed.
814  */
815 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
816 /* hwrm_func_buf_rgtr */
817 #define HWRM_MAX_REQ_LEN 128
818 /* hwrm_cfa_flow_info */
819 #define HWRM_MAX_RESP_LEN 704
820 /* 7 bit indirection table index. */
821 #define HW_HASH_INDEX_SIZE 0x80
822 #define HW_HASH_KEY_SIZE 40
823 /* valid key for HWRM response */
824 #define HWRM_RESP_VALID_KEY 1
825 /* Reserved for BONO processor */
826 #define HWRM_TARGET_ID_BONO 0xFFF8
827 /* Reserved for KONG processor */
828 #define HWRM_TARGET_ID_KONG 0xFFF9
829 /* Reserved for APE processor */
830 #define HWRM_TARGET_ID_APE 0xFFFA
831 /*
832  * This value will be used by tools for User-space HWRM Interface.
833  * When tool execute any HWRM command with this target_id, firmware
834  * will copy the response and/or data payload via register space instead
835  * of DMAing it.
836  */
837 #define HWRM_TARGET_ID_TOOLS 0xFFFD
838 #define HWRM_VERSION_MAJOR 1
839 #define HWRM_VERSION_MINOR 10
840 #define HWRM_VERSION_UPDATE 0
841 /* non-zero means beta version */
842 #define HWRM_VERSION_RSVD 91
843 #define HWRM_VERSION_STR "1.10.0.91"
844
845 /****************
846  * hwrm_ver_get *
847  ****************/
848
849
850 /* hwrm_ver_get_input (size:192b/24B) */
851 struct hwrm_ver_get_input {
852         /* The HWRM command request type. */
853         uint16_t        req_type;
854         /*
855          * The completion ring to send the completion event on. This should
856          * be the NQ ID returned from the `nq_alloc` HWRM command.
857          */
858         uint16_t        cmpl_ring;
859         /*
860          * The sequence ID is used by the driver for tracking multiple
861          * commands. This ID is treated as opaque data by the firmware and
862          * the value is returned in the `hwrm_resp_hdr` upon completion.
863          */
864         uint16_t        seq_id;
865         /*
866          * The target ID of the command:
867          * * 0x0-0xFFF8 - The function ID
868          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
869          * * 0xFFFD - Reserved for user-space HWRM interface
870          * * 0xFFFF - HWRM
871          */
872         uint16_t        target_id;
873         /*
874          * A physical address pointer pointing to a host buffer that the
875          * command's response data will be written. This can be either a host
876          * physical address (HPA) or a guest physical address (GPA) and must
877          * point to a physically contiguous block of memory.
878          */
879         uint64_t        resp_addr;
880         /*
881          * This field represents the major version of HWRM interface
882          * specification supported by the driver HWRM implementation.
883          * The interface major version is intended to change only when
884          * non backward compatible changes are made to the HWRM
885          * interface specification.
886          */
887         uint8_t hwrm_intf_maj;
888         /*
889          * This field represents the minor version of HWRM interface
890          * specification supported by the driver HWRM implementation.
891          * A change in interface minor version is used to reflect
892          * significant backward compatible modification to HWRM
893          * interface specification.
894          * This can be due to addition or removal of functionality.
895          * HWRM interface specifications with the same major version
896          * but different minor versions are compatible.
897          */
898         uint8_t hwrm_intf_min;
899         /*
900          * This field represents the update version of HWRM interface
901          * specification supported by the driver HWRM implementation.
902          * The interface update version is used to reflect minor
903          * changes or bug fixes to a released HWRM interface
904          * specification.
905          */
906         uint8_t hwrm_intf_upd;
907         uint8_t unused_0[5];
908 } __attribute__((packed));
909
910 /* hwrm_ver_get_output (size:1408b/176B) */
911 struct hwrm_ver_get_output {
912         /* The specific error status for the command. */
913         uint16_t        error_code;
914         /* The HWRM command request type. */
915         uint16_t        req_type;
916         /* The sequence ID from the original command. */
917         uint16_t        seq_id;
918         /* The length of the response data in number of bytes. */
919         uint16_t        resp_len;
920         /*
921          * This field represents the major version of HWRM interface
922          * specification supported by the HWRM implementation.
923          * The interface major version is intended to change only when
924          * non backward compatible changes are made to the HWRM
925          * interface specification.
926          * A HWRM implementation that is compliant with this
927          * specification shall provide value of 1 in this field.
928          */
929         uint8_t hwrm_intf_maj_8b;
930         /*
931          * This field represents the minor version of HWRM interface
932          * specification supported by the HWRM implementation.
933          * A change in interface minor version is used to reflect
934          * significant backward compatible modification to HWRM
935          * interface specification.
936          * This can be due to addition or removal of functionality.
937          * HWRM interface specifications with the same major version
938          * but different minor versions are compatible.
939          * A HWRM implementation that is compliant with this
940          * specification shall provide value of 2 in this field.
941          */
942         uint8_t hwrm_intf_min_8b;
943         /*
944          * This field represents the update version of HWRM interface
945          * specification supported by the HWRM implementation.
946          * The interface update version is used to reflect minor
947          * changes or bug fixes to a released HWRM interface
948          * specification.
949          * A HWRM implementation that is compliant with this
950          * specification shall provide value of 2 in this field.
951          */
952         uint8_t hwrm_intf_upd_8b;
953         uint8_t hwrm_intf_rsvd_8b;
954         /*
955          * This field represents the major version of HWRM firmware.
956          * A change in firmware major version represents a major
957          * firmware release.
958          */
959         uint8_t hwrm_fw_maj_8b;
960         /*
961          * This field represents the minor version of HWRM firmware.
962          * A change in firmware minor version represents significant
963          * firmware functionality changes.
964          */
965         uint8_t hwrm_fw_min_8b;
966         /*
967          * This field represents the build version of HWRM firmware.
968          * A change in firmware build version represents bug fixes
969          * to a released firmware.
970          */
971         uint8_t hwrm_fw_bld_8b;
972         /*
973          * This field is a reserved field. This field can be used to
974          * represent firmware branches or customer specific releases
975          * tied to a specific (major,minor,update) version of the
976          * HWRM firmware.
977          */
978         uint8_t hwrm_fw_rsvd_8b;
979         /*
980          * This field represents the major version of mgmt firmware.
981          * A change in major version represents a major release.
982          */
983         uint8_t mgmt_fw_maj_8b;
984         /*
985          * This field represents the minor version of mgmt firmware.
986          * A change in minor version represents significant
987          * functionality changes.
988          */
989         uint8_t mgmt_fw_min_8b;
990         /*
991          * This field represents the build version of mgmt firmware.
992          * A change in update version represents bug fixes.
993          */
994         uint8_t mgmt_fw_bld_8b;
995         /*
996          * This field is a reserved field. This field can be used to
997          * represent firmware branches or customer specific releases
998          * tied to a specific (major,minor,update) version
999          */
1000         uint8_t mgmt_fw_rsvd_8b;
1001         /*
1002          * This field represents the major version of network
1003          * control firmware.
1004          * A change in major version represents a major release.
1005          */
1006         uint8_t netctrl_fw_maj_8b;
1007         /*
1008          * This field represents the minor version of network
1009          * control firmware.
1010          * A change in minor version represents significant
1011          * functionality changes.
1012          */
1013         uint8_t netctrl_fw_min_8b;
1014         /*
1015          * This field represents the build version of network
1016          * control firmware.
1017          * A change in update version represents bug fixes.
1018          */
1019         uint8_t netctrl_fw_bld_8b;
1020         /*
1021          * This field is a reserved field. This field can be used to
1022          * represent firmware branches or customer specific releases
1023          * tied to a specific (major,minor,update) version
1024          */
1025         uint8_t netctrl_fw_rsvd_8b;
1026         /*
1027          * This field is used to indicate device's capabilities and
1028          * configurations.
1029          */
1030         uint32_t        dev_caps_cfg;
1031         /*
1032          * If set to 1, then secure firmware update behavior
1033          * is supported.
1034          * If set to 0, then secure firmware update behavior is
1035          * not supported.
1036          */
1037         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED \
1038                 UINT32_C(0x1)
1039         /*
1040          * If set to 1, then firmware based DCBX agent is supported.
1041          * If set to 0, then firmware based DCBX agent capability
1042          * is not supported on this device.
1043          */
1044         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED \
1045                 UINT32_C(0x2)
1046         /*
1047          * If set to 1, then HWRM short command format is supported.
1048          * If set to 0, then HWRM short command format is not supported.
1049          */
1050         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED \
1051                 UINT32_C(0x4)
1052         /*
1053          * If set to 1, then HWRM short command format is required.
1054          * If set to 0, then HWRM short command format is not required.
1055          */
1056         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED \
1057                 UINT32_C(0x8)
1058         /*
1059          * If set to 1, then the KONG host mailbox channel is supported.
1060          * If set to 0, then the KONG host mailbox channel is not supported.
1061          * By default, this flag should be 0 for older version of core firmware.
1062          */
1063         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_KONG_MB_CHNL_SUPPORTED \
1064                 UINT32_C(0x10)
1065         /*
1066          * If set to 1, then the 64bit flow handle is supported in addition to the
1067          * legacy 16bit flow handle. If set to 0, then the 64bit flow handle is not
1068          * supported. By default, this flag should be 0 for older version of core firmware.
1069          */
1070         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_HANDLE_64BIT_SUPPORTED \
1071                 UINT32_C(0x20)
1072         /*
1073          * If set to 1, then filter type can be provided in filter_alloc or filter_cfg
1074          * filter types like L2 for l2 traffic and ROCE for roce & l2 traffic.
1075          * If set to 0, then filter types not supported.
1076          * By default, this flag should be 0 for older version of core firmware.
1077          */
1078         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_L2_FILTER_TYPES_ROCE_OR_L2_SUPPORTED \
1079                 UINT32_C(0x40)
1080         /*
1081          * If set to 1, firmware is capable to support virtio vSwitch offload model.
1082          * If set to 0, firmware can't supported virtio vSwitch offload model.
1083          * By default, this flag should be 0 for older version of core firmware.
1084          */
1085         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_VIRTIO_VSWITCH_OFFLOAD_SUPPORTED \
1086                 UINT32_C(0x80)
1087         /*
1088          * If set to 1, firmware is capable to support trusted VF.
1089          * If set to 0, firmware is not capable to support trusted VF.
1090          * By default, this flag should be 0 for older version of core firmware.
1091          */
1092         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_TRUSTED_VF_SUPPORTED \
1093                 UINT32_C(0x100)
1094         /*
1095          * If set to 1, firmware is capable to support flow aging.
1096          * If set to 0, firmware is not capable to support flow aging.
1097          * By default, this flag should be 0 for older version of core firmware.
1098          */
1099         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FLOW_AGING_SUPPORTED \
1100                 UINT32_C(0x200)
1101         /*
1102          * If set to 1, firmware is capable to support advanced flow counters like,
1103          * Meter drop counters and EEM counters.
1104          * If set to 0, firmware is not capable to support advanced flow counters.
1105          * By default, this flag should be 0 for older version of core firmware.
1106          */
1107         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_ADV_FLOW_COUNTERS_SUPPORTED \
1108                 UINT32_C(0x400)
1109         /*
1110          * If set to 1, the firmware is able to support the use of the CFA
1111          * Extended Exact Match(EEM) feature.
1112          * If set to 0, firmware is not capable to support the use of the
1113          * CFA EEM feature.
1114          * By default, this flag should be 0 for older version of core firmware.
1115          */
1116         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_EEM_SUPPORTED \
1117                 UINT32_C(0x800)
1118         /*
1119          * If set to 1, the firmware is able to support advance CFA flow management
1120          * features reported in the HWRM_CFA_FLOW_MGNT_QCAPS.
1121          * If set to 0, then the firmware doesn’t support the advance CFA flow management
1122          * features.
1123          * By default, this flag should be 0 for older version of core firmware.
1124          */
1125         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_ADV_FLOW_MGNT_SUPPORTED \
1126                 UINT32_C(0x1000)
1127         /*
1128          * If set to 1, the firmware is able to support TFLIB features.
1129          * If set to 0, then the firmware doesn’t support TFLIB features.
1130          * By default, this flag should be 0 for older version of core firmware.
1131          */
1132         #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TFLIB_SUPPORTED \
1133                 UINT32_C(0x2000)
1134         /*
1135          * This field represents the major version of RoCE firmware.
1136          * A change in major version represents a major release.
1137          */
1138         uint8_t roce_fw_maj_8b;
1139         /*
1140          * This field represents the minor version of RoCE firmware.
1141          * A change in minor version represents significant
1142          * functionality changes.
1143          */
1144         uint8_t roce_fw_min_8b;
1145         /*
1146          * This field represents the build version of RoCE firmware.
1147          * A change in update version represents bug fixes.
1148          */
1149         uint8_t roce_fw_bld_8b;
1150         /*
1151          * This field is a reserved field. This field can be used to
1152          * represent firmware branches or customer specific releases
1153          * tied to a specific (major,minor,update) version
1154          */
1155         uint8_t roce_fw_rsvd_8b;
1156         /*
1157          * This field represents the name of HWRM FW (ASCII chars
1158          * with NULL at the end).
1159          */
1160         char    hwrm_fw_name[16];
1161         /*
1162          * This field represents the name of mgmt FW (ASCII chars
1163          * with NULL at the end).
1164          */
1165         char    mgmt_fw_name[16];
1166         /*
1167          * This field represents the name of network control
1168          * firmware (ASCII chars with NULL at the end).
1169          */
1170         char    netctrl_fw_name[16];
1171         /* This field represents the active board package name. */
1172         char    active_pkg_name[16];
1173         /*
1174          * This field represents the name of RoCE FW (ASCII chars
1175          * with NULL at the end).
1176          */
1177         char    roce_fw_name[16];
1178         /* This field returns the chip number. */
1179         uint16_t        chip_num;
1180         /* This field returns the revision of chip. */
1181         uint8_t chip_rev;
1182         /* This field returns the chip metal number. */
1183         uint8_t chip_metal;
1184         /* This field returns the bond id of the chip. */
1185         uint8_t chip_bond_id;
1186         /* This value indicates the type of platform used for chip implementation. */
1187         uint8_t chip_platform_type;
1188         /* ASIC */
1189         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC      UINT32_C(0x0)
1190         /* FPGA platform of the chip. */
1191         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA      UINT32_C(0x1)
1192         /* Palladium platform of the chip. */
1193         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
1194         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_LAST \
1195                 HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM
1196         /*
1197          * This field returns the maximum value of request window that
1198          * is supported by the HWRM. The request window is mapped
1199          * into device address space using MMIO.
1200          */
1201         uint16_t        max_req_win_len;
1202         /*
1203          * This field returns the maximum value of response buffer in
1204          * bytes.
1205          */
1206         uint16_t        max_resp_len;
1207         /*
1208          * This field returns the default request timeout value in
1209          * milliseconds.
1210          */
1211         uint16_t        def_req_timeout;
1212         /*
1213          * This field will indicate if any subsystems is not fully
1214          * initialized.
1215          */
1216         uint8_t flags;
1217         /*
1218          * If set to 1, it will indicate to host drivers that firmware is
1219          * not ready to start full blown HWRM commands. Host drivers should
1220          * re-try HWRM_VER_GET with some timeout period. The timeout period
1221          * can be selected up to 5 seconds.
1222          * For Example, PCIe hot-plug:
1223          *     Hot plug timing is system dependent. It generally takes up to
1224          *     600 miliseconds for firmware to clear DEV_NOT_RDY flag.
1225          * If set to 0, device is ready to accept all HWRM commands.
1226          */
1227         #define HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY       UINT32_C(0x1)
1228         /*
1229          * If set to 1, external version present.
1230          * If set to 0, external version not present.
1231          */
1232         #define HWRM_VER_GET_OUTPUT_FLAGS_EXT_VER_AVAIL     UINT32_C(0x2)
1233         uint8_t unused_0[2];
1234         /*
1235          * For backward compatibility this field must be set to 1.
1236          * Older drivers might look for this field to be 1 before
1237          * processing the message.
1238          */
1239         uint8_t always_1;
1240         /*
1241          * This field represents the major version of HWRM interface
1242          * specification supported by the HWRM implementation.
1243          * The interface major version is intended to change only when
1244          * non backward compatible changes are made to the HWRM
1245          * interface specification. A HWRM implementation that is
1246          * compliant with this specification shall provide value of 1
1247          * in this field.
1248          */
1249         uint16_t        hwrm_intf_major;
1250         /*
1251          * This field represents the minor version of HWRM interface
1252          * specification supported by the HWRM implementation.
1253          * A change in interface minor version is used to reflect
1254          * significant backward compatible modification to HWRM
1255          * interface specification. This can be due to addition or
1256          * removal of functionality. HWRM interface specifications
1257          * with the same major version but different minor versions are
1258          * compatible. A HWRM implementation that is compliant with
1259          * this specification shall provide value of 2 in this field.
1260          */
1261         uint16_t        hwrm_intf_minor;
1262         /*
1263          * This field represents the update version of HWRM interface
1264          * specification supported by the HWRM implementation. The
1265          * interface update version is used to reflect minor changes or
1266          * bug fixes to a released HWRM interface specification.
1267          * A HWRM implementation that is compliant with this
1268          * specification shall provide value of 2 in this field.
1269          */
1270         uint16_t        hwrm_intf_build;
1271         /*
1272          * This field represents the patch version of HWRM interface
1273          * specification supported by the HWRM implementation.
1274          */
1275         uint16_t        hwrm_intf_patch;
1276         /*
1277          * This field represents the major version of HWRM firmware.
1278          * A change in firmware major version represents a major
1279          * firmware release.
1280          */
1281         uint16_t        hwrm_fw_major;
1282         /*
1283          * This field represents the minor version of HWRM firmware.
1284          * A change in firmware minor version represents significant
1285          * firmware functionality changes.
1286          */
1287         uint16_t        hwrm_fw_minor;
1288         /*
1289          * This field represents the build version of HWRM firmware.
1290          * A change in firmware build version represents bug fixes to
1291          * a released firmware.
1292          */
1293         uint16_t        hwrm_fw_build;
1294         /*
1295          * This field is a reserved field.
1296          * This field can be used to represent firmware branches or customer
1297          * specific releases tied to a specific (major,minor,update) version
1298          * of the HWRM firmware.
1299          */
1300         uint16_t        hwrm_fw_patch;
1301         /*
1302          * This field represents the major version of mgmt firmware.
1303          * A change in major version represents a major release.
1304          */
1305         uint16_t        mgmt_fw_major;
1306         /*
1307          * This field represents the minor version of HWRM firmware.
1308          * A change in firmware minor version represents significant
1309          * firmware functionality changes.
1310          */
1311         uint16_t        mgmt_fw_minor;
1312         /*
1313          * This field represents the build version of mgmt firmware.
1314          * A change in update version represents bug fixes.
1315          */
1316         uint16_t        mgmt_fw_build;
1317         /*
1318          * This field is a reserved field. This field can be used to
1319          * represent firmware branches or customer specific releases
1320          * tied to a specific (major,minor,update) version.
1321          */
1322         uint16_t        mgmt_fw_patch;
1323         /*
1324          * This field represents the major version of network control
1325          * firmware. A change in major version represents
1326          * a major release.
1327          */
1328         uint16_t        netctrl_fw_major;
1329         /*
1330          * This field represents the minor version of network control
1331          * firmware. A change in minor version represents significant
1332          * functionality changes.
1333          */
1334         uint16_t        netctrl_fw_minor;
1335         /*
1336          * This field represents the build version of network control
1337          * firmware. A change in update version represents bug fixes.
1338          */
1339         uint16_t        netctrl_fw_build;
1340         /*
1341          * This field is a reserved field. This field can be used to
1342          * represent firmware branches or customer specific releases
1343          * tied to a specific (major,minor,update) version
1344          */
1345         uint16_t        netctrl_fw_patch;
1346         /*
1347          * This field represents the major version of RoCE firmware.
1348          * A change in major version represents a major release.
1349          */
1350         uint16_t        roce_fw_major;
1351         /*
1352          * This field represents the minor version of RoCE firmware.
1353          * A change in minor version represents significant
1354          * functionality changes.
1355          */
1356         uint16_t        roce_fw_minor;
1357         /*
1358          * This field represents the build version of RoCE firmware.
1359          * A change in update version represents bug fixes.
1360          */
1361         uint16_t        roce_fw_build;
1362         /*
1363          * This field is a reserved field. This field can be used to
1364          * represent firmware branches or customer specific releases
1365          * tied to a specific (major,minor,update) version
1366          */
1367         uint16_t        roce_fw_patch;
1368         /*
1369          * This field returns the maximum extended request length acceptable
1370          * by the device which allows requests greater than mailbox size when
1371          * used with the short cmd request format.
1372          */
1373         uint16_t        max_ext_req_len;
1374         uint8_t unused_1[5];
1375         /*
1376          * This field is used in Output records to indicate that the output
1377          * is completely written to RAM.  This field should be read as '1'
1378          * to indicate that the output has been completely written.
1379          * When writing a command completion or response to an internal processor,
1380          * the order of writes has to be such that this field is written last.
1381          */
1382         uint8_t valid;
1383 } __attribute__((packed));
1384
1385 /* bd_base (size:64b/8B) */
1386 struct bd_base {
1387         uint8_t type;
1388         /* This value identifies the type of buffer descriptor. */
1389         #define BD_BASE_TYPE_MASK             UINT32_C(0x3f)
1390         #define BD_BASE_TYPE_SFT              0
1391         /*
1392          * Indicates that this BD is 16B long and is used for
1393          * normal L2 packet transmission.
1394          */
1395         #define BD_BASE_TYPE_TX_BD_SHORT        UINT32_C(0x0)
1396         /*
1397          * Indicates that this BD is 1BB long and is an empty
1398          * TX BD.  Not valid for use by the driver.
1399          */
1400         #define BD_BASE_TYPE_TX_BD_EMPTY        UINT32_C(0x1)
1401         /*
1402          * Indicates that this BD is 16B long and is an RX Producer
1403          * (ie. empty) buffer descriptor.
1404          */
1405         #define BD_BASE_TYPE_RX_PROD_PKT        UINT32_C(0x4)
1406         /*
1407          * Indicates that this BD is 16B long and is an RX
1408          * Producer Buffer BD.
1409          */
1410         #define BD_BASE_TYPE_RX_PROD_BFR        UINT32_C(0x5)
1411         /*
1412          * Indicates that this BD is 16B long and is an
1413          * RX Producer Assembly Buffer Descriptor.
1414          */
1415         #define BD_BASE_TYPE_RX_PROD_AGG        UINT32_C(0x6)
1416         /*
1417          * Indicates that this BD is 32B long and is used for
1418          * normal L2 packet transmission.
1419          */
1420         #define BD_BASE_TYPE_TX_BD_LONG         UINT32_C(0x10)
1421         /*
1422          * Indicates that this BD is 32B long and is used for
1423          * L2 packet transmission for small packets that require
1424          * low latency.
1425          */
1426         #define BD_BASE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
1427         #define BD_BASE_TYPE_LAST              BD_BASE_TYPE_TX_BD_LONG_INLINE
1428         uint8_t unused_1[7];
1429 } __attribute__((packed));
1430
1431 /* tx_bd_short (size:128b/16B) */
1432 struct tx_bd_short {
1433         /*
1434          * All bits in this field must be valid on the first BD of a packet.
1435          * Only the packet_end bit must be valid for the remaining BDs
1436          * of a packet.
1437          */
1438         uint16_t        flags_type;
1439         /* This value identifies the type of buffer descriptor. */
1440         #define TX_BD_SHORT_TYPE_MASK            UINT32_C(0x3f)
1441         #define TX_BD_SHORT_TYPE_SFT             0
1442         /*
1443          * Indicates that this BD is 16B long and is used for
1444          * normal L2 packet transmission.
1445          */
1446         #define TX_BD_SHORT_TYPE_TX_BD_SHORT       UINT32_C(0x0)
1447         #define TX_BD_SHORT_TYPE_LAST             TX_BD_SHORT_TYPE_TX_BD_SHORT
1448         /*
1449          * All bits in this field must be valid on the first BD of a packet.
1450          * Only the packet_end bit must be valid for the remaining BDs
1451          * of a packet.
1452          */
1453         #define TX_BD_SHORT_FLAGS_MASK           UINT32_C(0xffc0)
1454         #define TX_BD_SHORT_FLAGS_SFT            6
1455         /*
1456          * If set to 1, the packet ends with the data in the buffer
1457          * pointed to by this descriptor.  This flag must be
1458          * valid on every BD.
1459          */
1460         #define TX_BD_SHORT_FLAGS_PACKET_END      UINT32_C(0x40)
1461         /*
1462          * If set to 1, the device will not generate a completion for
1463          * this transmit packet unless there is an error in it's
1464          * processing.
1465          * If this bit
1466          * is set to 0, then the packet will be completed normally.
1467          *
1468          * This bit must be valid only on the first BD of a packet.
1469          */
1470         #define TX_BD_SHORT_FLAGS_NO_CMPL         UINT32_C(0x80)
1471         /*
1472          * This value indicates how many 16B BD locations are consumed
1473          * in the ring by this packet.
1474          * A value of 1 indicates that this BD is the only BD (and that
1475          * the it is a short BD).  A value
1476          * of 3 indicates either 3 short BDs or 1 long BD and one short
1477          * BD in the packet.  A value of 0 indicates
1478          * that there are 32 BD locations in the packet (the maximum).
1479          *
1480          * This field is valid only on the first BD of a packet.
1481          */
1482         #define TX_BD_SHORT_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
1483         #define TX_BD_SHORT_FLAGS_BD_CNT_SFT      8
1484         /*
1485          * This value is a hint for the length of the entire packet.
1486          * It is used by the chip to optimize internal processing.
1487          *
1488          * The packet will be dropped if the hint is too short.
1489          *
1490          * This field is valid only on the first BD of a packet.
1491          */
1492         #define TX_BD_SHORT_FLAGS_LHINT_MASK      UINT32_C(0x6000)
1493         #define TX_BD_SHORT_FLAGS_LHINT_SFT       13
1494         /* indicates packet length < 512B */
1495         #define TX_BD_SHORT_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
1496         /* indicates 512 <= packet length < 1KB */
1497         #define TX_BD_SHORT_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
1498         /* indicates 1KB <= packet length < 2KB */
1499         #define TX_BD_SHORT_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
1500         /* indicates packet length >= 2KB */
1501         #define TX_BD_SHORT_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
1502         #define TX_BD_SHORT_FLAGS_LHINT_LAST \
1503                 TX_BD_SHORT_FLAGS_LHINT_GTE2K
1504         /*
1505          * If set to 1, the device immediately updates the Send Consumer
1506          * Index after the buffer associated with this descriptor has
1507          * been transferred via DMA to NIC memory from host memory. An
1508          * interrupt may or may not be generated according to the state
1509          * of the interrupt avoidance mechanisms. If this bit
1510          * is set to 0, then the Consumer Index is only updated as soon
1511          * as one of the host interrupt coalescing conditions has been met.
1512          *
1513          * This bit must be valid on the first BD of a packet.
1514          */
1515         #define TX_BD_SHORT_FLAGS_COAL_NOW        UINT32_C(0x8000)
1516         /*
1517          * This is the length of the host physical buffer this BD describes
1518          * in bytes.
1519          *
1520          * This field must be valid on all BDs of a packet.
1521          */
1522         uint16_t        len;
1523         /*
1524          * The opaque data field is pass through to the completion and can be
1525          * used for any data that the driver wants to associate with the
1526          * transmit BD.
1527          *
1528          * This field must be valid on the first BD of a packet.
1529          */
1530         uint32_t        opaque;
1531         /*
1532          * This is the host physical address for the portion of the packet
1533          * described by this TX BD.
1534          *
1535          * This value must be valid on all BDs of a packet.
1536          */
1537         uint64_t        address;
1538 } __attribute__((packed));
1539
1540 /* tx_bd_long (size:128b/16B) */
1541 struct tx_bd_long {
1542         /* This value identifies the type of buffer descriptor. */
1543         uint16_t        flags_type;
1544         /*
1545          * This value indicates the type of buffer descriptor.
1546          * packet.
1547          */
1548         #define TX_BD_LONG_TYPE_MASK            UINT32_C(0x3f)
1549         #define TX_BD_LONG_TYPE_SFT             0
1550         /*
1551          * Indicates that this BD is 32B long and is used for
1552          * normal L2 packet transmission.
1553          */
1554         #define TX_BD_LONG_TYPE_TX_BD_LONG        UINT32_C(0x10)
1555         #define TX_BD_LONG_TYPE_LAST             TX_BD_LONG_TYPE_TX_BD_LONG
1556         /*
1557          * All bits in this field must be valid on the first BD of a packet.
1558          * Only the packet_end bit must be valid for the remaining BDs
1559          * of a packet.
1560          */
1561         #define TX_BD_LONG_FLAGS_MASK           UINT32_C(0xffc0)
1562         #define TX_BD_LONG_FLAGS_SFT            6
1563         /*
1564          * If set to 1, the packet ends with the data in the buffer
1565          * pointed to by this descriptor.  This flag must be
1566          * valid on every BD.
1567          */
1568         #define TX_BD_LONG_FLAGS_PACKET_END      UINT32_C(0x40)
1569         /*
1570          * If set to 1, the device will not generate a completion for
1571          * this transmit packet unless there is an error in it's
1572          * processing.
1573          * If this bit
1574          * is set to 0, then the packet will be completed normally.
1575          *
1576          * This bit must be valid only on the first BD of a packet.
1577          */
1578         #define TX_BD_LONG_FLAGS_NO_CMPL         UINT32_C(0x80)
1579         /*
1580          * This value indicates how many 16B BD locations are consumed
1581          * in the ring by this packet.
1582          * A value of 1 indicates that this BD is the only BD (and that
1583          * the it is a short BD).  A value
1584          * of 3 indicates either 3 short BDs or 1 long BD and one short
1585          * BD in the packet.  A value of 0 indicates
1586          * that there are 32 BD locations in the packet (the maximum).
1587          *
1588          * This field is valid only on the first BD of a packet.
1589          */
1590         #define TX_BD_LONG_FLAGS_BD_CNT_MASK     UINT32_C(0x1f00)
1591         #define TX_BD_LONG_FLAGS_BD_CNT_SFT      8
1592         /*
1593          * This value is a hint for the length of the entire packet.
1594          * It is used by the chip to optimize internal processing.
1595          *
1596          * The packet will be dropped if the hint is too short.
1597          *
1598          * This field is valid only on the first BD of a packet.
1599          */
1600         #define TX_BD_LONG_FLAGS_LHINT_MASK      UINT32_C(0x6000)
1601         #define TX_BD_LONG_FLAGS_LHINT_SFT       13
1602         /* indicates packet length < 512B */
1603         #define TX_BD_LONG_FLAGS_LHINT_LT512       (UINT32_C(0x0) << 13)
1604         /* indicates 512 <= packet length < 1KB */
1605         #define TX_BD_LONG_FLAGS_LHINT_LT1K        (UINT32_C(0x1) << 13)
1606         /* indicates 1KB <= packet length < 2KB */
1607         #define TX_BD_LONG_FLAGS_LHINT_LT2K        (UINT32_C(0x2) << 13)
1608         /* indicates packet length >= 2KB */
1609         #define TX_BD_LONG_FLAGS_LHINT_GTE2K       (UINT32_C(0x3) << 13)
1610         #define TX_BD_LONG_FLAGS_LHINT_LAST       TX_BD_LONG_FLAGS_LHINT_GTE2K
1611         /*
1612          * If set to 1, the device immediately updates the Send Consumer
1613          * Index after the buffer associated with this descriptor has
1614          * been transferred via DMA to NIC memory from host memory. An
1615          * interrupt may or may not be generated according to the state
1616          * of the interrupt avoidance mechanisms. If this bit
1617          * is set to 0, then the Consumer Index is only updated as soon
1618          * as one of the host interrupt coalescing conditions has been met.
1619          *
1620          * This bit must be valid on the first BD of a packet.
1621          */
1622         #define TX_BD_LONG_FLAGS_COAL_NOW        UINT32_C(0x8000)
1623         /*
1624          * This is the length of the host physical buffer this BD describes
1625          * in bytes.
1626          *
1627          * This field must be valid on all BDs of a packet.
1628          */
1629         uint16_t        len;
1630         /*
1631          * The opaque data field is pass through to the completion and can be
1632          * used for any data that the driver wants to associate with the
1633          * transmit BD.
1634          *
1635          * This field must be valid on the first BD of a packet.
1636          */
1637         uint32_t        opaque;
1638         /*
1639          * This is the host physical address for the portion of the packet
1640          * described by this TX BD.
1641          *
1642          * This value must be valid on all BDs of a packet.
1643          */
1644         uint64_t        address;
1645 } __attribute__((packed));
1646
1647 /* Last 16 bytes of tx_bd_long. */
1648 /* tx_bd_long_hi (size:128b/16B) */
1649 struct tx_bd_long_hi {
1650         /*
1651          * All bits in this field must be valid on the first BD of a packet.
1652          * Their value on other BDs of the packet will be ignored.
1653          */
1654         uint16_t        lflags;
1655         /*
1656          * If set to 1, the controller replaces the TCP/UPD checksum
1657          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
1658          * checksum field of the encapsulated TCP/UDP packets with the
1659          * hardware calculated TCP/UDP checksum for the packet associated
1660          * with this descriptor. The flag is ignored if the LSO flag is set.
1661          *
1662          * This bit must be valid on the first BD of a packet.
1663          */
1664         #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
1665         /*
1666          * If set to 1,  the controller replaces the IP checksum of the
1667          * normal packets, or the inner IP checksum of the encapsulated
1668          * packets with the hardware calculated IP checksum for the
1669          * packet associated with this descriptor.
1670          *
1671          * This bit must be valid on the first BD of a packet.
1672          */
1673         #define TX_BD_LONG_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
1674         /*
1675          * If set to 1, the controller will not append an Ethernet CRC
1676          * to the end of the frame.
1677          *
1678          * This bit must be valid on the first BD of a packet.
1679          *
1680          * Packet must be 64B or longer when this flag is set.  It is not
1681          * useful to use this bit with any form of TX offload such as
1682          * CSO or LSO.  The intent is that the packet from the host already
1683          * has a valid Ethernet CRC on the packet.
1684          */
1685         #define TX_BD_LONG_LFLAGS_NOCRC              UINT32_C(0x4)
1686         /*
1687          * If set to 1, the device will record the time at which the packet
1688          * was actually transmitted at the TX MAC.
1689          *
1690          * This bit must be valid on the first BD of a packet.
1691          */
1692         #define TX_BD_LONG_LFLAGS_STAMP              UINT32_C(0x8)
1693         /*
1694          * If set to 1, The controller replaces the tunnel IP checksum
1695          * field with hardware calculated IP checksum for the IP header
1696          * of the packet associated with this descriptor.
1697          *
1698          * For outer UDP checksum, global outer UDP checksum TE_NIC register
1699          * needs to be enabled. If the global outer UDP checksum TE_NIC register
1700          * bit is set, outer UDP checksum will be calculated for the following
1701          * cases:
1702          * 1. Packets with tcp_udp_chksum flag set to offload checksum for inner
1703          * packet AND the inner packet is TCP/UDP. If the inner packet is ICMP for
1704          * example (non-TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
1705          * checksum will not be calculated.
1706          * 2. Packets with lso flag set which implies inner TCP checksum calculation
1707          * as part of LSO operation.
1708          */
1709         #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
1710         /*
1711          * If set to 1,  the device will treat this packet with LSO(Large
1712          * Send Offload) processing for both normal or encapsulated
1713          * packets, which is a form of TCP segmentation.  When this bit
1714          * is 1, the hdr_size and mss fields must be valid. The driver
1715          * doesn't need to set t_ip_chksum, ip_chksum, and tcp_udp_chksum
1716          * flags since the controller will replace the appropriate
1717          * checksum fields for segmented packets.
1718          *
1719          * When this bit is 1, the hdr_size and mss fields must be valid.
1720          */
1721         #define TX_BD_LONG_LFLAGS_LSO                UINT32_C(0x20)
1722         /*
1723          * If set to zero when LSO is '1', then the IPID will be treated
1724          * as a 16b number and will be wrapped if it exceeds a value of
1725          * 0xffff.
1726          *
1727          * If set to one when LSO is '1', then the IPID will be treated
1728          * as a 15b number and will be wrapped if it exceeds a value 0f
1729          * 0x7fff.
1730          */
1731         #define TX_BD_LONG_LFLAGS_IPID_FMT           UINT32_C(0x40)
1732         /*
1733          * If set to zero when LSO is '1', then the IPID of the tunnel
1734          * IP header will not be modified during LSO operations.
1735          *
1736          * If set to one when LSO is '1', then the IPID of the tunnel
1737          * IP header will be incremented for each subsequent segment of an
1738          * LSO operation.
1739          *
1740          * The flag is ignored if the LSO packet is a normal (non-tunneled)
1741          * TCP packet.
1742          */
1743         #define TX_BD_LONG_LFLAGS_T_IPID             UINT32_C(0x80)
1744         /*
1745          * If set to '1', then the RoCE ICRC will be appended to the
1746          * packet.  Packet must be a valid RoCE format packet.
1747          */
1748         #define TX_BD_LONG_LFLAGS_ROCE_CRC           UINT32_C(0x100)
1749         /*
1750          * If set to '1', then the FCoE CRC will be appended to the
1751          * packet.  Packet must be a valid FCoE format packet.
1752          */
1753         #define TX_BD_LONG_LFLAGS_FCOE_CRC           UINT32_C(0x200)
1754         uint16_t        hdr_size;
1755         /*
1756          * When LSO is '1', this field must contain the offset of the
1757          * TCP payload from the beginning of the packet in as
1758          * 16b words. In case of encapsulated/tunneling packet, this  field
1759          * contains the offset of the inner TCP payload from beginning of the
1760          * packet as 16-bit words.
1761          *
1762          * This value must be valid on the first BD of a packet.
1763          */
1764         #define TX_BD_LONG_HDR_SIZE_MASK UINT32_C(0x1ff)
1765         #define TX_BD_LONG_HDR_SIZE_SFT 0
1766         uint32_t        mss;
1767         /*
1768          * This is the MSS value that will be used to do the LSO processing.
1769          * The value is the length in bytes of the TCP payload for each
1770          * segment generated by the LSO operation.
1771          *
1772          * This value must be valid on the first BD of a packet.
1773          */
1774         #define TX_BD_LONG_MSS_MASK UINT32_C(0x7fff)
1775         #define TX_BD_LONG_MSS_SFT 0
1776         uint16_t        unused2;
1777         /*
1778          * This value selects a CFA action to perform on the packet.
1779          * Set this value to zero if no CFA action is desired.
1780          *
1781          * This value must be valid on the first BD of a packet.
1782          */
1783         uint16_t        cfa_action;
1784         /*
1785          * This value is action meta-data that defines CFA edit operations
1786          * that are done in addition to any action editing.
1787          */
1788         uint32_t        cfa_meta;
1789         /* When key=1, This is the VLAN tag VID value. */
1790         #define TX_BD_LONG_CFA_META_VLAN_VID_MASK     UINT32_C(0xfff)
1791         #define TX_BD_LONG_CFA_META_VLAN_VID_SFT      0
1792         /* When key=1, This is the VLAN tag DE value. */
1793         #define TX_BD_LONG_CFA_META_VLAN_DE           UINT32_C(0x1000)
1794         /* When key=1, This is the VLAN tag PRI value. */
1795         #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK     UINT32_C(0xe000)
1796         #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT      13
1797         /* When key=1, This is the VLAN tag TPID select value. */
1798         #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK    UINT32_C(0x70000)
1799         #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT     16
1800         /* 0x88a8 */
1801         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8  (UINT32_C(0x0) << 16)
1802         /* 0x8100 */
1803         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100  (UINT32_C(0x1) << 16)
1804         /* 0x9100 */
1805         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100  (UINT32_C(0x2) << 16)
1806         /* 0x9200 */
1807         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200  (UINT32_C(0x3) << 16)
1808         /* 0x9300 */
1809         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300  (UINT32_C(0x4) << 16)
1810         /* Value programmed in CFA VLANTPID register. */
1811         #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG   (UINT32_C(0x5) << 16)
1812         #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \
1813                 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
1814         /* When key=1, This is the VLAN tag TPID select value. */
1815         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
1816         #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT 19
1817         /*
1818          * This field identifies the type of edit to be performed
1819          * on the packet.
1820          *
1821          * This value must be valid on the first BD of a packet.
1822          */
1823         #define TX_BD_LONG_CFA_META_KEY_MASK          UINT32_C(0xf0000000)
1824         #define TX_BD_LONG_CFA_META_KEY_SFT           28
1825         /* No editing */
1826         #define TX_BD_LONG_CFA_META_KEY_NONE            (UINT32_C(0x0) << 28)
1827         /*
1828          * - meta[17:16] - TPID select value (0 = 0x8100).
1829          * - meta[15:12] - PRI/DE value.
1830          * - meta[11:0] - VID value.
1831          */
1832         #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG        (UINT32_C(0x1) << 28)
1833         #define TX_BD_LONG_CFA_META_KEY_LAST \
1834                 TX_BD_LONG_CFA_META_KEY_VLAN_TAG
1835 } __attribute__((packed));
1836
1837 /*
1838  * This structure is used to inform the NIC of packet data that needs to be
1839  * transmitted with additional processing that requires extra data such as
1840  * VLAN insertion plus attached inline data. This BD type may be used to
1841  * improve latency for small packets needing the additional extended features
1842  * supported by long BDs.
1843  */
1844 /* tx_bd_long_inline (size:256b/32B) */
1845 struct tx_bd_long_inline {
1846         uint16_t        flags_type;
1847         /* This value identifies the type of buffer descriptor. */
1848         #define TX_BD_LONG_INLINE_TYPE_MASK             UINT32_C(0x3f)
1849         #define TX_BD_LONG_INLINE_TYPE_SFT              0
1850         /*
1851          * This type of BD is 32B long and is used for inline L2 packet
1852          * transmission.
1853          */
1854         #define TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE  UINT32_C(0x11)
1855         #define TX_BD_LONG_INLINE_TYPE_LAST \
1856                 TX_BD_LONG_INLINE_TYPE_TX_BD_LONG_INLINE
1857         /*
1858          * All bits in this field may be set on the first BD of a packet.
1859          * Only the packet_end bit may be set in non-first BDs.
1860          */
1861         #define TX_BD_LONG_INLINE_FLAGS_MASK            UINT32_C(0xffc0)
1862         #define TX_BD_LONG_INLINE_FLAGS_SFT             6
1863         /*
1864          * If set to 1, the packet ends with the data in the buffer
1865          * pointed to by this descriptor.  This flag must be
1866          * valid on every BD.
1867          */
1868         #define TX_BD_LONG_INLINE_FLAGS_PACKET_END       UINT32_C(0x40)
1869         /*
1870          * If set to 1, the device will not generate a completion for
1871          * this transmit packet unless there is an error in its processing.
1872          * If this bit is set to 0, then the packet will be completed
1873          * normally.
1874          *
1875          * This bit may be set only on the first BD of a packet.
1876          */
1877         #define TX_BD_LONG_INLINE_FLAGS_NO_CMPL          UINT32_C(0x80)
1878         /*
1879          * This value indicates how many 16B BD locations are consumed
1880          * in the ring by this packet, including the BD and inline
1881          * data.
1882          */
1883         #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_MASK      UINT32_C(0x1f00)
1884         #define TX_BD_LONG_INLINE_FLAGS_BD_CNT_SFT       8
1885         /* This field is deprecated. */
1886         #define TX_BD_LONG_INLINE_FLAGS_LHINT_MASK       UINT32_C(0x6000)
1887         #define TX_BD_LONG_INLINE_FLAGS_LHINT_SFT        13
1888         /*
1889          * If set to 1, the device immediately updates the Send Consumer
1890          * Index after the buffer associated with this descriptor has
1891          * been transferred via DMA to NIC memory from host memory. An
1892          * interrupt may or may not be generated according to the state
1893          * of the interrupt avoidance mechanisms. If this bit
1894          * is set to 0, then the Consumer Index is only updated as soon
1895          * as one of the host interrupt coalescing conditions has been met.
1896          *
1897          * This bit must be valid on the first BD of a packet.
1898          */
1899         #define TX_BD_LONG_INLINE_FLAGS_COAL_NOW         UINT32_C(0x8000)
1900         /*
1901          * This is the length of the inline data, not including BD length, in
1902          * bytes.
1903          * The maximum value is 480.
1904          *
1905          * This field must be valid on all BDs of a packet.
1906          */
1907         uint16_t        len;
1908         /*
1909          * The opaque data field is passed through to the completion and can be
1910          * used for any data that the driver wants to associate with the transmit
1911          * BD.
1912          *
1913          * This field must be valid on the first BD of a packet.
1914          */
1915         uint32_t        opaque;
1916         uint64_t        unused1;
1917         /*
1918          * All bits in this field must be valid on the first BD of a packet.
1919          * Their value on other BDs of the packet is ignored.
1920          */
1921         uint16_t        lflags;
1922         /*
1923          * If set to 1, the controller replaces the TCP/UPD checksum
1924          * fields of normal TCP/UPD checksum, or the inner TCP/UDP
1925          * checksum field of the encapsulated TCP/UDP packets with the
1926          * hardware calculated TCP/UDP checksum for the packet associated
1927          * with this descriptor. The flag is ignored if the LSO flag is set.
1928          */
1929         #define TX_BD_LONG_INLINE_LFLAGS_TCP_UDP_CHKSUM     UINT32_C(0x1)
1930         /*
1931          * If set to 1, the controller replaces the IP checksum of the
1932          * normal packets, or the inner IP checksum of the encapsulated
1933          * packets with the hardware calculated IP checksum for the
1934          * packet associated with this descriptor.
1935          */
1936         #define TX_BD_LONG_INLINE_LFLAGS_IP_CHKSUM          UINT32_C(0x2)
1937         /*
1938          * If set to 1, the controller will not append an Ethernet CRC
1939          * to the end of the frame.
1940          *
1941          * Packet must be 64B or longer when this flag is set. It is not
1942          * useful to use this bit with any form of TX offload such as
1943          * CSO or LSO. The intent is that the packet from the host already
1944          * has a valid Ethernet CRC on the packet.
1945          */
1946         #define TX_BD_LONG_INLINE_LFLAGS_NOCRC              UINT32_C(0x4)
1947         /*
1948          * If set to 1, the device will record the time at which the packet
1949          * was actually transmitted at the TX MAC.
1950          */
1951         #define TX_BD_LONG_INLINE_LFLAGS_STAMP              UINT32_C(0x8)
1952         /*
1953          * If set to 1, the controller replaces the tunnel IP checksum
1954          * field with hardware calculated IP checksum for the IP header
1955          * of the packet associated with this descriptor. The hardware
1956          * updates an outer UDP checksum if it is non-zero.
1957          */
1958         #define TX_BD_LONG_INLINE_LFLAGS_T_IP_CHKSUM        UINT32_C(0x10)
1959         /*
1960          * This bit must be 0 for BDs of this type. LSO is not supported with
1961          * inline BDs.
1962          */
1963         #define TX_BD_LONG_INLINE_LFLAGS_LSO                UINT32_C(0x20)
1964         /* Since LSO is not supported with inline BDs, this bit is not used. */
1965         #define TX_BD_LONG_INLINE_LFLAGS_IPID_FMT           UINT32_C(0x40)
1966         /* Since LSO is not supported with inline BDs, this bit is not used. */
1967         #define TX_BD_LONG_INLINE_LFLAGS_T_IPID             UINT32_C(0x80)
1968         /*
1969          * If set to '1', then the RoCE ICRC will be appended to the
1970          * packet.  Packet must be a valid RoCE format packet.
1971          */
1972         #define TX_BD_LONG_INLINE_LFLAGS_ROCE_CRC           UINT32_C(0x100)
1973         /*
1974          * If set to '1', then the FCoE CRC will be appended to the
1975          * packet.  Packet must be a valid FCoE format packet.
1976          */
1977         #define TX_BD_LONG_INLINE_LFLAGS_FCOE_CRC           UINT32_C(0x200)
1978         uint16_t        unused2;
1979         uint32_t        unused3;
1980         uint16_t        unused4;
1981         /*
1982          * This value selects a CFA action to perform on the packet.
1983          * Set this value to zero if no CFA action is desired.
1984          *
1985          * This value must be valid on the first BD of a packet.
1986          */
1987         uint16_t        cfa_action;
1988         /*
1989          * This value is action meta-data that defines CFA edit operations
1990          * that are done in addition to any action editing.
1991          */
1992         uint32_t        cfa_meta;
1993         /* When key = 1, this is the VLAN tag VID value. */
1994         #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_MASK     UINT32_C(0xfff)
1995         #define TX_BD_LONG_INLINE_CFA_META_VLAN_VID_SFT      0
1996         /* When key = 1, this is the VLAN tag DE value. */
1997         #define TX_BD_LONG_INLINE_CFA_META_VLAN_DE           UINT32_C(0x1000)
1998         /* When key = 1, this is the VLAN tag PRI value. */
1999         #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_MASK     UINT32_C(0xe000)
2000         #define TX_BD_LONG_INLINE_CFA_META_VLAN_PRI_SFT      13
2001         /* When key = 1, this is the VLAN tag TPID select value. */
2002         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_MASK    UINT32_C(0x70000)
2003         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_SFT     16
2004         /* 0x88a8 */
2005         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID88A8 \
2006                 (UINT32_C(0x0) << 16)
2007         /* 0x8100 */
2008         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID8100 \
2009                 (UINT32_C(0x1) << 16)
2010         /* 0x9100 */
2011         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9100 \
2012                 (UINT32_C(0x2) << 16)
2013         /* 0x9200 */
2014         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9200 \
2015                 (UINT32_C(0x3) << 16)
2016         /* 0x9300 */
2017         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPID9300 \
2018                 (UINT32_C(0x4) << 16)
2019         /* Value programmed in CFA VLANTPID register. */
2020         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG \
2021                 (UINT32_C(0x5) << 16)
2022         #define TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_LAST \
2023                 TX_BD_LONG_INLINE_CFA_META_VLAN_TPID_TPIDCFG
2024         #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_MASK \
2025                 UINT32_C(0xff80000)
2026         #define TX_BD_LONG_INLINE_CFA_META_VLAN_RESERVED_SFT 19
2027         /*
2028          * This field identifies the type of edit to be performed
2029          * on the packet.
2030          *
2031          * This value must be valid on the first BD of a packet.
2032          */
2033         #define TX_BD_LONG_INLINE_CFA_META_KEY_MASK \
2034                 UINT32_C(0xf0000000)
2035         #define TX_BD_LONG_INLINE_CFA_META_KEY_SFT           28
2036         /* No editing */
2037         #define TX_BD_LONG_INLINE_CFA_META_KEY_NONE \
2038                 (UINT32_C(0x0) << 28)
2039         /*
2040          * - meta[17:16] - TPID select value (0 = 0x8100).
2041          * - meta[15:12] - PRI/DE value.
2042          * - meta[11:0] - VID value.
2043          */
2044         #define TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG \
2045                 (UINT32_C(0x1) << 28)
2046         #define TX_BD_LONG_INLINE_CFA_META_KEY_LAST \
2047                 TX_BD_LONG_INLINE_CFA_META_KEY_VLAN_TAG
2048 } __attribute__((packed));
2049
2050 /* tx_bd_empty (size:128b/16B) */
2051 struct tx_bd_empty {
2052         /* This value identifies the type of buffer descriptor. */
2053         uint8_t type;
2054         #define TX_BD_EMPTY_TYPE_MASK       UINT32_C(0x3f)
2055         #define TX_BD_EMPTY_TYPE_SFT        0
2056         /*
2057          * Indicates that this BD is 1BB long and is an empty
2058          * TX BD.  Not valid for use by the driver.
2059          */
2060         #define TX_BD_EMPTY_TYPE_TX_BD_EMPTY  UINT32_C(0x1)
2061         #define TX_BD_EMPTY_TYPE_LAST        TX_BD_EMPTY_TYPE_TX_BD_EMPTY
2062         uint8_t unused_1[3];
2063         uint8_t unused_2;
2064         uint8_t unused_3[3];
2065         uint8_t unused_4[8];
2066 } __attribute__((packed));
2067
2068 /* rx_prod_pkt_bd (size:128b/16B) */
2069 struct rx_prod_pkt_bd {
2070         /* This value identifies the type of buffer descriptor. */
2071         uint16_t        flags_type;
2072         /* This value identifies the type of buffer descriptor. */
2073         #define RX_PROD_PKT_BD_TYPE_MASK         UINT32_C(0x3f)
2074         #define RX_PROD_PKT_BD_TYPE_SFT          0
2075         /*
2076          * Indicates that this BD is 16B long and is an RX Producer
2077          * (ie. empty) buffer descriptor.
2078          */
2079         #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT    UINT32_C(0x4)
2080         #define RX_PROD_PKT_BD_TYPE_LAST \
2081                 RX_PROD_PKT_BD_TYPE_RX_PROD_PKT
2082         #define RX_PROD_PKT_BD_FLAGS_MASK        UINT32_C(0xffc0)
2083         #define RX_PROD_PKT_BD_FLAGS_SFT         6
2084         /*
2085          * If set to 1, the packet will be placed at the address plus
2086          * 2B.  The 2 Bytes of padding will be written as zero.
2087          */
2088         #define RX_PROD_PKT_BD_FLAGS_SOP_PAD      UINT32_C(0x40)
2089         /*
2090          * If set to 1, the packet write will be padded out to the
2091          * nearest cache-line with zero value padding.
2092          */
2093         #define RX_PROD_PKT_BD_FLAGS_EOP_PAD      UINT32_C(0x80)
2094         /*
2095          * This value is the number of additional buffers in the ring that
2096          * describe the buffer space to be consumed for the this packet.
2097          * If the value is zero, then the packet must fit within the
2098          * space described by this BD.  If this value is 1 or more, it
2099          * indicates how many additional "buffer" BDs are in the ring
2100          * immediately following this BD to be used for the same
2101          * network packet.
2102          *
2103          * Even if the packet to be placed does not need all the
2104          * additional buffers, they will be consumed anyway.
2105          */
2106         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
2107         #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT  8
2108         /*
2109          * This is the length in Bytes of the host physical buffer where
2110          * data for the packet may be placed in host memory.
2111          */
2112         uint16_t        len;
2113         /*
2114          * The opaque data field is pass through to the completion and can be
2115          * used for any data that the driver wants to associate with this
2116          * receive buffer set.
2117          */
2118         uint32_t        opaque;
2119         /*
2120          * This is the host physical address where data for the packet may
2121          * by placed in host memory.
2122          */
2123         uint64_t        address;
2124 } __attribute__((packed));
2125
2126 /* rx_prod_bfr_bd (size:128b/16B) */
2127 struct rx_prod_bfr_bd {
2128         /* This value identifies the type of buffer descriptor. */
2129         uint16_t        flags_type;
2130         /* This value identifies the type of buffer descriptor. */
2131         #define RX_PROD_BFR_BD_TYPE_MASK       UINT32_C(0x3f)
2132         #define RX_PROD_BFR_BD_TYPE_SFT        0
2133         /*
2134          * Indicates that this BD is 16B long and is an RX
2135          * Producer Buffer BD.
2136          */
2137         #define RX_PROD_BFR_BD_TYPE_RX_PROD_BFR  UINT32_C(0x5)
2138         #define RX_PROD_BFR_BD_TYPE_LAST        RX_PROD_BFR_BD_TYPE_RX_PROD_BFR
2139         #define RX_PROD_BFR_BD_FLAGS_MASK      UINT32_C(0xffc0)
2140         #define RX_PROD_BFR_BD_FLAGS_SFT       6
2141         /*
2142          * This is the length in Bytes of the host physical buffer where
2143          * data for the packet may be placed in host memory.
2144          */
2145         uint16_t        len;
2146         /* This field is not used. */
2147         uint32_t        opaque;
2148         /*
2149          * This is the host physical address where data for the packet may
2150          * by placed in host memory.
2151          */
2152         uint64_t        address;
2153 } __attribute__((packed));
2154
2155 /* rx_prod_agg_bd (size:128b/16B) */
2156 struct rx_prod_agg_bd {
2157         /* This value identifies the type of buffer descriptor. */
2158         uint16_t        flags_type;
2159         /* This value identifies the type of buffer descriptor. */
2160         #define RX_PROD_AGG_BD_TYPE_MASK         UINT32_C(0x3f)
2161         #define RX_PROD_AGG_BD_TYPE_SFT          0
2162         /*
2163          * Indicates that this BD is 16B long and is an
2164          * RX Producer Assembly Buffer Descriptor.
2165          */
2166         #define RX_PROD_AGG_BD_TYPE_RX_PROD_AGG    UINT32_C(0x6)
2167         #define RX_PROD_AGG_BD_TYPE_LAST \
2168                 RX_PROD_AGG_BD_TYPE_RX_PROD_AGG
2169         #define RX_PROD_AGG_BD_FLAGS_MASK        UINT32_C(0xffc0)
2170         #define RX_PROD_AGG_BD_FLAGS_SFT         6
2171         /*
2172          * If set to 1, the packet write will be padded out to the
2173          * nearest cache-line with zero value padding.
2174          */
2175         #define RX_PROD_AGG_BD_FLAGS_EOP_PAD      UINT32_C(0x40)
2176         /*
2177          * This is the length in Bytes of the host physical buffer where
2178          * data for the packet may be placed in host memory.
2179          */
2180         uint16_t        len;
2181         /*
2182          * The opaque data field is pass through to the completion and can be
2183          * used for any data that the driver wants to associate with this
2184          * receive assembly buffer.
2185          */
2186         uint32_t        opaque;
2187         /*
2188          * This is the host physical address where data for the packet may
2189          * by placed in host memory.
2190          */
2191         uint64_t        address;
2192 } __attribute__((packed));
2193
2194 /* cmpl_base (size:128b/16B) */
2195 struct cmpl_base {
2196         uint16_t        type;
2197         /*
2198          * This field indicates the exact type of the completion.
2199          * By convention, the LSB identifies the length of the
2200          * record in 16B units.  Even values indicate 16B
2201          * records.  Odd values indicate 32B
2202          * records.
2203          */
2204         #define CMPL_BASE_TYPE_MASK            UINT32_C(0x3f)
2205         #define CMPL_BASE_TYPE_SFT             0
2206         /*
2207          * TX L2 completion:
2208          * Completion of TX packet.  Length = 16B
2209          */
2210         #define CMPL_BASE_TYPE_TX_L2             UINT32_C(0x0)
2211         /*
2212          * RX L2 completion:
2213          * Completion of and L2 RX packet. Length = 32B
2214          */
2215         #define CMPL_BASE_TYPE_RX_L2             UINT32_C(0x11)
2216         /*
2217          * RX Aggregation Buffer completion :
2218          * Completion of an L2 aggregation buffer in support of
2219          * TPA, HDS, or Jumbo packet completion.  Length = 16B
2220          */
2221         #define CMPL_BASE_TYPE_RX_AGG            UINT32_C(0x12)
2222         /*
2223          * RX L2 TPA Start Completion:
2224          * Completion at the beginning of a TPA operation.
2225          * Length = 32B
2226          */
2227         #define CMPL_BASE_TYPE_RX_TPA_START      UINT32_C(0x13)
2228         /*
2229          * RX L2 TPA End Completion:
2230          * Completion at the end of a TPA operation.
2231          * Length = 32B
2232          */
2233         #define CMPL_BASE_TYPE_RX_TPA_END        UINT32_C(0x15)
2234         /*
2235          * Statistics Ejection Completion:
2236          * Completion of statistics data ejection buffer.
2237          * Length = 16B
2238          */
2239         #define CMPL_BASE_TYPE_STAT_EJECT        UINT32_C(0x1a)
2240         /*
2241          * HWRM Command Completion:
2242          * Completion of an HWRM command.
2243          */
2244         #define CMPL_BASE_TYPE_HWRM_DONE         UINT32_C(0x20)
2245         /* Forwarded HWRM Request */
2246         #define CMPL_BASE_TYPE_HWRM_FWD_REQ      UINT32_C(0x22)
2247         /* Forwarded HWRM Response */
2248         #define CMPL_BASE_TYPE_HWRM_FWD_RESP     UINT32_C(0x24)
2249         /* HWRM Asynchronous Event Information */
2250         #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
2251         /* CQ Notification */
2252         #define CMPL_BASE_TYPE_CQ_NOTIFICATION   UINT32_C(0x30)
2253         /* SRQ Threshold Event */
2254         #define CMPL_BASE_TYPE_SRQ_EVENT         UINT32_C(0x32)
2255         /* DBQ Threshold Event */
2256         #define CMPL_BASE_TYPE_DBQ_EVENT         UINT32_C(0x34)
2257         /* QP Async Notification */
2258         #define CMPL_BASE_TYPE_QP_EVENT          UINT32_C(0x38)
2259         /* Function Async Notification */
2260         #define CMPL_BASE_TYPE_FUNC_EVENT        UINT32_C(0x3a)
2261         #define CMPL_BASE_TYPE_LAST             CMPL_BASE_TYPE_FUNC_EVENT
2262         /* info1 is 16 b */
2263         uint16_t        info1;
2264         /* info2 is 32 b */
2265         uint32_t        info2;
2266         /*
2267          * This value is written by the NIC such that it will be different
2268          * for each pass through the completion queue.   The even passes
2269          * will write 1.  The odd passes will write 0.
2270          */
2271         uint32_t        info3_v;
2272         #define CMPL_BASE_V         UINT32_C(0x1)
2273         #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
2274         #define CMPL_BASE_INFO3_SFT 1
2275         /* info4 is 32 b */
2276         uint32_t        info4;
2277 } __attribute__((packed));
2278
2279 /* tx_cmpl (size:128b/16B) */
2280 struct tx_cmpl {
2281         uint16_t        flags_type;
2282         /*
2283          * This field indicates the exact type of the completion.
2284          * By convention, the LSB identifies the length of the
2285          * record in 16B units.  Even values indicate 16B
2286          * records.  Odd values indicate 32B
2287          * records.
2288          */
2289         #define TX_CMPL_TYPE_MASK       UINT32_C(0x3f)
2290         #define TX_CMPL_TYPE_SFT        0
2291         /*
2292          * TX L2 completion:
2293          * Completion of TX packet.  Length = 16B
2294          */
2295         #define TX_CMPL_TYPE_TX_L2        UINT32_C(0x0)
2296         #define TX_CMPL_TYPE_LAST        TX_CMPL_TYPE_TX_L2
2297         #define TX_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
2298         #define TX_CMPL_FLAGS_SFT       6
2299         /*
2300          * When this bit is '1', it indicates a packet that has an
2301          * error of some type.  Type of error is indicated in
2302          * error_flags.
2303          */
2304         #define TX_CMPL_FLAGS_ERROR      UINT32_C(0x40)
2305         /*
2306          * When this bit is '1', it indicates that the packet completed
2307          * was transmitted using the push acceleration data provided
2308          * by the driver.  When this bit is '0', it indicates that the
2309          * packet had not push acceleration data written or was executed
2310          * as a normal packet even though push data was provided.
2311          */
2312         #define TX_CMPL_FLAGS_PUSH       UINT32_C(0x80)
2313         /* unused1 is 16 b */
2314         uint16_t        unused_0;
2315         /*
2316          * This is a copy of the opaque field from the first TX BD of this
2317          * transmitted packet.
2318          */
2319         uint32_t        opaque;
2320         uint16_t        errors_v;
2321         /*
2322          * This value is written by the NIC such that it will be different
2323          * for each pass through the completion queue.   The even passes
2324          * will write 1.  The odd passes will write 0.
2325          */
2326         #define TX_CMPL_V                              UINT32_C(0x1)
2327         #define TX_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
2328         #define TX_CMPL_ERRORS_SFT                     1
2329         /*
2330          * This error indicates that there was some sort of problem
2331          * with the BDs for the packet.
2332          */
2333         #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
2334         #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT         1
2335         /* No error */
2336         #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR      (UINT32_C(0x0) << 1)
2337         /*
2338          * Bad Format:
2339          * BDs were not formatted correctly.
2340          */
2341         #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT       (UINT32_C(0x2) << 1)
2342         #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \
2343                 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
2344         /*
2345          * When this bit is '1', it indicates that the length of
2346          * the packet was zero.  No packet was transmitted.
2347          */
2348         #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT          UINT32_C(0x10)
2349         /*
2350          * When this bit is '1', it indicates that the packet
2351          * was longer than the programmed limit in TDI. No
2352          * packet was transmitted.
2353          */
2354         #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH      UINT32_C(0x20)
2355         /*
2356          * When this bit is '1', it indicates that one or more of the
2357          * BDs associated with this packet generated a PCI error.
2358          * This probably means the address was not valid.
2359          */
2360         #define TX_CMPL_ERRORS_DMA_ERROR                UINT32_C(0x40)
2361         /*
2362          * When this bit is '1', it indicates that the packet was longer
2363          * than indicated by the hint.  No packet was transmitted.
2364          */
2365         #define TX_CMPL_ERRORS_HINT_TOO_SHORT           UINT32_C(0x80)
2366         /*
2367          * When this bit is '1', it indicates that the packet was
2368          * dropped due to Poison TLP error on one or more of the
2369          * TLPs in the PXP completion.
2370          */
2371         #define TX_CMPL_ERRORS_POISON_TLP_ERROR         UINT32_C(0x100)
2372         /* unused2 is 16 b */
2373         uint16_t        unused_1;
2374         /* unused3 is 32 b */
2375         uint32_t        unused_2;
2376 } __attribute__((packed));
2377
2378 /* rx_pkt_cmpl (size:128b/16B) */
2379 struct rx_pkt_cmpl {
2380         uint16_t        flags_type;
2381         /*
2382          * This field indicates the exact type of the completion.
2383          * By convention, the LSB identifies the length of the
2384          * record in 16B units.  Even values indicate 16B
2385          * records.  Odd values indicate 32B
2386          * records.
2387          */
2388         #define RX_PKT_CMPL_TYPE_MASK                   UINT32_C(0x3f)
2389         #define RX_PKT_CMPL_TYPE_SFT                    0
2390         /*
2391          * RX L2 completion:
2392          * Completion of and L2 RX packet. Length = 32B
2393          */
2394         #define RX_PKT_CMPL_TYPE_RX_L2                    UINT32_C(0x11)
2395         #define RX_PKT_CMPL_TYPE_LAST                    RX_PKT_CMPL_TYPE_RX_L2
2396         #define RX_PKT_CMPL_FLAGS_MASK                  UINT32_C(0xffc0)
2397         #define RX_PKT_CMPL_FLAGS_SFT                   6
2398         /*
2399          * When this bit is '1', it indicates a packet that has an
2400          * error of some type.  Type of error is indicated in
2401          * error_flags.
2402          */
2403         #define RX_PKT_CMPL_FLAGS_ERROR                  UINT32_C(0x40)
2404         /* This field indicates how the packet was placed in the buffer. */
2405         #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK         UINT32_C(0x380)
2406         #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT          7
2407         /*
2408          * Normal:
2409          * Packet was placed using normal algorithm.
2410          */
2411         #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL         (UINT32_C(0x0) << 7)
2412         /*
2413          * Jumbo:
2414          * Packet was placed using jumbo algorithm.
2415          */
2416         #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO          (UINT32_C(0x1) << 7)
2417         /*
2418          * Header/Data Separation:
2419          * Packet was placed using Header/Data separation algorithm.
2420          * The separation location is indicated by the itype field.
2421          */
2422         #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS            (UINT32_C(0x2) << 7)
2423         #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \
2424                 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
2425         /* This bit is '1' if the RSS field in this completion is valid. */
2426         #define RX_PKT_CMPL_FLAGS_RSS_VALID              UINT32_C(0x400)
2427         /* unused is 1 b */
2428         #define RX_PKT_CMPL_FLAGS_UNUSED                 UINT32_C(0x800)
2429         /*
2430          * This value indicates what the inner packet determined for the
2431          * packet was.
2432          */
2433         #define RX_PKT_CMPL_FLAGS_ITYPE_MASK             UINT32_C(0xf000)
2434         #define RX_PKT_CMPL_FLAGS_ITYPE_SFT              12
2435         /*
2436          * Not Known:
2437          * Indicates that the packet type was not known.
2438          */
2439         #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN \
2440                 (UINT32_C(0x0) << 12)
2441         /*
2442          * IP Packet:
2443          * Indicates that the packet was an IP packet, but further
2444          * classification was not possible.
2445          */
2446         #define RX_PKT_CMPL_FLAGS_ITYPE_IP \
2447                 (UINT32_C(0x1) << 12)
2448         /*
2449          * TCP Packet:
2450          * Indicates that the packet was IP and TCP.
2451          * This indicates that the payload_offset field is valid.
2452          */
2453         #define RX_PKT_CMPL_FLAGS_ITYPE_TCP \
2454                 (UINT32_C(0x2) << 12)
2455         /*
2456          * UDP Packet:
2457          * Indicates that the packet was IP and UDP.
2458          * This indicates that the payload_offset field is valid.
2459          */
2460         #define RX_PKT_CMPL_FLAGS_ITYPE_UDP \
2461                 (UINT32_C(0x3) << 12)
2462         /*
2463          * FCoE Packet:
2464          * Indicates that the packet was recognized as a FCoE.
2465          * This also indicates that the payload_offset field is valid.
2466          */
2467         #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE \
2468                 (UINT32_C(0x4) << 12)
2469         /*
2470          * RoCE Packet:
2471          * Indicates that the packet was recognized as a RoCE.
2472          * This also indicates that the payload_offset field is valid.
2473          */
2474         #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE \
2475                 (UINT32_C(0x5) << 12)
2476         /*
2477          * ICMP Packet:
2478          * Indicates that the packet was recognized as ICMP.
2479          * This indicates that the payload_offset field is valid.
2480          */
2481         #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP \
2482                 (UINT32_C(0x7) << 12)
2483         /*
2484          * PtP packet wo/timestamp:
2485          * Indicates that the packet was recognized as a PtP
2486          * packet.
2487          */
2488         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
2489                 (UINT32_C(0x8) << 12)
2490         /*
2491          * PtP packet w/timestamp:
2492          * Indicates that the packet was recognized as a PtP
2493          * packet and that a timestamp was taken for the packet.
2494          */
2495         #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \
2496                 (UINT32_C(0x9) << 12)
2497         #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \
2498                 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
2499         /*
2500          * This is the length of the data for the packet stored in the
2501          * buffer(s) identified by the opaque value.  This includes
2502          * the packet BD and any associated buffer BDs.  This does not include
2503          * the the length of any data places in aggregation BDs.
2504          */
2505         uint16_t        len;
2506         /*
2507          * This is a copy of the opaque field from the RX BD this completion
2508          * corresponds to.
2509          */
2510         uint32_t        opaque;
2511         uint8_t agg_bufs_v1;
2512         /*
2513          * This value is written by the NIC such that it will be different
2514          * for each pass through the completion queue.   The even passes
2515          * will write 1.  The odd passes will write 0.
2516          */
2517         #define RX_PKT_CMPL_V1           UINT32_C(0x1)
2518         /*
2519          * This value is the number of aggregation buffers that follow this
2520          * entry in the completion ring that are a part of this packet.
2521          * If the value is zero, then the packet is completely contained
2522          * in the buffer space provided for the packet in the RX ring.
2523          */
2524         #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
2525         #define RX_PKT_CMPL_AGG_BUFS_SFT 1
2526         /* unused1 is 2 b */
2527         #define RX_PKT_CMPL_UNUSED1_MASK UINT32_C(0xc0)
2528         #define RX_PKT_CMPL_UNUSED1_SFT  6
2529         /*
2530          * This is the RSS hash type for the packet.  The value is packed
2531          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
2532          *
2533          * The value of tuple_extrac_op provides the information about
2534          * what fields the hash was computed on.
2535          * * 0: The RSS hash was computed over source IP address,
2536          * destination IP address, source port, and destination port of inner
2537          * IP and TCP or UDP headers. Note: For non-tunneled packets,
2538          * the packet headers are considered inner packet headers for the RSS
2539          * hash computation purpose.
2540          * * 1: The RSS hash was computed over source IP address and destination
2541          * IP address of inner IP header. Note: For non-tunneled packets,
2542          * the packet headers are considered inner packet headers for the RSS
2543          * hash computation purpose.
2544          * * 2: The RSS hash was computed over source IP address,
2545          * destination IP address, source port, and destination port of
2546          * IP and TCP or UDP headers of outer tunnel headers.
2547          * Note: For non-tunneled packets, this value is not applicable.
2548          * * 3: The RSS hash was computed over source IP address and
2549          * destination IP address of IP header of outer tunnel headers.
2550          * Note: For non-tunneled packets, this value is not applicable.
2551          *
2552          * Note that 4-tuples values listed above are applicable
2553          * for layer 4 protocols supported and enabled for RSS in the hardware,
2554          * HWRM firmware, and drivers. For example, if RSS hash is supported and
2555          * enabled for TCP traffic only, then the values of tuple_extract_op
2556          * corresponding to 4-tuples are only valid for TCP traffic.
2557          */
2558         uint8_t rss_hash_type;
2559         /*
2560          * This value indicates the offset in bytes from the beginning of the packet
2561          * where the inner payload starts.  This value is valid for TCP, UDP,
2562          * FCoE, and RoCE packets.
2563          *
2564          * A value of zero indicates that header is 256B into the packet.
2565          */
2566         uint8_t payload_offset;
2567         /* unused2 is 8 b */
2568         uint8_t unused1;
2569         /*
2570          * This value is the RSS hash value calculated for the packet
2571          * based on the mode bits and key value in the VNIC.
2572          */
2573         uint32_t        rss_hash;
2574 } __attribute__((packed));
2575
2576 /* Last 16 bytes of rx_pkt_cmpl. */
2577 /* rx_pkt_cmpl_hi (size:128b/16B) */
2578 struct rx_pkt_cmpl_hi {
2579         uint32_t        flags2;
2580         /*
2581          * This indicates that the ip checksum was calculated for the
2582          * inner packet and that the ip_cs_error field indicates if there
2583          * was an error.
2584          */
2585         #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC                 UINT32_C(0x1)
2586         /*
2587          * This indicates that the TCP, UDP or ICMP checksum was
2588          * calculated for the inner packet and that the l4_cs_error field
2589          * indicates if there was an error.
2590          */
2591         #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC                 UINT32_C(0x2)
2592         /*
2593          * This indicates that the ip checksum was calculated for the
2594          * tunnel header and that the t_ip_cs_error field indicates if there
2595          * was an error.
2596          */
2597         #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC               UINT32_C(0x4)
2598         /*
2599          * This indicates that the UDP checksum was
2600          * calculated for the tunnel packet and that the t_l4_cs_error field
2601          * indicates if there was an error.
2602          */
2603         #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC               UINT32_C(0x8)
2604         /* This value indicates what format the metadata field is. */
2605         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK           UINT32_C(0xf0)
2606         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT            4
2607         /* No metadata informtaion.  Value is zero. */
2608         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE \
2609                 (UINT32_C(0x0) << 4)
2610         /*
2611          * The metadata field contains the VLAN tag and TPID value.
2612          * - metadata[11:0] contains the vlan VID value.
2613          * - metadata[12] contains the vlan DE value.
2614          * - metadata[15:13] contains the vlan PRI value.
2615          * - metadata[31:16] contains the vlan TPID value.
2616          */
2617         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN \
2618                 (UINT32_C(0x1) << 4)
2619         /*
2620          * If ext_meta_format is equal to 1, the metadata field
2621          * contains the lower 16b of the tunnel ID value, justified
2622          * to LSB
2623          * - VXLAN = VNI[23:0] -> VXLAN Network ID
2624          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
2625          * - NVGRE = TNI[23:0] -> Tenant Network ID
2626          * - GRE = KEY[31:0 -> key fieled with bit mask. zero if K = 0
2627          * - IPV4 = 0 (not populated)
2628          * - IPV6 = Flow Label[19:0]
2629          * - PPPoE = sessionID[15:0]
2630          * - MPLs = Outer label[19:0]
2631          * - UPAR = Selected[31:0] with bit mask
2632          */
2633         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
2634                 (UINT32_C(0x2) << 4)
2635         /*
2636          * if ext_meta_format is equal to 1, metadata field contains
2637          * 16b metadata from the prepended header (chdr_data).
2638          */
2639         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
2640                 (UINT32_C(0x3) << 4)
2641         /*
2642          * If ext_meta_format is equal to 1, the metadata field contains
2643          * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
2644          * inner_l4_size.
2645          * - metadata[8:0] contains the outer_l3_offset.
2646          * - metadata[17:9] contains the inner_l2_offset.
2647          * - metadata[26:18] contains the inner_l3_offset.
2648          * - metadata[31:27] contains the inner_l4_size.
2649          */
2650         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
2651                 (UINT32_C(0x4) << 4)
2652         #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \
2653                 RX_PKT_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
2654         /*
2655          * This field indicates the IP type for the inner-most IP header.
2656          * A value of '0' indicates IPv4.  A value of '1' indicates IPv6.
2657          * This value is only valid if itype indicates a packet
2658          * with an IP header.
2659          */
2660         #define RX_PKT_CMPL_FLAGS2_IP_TYPE                    UINT32_C(0x100)
2661         /*
2662          * This indicates that the complete 1's complement checksum was
2663          * calculated for the packet.
2664          */
2665         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC     UINT32_C(0x200)
2666         /*
2667          * The combination of this value and meta_format indicated what
2668          * format the metadata field is.
2669          */
2670         #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_MASK       UINT32_C(0xc00)
2671         #define RX_PKT_CMPL_FLAGS2_EXT_META_FORMAT_SFT        10
2672         /*
2673          * This value is the complete 1's complement checksum calculated from
2674          * the start of the outer L3 header to the end of the packet (not
2675          * including the ethernet crc). It is valid when the
2676          * 'complete_checksum_calc' flag is set.
2677          */
2678         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
2679                 UINT32_C(0xffff0000)
2680         #define RX_PKT_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
2681         /*
2682          * This is data from the CFA block as indicated by the meta_format
2683          * field.
2684          */
2685         uint32_t        metadata;
2686         /* When meta_format=1, this value is the VLAN VID. */
2687         #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
2688         #define RX_PKT_CMPL_METADATA_VID_SFT  0
2689         /* When meta_format=1, this value is the VLAN DE. */
2690         #define RX_PKT_CMPL_METADATA_DE       UINT32_C(0x1000)
2691         /* When meta_format=1, this value is the VLAN PRI. */
2692         #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
2693         #define RX_PKT_CMPL_METADATA_PRI_SFT  13
2694         /* When meta_format=1, this value is the VLAN TPID. */
2695         #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
2696         #define RX_PKT_CMPL_METADATA_TPID_SFT 16
2697         uint16_t        errors_v2;
2698         /*
2699          * This value is written by the NIC such that it will be different
2700          * for each pass through the completion queue.   The even passes
2701          * will write 1.  The odd passes will write 0.
2702          */
2703         #define RX_PKT_CMPL_V2 \
2704                 UINT32_C(0x1)
2705         #define RX_PKT_CMPL_ERRORS_MASK \
2706                 UINT32_C(0xfffe)
2707         #define RX_PKT_CMPL_ERRORS_SFT                               1
2708         /*
2709          * This error indicates that there was some sort of problem with
2710          * the BDs for the packet that was found after part of the
2711          * packet was already placed.  The packet should be treated as
2712          * invalid.
2713          */
2714         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK \
2715                 UINT32_C(0xe)
2716         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT                   1
2717         /* No buffer error */
2718         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
2719                 (UINT32_C(0x0) << 1)
2720         /*
2721          * Did Not Fit:
2722          * Packet did not fit into packet buffer provided.
2723          * For regular placement, this means the packet did not fit
2724          * in the buffer provided.  For HDS and jumbo placement, this
2725          * means that the packet could not be placed into 7 physical
2726          * buffers or less.
2727          */
2728         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
2729                 (UINT32_C(0x1) << 1)
2730         /*
2731          * Not On Chip:
2732          * All BDs needed for the packet were not on-chip when
2733          * the packet arrived.
2734          */
2735         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
2736                 (UINT32_C(0x2) << 1)
2737         /*
2738          * Bad Format:
2739          * BDs were not formatted correctly.
2740          */
2741         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
2742                 (UINT32_C(0x3) << 1)
2743         /*
2744          * Flush:
2745          * There was a bad_format error on the previous operation
2746          */
2747         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
2748                 (UINT32_C(0x5) << 1)
2749         #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \
2750                 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
2751         /*
2752          * This indicates that there was an error in the IP header
2753          * checksum.
2754          */
2755         #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR \
2756                 UINT32_C(0x10)
2757         /*
2758          * This indicates that there was an error in the TCP, UDP
2759          * or ICMP checksum.
2760          */
2761         #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR \
2762                 UINT32_C(0x20)
2763         /*
2764          * This indicates that there was an error in the tunnel
2765          * IP header checksum.
2766          */
2767         #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR \
2768                 UINT32_C(0x40)
2769         /*
2770          * This indicates that there was an error in the tunnel
2771          * UDP checksum.
2772          */
2773         #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR \
2774                 UINT32_C(0x80)
2775         /*
2776          * This indicates that there was a CRC error on either an FCoE
2777          * or RoCE packet.  The itype indicates the packet type.
2778          */
2779         #define RX_PKT_CMPL_ERRORS_CRC_ERROR \
2780                 UINT32_C(0x100)
2781         /*
2782          * This indicates that there was an error in the tunnel
2783          * portion of the packet when this
2784          * field is non-zero.
2785          */
2786         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK \
2787                 UINT32_C(0xe00)
2788         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT                    9
2789         /*
2790          * No additional error occurred on the tunnel portion
2791          * or the packet of the packet does not have a tunnel.
2792          */
2793         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR \
2794                 (UINT32_C(0x0) << 9)
2795         /*
2796          * Indicates that IP header version does not match
2797          * expectation from L2 Ethertype for IPv4 and IPv6
2798          * in the tunnel header.
2799          */
2800         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
2801                 (UINT32_C(0x1) << 9)
2802         /*
2803          * Indicates that header length is out of range in the
2804          * tunnel header. Valid for
2805          * IPv4.
2806          */
2807         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
2808                 (UINT32_C(0x2) << 9)
2809         /*
2810          * Indicates that the physical packet is shorter than that
2811          * claimed by the PPPoE header length for a tunnel PPPoE
2812          * packet.
2813          */
2814         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
2815                 (UINT32_C(0x3) << 9)
2816         /*
2817          * Indicates that physical packet is shorter than that claimed
2818          * by the tunnel l3 header length. Valid for IPv4, or IPv6
2819          * tunnel packet packets.
2820          */
2821         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
2822                 (UINT32_C(0x4) << 9)
2823         /*
2824          * Indicates that the physical packet is shorter than that
2825          * claimed by the tunnel UDP header length for a tunnel
2826          * UDP packet that is not fragmented.
2827          */
2828         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
2829                 (UINT32_C(0x5) << 9)
2830         /*
2831          * indicates that the IPv4 TTL or IPv6 hop limit check
2832          * have failed (e.g. TTL = 0) in the tunnel header. Valid
2833          * for IPv4, and IPv6.
2834          */
2835         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
2836                 (UINT32_C(0x6) << 9)
2837         #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \
2838                 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
2839         /*
2840          * This indicates that there was an error in the inner
2841          * portion of the packet when this
2842          * field is non-zero.
2843          */
2844         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK \
2845                 UINT32_C(0xf000)
2846         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT                      12
2847         /*
2848          * No additional error occurred on the tunnel portion
2849          * or the packet of the packet does not have a tunnel.
2850          */
2851         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR \
2852                 (UINT32_C(0x0) << 12)
2853         /*
2854          * Indicates that IP header version does not match
2855          * expectation from L2 Ethertype for IPv4 and IPv6 or that
2856          * option other than VFT was parsed on
2857          * FCoE packet.
2858          */
2859         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \
2860                 (UINT32_C(0x1) << 12)
2861         /*
2862          * indicates that header length is out of range. Valid for
2863          * IPv4 and RoCE
2864          */
2865         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
2866                 (UINT32_C(0x2) << 12)
2867         /*
2868          * indicates that the IPv4 TTL or IPv6 hop limit check
2869          * have failed (e.g. TTL = 0). Valid for IPv4, and IPv6
2870          */
2871         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL \
2872                 (UINT32_C(0x3) << 12)
2873         /*
2874          * Indicates that physical packet is shorter than that
2875          * claimed by the l3 header length. Valid for IPv4,
2876          * IPv6 packet or RoCE packets.
2877          */
2878         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
2879                 (UINT32_C(0x4) << 12)
2880         /*
2881          * Indicates that the physical packet is shorter than that
2882          * claimed by the UDP header length for a UDP packet that is
2883          * not fragmented.
2884          */
2885         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
2886                 (UINT32_C(0x5) << 12)
2887         /*
2888          * Indicates that TCP header length > IP payload. Valid for
2889          * TCP packets only.
2890          */
2891         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
2892                 (UINT32_C(0x6) << 12)
2893         /* Indicates that TCP header length < 5. Valid for TCP. */
2894         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
2895                 (UINT32_C(0x7) << 12)
2896         /*
2897          * Indicates that TCP option headers result in a TCP header
2898          * size that does not match data offset in TCP header. Valid
2899          * for TCP.
2900          */
2901         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
2902                 (UINT32_C(0x8) << 12)
2903         #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \
2904                 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
2905         /*
2906          * This field identifies the CFA action rule that was used for this
2907          * packet.
2908          */
2909         uint16_t        cfa_code;
2910         uint32_t        reorder;
2911         /*
2912          * This value holds the reordering sequence number for the packet.
2913          * If the reordering sequence is not valid, then this value is zero.
2914          * The reordering domain for the packet is in the bottom 8 to 10b of
2915          * the rss_hash value.  The bottom 20b of this value contain the
2916          * ordering domain value for the packet.
2917          */
2918         #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
2919         #define RX_PKT_CMPL_REORDER_SFT 0
2920 } __attribute__((packed));
2921
2922 /*
2923  * This TPA completion structure is used on devices where the
2924  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
2925  */
2926 /* rx_tpa_start_cmpl (size:128b/16B) */
2927 struct rx_tpa_start_cmpl {
2928         uint16_t        flags_type;
2929         /*
2930          * This field indicates the exact type of the completion.
2931          * By convention, the LSB identifies the length of the
2932          * record in 16B units.  Even values indicate 16B
2933          * records.  Odd values indicate 32B
2934          * records.
2935          */
2936         #define RX_TPA_START_CMPL_TYPE_MASK                UINT32_C(0x3f)
2937         #define RX_TPA_START_CMPL_TYPE_SFT                 0
2938         /*
2939          * RX L2 TPA Start Completion:
2940          * Completion at the beginning of a TPA operation.
2941          * Length = 32B
2942          */
2943         #define RX_TPA_START_CMPL_TYPE_RX_TPA_START          UINT32_C(0x13)
2944         #define RX_TPA_START_CMPL_TYPE_LAST \
2945                 RX_TPA_START_CMPL_TYPE_RX_TPA_START
2946         #define RX_TPA_START_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
2947         #define RX_TPA_START_CMPL_FLAGS_SFT                6
2948         /* This bit will always be '0' for TPA start completions. */
2949         #define RX_TPA_START_CMPL_FLAGS_ERROR               UINT32_C(0x40)
2950         /* This field indicates how the packet was placed in the buffer. */
2951         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
2952         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT       7
2953         /*
2954          * Jumbo:
2955          * TPA Packet was placed using jumbo algorithm.  This means
2956          * that the first buffer will be filled with data before
2957          * moving to aggregation buffers.  Each aggregation buffer
2958          * will be filled before moving to the next aggregation
2959          * buffer.
2960          */
2961         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO \
2962                 (UINT32_C(0x1) << 7)
2963         /*
2964          * Header/Data Separation:
2965          * Packet was placed using Header/Data separation algorithm.
2966          * The separation location is indicated by the itype field.
2967          */
2968         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS \
2969                 (UINT32_C(0x2) << 7)
2970         /*
2971          * GRO/Jumbo:
2972          * Packet will be placed using GRO/Jumbo where the first
2973          * packet is filled with data. Subsequent packets will be
2974          * placed such that any one packet does not span two
2975          * aggregation buffers unless it starts at the beginning of
2976          * an aggregation buffer.
2977          */
2978         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
2979                 (UINT32_C(0x5) << 7)
2980         /*
2981          * GRO/Header-Data Separation:
2982          * Packet will be placed using GRO/HDS where the header
2983          * is in the first packet.
2984          * Payload of each packet will be
2985          * placed such that any one packet does not span two
2986          * aggregation buffers unless it starts at the beginning of
2987          * an aggregation buffer.
2988          */
2989         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \
2990                 (UINT32_C(0x6) << 7)
2991         #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \
2992                 RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
2993         /* This bit is '1' if the RSS field in this completion is valid. */
2994         #define RX_TPA_START_CMPL_FLAGS_RSS_VALID           UINT32_C(0x400)
2995         /* unused is 1 b */
2996         #define RX_TPA_START_CMPL_FLAGS_UNUSED              UINT32_C(0x800)
2997         /*
2998          * This value indicates what the inner packet determined for the
2999          * packet was.
3000          */
3001         #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
3002         #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT           12
3003         /*
3004          * TCP Packet:
3005          * Indicates that the packet was IP and TCP.
3006          */
3007         #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP \
3008                 (UINT32_C(0x2) << 12)
3009         #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \
3010                 RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
3011         /*
3012          * This value indicates the amount of packet data written to the
3013          * buffer the opaque field in this completion corresponds to.
3014          */
3015         uint16_t        len;
3016         /*
3017          * This is a copy of the opaque field from the RX BD this completion
3018          * corresponds to.
3019          */
3020         uint32_t        opaque;
3021         /*
3022          * This value is written by the NIC such that it will be different
3023          * for each pass through the completion queue.   The even passes
3024          * will write 1.  The odd passes will write 0.
3025          */
3026         uint8_t v1;
3027         /*
3028          * This value is written by the NIC such that it will be different
3029          * for each pass through the completion queue.   The even passes
3030          * will write 1.  The odd passes will write 0.
3031          */
3032         #define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
3033         #define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1
3034         /*
3035          * This is the RSS hash type for the packet.  The value is packed
3036          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
3037          *
3038          * The value of tuple_extrac_op provides the information about
3039          * what fields the hash was computed on.
3040          * * 0: The RSS hash was computed over source IP address,
3041          * destination IP address, source port, and destination port of inner
3042          * IP and TCP or UDP headers. Note: For non-tunneled packets,
3043          * the packet headers are considered inner packet headers for the RSS
3044          * hash computation purpose.
3045          * * 1: The RSS hash was computed over source IP address and destination
3046          * IP address of inner IP header. Note: For non-tunneled packets,
3047          * the packet headers are considered inner packet headers for the RSS
3048          * hash computation purpose.
3049          * * 2: The RSS hash was computed over source IP address,
3050          * destination IP address, source port, and destination port of
3051          * IP and TCP or UDP headers of outer tunnel headers.
3052          * Note: For non-tunneled packets, this value is not applicable.
3053          * * 3: The RSS hash was computed over source IP address and
3054          * destination IP address of IP header of outer tunnel headers.
3055          * Note: For non-tunneled packets, this value is not applicable.
3056          *
3057          * Note that 4-tuples values listed above are applicable
3058          * for layer 4 protocols supported and enabled for RSS in the hardware,
3059          * HWRM firmware, and drivers. For example, if RSS hash is supported and
3060          * enabled for TCP traffic only, then the values of tuple_extract_op
3061          * corresponding to 4-tuples are only valid for TCP traffic.
3062          */
3063         uint8_t rss_hash_type;
3064         /*
3065          * This is the aggregation ID that the completion is associated
3066          * with.  Use this number to correlate the TPA start completion
3067          * with the TPA end completion.
3068          */
3069         uint16_t        agg_id;
3070         /* unused2 is 9 b */
3071         #define RX_TPA_START_CMPL_UNUSED2_MASK UINT32_C(0x1ff)
3072         #define RX_TPA_START_CMPL_UNUSED2_SFT 0
3073         /*
3074          * This is the aggregation ID that the completion is associated
3075          * with.  Use this number to correlate the TPA start completion
3076          * with the TPA end completion.
3077          */
3078         #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
3079         #define RX_TPA_START_CMPL_AGG_ID_SFT  9
3080         /*
3081          * This value is the RSS hash value calculated for the packet
3082          * based on the mode bits and key value in the VNIC.
3083          */
3084         uint32_t        rss_hash;
3085 } __attribute__((packed));
3086
3087 /*
3088  * Last 16 bytes of rx_tpa_start_cmpl.
3089  *
3090  * This TPA completion structure is used on devices where the
3091  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
3092  */
3093 /* rx_tpa_start_cmpl_hi (size:128b/16B) */
3094 struct rx_tpa_start_cmpl_hi {
3095         uint32_t        flags2;
3096         /*
3097          * This indicates that the ip checksum was calculated for the
3098          * inner packet and that the sum passed for all segments
3099          * included in the aggregation.
3100          */
3101         #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC       UINT32_C(0x1)
3102         /*
3103          * This indicates that the TCP, UDP or ICMP checksum was
3104          * calculated for the inner packet and that the sum passed
3105          * for all segments included in the aggregation.
3106          */
3107         #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC       UINT32_C(0x2)
3108         /*
3109          * This indicates that the ip checksum was calculated for the
3110          * tunnel header and that the sum passed for all segments
3111          * included in the aggregation.
3112          */
3113         #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC     UINT32_C(0x4)
3114         /*
3115          * This indicates that the UDP checksum was
3116          * calculated for the tunnel packet and that the sum passed for
3117          * all segments included in the aggregation.
3118          */
3119         #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC     UINT32_C(0x8)
3120         /* This value indicates what format the metadata field is. */
3121         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
3122         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT  4
3123         /* No metadata information.  Value is zero. */
3124         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE \
3125                 (UINT32_C(0x0) << 4)
3126         /*
3127          * The metadata field contains the VLAN tag and TPID value.
3128          * - metadata[11:0] contains the vlan VID value.
3129          * - metadata[12] contains the vlan DE value.
3130          * - metadata[15:13] contains the vlan PRI value.
3131          * - metadata[31:16] contains the vlan TPID value.
3132          */
3133         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN \
3134                 (UINT32_C(0x1) << 4)
3135         #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST \
3136                 RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
3137         /*
3138          * This field indicates the IP type for the inner-most IP header.
3139          * A value of '0' indicates IPv4.  A value of '1' indicates IPv6.
3140          */
3141         #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE          UINT32_C(0x100)
3142         /*
3143          * This is data from the CFA block as indicated by the meta_format
3144          * field.
3145          */
3146         uint32_t        metadata;
3147         /* When meta_format=1, this value is the VLAN VID. */
3148         #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
3149         #define RX_TPA_START_CMPL_METADATA_VID_SFT  0
3150         /* When meta_format=1, this value is the VLAN DE. */
3151         #define RX_TPA_START_CMPL_METADATA_DE       UINT32_C(0x1000)
3152         /* When meta_format=1, this value is the VLAN PRI. */
3153         #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
3154         #define RX_TPA_START_CMPL_METADATA_PRI_SFT  13
3155         /* When meta_format=1, this value is the VLAN TPID. */
3156         #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
3157         #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
3158         uint16_t        v2;
3159         /*
3160          * This value is written by the NIC such that it will be different
3161          * for each pass through the completion queue.   The even passes
3162          * will write 1.  The odd passes will write 0.
3163          */
3164         #define RX_TPA_START_CMPL_V2     UINT32_C(0x1)
3165         /*
3166          * This field identifies the CFA action rule that was used for this
3167          * packet.
3168          */
3169         uint16_t        cfa_code;
3170         /*
3171          * This is the size in bytes of the inner most L4 header.
3172          * This can be subtracted from the payload_offset to determine
3173          * the start of the inner most L4 header.
3174          */
3175         uint32_t        inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
3176         /*
3177          * This is the offset from the beginning of the packet in bytes for
3178          * the outer L3 header.  If there is no outer L3 header, then this
3179          * value is zero.
3180          */
3181         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
3182         #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
3183         /*
3184          * This is the offset from the beginning of the packet in bytes for
3185          * the inner most L2 header.
3186          */
3187         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
3188         #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
3189         /*
3190          * This is the offset from the beginning of the packet in bytes for
3191          * the inner most L3 header.
3192          */
3193         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
3194         #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
3195         /*
3196          * This is the size in bytes of the inner most L4 header.
3197          * This can be subtracted from the payload_offset to determine
3198          * the start of the inner most L4 header.
3199          */
3200         #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
3201         #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT   27
3202 } __attribute__((packed));
3203
3204 /*
3205  * This TPA completion structure is used on devices where the
3206  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
3207  */
3208 /* rx_tpa_end_cmpl (size:128b/16B) */
3209 struct rx_tpa_end_cmpl {
3210         uint16_t        flags_type;
3211         /*
3212          * This field indicates the exact type of the completion.
3213          * By convention, the LSB identifies the length of the
3214          * record in 16B units.  Even values indicate 16B
3215          * records.  Odd values indicate 32B
3216          * records.
3217          */
3218         #define RX_TPA_END_CMPL_TYPE_MASK                UINT32_C(0x3f)
3219         #define RX_TPA_END_CMPL_TYPE_SFT                 0
3220         /*
3221          * RX L2 TPA End Completion:
3222          * Completion at the end of a TPA operation.
3223          * Length = 32B
3224          */
3225         #define RX_TPA_END_CMPL_TYPE_RX_TPA_END            UINT32_C(0x15)
3226         #define RX_TPA_END_CMPL_TYPE_LAST \
3227                 RX_TPA_END_CMPL_TYPE_RX_TPA_END
3228         #define RX_TPA_END_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
3229         #define RX_TPA_END_CMPL_FLAGS_SFT                6
3230         /*
3231          * When this bit is '1', it indicates a packet that has an
3232          * error of some type.  Type of error is indicated in
3233          * error_flags.
3234          */
3235         #define RX_TPA_END_CMPL_FLAGS_ERROR               UINT32_C(0x40)
3236         /* This field indicates how the packet was placed in the buffer. */
3237         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
3238         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT       7
3239         /*
3240          * Jumbo:
3241          * TPA Packet was placed using jumbo algorithm.  This means
3242          * that the first buffer will be filled with data before
3243          * moving to aggregation buffers.  Each aggregation buffer
3244          * will be filled before moving to the next aggregation
3245          * buffer.
3246          */
3247         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO \
3248                 (UINT32_C(0x1) << 7)
3249         /*
3250          * Header/Data Separation:
3251          * Packet was placed using Header/Data separation algorithm.
3252          * The separation location is indicated by the itype field.
3253          */
3254         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS \
3255                 (UINT32_C(0x2) << 7)
3256         /*
3257          * GRO/Jumbo:
3258          * Packet will be placed using GRO/Jumbo where the first
3259          * packet is filled with data. Subsequent packets will be
3260          * placed such that any one packet does not span two
3261          * aggregation buffers unless it starts at the beginning of
3262          * an aggregation buffer.
3263          */
3264         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
3265                 (UINT32_C(0x5) << 7)
3266         /*
3267          * GRO/Header-Data Separation:
3268          * Packet will be placed using GRO/HDS where the header
3269          * is in the first packet.
3270          * Payload of each packet will be
3271          * placed such that any one packet does not span two
3272          * aggregation buffers unless it starts at the beginning of
3273          * an aggregation buffer.
3274          */
3275         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \
3276                 (UINT32_C(0x6) << 7)
3277         #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \
3278                 RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS
3279         /* unused is 2 b */
3280         #define RX_TPA_END_CMPL_FLAGS_UNUSED_MASK         UINT32_C(0xc00)
3281         #define RX_TPA_END_CMPL_FLAGS_UNUSED_SFT          10
3282         /*
3283          * This value indicates what the inner packet determined for the
3284          * packet was.
3285          * - 2 TCP Packet
3286          *     Indicates that the packet was IP and TCP.  This indicates
3287          *     that the ip_cs field is valid and that the tcp_udp_cs
3288          *     field is valid and contains the TCP checksum.
3289          *     This also indicates that the payload_offset field is valid.
3290          */
3291         #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
3292         #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT           12
3293         /*
3294          * This value is zero for TPA End completions.
3295          * There is no data in the buffer that corresponds to the opaque
3296          * value in this completion.
3297          */
3298         uint16_t        len;
3299         /*
3300          * This is a copy of the opaque field from the RX BD this completion
3301          * corresponds to.
3302          */
3303         uint32_t        opaque;
3304         /*
3305          * This value is written by the NIC such that it will be different
3306          * for each pass through the completion queue.   The even passes
3307          * will write 1.  The odd passes will write 0.
3308          */
3309         uint8_t agg_bufs_v1;
3310         /*
3311          * This value is written by the NIC such that it will be different
3312          * for each pass through the completion queue.   The even passes
3313          * will write 1.  The odd passes will write 0.
3314          */
3315         #define RX_TPA_END_CMPL_V1           UINT32_C(0x1)
3316         /*
3317          * This value is the number of aggregation buffers that follow this
3318          * entry in the completion ring that are a part of this aggregation
3319          * packet.
3320          * If the value is zero, then the packet is completely contained
3321          * in the buffer space provided in the aggregation start completion.
3322          */
3323         #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
3324         #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
3325         /* This value is the number of segments in the TPA operation. */
3326         uint8_t tpa_segs;
3327         /*
3328          * This value indicates the offset in bytes from the beginning of the packet
3329          * where the inner payload starts.  This value is valid for TCP, UDP,
3330          * FCoE, and RoCE packets.
3331          *
3332          * A value of zero indicates an offset of 256 bytes.
3333          */
3334         uint8_t payload_offset;
3335         uint8_t agg_id;
3336         /* unused2 is 1 b */
3337         #define RX_TPA_END_CMPL_UNUSED2     UINT32_C(0x1)
3338         /*
3339          * This is the aggregation ID that the completion is associated
3340          * with.  Use this number to correlate the TPA start completion
3341          * with the TPA end completion.
3342          */
3343         #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
3344         #define RX_TPA_END_CMPL_AGG_ID_SFT  1
3345         /*
3346          * For non-GRO packets, this value is the
3347          * timestamp delta between earliest and latest timestamp values for
3348          * TPA packet. If packets were not time stamped, then delta will be
3349          * zero.
3350          *
3351          * For GRO packets, this field is zero except for the following
3352          * sub-fields.
3353          * - tsdelta[31]
3354          *     Timestamp present indication.  When '0', no Timestamp
3355          *     option is in the packet.  When '1', then a Timestamp
3356          *     option is present in the packet.
3357          */
3358         uint32_t        tsdelta;
3359 } __attribute__((packed));
3360
3361 /*
3362  * Last 16 bytes of rx_tpa_end_cmpl.
3363  *
3364  * This TPA completion structure is used on devices where the
3365  * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
3366  */
3367 /* rx_tpa_end_cmpl_hi (size:128b/16B) */
3368 struct rx_tpa_end_cmpl_hi {
3369         uint32_t        tpa_dup_acks;
3370         /*
3371          * This value is the number of duplicate ACKs that have been
3372          * received as part of the TPA operation.
3373          */
3374         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
3375         #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
3376         /*
3377          * This value is the valid when TPA completion is active.  It
3378          * indicates the length of the longest segment of the TPA operation
3379          * for LRO mode and the length of the first segment in GRO mode.
3380          *
3381          * This value may be used by GRO software to re-construct the original
3382          * packet stream from the TPA packet.  This is the length of all
3383          * but the last segment for GRO.  In LRO mode this value may be used
3384          * to indicate MSS size to the stack.
3385          */
3386         uint16_t        tpa_seg_len;
3387         /* unused4 is 16 b */
3388         uint16_t        unused3;
3389         uint16_t        errors_v2;
3390         /*
3391          * This value is written by the NIC such that it will be different
3392          * for each pass through the completion queue.   The even passes
3393          * will write 1.  The odd passes will write 0.
3394          */
3395         #define RX_TPA_END_CMPL_V2                             UINT32_C(0x1)
3396         #define RX_TPA_END_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
3397         #define RX_TPA_END_CMPL_ERRORS_SFT                     1
3398         /*
3399          * This error indicates that there was some sort of problem with
3400          * the BDs for the packet that was found after part of the
3401          * packet was already placed.  The packet should be treated as
3402          * invalid.
3403          */
3404         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
3405         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT         1
3406         /*
3407          * This error occurs when there is a fatal HW problem in
3408          * the chip only.  It indicates that there were not
3409          * BDs on chip but that there was adequate reservation.
3410          * provided by the TPA block.
3411          */
3412         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
3413                 (UINT32_C(0x2) << 1)
3414         /*
3415          * This error occurs when TPA block was not configured to
3416          * reserve adequate BDs for TPA operations on this RX
3417          * ring.  All data for the TPA operation was not placed.
3418          *
3419          * This error can also be generated when the number of
3420          * segments is not programmed correctly in TPA and the
3421          * 33 total aggregation buffers allowed for the TPA
3422          * operation has been exceeded.
3423          */
3424         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
3425                 (UINT32_C(0x4) << 1)
3426         #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
3427                 RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
3428         /* unused5 is 16 b */
3429         uint16_t        unused_4;
3430         /*
3431          * This is the opaque value that was completed for the TPA start
3432          * completion that corresponds to this TPA end completion.
3433          */
3434         uint32_t        start_opaque;
3435 } __attribute__((packed));
3436
3437 /*
3438  * This TPA completion structure is used on devices where the
3439  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
3440  */
3441 /* rx_tpa_v2_start_cmpl (size:128b/16B) */
3442 struct rx_tpa_v2_start_cmpl {
3443         uint16_t        flags_type;
3444         /*
3445          * This field indicates the exact type of the completion.
3446          * By convention, the LSB identifies the length of the
3447          * record in 16B units.  Even values indicate 16B
3448          * records.  Odd values indicate 32B
3449          * records.
3450          */
3451         #define RX_TPA_V2_START_CMPL_TYPE_MASK \
3452                 UINT32_C(0x3f)
3453         #define RX_TPA_V2_START_CMPL_TYPE_SFT                       0
3454         /*
3455          * RX L2 TPA Start Completion:
3456          * Completion at the beginning of a TPA operation.
3457          * Length = 32B
3458          */
3459         #define RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START \
3460                 UINT32_C(0x13)
3461         #define RX_TPA_V2_START_CMPL_TYPE_LAST \
3462                 RX_TPA_V2_START_CMPL_TYPE_RX_TPA_START
3463         #define RX_TPA_V2_START_CMPL_FLAGS_MASK \
3464                 UINT32_C(0xffc0)
3465         #define RX_TPA_V2_START_CMPL_FLAGS_SFT                      6
3466         /* This bit will always be '0' for TPA start completions. */
3467         #define RX_TPA_V2_START_CMPL_FLAGS_ERROR \
3468                 UINT32_C(0x40)
3469         /* This field indicates how the packet was placed in the buffer. */
3470         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_MASK \
3471                 UINT32_C(0x380)
3472         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_SFT             7
3473         /*
3474          * Jumbo:
3475          * TPA Packet was placed using jumbo algorithm.  This means
3476          * that the first buffer will be filled with data before
3477          * moving to aggregation buffers.  Each aggregation buffer
3478          * will be filled before moving to the next aggregation
3479          * buffer.
3480          */
3481         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_JUMBO \
3482                 (UINT32_C(0x1) << 7)
3483         /*
3484          * Header/Data Separation:
3485          * Packet was placed using Header/Data separation algorithm.
3486          * The separation location is indicated by the itype field.
3487          */
3488         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_HDS \
3489                 (UINT32_C(0x2) << 7)
3490         /*
3491          * GRO/Jumbo:
3492          * Packet will be placed using GRO/Jumbo where the first
3493          * packet is filled with data. Subsequent packets will be
3494          * placed such that any one packet does not span two
3495          * aggregation buffers unless it starts at the beginning of
3496          * an aggregation buffer.
3497          */
3498         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
3499                 (UINT32_C(0x5) << 7)
3500         /*
3501          * GRO/Header-Data Separation:
3502          * Packet will be placed using GRO/HDS where the header
3503          * is in the first packet.
3504          * Payload of each packet will be
3505          * placed such that any one packet does not span two
3506          * aggregation buffers unless it starts at the beginning of
3507          * an aggregation buffer.
3508          */
3509         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \
3510                 (UINT32_C(0x6) << 7)
3511         #define RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_LAST \
3512                 RX_TPA_V2_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
3513         /* This bit is '1' if the RSS field in this completion is valid. */
3514         #define RX_TPA_V2_START_CMPL_FLAGS_RSS_VALID \
3515                 UINT32_C(0x400)
3516         /*
3517          * For devices that support timestamps, when this bit is cleared the
3518          * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
3519          * field contains the 32b timestamp for
3520          * the packet from the MAC. When this bit is set, the
3521          * `inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset`
3522          * field contains the outer_l3_offset, inner_l2_offset,
3523          * inner_l3_offset, and inner_l4_size.
3524          */
3525         #define RX_TPA_V2_START_CMPL_FLAGS_TIMESTAMP_FLD_FORMAT \
3526                 UINT32_C(0x800)
3527         /*
3528          * This value indicates what the inner packet determined for the
3529          * packet was.
3530          */
3531         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_MASK \
3532                 UINT32_C(0xf000)
3533         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_SFT                 12
3534         /*
3535          * TCP Packet:
3536          * Indicates that the packet was IP and TCP.
3537          */
3538         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP \
3539                 (UINT32_C(0x2) << 12)
3540         #define RX_TPA_V2_START_CMPL_FLAGS_ITYPE_LAST \
3541                 RX_TPA_V2_START_CMPL_FLAGS_ITYPE_TCP
3542         /*
3543          * This value indicates the amount of packet data written to the
3544          * buffer the opaque field in this completion corresponds to.
3545          */
3546         uint16_t        len;
3547         /*
3548          * This is a copy of the opaque field from the RX BD this completion
3549          * corresponds to.
3550          */
3551         uint32_t        opaque;
3552         /*
3553          * This value is written by the NIC such that it will be different
3554          * for each pass through the completion queue.   The even passes
3555          * will write 1.  The odd passes will write 0.
3556          */
3557         uint8_t v1;
3558         /*
3559          * This value is written by the NIC such that it will be different
3560          * for each pass through the completion queue.   The even passes
3561          * will write 1.  The odd passes will write 0.
3562          */
3563         #define RX_TPA_V2_START_CMPL_V1 UINT32_C(0x1)
3564         #define RX_TPA_V2_START_CMPL_LAST RX_TPA_V2_START_CMPL_V1
3565         /*
3566          * This is the RSS hash type for the packet.  The value is packed
3567          * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
3568          *
3569          * The value of tuple_extrac_op provides the information about
3570          * what fields the hash was computed on.
3571          * * 0: The RSS hash was computed over source IP address,
3572          * destination IP address, source port, and destination port of inner
3573          * IP and TCP or UDP headers. Note: For non-tunneled packets,
3574          * the packet headers are considered inner packet headers for the RSS
3575          * hash computation purpose.
3576          * * 1: The RSS hash was computed over source IP address and destination
3577          * IP address of inner IP header. Note: For non-tunneled packets,
3578          * the packet headers are considered inner packet headers for the RSS
3579          * hash computation purpose.
3580          * * 2: The RSS hash was computed over source IP address,
3581          * destination IP address, source port, and destination port of
3582          * IP and TCP or UDP headers of outer tunnel headers.
3583          * Note: For non-tunneled packets, this value is not applicable.
3584          * * 3: The RSS hash was computed over source IP address and
3585          * destination IP address of IP header of outer tunnel headers.
3586          * Note: For non-tunneled packets, this value is not applicable.
3587          *
3588          * Note that 4-tuples values listed above are applicable
3589          * for layer 4 protocols supported and enabled for RSS in the hardware,
3590          * HWRM firmware, and drivers. For example, if RSS hash is supported and
3591          * enabled for TCP traffic only, then the values of tuple_extract_op
3592          * corresponding to 4-tuples are only valid for TCP traffic.
3593          */
3594         uint8_t rss_hash_type;
3595         /*
3596          * This is the aggregation ID that the completion is associated
3597          * with.  Use this number to correlate the TPA start completion
3598          * with the TPA end completion.
3599          */
3600         uint16_t        agg_id;
3601         /*
3602          * This value is the RSS hash value calculated for the packet
3603          * based on the mode bits and key value in the VNIC.
3604          */
3605         uint32_t        rss_hash;
3606 } __attribute__((packed));
3607
3608 /*
3609  * Last 16 bytes of rx_tpa_v2_start_cmpl.
3610  *
3611  * This TPA completion structure is used on devices where the
3612  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
3613  */
3614 /* rx_tpa_v2_start_cmpl_hi (size:128b/16B) */
3615 struct rx_tpa_v2_start_cmpl_hi {
3616         uint32_t        flags2;
3617         /*
3618          * This indicates that the ip checksum was calculated for the
3619          * inner packet and that the sum passed for all segments
3620          * included in the aggregation.
3621          */
3622         #define RX_TPA_V2_START_CMPL_FLAGS2_IP_CS_CALC \
3623                 UINT32_C(0x1)
3624         /*
3625          * This indicates that the TCP, UDP or ICMP checksum was
3626          * calculated for the inner packet and that the sum passed
3627          * for all segments included in the aggregation.
3628          */
3629         #define RX_TPA_V2_START_CMPL_FLAGS2_L4_CS_CALC \
3630                 UINT32_C(0x2)
3631         /*
3632          * This indicates that the ip checksum was calculated for the
3633          * tunnel header and that the sum passed for all segments
3634          * included in the aggregation.
3635          */
3636         #define RX_TPA_V2_START_CMPL_FLAGS2_T_IP_CS_CALC \
3637                 UINT32_C(0x4)
3638         /*
3639          * This indicates that the UDP checksum was
3640          * calculated for the tunnel packet and that the sum passed for
3641          * all segments included in the aggregation.
3642          */
3643         #define RX_TPA_V2_START_CMPL_FLAGS2_T_L4_CS_CALC \
3644                 UINT32_C(0x8)
3645         /* This value indicates what format the metadata field is. */
3646         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_MASK \
3647                 UINT32_C(0xf0)
3648         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_SFT            4
3649         /* No metadata informtaion.  Value is zero. */
3650         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_NONE \
3651                 (UINT32_C(0x0) << 4)
3652         /*
3653          * The metadata field contains the VLAN tag and TPID value.
3654          * - metadata[11:0] contains the vlan VID value.
3655          * - metadata[12] contains the vlan DE value.
3656          * - metadata[15:13] contains the vlan PRI value.
3657          * - metadata[31:16] contains the vlan TPID value.
3658          */
3659         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_VLAN \
3660                 (UINT32_C(0x1) << 4)
3661         /*
3662          * If ext_meta_format is equal to 1, the metadata field
3663          * contains the lower 16b of the tunnel ID value, justified
3664          * to LSB
3665          * - VXLAN = VNI[23:0] -> VXLAN Network ID
3666          * - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier.
3667          * - NVGRE = TNI[23:0] -> Tenant Network ID
3668          * - GRE = KEY[31:0 -> key fieled with bit mask. zero if K = 0
3669          * - IPV4 = 0 (not populated)
3670          * - IPV6 = Flow Label[19:0]
3671          * - PPPoE = sessionID[15:0]
3672          * - MPLs = Outer label[19:0]
3673          * - UPAR = Selected[31:0] with bit mask
3674          */
3675         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \
3676                 (UINT32_C(0x2) << 4)
3677         /*
3678          * if ext_meta_format is equal to 1, metadata field contains
3679          * 16b metadata from the prepended header (chdr_data).
3680          */
3681         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \
3682                 (UINT32_C(0x3) << 4)
3683         /*
3684          * If ext_meta_format is equal to 1, the metadata field contains
3685          * the outer_l3_offset, inner_l2_offset, inner_l3_offset and
3686          * inner_l4_size.
3687          * - metadata[8:0] contains the outer_l3_offset.
3688          * - metadata[17:9] contains the inner_l2_offset.
3689          * - metadata[26:18] contains the inner_l3_offset.
3690          * - metadata[31:27] contains the inner_l4_size.
3691          */
3692         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \
3693                 (UINT32_C(0x4) << 4)
3694         #define RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_LAST \
3695                 RX_TPA_V2_START_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET
3696         /*
3697          * This field indicates the IP type for the inner-most IP header.
3698          * A value of '0' indicates IPv4.  A value of '1' indicates IPv6.
3699          */
3700         #define RX_TPA_V2_START_CMPL_FLAGS2_IP_TYPE \
3701                 UINT32_C(0x100)
3702         /*
3703          * This indicates that the complete 1's complement checksum was
3704          * calculated for the packet.
3705          */
3706         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC \
3707                 UINT32_C(0x200)
3708         /*
3709          * The combination of this value and meta_format indicated what
3710          * format the metadata field is.
3711          */
3712         #define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_MASK \
3713                 UINT32_C(0xc00)
3714         #define RX_TPA_V2_START_CMPL_FLAGS2_EXT_META_FORMAT_SFT        10
3715         /*
3716          * This value is the complete 1's complement checksum calculated from
3717          * the start of the outer L3 header to the end of the packet (not
3718          * including the ethernet crc). It is valid when the
3719          * 'complete_checksum_calc' flag is set. For TPA Start completions,
3720          * the complete checksum is calculated for the first packet in the
3721          * aggregation only.
3722          */
3723         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \
3724                 UINT32_C(0xffff0000)
3725         #define RX_TPA_V2_START_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT      16
3726         /*
3727          * This is data from the CFA block as indicated by the meta_format
3728          * field.
3729          */
3730         uint32_t        metadata;
3731         /* When {ext_meta_format,meta_format}=1, this value is the VLAN VID. */
3732         #define RX_TPA_V2_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
3733         #define RX_TPA_V2_START_CMPL_METADATA_VID_SFT  0
3734         /* When {ext_meta_format,meta_format}=1, this value is the VLAN DE. */
3735         #define RX_TPA_V2_START_CMPL_METADATA_DE       UINT32_C(0x1000)
3736         /* When {ext_meta_format,meta_format}=1, this value is the VLAN PRI. */
3737         #define RX_TPA_V2_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
3738         #define RX_TPA_V2_START_CMPL_METADATA_PRI_SFT  13
3739         /* When {ext_meta_format,meta_format}=1, this value is the VLAN TPID. */
3740         #define RX_TPA_V2_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
3741         #define RX_TPA_V2_START_CMPL_METADATA_TPID_SFT 16
3742         uint16_t        errors_v2;
3743         /*
3744          * This value is written by the NIC such that it will be different
3745          * for each pass through the completion queue.   The even passes
3746          * will write 1.  The odd passes will write 0.
3747          */
3748         #define RX_TPA_V2_START_CMPL_V2 \
3749                 UINT32_C(0x1)
3750         #define RX_TPA_V2_START_CMPL_ERRORS_MASK \
3751                 UINT32_C(0xfffe)
3752         #define RX_TPA_V2_START_CMPL_ERRORS_SFT                    1
3753         /*
3754          * This error indicates that there was some sort of problem with
3755          * the BDs for the packet that was found after part of the
3756          * packet was already placed.  The packet should be treated as
3757          * invalid.
3758          */
3759         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_MASK \
3760                 UINT32_C(0xe)
3761         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_SFT        1
3762         /* No buffer error */
3763         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
3764                 (UINT32_C(0x0) << 1)
3765         /*
3766          * Bad Format:
3767          * BDs were not formatted correctly.
3768          */
3769         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
3770                 (UINT32_C(0x3) << 1)
3771         /*
3772          * Flush:
3773          * There was a bad_format error on the previous operation
3774          */
3775         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
3776                 (UINT32_C(0x5) << 1)
3777         #define RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_LAST \
3778                 RX_TPA_V2_START_CMPL_ERRORS_BUFFER_ERROR_FLUSH
3779         /*
3780          * This field identifies the CFA action rule that was used for this
3781          * packet.
3782          */
3783         uint16_t        cfa_code;
3784         /*
3785          * For devices that support timestamps this field is overridden
3786          * with the timestamp value. When `flags.timestamp_fld_format` is
3787          * cleared, this field contains the 32b timestamp for the packet from the
3788          * MAC.
3789          *
3790          * When `flags.timestamp_fld_format` is set, this field contains the
3791          * outer_l3_offset, inner_l2_offset, inner_l3_offset, and inner_l4_size
3792          * as defined below.
3793          */
3794         uint32_t        inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
3795         /*
3796          * This is the offset from the beginning of the packet in bytes for
3797          * the outer L3 header.  If there is no outer L3 header, then this
3798          * value is zero.
3799          */
3800         #define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
3801         #define RX_TPA_V2_START_CMPL_OUTER_L3_OFFSET_SFT 0
3802         /*
3803          * This is the offset from the beginning of the packet in bytes for
3804          * the inner most L2 header.
3805          */
3806         #define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
3807         #define RX_TPA_V2_START_CMPL_INNER_L2_OFFSET_SFT 9
3808         /*
3809          * This is the offset from the beginning of the packet in bytes for
3810          * the inner most L3 header.
3811          */
3812         #define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
3813         #define RX_TPA_V2_START_CMPL_INNER_L3_OFFSET_SFT 18
3814         /*
3815          * This is the size in bytes of the inner most L4 header.
3816          * This can be subtracted from the payload_offset to determine
3817          * the start of the inner most L4 header.
3818          */
3819         #define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_MASK  UINT32_C(0xf8000000)
3820         #define RX_TPA_V2_START_CMPL_INNER_L4_SIZE_SFT   27
3821 } __attribute__((packed));
3822
3823 /*
3824  * This TPA completion structure is used on devices where the
3825  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
3826  */
3827 /* rx_tpa_v2_end_cmpl (size:128b/16B) */
3828 struct rx_tpa_v2_end_cmpl {
3829         uint16_t        flags_type;
3830         /*
3831          * This field indicates the exact type of the completion.
3832          * By convention, the LSB identifies the length of the
3833          * record in 16B units.  Even values indicate 16B
3834          * records.  Odd values indicate 32B
3835          * records.
3836          */
3837         #define RX_TPA_V2_END_CMPL_TYPE_MASK                UINT32_C(0x3f)
3838         #define RX_TPA_V2_END_CMPL_TYPE_SFT                 0
3839         /*
3840          * RX L2 TPA End Completion:
3841          * Completion at the end of a TPA operation.
3842          * Length = 32B
3843          */
3844         #define RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END            UINT32_C(0x15)
3845         #define RX_TPA_V2_END_CMPL_TYPE_LAST \
3846                 RX_TPA_V2_END_CMPL_TYPE_RX_TPA_END
3847         #define RX_TPA_V2_END_CMPL_FLAGS_MASK               UINT32_C(0xffc0)
3848         #define RX_TPA_V2_END_CMPL_FLAGS_SFT                6
3849         /*
3850          * When this bit is '1', it indicates a packet that has an
3851          * error of some type.  Type of error is indicated in
3852          * error_flags.
3853          */
3854         #define RX_TPA_V2_END_CMPL_FLAGS_ERROR               UINT32_C(0x40)
3855         /* This field indicates how the packet was placed in the buffer. */
3856         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_MASK      UINT32_C(0x380)
3857         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_SFT       7
3858         /*
3859          * Jumbo:
3860          * TPA Packet was placed using jumbo algorithm.  This means
3861          * that the first buffer will be filled with data before
3862          * moving to aggregation buffers.  Each aggregation buffer
3863          * will be filled before moving to the next aggregation
3864          * buffer.
3865          */
3866         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_JUMBO \
3867                 (UINT32_C(0x1) << 7)
3868         /*
3869          * Header/Data Separation:
3870          * Packet was placed using Header/Data separation algorithm.
3871          * The separation location is indicated by the itype field.
3872          */
3873         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_HDS \
3874                 (UINT32_C(0x2) << 7)
3875         /*
3876          * GRO/Jumbo:
3877          * Packet will be placed using GRO/Jumbo where the first
3878          * packet is filled with data. Subsequent packets will be
3879          * placed such that any one packet does not span two
3880          * aggregation buffers unless it starts at the beginning of
3881          * an aggregation buffer.
3882          */
3883         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
3884                 (UINT32_C(0x5) << 7)
3885         /*
3886          * GRO/Header-Data Separation:
3887          * Packet will be placed using GRO/HDS where the header
3888          * is in the first packet.
3889          * Payload of each packet will be
3890          * placed such that any one packet does not span two
3891          * aggregation buffers unless it starts at the beginning of
3892          * an aggregation buffer.
3893          */
3894         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \
3895                 (UINT32_C(0x6) << 7)
3896         #define RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_LAST \
3897                 RX_TPA_V2_END_CMPL_FLAGS_PLACEMENT_GRO_HDS
3898         /* unused is 2 b */
3899         #define RX_TPA_V2_END_CMPL_FLAGS_UNUSED_MASK         UINT32_C(0xc00)
3900         #define RX_TPA_V2_END_CMPL_FLAGS_UNUSED_SFT          10
3901         /*
3902          * This value indicates what the inner packet determined for the
3903          * packet was.
3904          * - 2 TCP Packet
3905          *     Indicates that the packet was IP and TCP.  This indicates
3906          *     that the ip_cs field is valid and that the tcp_udp_cs
3907          *     field is valid and contains the TCP checksum.
3908          *     This also indicates that the payload_offset field is valid.
3909          */
3910         #define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_MASK          UINT32_C(0xf000)
3911         #define RX_TPA_V2_END_CMPL_FLAGS_ITYPE_SFT           12
3912         /*
3913          * This value is zero for TPA End completions.
3914          * There is no data in the buffer that corresponds to the opaque
3915          * value in this completion.
3916          */
3917         uint16_t        len;
3918         /*
3919          * This is a copy of the opaque field from the RX BD this completion
3920          * corresponds to.
3921          */
3922         uint32_t        opaque;
3923         uint8_t v1;
3924         /*
3925          * This value is written by the NIC such that it will be different
3926          * for each pass through the completion queue.   The even passes
3927          * will write 1.  The odd passes will write 0.
3928          */
3929         #define RX_TPA_V2_END_CMPL_V1     UINT32_C(0x1)
3930         /* This value is the number of segments in the TPA operation. */
3931         uint8_t tpa_segs;
3932         /*
3933          * This is the aggregation ID that the completion is associated
3934          * with.  Use this number to correlate the TPA start completion
3935          * with the TPA end completion.
3936          */
3937         uint16_t        agg_id;
3938         /*
3939          * For non-GRO packets, this value is the
3940          * timestamp delta between earliest and latest timestamp values for
3941          * TPA packet. If packets were not time stamped, then delta will be
3942          * zero.
3943          *
3944          * For GRO packets, this field is zero except for the following
3945          * sub-fields.
3946          * - tsdelta[31]
3947          *     Timestamp present indication.  When '0', no Timestamp
3948          *     option is in the packet.  When '1', then a Timestamp
3949          *     option is present in the packet.
3950          */
3951         uint32_t        tsdelta;
3952 } __attribute__((packed));
3953
3954 /*
3955  * Last 16 bytes of rx_tpa_v2_end_cmpl.
3956  *
3957  * This TPA completion structure is used on devices where the
3958  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
3959  */
3960 /* rx_tpa_v2_end_cmpl_hi (size:128b/16B) */
3961 struct rx_tpa_v2_end_cmpl_hi {
3962         /*
3963          * This value is the number of duplicate ACKs that have been
3964          * received as part of the TPA operation.
3965          */
3966         uint16_t        tpa_dup_acks;
3967         /*
3968          * This value is the number of duplicate ACKs that have been
3969          * received as part of the TPA operation.
3970          */
3971         #define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
3972         #define RX_TPA_V2_END_CMPL_TPA_DUP_ACKS_SFT 0
3973         /*
3974          * This value indicated the offset in bytes from the beginning of
3975          * the packet where the inner payload starts. This value is valid
3976          * for TCP, UDP, FCoE and RoCE packets
3977          */
3978         uint8_t payload_offset;
3979         /*
3980          * The value is the total number of aggregation buffers that were
3981          * used in the TPA operation. All TPA aggregation buffer completions
3982          * precede the TPA End completion. If the value is zero, then the
3983          * aggregation is completely contained in the buffer space provided
3984          * in the aggregation start completion.
3985          * Note that the field is simply provided as a cross check.
3986          */
3987         uint8_t tpa_agg_bufs;
3988         /*
3989          * This value is the valid when TPA completion is active.  It
3990          * indicates the length of the longest segment of the TPA operation
3991          * for LRO mode and the length of the first segment in GRO mode.
3992          *
3993          * This value may be used by GRO software to re-construct the original
3994          * packet stream from the TPA packet.  This is the length of all
3995          * but the last segment for GRO.  In LRO mode this value may be used
3996          * to indicate MSS size to the stack.
3997          */
3998         uint16_t        tpa_seg_len;
3999         uint16_t        unused_1;
4000         uint16_t        errors_v2;
4001         /*
4002          * This value is written by the NIC such that it will be different
4003          * for each pass through the completion queue.   The even passes
4004          * will write 1.  The odd passes will write 0.
4005          */
4006         #define RX_TPA_V2_END_CMPL_V2                             UINT32_C(0x1)
4007         #define RX_TPA_V2_END_CMPL_ERRORS_MASK \
4008                 UINT32_C(0xfffe)
4009         #define RX_TPA_V2_END_CMPL_ERRORS_SFT                     1
4010         /*
4011          * This error indicates that there was some sort of problem with
4012          * the BDs for the packet that was found after part of the
4013          * packet was already placed.  The packet should be treated as
4014          * invalid.
4015          */
4016         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_MASK \
4017                 UINT32_C(0xe)
4018         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_SFT         1
4019         /* No buffer error */
4020         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
4021                 (UINT32_C(0x0) << 1)
4022         /*
4023          * This error occurs when there is a fatal HW problem in
4024          * the chip only.  It indicates that there were not
4025          * BDs on chip but that there was adequate reservation.
4026          * provided by the TPA block.
4027          */
4028         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
4029                 (UINT32_C(0x2) << 1)
4030         /*
4031          * Bad Format:
4032          * BDs were not formatted correctly.
4033          */
4034         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
4035                 (UINT32_C(0x3) << 1)
4036         /*
4037          * This error occurs when TPA block was not configured to
4038          * reserve adequate BDs for TPA operations on this RX
4039          * ring.  All data for the TPA operation was not placed.
4040          *
4041          * This error can also be generated when the number of
4042          * segments is not programmed correctly in TPA and the
4043          * 33 total aggregation buffers allowed for the TPA
4044          * operation has been exceeded.
4045          */
4046         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
4047                 (UINT32_C(0x4) << 1)
4048         /*
4049          * Flush:
4050          * There was a bad_format error on the previous operation
4051          */
4052         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
4053                 (UINT32_C(0x5) << 1)
4054         #define RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
4055                 RX_TPA_V2_END_CMPL_ERRORS_BUFFER_ERROR_FLUSH
4056         uint16_t        unused_2;
4057         /*
4058          * This is the opaque value that was completed for the TPA start
4059          * completion that corresponds to this TPA end completion.
4060          */
4061         uint32_t        start_opaque;
4062 } __attribute__((packed));
4063
4064 /*
4065  * This TPA completion structure is used on devices where the
4066  * `hwrm_vnic_qcaps.max_aggs_supported` value is greater than 0.
4067  */
4068 /* rx_tpa_v2_abuf_cmpl (size:128b/16B) */
4069 struct rx_tpa_v2_abuf_cmpl {
4070         uint16_t        type;
4071         /*
4072          * This field indicates the exact type of the completion.
4073          * By convention, the LSB identifies the length of the
4074          * record in 16B units.  Even values indicate 16B
4075          * records.  Odd values indicate 32B
4076          * records.
4077          */
4078         #define RX_TPA_V2_ABUF_CMPL_TYPE_MASK      UINT32_C(0x3f)
4079         #define RX_TPA_V2_ABUF_CMPL_TYPE_SFT       0
4080         /*
4081          * RX TPA Aggregation Buffer completion :
4082          * Completion of an L2 aggregation buffer in support of
4083          * TPA packet completion.  Length = 16B
4084          */
4085         #define RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG  UINT32_C(0x16)
4086         #define RX_TPA_V2_ABUF_CMPL_TYPE_LAST \
4087                 RX_TPA_V2_ABUF_CMPL_TYPE_RX_TPA_AGG
4088         /*
4089          * This is the length of the data for the packet stored in this
4090          * aggregation buffer identified by the opaque value.  This does not
4091          * include the length of any
4092          * data placed in other aggregation BDs or in the packet or buffer
4093          * BDs.   This length does not include any space added due to
4094          * hdr_offset register during HDS placement mode.
4095          */
4096         uint16_t        len;
4097         /*
4098          * This is a copy of the opaque field from the RX BD this aggregation
4099          * buffer corresponds to.
4100          */
4101         uint32_t        opaque;
4102         uint16_t        v;
4103         /*
4104          * This value is written by the NIC such that it will be different
4105          * for each pass through the completion queue.   The even passes
4106          * will write 1.  The odd passes will write 0.
4107          */
4108         #define RX_TPA_V2_ABUF_CMPL_V     UINT32_C(0x1)
4109         /*
4110          * This is the aggregation ID that the completion is associated with. Use
4111          * this number to correlate the TPA agg completion with the TPA start
4112          * completion and the TPA end completion.
4113          */
4114         uint16_t        agg_id;
4115         uint32_t        unused_1;
4116 } __attribute__((packed));
4117
4118 /* rx_abuf_cmpl (size:128b/16B) */
4119 struct rx_abuf_cmpl {
4120         uint16_t        type;
4121         /*
4122          * This field indicates the exact type of the completion.
4123          * By convention, the LSB identifies the length of the
4124          * record in 16B units.  Even values indicate 16B
4125          * records.  Odd values indicate 32B
4126          * records.
4127          */
4128         #define RX_ABUF_CMPL_TYPE_MASK  UINT32_C(0x3f)
4129         #define RX_ABUF_CMPL_TYPE_SFT   0
4130         /*
4131          * RX Aggregation Buffer completion :
4132          * Completion of an L2 aggregation buffer in support of
4133          * TPA, HDS, or Jumbo packet completion.  Length = 16B
4134          */
4135         #define RX_ABUF_CMPL_TYPE_RX_AGG  UINT32_C(0x12)
4136         #define RX_ABUF_CMPL_TYPE_LAST   RX_ABUF_CMPL_TYPE_RX_AGG
4137         /*
4138          * This is the length of the data for the packet stored in this
4139          * aggregation buffer identified by the opaque value.  This does not
4140          * include the length of any
4141          * data placed in other aggregation BDs or in the packet or buffer
4142          * BDs.   This length does not include any space added due to
4143          * hdr_offset register during HDS placement mode.
4144          */
4145         uint16_t        len;
4146         /*
4147          * This is a copy of the opaque field from the RX BD this aggregation
4148          * buffer corresponds to.
4149          */
4150         uint32_t        opaque;
4151         uint32_t        v;
4152         /*
4153          * This value is written by the NIC such that it will be different
4154          * for each pass through the completion queue.   The even passes
4155          * will write 1.  The odd passes will write 0.
4156          */
4157         #define RX_ABUF_CMPL_V     UINT32_C(0x1)
4158         /* unused3 is 32 b */
4159         uint32_t        unused_2;
4160 } __attribute__((packed));
4161
4162 /* eject_cmpl (size:128b/16B) */
4163 struct eject_cmpl {
4164         uint16_t        type;
4165         /*
4166          * This field indicates the exact type of the completion.
4167          * By convention, the LSB identifies the length of the
4168          * record in 16B units.  Even values indicate 16B
4169          * records.  Odd values indicate 32B
4170          * records.
4171          */
4172         #define EJECT_CMPL_TYPE_MASK       UINT32_C(0x3f)
4173         #define EJECT_CMPL_TYPE_SFT        0
4174         /*
4175          * Statistics Ejection Completion:
4176          * Completion of statistics data ejection buffer.
4177          * Length = 16B
4178          */
4179         #define EJECT_CMPL_TYPE_STAT_EJECT   UINT32_C(0x1a)
4180         #define EJECT_CMPL_TYPE_LAST        EJECT_CMPL_TYPE_STAT_EJECT
4181         #define EJECT_CMPL_FLAGS_MASK      UINT32_C(0xffc0)
4182         #define EJECT_CMPL_FLAGS_SFT       6
4183         /*
4184          * When this bit is '1', it indicates a packet that has an
4185          * error of some type.  Type of error is indicated in
4186          * error_flags.
4187          */
4188         #define EJECT_CMPL_FLAGS_ERROR      UINT32_C(0x40)
4189         /*
4190          * This is the length of the statistics data stored in this
4191          * buffer.
4192          */
4193         uint16_t        len;
4194         /*
4195          * This is a copy of the opaque field from the RX BD this ejection
4196          * buffer corresponds to.
4197          */
4198         uint32_t        opaque;
4199         uint16_t        v;
4200         /*
4201          * This value is written by the NIC such that it will be different
4202          * for each pass through the completion queue.   The even passes
4203          * will write 1.  The odd passes will write 0.
4204          */
4205         #define EJECT_CMPL_V                              UINT32_C(0x1)
4206         #define EJECT_CMPL_ERRORS_MASK                    UINT32_C(0xfffe)
4207         #define EJECT_CMPL_ERRORS_SFT                     1
4208         /*
4209          * This error indicates that there was some sort of problem with
4210          * the BDs for statistics ejection. The statistics ejection should
4211          * be treated as invalid
4212          */
4213         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_MASK        UINT32_C(0xe)
4214         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_SFT         1
4215         /* No buffer error */
4216         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
4217                 (UINT32_C(0x0) << 1)
4218         /*
4219          * Did Not Fit:
4220          * Statistics did not fit into aggregation buffer provided.
4221          */
4222         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
4223                 (UINT32_C(0x1) << 1)
4224         /*
4225          * Bad Format:
4226          * BDs were not formatted correctly.
4227          */
4228         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
4229                 (UINT32_C(0x3) << 1)
4230         /*
4231          * Flush:
4232          * There was a bad_format error on the previous operation
4233          */
4234         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH \
4235                 (UINT32_C(0x5) << 1)
4236         #define EJECT_CMPL_ERRORS_BUFFER_ERROR_LAST \
4237                 EJECT_CMPL_ERRORS_BUFFER_ERROR_FLUSH
4238         /* reserved16 is 16 b */
4239         uint16_t        reserved16;
4240         /* unused3 is 32 b */
4241         uint32_t        unused_2;
4242 } __attribute__((packed));
4243
4244 /* hwrm_cmpl (size:128b/16B) */
4245 struct hwrm_cmpl {
4246         uint16_t        type;
4247         /*
4248          * This field indicates the exact type of the completion.
4249          * By convention, the LSB identifies the length of the
4250          * record in 16B units.  Even values indicate 16B
4251          * records.  Odd values indicate 32B
4252          * records.
4253          */
4254         #define HWRM_CMPL_TYPE_MASK     UINT32_C(0x3f)
4255         #define HWRM_CMPL_TYPE_SFT      0
4256         /*
4257          * HWRM Command Completion:
4258          * Completion of an HWRM command.
4259          */
4260         #define HWRM_CMPL_TYPE_HWRM_DONE  UINT32_C(0x20)
4261         #define HWRM_CMPL_TYPE_LAST      HWRM_CMPL_TYPE_HWRM_DONE
4262         /* This is the sequence_id of the HWRM command that has completed. */
4263         uint16_t        sequence_id;
4264         /* unused2 is 32 b */
4265         uint32_t        unused_1;
4266         uint32_t        v;
4267         /*
4268          * This value is written by the NIC such that it will be different
4269          * for each pass through the completion queue.   The even passes
4270          * will write 1.  The odd passes will write 0.
4271          */
4272         #define HWRM_CMPL_V     UINT32_C(0x1)
4273         /* unused4 is 32 b */
4274         uint32_t        unused_3;
4275 } __attribute__((packed));
4276
4277 /* hwrm_fwd_req_cmpl (size:128b/16B) */
4278 struct hwrm_fwd_req_cmpl {
4279         /*
4280          * This field indicates the exact type of the completion.
4281          * By convention, the LSB identifies the length of the
4282          * record in 16B units.  Even values indicate 16B
4283          * records.  Odd values indicate 32B
4284          * records.
4285          */
4286         uint16_t        req_len_type;
4287         /*
4288          * This field indicates the exact type of the completion.
4289          * By convention, the LSB identifies the length of the
4290          * record in 16B units.  Even values indicate 16B
4291          * records.  Odd values indicate 32B
4292          * records.
4293          */
4294         #define HWRM_FWD_REQ_CMPL_TYPE_MASK        UINT32_C(0x3f)
4295         #define HWRM_FWD_REQ_CMPL_TYPE_SFT         0
4296         /* Forwarded HWRM Request */
4297         #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ  UINT32_C(0x22)
4298         #define HWRM_FWD_REQ_CMPL_TYPE_LAST \
4299                 HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ
4300         /* Length of forwarded request in bytes. */
4301         #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK     UINT32_C(0xffc0)
4302         #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT      6
4303         /*
4304          * Source ID of this request.
4305          * Typically used in forwarding requests and responses.
4306          * 0x0 - 0xFFF8 - Used for function ids
4307          * 0xFFF8 - 0xFFFE - Reserved for internal processors
4308          * 0xFFFF - HWRM
4309          */
4310         uint16_t        source_id;
4311         /* unused1 is 32 b */
4312         uint32_t        unused0;
4313         /* Address of forwarded request. */
4314         uint32_t        req_buf_addr_v[2];
4315         /*
4316          * This value is written by the NIC such that it will be different
4317          * for each pass through the completion queue.   The even passes
4318          * will write 1.  The odd passes will write 0.
4319          */
4320         #define HWRM_FWD_REQ_CMPL_V                UINT32_C(0x1)
4321         /* Address of forwarded request. */
4322         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
4323         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
4324 } __attribute__((packed));
4325
4326 /* hwrm_fwd_resp_cmpl (size:128b/16B) */
4327 struct hwrm_fwd_resp_cmpl {
4328         uint16_t        type;
4329         /*
4330          * This field indicates the exact type of the completion.
4331          * By convention, the LSB identifies the length of the
4332          * record in 16B units.  Even values indicate 16B
4333          * records.  Odd values indicate 32B
4334          * records.
4335          */
4336         #define HWRM_FWD_RESP_CMPL_TYPE_MASK         UINT32_C(0x3f)
4337         #define HWRM_FWD_RESP_CMPL_TYPE_SFT          0
4338         /* Forwarded HWRM Response */
4339         #define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP  UINT32_C(0x24)
4340         #define HWRM_FWD_RESP_CMPL_TYPE_LAST \
4341                 HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP
4342         /*
4343          * Source ID of this response.
4344          * Typically used in forwarding requests and responses.
4345          * 0x0 - 0xFFF8 - Used for function ids
4346          * 0xFFF8 - 0xFFFE - Reserved for internal processors
4347          * 0xFFFF - HWRM
4348          */
4349         uint16_t        source_id;
4350         /* Length of forwarded response in bytes. */
4351         uint16_t        resp_len;
4352         /* unused2 is 16 b */
4353         uint16_t        unused_1;
4354         /* Address of forwarded request. */
4355         uint32_t        resp_buf_addr_v[2];
4356         /*
4357          * This value is written by the NIC such that it will be different
4358          * for each pass through the completion queue.   The even passes
4359          * will write 1.  The odd passes will write 0.
4360          */
4361         #define HWRM_FWD_RESP_CMPL_V                 UINT32_C(0x1)
4362         /* Address of forwarded request. */
4363         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK UINT32_C(0xfffffffe)
4364         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT 1
4365 } __attribute__((packed));
4366
4367 /* hwrm_async_event_cmpl (size:128b/16B) */
4368 struct hwrm_async_event_cmpl {
4369         uint16_t        type;
4370         /*
4371          * This field indicates the exact type of the completion.
4372          * By convention, the LSB identifies the length of the
4373          * record in 16B units.  Even values indicate 16B
4374          * records.  Odd values indicate 32B
4375          * records.
4376          */
4377         #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK            UINT32_C(0x3f)
4378         #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT             0
4379         /* HWRM Asynchronous Event Information */
4380         #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT  UINT32_C(0x2e)
4381         #define HWRM_ASYNC_EVENT_CMPL_TYPE_LAST \
4382                 HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT
4383         /* Identifiers of events. */
4384         uint16_t        event_id;
4385         /* Link status changed */
4386         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \
4387                 UINT32_C(0x0)
4388         /* Link MTU changed */
4389         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \
4390                 UINT32_C(0x1)
4391         /* Link speed changed */
4392         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \
4393                 UINT32_C(0x2)
4394         /* DCB Configuration changed */
4395         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \
4396                 UINT32_C(0x3)
4397         /* Port connection not allowed */
4398         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \
4399                 UINT32_C(0x4)
4400         /* Link speed configuration was not allowed */
4401         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
4402                 UINT32_C(0x5)
4403         /* Link speed configuration change */
4404         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE \
4405                 UINT32_C(0x6)
4406         /* Port PHY configuration change */
4407         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE \
4408                 UINT32_C(0x7)
4409         /* Reset notification to clients */
4410         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY \
4411                 UINT32_C(0x8)
4412         /* Master function selection event */
4413         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY \
4414                 UINT32_C(0x9)
4415         /* Function driver unloaded */
4416         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \
4417                 UINT32_C(0x10)
4418         /* Function driver loaded */
4419         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \
4420                 UINT32_C(0x11)
4421         /* Function FLR related processing has completed */
4422         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT \
4423                 UINT32_C(0x12)
4424         /* PF driver unloaded */
4425         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \
4426                 UINT32_C(0x20)
4427         /* PF driver loaded */
4428         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \
4429                 UINT32_C(0x21)
4430         /* VF Function Level Reset (FLR) */
4431         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR \
4432                 UINT32_C(0x30)
4433         /* VF MAC Address Change */
4434         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \
4435                 UINT32_C(0x31)
4436         /* PF-VF communication channel status change. */
4437         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
4438                 UINT32_C(0x32)
4439         /* VF Configuration Change */
4440         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE \
4441                 UINT32_C(0x33)
4442         /* LLFC/PFC Configuration Change */
4443         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE \
4444                 UINT32_C(0x34)
4445         /* Default VNIC Configuration Change */
4446         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE \
4447                 UINT32_C(0x35)
4448         /* HW flow aged */
4449         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HW_FLOW_AGED \
4450                 UINT32_C(0x36)
4451         /*
4452          * A debug notification being posted to the driver. These
4453          * notifications are purely for diagnostic purpose and should not be
4454          * used for functional purpose. The driver is not supposed to act
4455          * on these messages except to log/record it.
4456          */
4457         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION \
4458                 UINT32_C(0x37)
4459         /*
4460          * An EEM flow cached memory flush for all flows request event being
4461          * posted to the PF driver.
4462          */
4463         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_REQ \
4464                 UINT32_C(0x38)
4465         /*
4466          * An EEM flow cache memory flush completion event being posted to the
4467          * firmware by the PF driver. This is indication that host EEM flush
4468          * has completed by the PF.
4469          */
4470         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_DONE \
4471                 UINT32_C(0x39)
4472         /*
4473          * A tcp flag action change event being posted to the PF or trusted VF
4474          * driver by the firmware. The PF or trusted VF driver should query
4475          * the firmware for the new TCP flag action update after receiving
4476          * this async event.
4477          */
4478         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TCP_FLAG_ACTION_CHANGE \
4479                 UINT32_C(0x3a)
4480         /*
4481          * An EEM flow active event being posted to the PF or trusted VF driver
4482          * by the firmware. The PF or trusted VF driver should update the
4483          * flow's aging timer after receiving this async event.
4484          */
4485         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_FLOW_ACTIVE \
4486                 UINT32_C(0x3b)
4487         /*
4488          * A eem cfg change event being posted to the trusted VF driver by the
4489          * firmware if the parent PF EEM configuration changed.
4490          */
4491         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_EEM_CFG_CHANGE \
4492                 UINT32_C(0x3c)
4493         /* TFLIB unique default VNIC Configuration Change */
4494         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_DEFAULT_VNIC_CHANGE \
4495                 UINT32_C(0x3d)
4496         /* TFLIB unique link status changed */
4497         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_LINK_STATUS_CHANGE \
4498                 UINT32_C(0x3e)
4499         /*
4500          * A trace log message. This contains firmware trace logs string
4501          * embedded in the asynchronous message. This is an experimental
4502          * event, not meant for production use at this time.
4503          */
4504         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG \
4505                 UINT32_C(0xfe)
4506         /* HWRM Error */
4507         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \
4508                 UINT32_C(0xff)
4509         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LAST \
4510                 HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR
4511         /* Event specific data */
4512         uint32_t        event_data2;
4513         uint8_t opaque_v;
4514         /*
4515          * This value is written by the NIC such that it will be different
4516          * for each pass through the completion queue.   The even passes
4517          * will write 1.  The odd passes will write 0.
4518          */
4519         #define HWRM_ASYNC_EVENT_CMPL_V          UINT32_C(0x1)
4520         /* opaque is 7 b */
4521         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
4522         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
4523         /* 8-lsb timestamp from POR (100-msec resolution) */
4524         uint8_t timestamp_lo;
4525         /* 16-lsb timestamp from POR (100-msec resolution) */
4526         uint16_t        timestamp_hi;
4527         /* Event specific data */
4528         uint32_t        event_data1;
4529 } __attribute__((packed));
4530
4531 /* hwrm_async_event_cmpl_link_status_change (size:128b/16B) */
4532 struct hwrm_async_event_cmpl_link_status_change {
4533         uint16_t        type;
4534         /*
4535          * This field indicates the exact type of the completion.
4536          * By convention, the LSB identifies the length of the
4537          * record in 16B units.  Even values indicate 16B
4538          * records.  Odd values indicate 32B
4539          * records.
4540          */
4541         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK \
4542                 UINT32_C(0x3f)
4543         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT             0
4544         /* HWRM Asynchronous Event Information */
4545         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4546                 UINT32_C(0x2e)
4547         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_LAST \
4548                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
4549         /* Identifiers of events. */
4550         uint16_t        event_id;
4551         /* Link status changed */
4552         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE \
4553                 UINT32_C(0x0)
4554         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LAST \
4555                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE
4556         /* Event specific data */
4557         uint32_t        event_data2;
4558         uint8_t opaque_v;
4559         /*
4560          * This value is written by the NIC such that it will be different
4561          * for each pass through the completion queue.   The even passes
4562          * will write 1.  The odd passes will write 0.
4563          */
4564         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V \
4565                 UINT32_C(0x1)
4566         /* opaque is 7 b */
4567         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK \
4568                 UINT32_C(0xfe)
4569         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
4570         /* 8-lsb timestamp from POR (100-msec resolution) */
4571         uint8_t timestamp_lo;
4572         /* 16-lsb timestamp from POR (100-msec resolution) */
4573         uint16_t        timestamp_hi;
4574         /* Event specific data */
4575         uint32_t        event_data1;
4576         /* Indicates link status change */
4577         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE \
4578                 UINT32_C(0x1)
4579         /*
4580          * If this bit set to 0, then it indicates that the link
4581          * was up and it went down.
4582          */
4583         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN \
4584                 UINT32_C(0x0)
4585         /*
4586          * If this bit is set to 1, then it indicates that the link
4587          * was down and it went up.
4588          */
4589         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP \
4590                 UINT32_C(0x1)
4591         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_LAST \
4592                 HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP
4593         /* Indicates the physical port this link status change occur */
4594         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK \
4595                 UINT32_C(0xe)
4596         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT \
4597                 1
4598         /* PORT ID */
4599         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK \
4600                 UINT32_C(0xffff0)
4601         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT \
4602                 4
4603         /* Indicates the physical function this event occurred on. */
4604         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_MASK \
4605                 UINT32_C(0xff00000)
4606         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PF_ID_SFT \
4607                 20
4608 } __attribute__((packed));
4609
4610 /* hwrm_async_event_cmpl_link_mtu_change (size:128b/16B) */
4611 struct hwrm_async_event_cmpl_link_mtu_change {
4612         uint16_t        type;
4613         /*
4614          * This field indicates the exact type of the completion.
4615          * By convention, the LSB identifies the length of the
4616          * record in 16B units.  Even values indicate 16B
4617          * records.  Odd values indicate 32B
4618          * records.
4619          */
4620         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK \
4621                 UINT32_C(0x3f)
4622         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT             0
4623         /* HWRM Asynchronous Event Information */
4624         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4625                 UINT32_C(0x2e)
4626         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_LAST \
4627                 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT
4628         /* Identifiers of events. */
4629         uint16_t        event_id;
4630         /* Link MTU changed */
4631         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE \
4632                 UINT32_C(0x1)
4633         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LAST \
4634                 HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE
4635         /* Event specific data */
4636         uint32_t        event_data2;
4637         uint8_t opaque_v;
4638         /*
4639          * This value is written by the NIC such that it will be different
4640          * for each pass through the completion queue.   The even passes
4641          * will write 1.  The odd passes will write 0.
4642          */
4643         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V          UINT32_C(0x1)
4644         /* opaque is 7 b */
4645         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK \
4646                 UINT32_C(0xfe)
4647         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT 1
4648         /* 8-lsb timestamp from POR (100-msec resolution) */
4649         uint8_t timestamp_lo;
4650         /* 16-lsb timestamp from POR (100-msec resolution) */
4651         uint16_t        timestamp_hi;
4652         /* Event specific data */
4653         uint32_t        event_data1;
4654         /* The new MTU of the link in bytes. */
4655         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK \
4656                 UINT32_C(0xffff)
4657         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
4658 } __attribute__((packed));
4659
4660 /* hwrm_async_event_cmpl_link_speed_change (size:128b/16B) */
4661 struct hwrm_async_event_cmpl_link_speed_change {
4662         uint16_t        type;
4663         /*
4664          * This field indicates the exact type of the completion.
4665          * By convention, the LSB identifies the length of the
4666          * record in 16B units.  Even values indicate 16B
4667          * records.  Odd values indicate 32B
4668          * records.
4669          */
4670         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK \
4671                 UINT32_C(0x3f)
4672         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT             0
4673         /* HWRM Asynchronous Event Information */
4674         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4675                 UINT32_C(0x2e)
4676         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_LAST \
4677                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT
4678         /* Identifiers of events. */
4679         uint16_t        event_id;
4680         /* Link speed changed */
4681         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE \
4682                 UINT32_C(0x2)
4683         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LAST \
4684                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE
4685         /* Event specific data */
4686         uint32_t        event_data2;
4687         uint8_t opaque_v;
4688         /*
4689          * This value is written by the NIC such that it will be different
4690          * for each pass through the completion queue.   The even passes
4691          * will write 1.  The odd passes will write 0.
4692          */
4693         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V \
4694                 UINT32_C(0x1)
4695         /* opaque is 7 b */
4696         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK \
4697                 UINT32_C(0xfe)
4698         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
4699         /* 8-lsb timestamp from POR (100-msec resolution) */
4700         uint8_t timestamp_lo;
4701         /* 16-lsb timestamp from POR (100-msec resolution) */
4702         uint16_t        timestamp_hi;
4703         /* Event specific data */
4704         uint32_t        event_data1;
4705         /*
4706          * When this bit is '1', the link was forced to the
4707          * force_link_speed value.
4708          */
4709         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE \
4710                 UINT32_C(0x1)
4711         /* The new link speed in 100 Mbps units. */
4712         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK \
4713                 UINT32_C(0xfffe)
4714         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT \
4715                 1
4716         /* 100Mb link speed */
4717         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB \
4718                 (UINT32_C(0x1) << 1)
4719         /* 1Gb link speed */
4720         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB \
4721                 (UINT32_C(0xa) << 1)
4722         /* 2Gb link speed */
4723         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB \
4724                 (UINT32_C(0x14) << 1)
4725         /* 25Gb link speed */
4726         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB \
4727                 (UINT32_C(0x19) << 1)
4728         /* 10Gb link speed */
4729         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB \
4730                 (UINT32_C(0x64) << 1)
4731         /* 20Mb link speed */
4732         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB \
4733                 (UINT32_C(0xc8) << 1)
4734         /* 25Gb link speed */
4735         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB \
4736                 (UINT32_C(0xfa) << 1)
4737         /* 40Gb link speed */
4738         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB \
4739                 (UINT32_C(0x190) << 1)
4740         /* 50Gb link speed */
4741         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB \
4742                 (UINT32_C(0x1f4) << 1)
4743         /* 100Gb link speed */
4744         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB \
4745                 (UINT32_C(0x3e8) << 1)
4746         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_LAST \
4747                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB
4748         /* PORT ID */
4749         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK \
4750                 UINT32_C(0xffff0000)
4751         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT \
4752                 16
4753 } __attribute__((packed));
4754
4755 /* hwrm_async_event_cmpl_dcb_config_change (size:128b/16B) */
4756 struct hwrm_async_event_cmpl_dcb_config_change {
4757         uint16_t        type;
4758         /*
4759          * This field indicates the exact type of the completion.
4760          * By convention, the LSB identifies the length of the
4761          * record in 16B units.  Even values indicate 16B
4762          * records.  Odd values indicate 32B
4763          * records.
4764          */
4765         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK \
4766                 UINT32_C(0x3f)
4767         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT             0
4768         /* HWRM Asynchronous Event Information */
4769         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4770                 UINT32_C(0x2e)
4771         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_LAST \
4772                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT
4773         /* Identifiers of events. */
4774         uint16_t        event_id;
4775         /* DCB Configuration changed */
4776         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE \
4777                 UINT32_C(0x3)
4778         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_LAST \
4779                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE
4780         /* Event specific data */
4781         uint32_t        event_data2;
4782         /* ETS configuration change */
4783         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_ETS \
4784                 UINT32_C(0x1)
4785         /* PFC configuration change */
4786         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_PFC \
4787                 UINT32_C(0x2)
4788         /* APP configuration change */
4789         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA2_APP \
4790                 UINT32_C(0x4)
4791         uint8_t opaque_v;
4792         /*
4793          * This value is written by the NIC such that it will be different
4794          * for each pass through the completion queue.   The even passes
4795          * will write 1.  The odd passes will write 0.
4796          */
4797         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V \
4798                 UINT32_C(0x1)
4799         /* opaque is 7 b */
4800         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK \
4801                 UINT32_C(0xfe)
4802         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
4803         /* 8-lsb timestamp from POR (100-msec resolution) */
4804         uint8_t timestamp_lo;
4805         /* 16-lsb timestamp from POR (100-msec resolution) */
4806         uint16_t        timestamp_hi;
4807         /* Event specific data */
4808         uint32_t        event_data1;
4809         /* PORT ID */
4810         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
4811                 UINT32_C(0xffff)
4812         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
4813                 0
4814         /* Priority recommended for RoCE traffic */
4815         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_MASK \
4816                 UINT32_C(0xff0000)
4817         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_SFT \
4818                 16
4819         /* none is 255 */
4820         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE \
4821                 (UINT32_C(0xff) << 16)
4822         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_LAST \
4823                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_ROCE_PRIORITY_NONE
4824         /* Priority recommended for L2 traffic */
4825         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_MASK \
4826                 UINT32_C(0xff000000)
4827         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_SFT \
4828                 24
4829         /* none is 255 */
4830         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE \
4831                 (UINT32_C(0xff) << 24)
4832         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_LAST \
4833                 HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_RECOMMEND_L2_PRIORITY_NONE
4834 } __attribute__((packed));
4835
4836 /* hwrm_async_event_cmpl_port_conn_not_allowed (size:128b/16B) */
4837 struct hwrm_async_event_cmpl_port_conn_not_allowed {
4838         uint16_t        type;
4839         /*
4840          * This field indicates the exact type of the completion.
4841          * By convention, the LSB identifies the length of the
4842          * record in 16B units.  Even values indicate 16B
4843          * records.  Odd values indicate 32B
4844          * records.
4845          */
4846         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK \
4847                 UINT32_C(0x3f)
4848         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT \
4849                 0
4850         /* HWRM Asynchronous Event Information */
4851         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \
4852                 UINT32_C(0x2e)
4853         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_LAST \
4854                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
4855         /* Identifiers of events. */
4856         uint16_t        event_id;
4857         /* Port connection not allowed */
4858         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED \
4859                 UINT32_C(0x4)
4860         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_LAST \
4861                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED
4862         /* Event specific data */
4863         uint32_t        event_data2;
4864         uint8_t opaque_v;
4865         /*
4866          * This value is written by the NIC such that it will be different
4867          * for each pass through the completion queue.   The even passes
4868          * will write 1.  The odd passes will write 0.
4869          */
4870         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V \
4871                 UINT32_C(0x1)
4872         /* opaque is 7 b */
4873         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK \
4874                 UINT32_C(0xfe)
4875         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
4876         /* 8-lsb timestamp from POR (100-msec resolution) */
4877         uint8_t timestamp_lo;
4878         /* 16-lsb timestamp from POR (100-msec resolution) */
4879         uint16_t        timestamp_hi;
4880         /* Event specific data */
4881         uint32_t        event_data1;
4882         /* PORT ID */
4883         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \
4884                 UINT32_C(0xffff)
4885         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
4886                 0
4887         /*
4888          * This value indicates the current port level enforcement policy
4889          * for the optics module when there is an optical module mismatch
4890          * and port is not connected.
4891          */
4892         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK \
4893                 UINT32_C(0xff0000)
4894         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT \
4895                 16
4896         /* No enforcement */
4897         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE \
4898                 (UINT32_C(0x0) << 16)
4899         /* Disable Transmit side Laser. */
4900         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX \
4901                 (UINT32_C(0x1) << 16)
4902         /* Raise a warning message. */
4903         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG \
4904                 (UINT32_C(0x2) << 16)
4905         /* Power down the module. */
4906         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN \
4907                 (UINT32_C(0x3) << 16)
4908         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_LAST \
4909                 HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN
4910 } __attribute__((packed));
4911
4912 /* hwrm_async_event_cmpl_link_speed_cfg_not_allowed (size:128b/16B) */
4913 struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
4914         uint16_t        type;
4915         /*
4916          * This field indicates the exact type of the completion.
4917          * By convention, the LSB identifies the length of the
4918          * record in 16B units.  Even values indicate 16B
4919          * records.  Odd values indicate 32B
4920          * records.
4921          */
4922         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK \
4923                 UINT32_C(0x3f)
4924         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT \
4925                 0
4926         /* HWRM Asynchronous Event Information */
4927         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT \
4928                 UINT32_C(0x2e)
4929         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_LAST \
4930                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT
4931         /* Identifiers of events. */
4932         uint16_t        event_id;
4933         /* Link speed configuration was not allowed */
4934         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
4935                 UINT32_C(0x5)
4936         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LAST \
4937                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED
4938         /* Event specific data */
4939         uint32_t        event_data2;
4940         uint8_t opaque_v;
4941         /*
4942          * This value is written by the NIC such that it will be different
4943          * for each pass through the completion queue.   The even passes
4944          * will write 1.  The odd passes will write 0.
4945          */
4946         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V \
4947                 UINT32_C(0x1)
4948         /* opaque is 7 b */
4949         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK \
4950                 UINT32_C(0xfe)
4951         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1
4952         /* 8-lsb timestamp from POR (100-msec resolution) */
4953         uint8_t timestamp_lo;
4954         /* 16-lsb timestamp from POR (100-msec resolution) */
4955         uint16_t        timestamp_hi;
4956         /* Event specific data */
4957         uint32_t        event_data1;
4958         /* PORT ID */
4959         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK \
4960                 UINT32_C(0xffff)
4961         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT \
4962                 0
4963 } __attribute__((packed));
4964
4965 /* hwrm_async_event_cmpl_link_speed_cfg_change (size:128b/16B) */
4966 struct hwrm_async_event_cmpl_link_speed_cfg_change {
4967         uint16_t        type;
4968         /*
4969          * This field indicates the exact type of the completion.
4970          * By convention, the LSB identifies the length of the
4971          * record in 16B units.  Even values indicate 16B
4972          * records.  Odd values indicate 32B
4973          * records.
4974          */
4975         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK \
4976                 UINT32_C(0x3f)
4977         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT \
4978                 0
4979         /* HWRM Asynchronous Event Information */
4980         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
4981                 UINT32_C(0x2e)
4982         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_LAST \
4983                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
4984         /* Identifiers of events. */
4985         uint16_t        event_id;
4986         /* Link speed configuration change */
4987         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE \
4988                 UINT32_C(0x6)
4989         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LAST \
4990                 HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE
4991         /* Event specific data */
4992         uint32_t        event_data2;
4993         uint8_t opaque_v;
4994         /*
4995          * This value is written by the NIC such that it will be different
4996          * for each pass through the completion queue.   The even passes
4997          * will write 1.  The odd passes will write 0.
4998          */
4999         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V \
5000                 UINT32_C(0x1)
5001         /* opaque is 7 b */
5002         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK \
5003                 UINT32_C(0xfe)
5004         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1
5005         /* 8-lsb timestamp from POR (100-msec resolution) */
5006         uint8_t timestamp_lo;
5007         /* 16-lsb timestamp from POR (100-msec resolution) */
5008         uint16_t        timestamp_hi;
5009         /* Event specific data */
5010         uint32_t        event_data1;
5011         /* PORT ID */
5012         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
5013                 UINT32_C(0xffff)
5014         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
5015                 0
5016         /*
5017          * If set to 1, it indicates that the supported link speeds
5018          * configuration on the port has changed.
5019          * If set to 0, then there is no change in supported link speeds
5020          * configuration.
5021          */
5022         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE \
5023                 UINT32_C(0x10000)
5024         /*
5025          * If set to 1, it indicates that the link speed configuration
5026          * on the port has become illegal or invalid.
5027          * If set to 0, then the link speed configuration on the port is
5028          * legal or valid.
5029          */
5030         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG \
5031                 UINT32_C(0x20000)
5032 } __attribute__((packed));
5033
5034 /* hwrm_async_event_cmpl_port_phy_cfg_change (size:128b/16B) */
5035 struct hwrm_async_event_cmpl_port_phy_cfg_change {
5036         uint16_t        type;
5037         /*
5038          * This field indicates the exact type of the completion.
5039          * By convention, the LSB identifies the length of the
5040          * record in 16B units.  Even values indicate 16B
5041          * records.  Odd values indicate 32B
5042          * records.
5043          */
5044         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_MASK \
5045                 UINT32_C(0x3f)
5046         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_SFT \
5047                 0
5048         /* HWRM Asynchronous Event Information */
5049         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
5050                 UINT32_C(0x2e)
5051         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_LAST \
5052                 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
5053         /* Identifiers of events. */
5054         uint16_t        event_id;
5055         /* Port PHY configuration change */
5056         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE \
5057                 UINT32_C(0x7)
5058         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_LAST \
5059                 HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_ID_PORT_PHY_CFG_CHANGE
5060         /* Event specific data */
5061         uint32_t        event_data2;
5062         uint8_t opaque_v;
5063         /*
5064          * This value is written by the NIC such that it will be different
5065          * for each pass through the completion queue.   The even passes
5066          * will write 1.  The odd passes will write 0.
5067          */
5068         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_V \
5069                 UINT32_C(0x1)
5070         /* opaque is 7 b */
5071         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_MASK \
5072                 UINT32_C(0xfe)
5073         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_OPAQUE_SFT 1
5074         /* 8-lsb timestamp from POR (100-msec resolution) */
5075         uint8_t timestamp_lo;
5076         /* 16-lsb timestamp from POR (100-msec resolution) */
5077         uint16_t        timestamp_hi;
5078         /* Event specific data */
5079         uint32_t        event_data1;
5080         /* PORT ID */
5081         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK \
5082                 UINT32_C(0xffff)
5083         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT \
5084                 0
5085         /*
5086          * If set to 1, it indicates that the FEC
5087          * configuration on the port has changed.
5088          * If set to 0, then there is no change in FEC configuration.
5089          */
5090         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_FEC_CFG_CHANGE \
5091                 UINT32_C(0x10000)
5092         /*
5093          * If set to 1, it indicates that the EEE configuration
5094          * on the port has changed.
5095          * If set to 0, then there is no change in EEE configuration
5096          * on the port.
5097          */
5098         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_EEE_CFG_CHANGE \
5099                 UINT32_C(0x20000)
5100         /*
5101          * If set to 1, it indicates that the pause configuration
5102          * on the PHY has changed.
5103          * If set to 0, then there is no change in the pause
5104          * configuration on the PHY.
5105          */
5106         #define HWRM_ASYNC_EVENT_CMPL_PORT_PHY_CFG_CHANGE_EVENT_DATA1_PAUSE_CFG_CHANGE \
5107                 UINT32_C(0x40000)
5108 } __attribute__((packed));
5109
5110 /* hwrm_async_event_cmpl_reset_notify (size:128b/16B) */
5111 struct hwrm_async_event_cmpl_reset_notify {
5112         uint16_t        type;
5113         /*
5114          * This field indicates the exact type of the completion.
5115          * By convention, the LSB identifies the length of the
5116          * record in 16B units.  Even values indicate 16B
5117          * records.  Odd values indicate 32B
5118          * records.
5119          */
5120         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_MASK \
5121                 UINT32_C(0x3f)
5122         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_SFT             0
5123         /* HWRM Asynchronous Event Information */
5124         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT \
5125                 UINT32_C(0x2e)
5126         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_LAST \
5127                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_TYPE_HWRM_ASYNC_EVENT
5128         /* Identifiers of events. */
5129         uint16_t        event_id;
5130         /* Notify clients of imminent reset. */
5131         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY \
5132                 UINT32_C(0x8)
5133         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_LAST \
5134                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_ID_RESET_NOTIFY
5135         /* Event specific data */
5136         uint32_t        event_data2;
5137         uint8_t opaque_v;
5138         /*
5139          * This value is written by the NIC such that it will be different
5140          * for each pass through the completion queue.   The even passes
5141          * will write 1.  The odd passes will write 0.
5142          */
5143         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_V          UINT32_C(0x1)
5144         /* opaque is 7 b */
5145         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_MASK UINT32_C(0xfe)
5146         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_OPAQUE_SFT 1
5147         /*
5148          * 8-lsb timestamp (100-msec resolution)
5149          * The Minimum time required for the Firmware readiness after sending this
5150          * notification to the driver instances.
5151          */
5152         uint8_t timestamp_lo;
5153         /*
5154          * 16-lsb timestamp (100-msec resolution)
5155          * The Maximum Firmware Reset bail out value in the order of 100
5156          * milli seconds. The driver instances will use this value to re-initiate the
5157          * registration process again if the core firmware didn’t set the ready
5158          * state bit.
5159          */
5160         uint16_t        timestamp_hi;
5161         /* Event specific data */
5162         uint32_t        event_data1;
5163         /* Indicates driver action requested */
5164         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_MASK \
5165                 UINT32_C(0xff)
5166         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_SFT \
5167                 0
5168         /*
5169          * If set to 1, it indicates that the l2 client should
5170          * stop sending in band traffic to Nitro.
5171          * if set to 0, there is no change in L2 client behavior.
5172          */
5173         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_STOP_TX_QUEUE \
5174                 UINT32_C(0x1)
5175         /*
5176          * If set to 1, it indicates that the L2 client should
5177          * bring down the interface.
5178          * If set to 0, then there is no change in L2 client behavior.
5179          */
5180         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN \
5181                 UINT32_C(0x2)
5182         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_LAST \
5183                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DRIVER_ACTION_DRIVER_IFDOWN
5184         /* Indicates reason for reset. */
5185         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MASK \
5186                 UINT32_C(0xff00)
5187         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_SFT \
5188                 8
5189         /* A management client has requested reset. */
5190         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_MANAGEMENT_RESET_REQUEST \
5191                 (UINT32_C(0x1) << 8)
5192         /* A fatal firmware exception has occurred. */
5193         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL \
5194                 (UINT32_C(0x2) << 8)
5195         /* A non-fatal firmware exception has occurred. */
5196         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL \
5197                 (UINT32_C(0x3) << 8)
5198         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_LAST \
5199                 HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_REASON_CODE_FW_EXCEPTION_NON_FATAL
5200         /*
5201          * Minimum time before driver should attempt access - units 100ms ticks.
5202          * Range 0-65535
5203          */
5204         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_MASK \
5205                 UINT32_C(0xffff0000)
5206         #define HWRM_ASYNC_EVENT_CMPL_RESET_NOTIFY_EVENT_DATA1_DELAY_IN_100MS_TICKS_SFT \
5207                 16
5208 } __attribute__((packed));
5209
5210 /* hwrm_async_event_cmpl_error_recovery (size:128b/16B) */
5211 struct hwrm_async_event_cmpl_error_recovery {
5212         uint16_t        type;
5213         /*
5214          * This field indicates the exact type of the completion.
5215          * By convention, the LSB identifies the length of the
5216          * record in 16B units.  Even values indicate 16B
5217          * records.  Odd values indicate 32B
5218          * records.
5219          */
5220         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_MASK \
5221                 UINT32_C(0x3f)
5222         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_SFT             0
5223         /* HWRM Asynchronous Event Information */
5224         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT \
5225                 UINT32_C(0x2e)
5226         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_LAST \
5227                 HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_TYPE_HWRM_ASYNC_EVENT
5228         /* Identifiers of events. */
5229         uint16_t        event_id;
5230         /*
5231          * This async notification message can be used for selecting or
5232          * deselecting master function for error recovery,
5233          * and to communicate to all the functions whether error recovery
5234          * was enabled/disabled.
5235          */
5236         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY \
5237                 UINT32_C(0x9)
5238         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_LAST \
5239                 HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_ID_ERROR_RECOVERY
5240         /* Event specific data */
5241         uint32_t        event_data2;
5242         uint8_t opaque_v;
5243         /*
5244          * This value is written by the NIC such that it will be different
5245          * for each pass through the completion queue.   The even passes
5246          * will write 1.  The odd passes will write 0.
5247          */
5248         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_V          UINT32_C(0x1)
5249         /* opaque is 7 b */
5250         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_MASK UINT32_C(0xfe)
5251         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_OPAQUE_SFT 1
5252         /* 8-lsb timestamp (100-msec resolution) */
5253         uint8_t timestamp_lo;
5254         /* 16-lsb timestamp (100-msec resolution) */
5255         uint16_t        timestamp_hi;
5256         /* Event specific data */
5257         uint32_t        event_data1;
5258         /* Indicates driver action requested */
5259         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASK \
5260                 UINT32_C(0xff)
5261         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_SFT \
5262                 0
5263         /*
5264          * If set to 1, this function is selected as Master function.
5265          * This function has responsibility to do 'chip reset' when it
5266          * detects a fatal error. If set to 0, master function functionality
5267          * is disabled on this function.
5268          */
5269         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_MASTER_FUNC \
5270                 UINT32_C(0x1)
5271         /*
5272          * If set to 1, error recovery is enabled.
5273          * If set to 0, error recovery is disabled.
5274          */
5275         #define HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED \
5276                 UINT32_C(0x2)
5277 } __attribute__((packed));
5278
5279 /* hwrm_async_event_cmpl_func_drvr_unload (size:128b/16B) */
5280 struct hwrm_async_event_cmpl_func_drvr_unload {
5281         uint16_t        type;
5282         /*
5283          * This field indicates the exact type of the completion.
5284          * By convention, the LSB identifies the length of the
5285          * record in 16B units.  Even values indicate 16B
5286          * records.  Odd values indicate 32B
5287          * records.
5288          */
5289         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK \
5290                 UINT32_C(0x3f)
5291         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT             0
5292         /* HWRM Asynchronous Event Information */
5293         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \
5294                 UINT32_C(0x2e)
5295         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_LAST \
5296                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
5297         /* Identifiers of events. */
5298         uint16_t        event_id;
5299         /* Function driver unloaded */
5300         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD \
5301                 UINT32_C(0x10)
5302         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_LAST \
5303                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD
5304         /* Event specific data */
5305         uint32_t        event_data2;
5306         uint8_t opaque_v;
5307         /*
5308          * This value is written by the NIC such that it will be different
5309          * for each pass through the completion queue.   The even passes
5310          * will write 1.  The odd passes will write 0.
5311          */
5312         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V          UINT32_C(0x1)
5313         /* opaque is 7 b */
5314         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK \
5315                 UINT32_C(0xfe)
5316         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT 1
5317         /* 8-lsb timestamp from POR (100-msec resolution) */
5318         uint8_t timestamp_lo;
5319         /* 16-lsb timestamp from POR (100-msec resolution) */
5320         uint16_t        timestamp_hi;
5321         /* Event specific data */
5322         uint32_t        event_data1;
5323         /* Function ID */
5324         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \
5325                 UINT32_C(0xffff)
5326         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT \
5327                 0
5328 } __attribute__((packed));
5329
5330 /* hwrm_async_event_cmpl_func_drvr_load (size:128b/16B) */
5331 struct hwrm_async_event_cmpl_func_drvr_load {
5332         uint16_t        type;
5333         /*
5334          * This field indicates the exact type of the completion.
5335          * By convention, the LSB identifies the length of the
5336          * record in 16B units.  Even values indicate 16B
5337          * records.  Odd values indicate 32B
5338          * records.
5339          */
5340         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK \
5341                 UINT32_C(0x3f)
5342         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT             0
5343         /* HWRM Asynchronous Event Information */
5344         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \
5345                 UINT32_C(0x2e)
5346         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_LAST \
5347                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
5348         /* Identifiers of events. */
5349         uint16_t        event_id;
5350         /* Function driver loaded */
5351         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD \
5352                 UINT32_C(0x11)
5353         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_LAST \
5354                 HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD
5355         /* Event specific data */
5356         uint32_t        event_data2;
5357         uint8_t opaque_v;
5358         /*
5359          * This value is written by the NIC such that it will be different
5360          * for each pass through the completion queue.   The even passes
5361          * will write 1.  The odd passes will write 0.
5362          */
5363         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V          UINT32_C(0x1)
5364         /* opaque is 7 b */
5365         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
5366         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT 1
5367         /* 8-lsb timestamp from POR (100-msec resolution) */
5368         uint8_t timestamp_lo;
5369         /* 16-lsb timestamp from POR (100-msec resolution) */
5370         uint16_t        timestamp_hi;
5371         /* Event specific data */
5372         uint32_t        event_data1;
5373         /* Function ID */
5374         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
5375                 UINT32_C(0xffff)
5376         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
5377 } __attribute__((packed));
5378
5379 /* hwrm_async_event_cmpl_func_flr_proc_cmplt (size:128b/16B) */
5380 struct hwrm_async_event_cmpl_func_flr_proc_cmplt {
5381         uint16_t        type;
5382         /*
5383          * This field indicates the exact type of the completion.
5384          * By convention, the LSB identifies the length of the
5385          * record in 16B units.  Even values indicate 16B
5386          * records.  Odd values indicate 32B
5387          * records.
5388          */
5389         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_MASK \
5390                 UINT32_C(0x3f)
5391         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_SFT \
5392                 0
5393         /* HWRM Asynchronous Event Information */
5394         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT \
5395                 UINT32_C(0x2e)
5396         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_LAST \
5397                 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_TYPE_HWRM_ASYNC_EVENT
5398         /* Identifiers of events. */
5399         uint16_t        event_id;
5400         /* Function FLR related processing has completed */
5401         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT \
5402                 UINT32_C(0x12)
5403         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_LAST \
5404                 HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_ID_FUNC_FLR_PROC_CMPLT
5405         /* Event specific data */
5406         uint32_t        event_data2;
5407         uint8_t opaque_v;
5408         /*
5409          * This value is written by the NIC such that it will be different
5410          * for each pass through the completion queue.   The even passes
5411          * will write 1.  The odd passes will write 0.
5412          */
5413         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_V \
5414                 UINT32_C(0x1)
5415         /* opaque is 7 b */
5416         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_MASK \
5417                 UINT32_C(0xfe)
5418         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_OPAQUE_SFT 1
5419         /* 8-lsb timestamp from POR (100-msec resolution) */
5420         uint8_t timestamp_lo;
5421         /* 16-lsb timestamp from POR (100-msec resolution) */
5422         uint16_t        timestamp_hi;
5423         /* Event specific data */
5424         uint32_t        event_data1;
5425         /* Function ID */
5426         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_MASK \
5427                 UINT32_C(0xffff)
5428         #define HWRM_ASYNC_EVENT_CMPL_FUNC_FLR_PROC_CMPLT_EVENT_DATA1_FUNC_ID_SFT \
5429                 0
5430 } __attribute__((packed));
5431
5432 /* hwrm_async_event_cmpl_pf_drvr_unload (size:128b/16B) */
5433 struct hwrm_async_event_cmpl_pf_drvr_unload {
5434         uint16_t        type;
5435         /*
5436          * This field indicates the exact type of the completion.
5437          * By convention, the LSB identifies the length of the
5438          * record in 16B units.  Even values indicate 16B
5439          * records.  Odd values indicate 32B
5440          * records.
5441          */
5442         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK \
5443                 UINT32_C(0x3f)
5444         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT             0
5445         /* HWRM Asynchronous Event Information */
5446         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT \
5447                 UINT32_C(0x2e)
5448         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_LAST \
5449                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT
5450         /* Identifiers of events. */
5451         uint16_t        event_id;
5452         /* PF driver unloaded */
5453         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD \
5454                 UINT32_C(0x20)
5455         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_LAST \
5456                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD
5457         /* Event specific data */
5458         uint32_t        event_data2;
5459         uint8_t opaque_v;
5460         /*
5461          * This value is written by the NIC such that it will be different
5462          * for each pass through the completion queue.   The even passes
5463          * will write 1.  The odd passes will write 0.
5464          */
5465         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V          UINT32_C(0x1)
5466         /* opaque is 7 b */
5467         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK UINT32_C(0xfe)
5468         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT 1
5469         /* 8-lsb timestamp from POR (100-msec resolution) */
5470         uint8_t timestamp_lo;
5471         /* 16-lsb timestamp from POR (100-msec resolution) */
5472         uint16_t        timestamp_hi;
5473         /* Event specific data */
5474         uint32_t        event_data1;
5475         /* PF ID */
5476         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK \
5477                 UINT32_C(0xffff)
5478         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
5479         /* Indicates the physical port this pf belongs to */
5480         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK \
5481                 UINT32_C(0x70000)
5482         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT    16
5483 } __attribute__((packed));
5484
5485 /* hwrm_async_event_cmpl_pf_drvr_load (size:128b/16B) */
5486 struct hwrm_async_event_cmpl_pf_drvr_load {
5487         uint16_t        type;
5488         /*
5489          * This field indicates the exact type of the completion.
5490          * By convention, the LSB identifies the length of the
5491          * record in 16B units.  Even values indicate 16B
5492          * records.  Odd values indicate 32B
5493          * records.
5494          */
5495         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK \
5496                 UINT32_C(0x3f)
5497         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT             0
5498         /* HWRM Asynchronous Event Information */
5499         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT \
5500                 UINT32_C(0x2e)
5501         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_LAST \
5502                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT
5503         /* Identifiers of events. */
5504         uint16_t        event_id;
5505         /* PF driver loaded */
5506         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD \
5507                 UINT32_C(0x21)
5508         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_LAST \
5509                 HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD
5510         /* Event specific data */
5511         uint32_t        event_data2;
5512         uint8_t opaque_v;
5513         /*
5514          * This value is written by the NIC such that it will be different
5515          * for each pass through the completion queue.   The even passes
5516          * will write 1.  The odd passes will write 0.
5517          */
5518         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V          UINT32_C(0x1)
5519         /* opaque is 7 b */
5520         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK UINT32_C(0xfe)
5521         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT 1
5522         /* 8-lsb timestamp from POR (100-msec resolution) */
5523         uint8_t timestamp_lo;
5524         /* 16-lsb timestamp from POR (100-msec resolution) */
5525         uint16_t        timestamp_hi;
5526         /* Event specific data */
5527         uint32_t        event_data1;
5528         /* PF ID */
5529         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK \
5530                 UINT32_C(0xffff)
5531         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
5532         /* Indicates the physical port this pf belongs to */
5533         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK \
5534                 UINT32_C(0x70000)
5535         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT    16
5536 } __attribute__((packed));
5537
5538 /* hwrm_async_event_cmpl_vf_flr (size:128b/16B) */
5539 struct hwrm_async_event_cmpl_vf_flr {
5540         uint16_t        type;
5541         /*
5542          * This field indicates the exact type of the completion.
5543          * By convention, the LSB identifies the length of the
5544          * record in 16B units.  Even values indicate 16B
5545          * records.  Odd values indicate 32B
5546          * records.
5547          */
5548         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK \
5549                 UINT32_C(0x3f)
5550         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT             0
5551         /* HWRM Asynchronous Event Information */
5552         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT \
5553                 UINT32_C(0x2e)
5554         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_LAST \
5555                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT
5556         /* Identifiers of events. */
5557         uint16_t        event_id;
5558         /* VF Function Level Reset (FLR) */
5559         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR UINT32_C(0x30)
5560         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_LAST \
5561                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR
5562         /* Event specific data */
5563         uint32_t        event_data2;
5564         uint8_t opaque_v;
5565         /*
5566          * This value is written by the NIC such that it will be different
5567          * for each pass through the completion queue.   The even passes
5568          * will write 1.  The odd passes will write 0.
5569          */
5570         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V          UINT32_C(0x1)
5571         /* opaque is 7 b */
5572         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK UINT32_C(0xfe)
5573         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT 1
5574         /* 8-lsb timestamp from POR (100-msec resolution) */
5575         uint8_t timestamp_lo;
5576         /* 16-lsb timestamp from POR (100-msec resolution) */
5577         uint16_t        timestamp_hi;
5578         /* Event specific data */
5579         uint32_t        event_data1;
5580         /* VF ID */
5581         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK \
5582                 UINT32_C(0xffff)
5583         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
5584         /* Indicates the physical function this event occurred on. */
5585         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK \
5586                 UINT32_C(0xff0000)
5587         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT 16
5588 } __attribute__((packed));
5589
5590 /* hwrm_async_event_cmpl_vf_mac_addr_change (size:128b/16B) */
5591 struct hwrm_async_event_cmpl_vf_mac_addr_change {
5592         uint16_t        type;
5593         /*
5594          * This field indicates the exact type of the completion.
5595          * By convention, the LSB identifies the length of the
5596          * record in 16B units.  Even values indicate 16B
5597          * records.  Odd values indicate 32B
5598          * records.
5599          */
5600         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK \
5601                 UINT32_C(0x3f)
5602         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT             0
5603         /* HWRM Asynchronous Event Information */
5604         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT \
5605                 UINT32_C(0x2e)
5606         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_LAST \
5607                 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT
5608         /* Identifiers of events. */
5609         uint16_t        event_id;
5610         /* VF MAC Address Change */
5611         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE \
5612                 UINT32_C(0x31)
5613         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_LAST \
5614                 HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE
5615         /* Event specific data */
5616         uint32_t        event_data2;
5617         uint8_t opaque_v;
5618         /*
5619          * This value is written by the NIC such that it will be different
5620          * for each pass through the completion queue.   The even passes
5621          * will write 1.  The odd passes will write 0.
5622          */
5623         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V \
5624                 UINT32_C(0x1)
5625         /* opaque is 7 b */
5626         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK \
5627                 UINT32_C(0xfe)
5628         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
5629         /* 8-lsb timestamp from POR (100-msec resolution) */
5630         uint8_t timestamp_lo;
5631         /* 16-lsb timestamp from POR (100-msec resolution) */
5632         uint16_t        timestamp_hi;
5633         /* Event specific data */
5634         uint32_t        event_data1;
5635         /* VF ID */
5636         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK \
5637                 UINT32_C(0xffff)
5638         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT \
5639                 0
5640 } __attribute__((packed));
5641
5642 /* hwrm_async_event_cmpl_pf_vf_comm_status_change (size:128b/16B) */
5643 struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
5644         uint16_t        type;
5645         /*
5646          * This field indicates the exact type of the completion.
5647          * By convention, the LSB identifies the length of the
5648          * record in 16B units.  Even values indicate 16B
5649          * records.  Odd values indicate 32B
5650          * records.
5651          */
5652         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK \
5653                 UINT32_C(0x3f)
5654         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT \
5655                 0
5656         /* HWRM Asynchronous Event Information */
5657         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT \
5658                 UINT32_C(0x2e)
5659         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_LAST \
5660                 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT
5661         /* Identifiers of events. */
5662         uint16_t        event_id;
5663         /* PF-VF communication channel status change. */
5664         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
5665                 UINT32_C(0x32)
5666         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_LAST \
5667                 HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE
5668         /* Event specific data */
5669         uint32_t        event_data2;
5670         uint8_t opaque_v;
5671         /*
5672          * This value is written by the NIC such that it will be different
5673          * for each pass through the completion queue.   The even passes
5674          * will write 1.  The odd passes will write 0.
5675          */
5676         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V \
5677                 UINT32_C(0x1)
5678         /* opaque is 7 b */
5679         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK \
5680                 UINT32_C(0xfe)
5681         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1
5682         /* 8-lsb timestamp from POR (100-msec resolution) */
5683         uint8_t timestamp_lo;
5684         /* 16-lsb timestamp from POR (100-msec resolution) */
5685         uint16_t        timestamp_hi;
5686         /* Event specific data */
5687         uint32_t        event_data1;
5688         /*
5689          * If this bit is set to 1, then it indicates that the PF-VF
5690          * communication was lost and it is established.
5691          * If this bit set to 0, then it indicates that the PF-VF
5692          * communication was established and it is lost.
5693          */
5694         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED \
5695                 UINT32_C(0x1)
5696 } __attribute__((packed));
5697
5698 /* hwrm_async_event_cmpl_vf_cfg_change (size:128b/16B) */
5699 struct hwrm_async_event_cmpl_vf_cfg_change {
5700         uint16_t        type;
5701         /*
5702          * This field indicates the exact type of the completion.
5703          * By convention, the LSB identifies the length of the
5704          * record in 16B units.  Even values indicate 16B
5705          * records.  Odd values indicate 32B
5706          * records.
5707          */
5708         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK \
5709                 UINT32_C(0x3f)
5710         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT             0
5711         /* HWRM Asynchronous Event Information */
5712         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
5713                 UINT32_C(0x2e)
5714         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_LAST \
5715                 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
5716         /* Identifiers of events. */
5717         uint16_t        event_id;
5718         /* VF Configuration Change */
5719         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE \
5720                 UINT32_C(0x33)
5721         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_LAST \
5722                 HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE
5723         /* Event specific data */
5724         uint32_t        event_data2;
5725         uint8_t opaque_v;
5726         /*
5727          * This value is written by the NIC such that it will be different
5728          * for each pass through the completion queue.   The even passes
5729          * will write 1.  The odd passes will write 0.
5730          */
5731         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V          UINT32_C(0x1)
5732         /* opaque is 7 b */
5733         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
5734         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT 1
5735         /* 8-lsb timestamp from POR (100-msec resolution) */
5736         uint8_t timestamp_lo;
5737         /* 16-lsb timestamp from POR (100-msec resolution) */
5738         uint16_t        timestamp_hi;
5739         /*
5740          * Each flag provided in this field indicates a specific VF
5741          * configuration change. At least one of these flags shall be set to 1
5742          * when an asynchronous event completion of this type is provided
5743          * by the HWRM.
5744          */
5745         uint32_t        event_data1;
5746         /*
5747          * If this bit is set to 1, then the value of MTU
5748          * was changed on this VF.
5749          * If set to 0, then this bit should be ignored.
5750          */
5751         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE \
5752                 UINT32_C(0x1)
5753         /*
5754          * If this bit is set to 1, then the value of MRU
5755          * was changed on this VF.
5756          * If set to 0, then this bit should be ignored.
5757          */
5758         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE \
5759                 UINT32_C(0x2)
5760         /*
5761          * If this bit is set to 1, then the value of default MAC
5762          * address was changed on this VF.
5763          * If set to 0, then this bit should be ignored.
5764          */
5765         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE \
5766                 UINT32_C(0x4)
5767         /*
5768          * If this bit is set to 1, then the value of default VLAN
5769          * was changed on this VF.
5770          * If set to 0, then this bit should be ignored.
5771          */
5772         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE \
5773                 UINT32_C(0x8)
5774         /*
5775          * If this bit is set to 1, then the value of trusted VF enable
5776          * was changed on this VF.
5777          * If set to 0, then this bit should be ignored.
5778          */
5779         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE \
5780                 UINT32_C(0x10)
5781 } __attribute__((packed));
5782
5783 /* hwrm_async_event_cmpl_llfc_pfc_change (size:128b/16B) */
5784 struct hwrm_async_event_cmpl_llfc_pfc_change {
5785         uint16_t        type;
5786         /*
5787          * This field indicates the exact type of the completion.
5788          * By convention, the LSB identifies the length of the
5789          * record in 16B units.  Even values indicate 16B
5790          * records.  Odd values indicate 32B
5791          * records.
5792          */
5793         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_MASK \
5794                 UINT32_C(0x3f)
5795         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_SFT             0
5796         /* HWRM Asynchronous Event Information */
5797         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT \
5798                 UINT32_C(0x2e)
5799         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_LAST \
5800                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_TYPE_HWRM_ASYNC_EVENT
5801         /* unused1 is 10 b */
5802         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_MASK \
5803                 UINT32_C(0xffc0)
5804         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_UNUSED1_SFT          6
5805         /* Identifiers of events. */
5806         uint16_t        event_id;
5807         /* LLFC/PFC Configuration Change */
5808         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE \
5809                 UINT32_C(0x34)
5810         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LAST \
5811                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_ID_LLFC_PFC_CHANGE
5812         /* Event specific data */
5813         uint32_t        event_data2;
5814         uint8_t opaque_v;
5815         /*
5816          * This value is written by the NIC such that it will be different
5817          * for each pass through the completion queue.   The even passes
5818          * will write 1.  The odd passes will write 0.
5819          */
5820         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_V          UINT32_C(0x1)
5821         /* opaque is 7 b */
5822         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_MASK \
5823                 UINT32_C(0xfe)
5824         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_OPAQUE_SFT 1
5825         /* 8-lsb timestamp from POR (100-msec resolution) */
5826         uint8_t timestamp_lo;
5827         /* 16-lsb timestamp from POR (100-msec resolution) */
5828         uint16_t        timestamp_hi;
5829         /* Event specific data */
5830         uint32_t        event_data1;
5831         /* Indicates llfc pfc status change */
5832         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_MASK \
5833                 UINT32_C(0x3)
5834         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_SFT \
5835                 0
5836         /*
5837          * If this field set to 1, then it indicates that llfc is
5838          * enabled.
5839          */
5840         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LLFC \
5841                 UINT32_C(0x1)
5842         /*
5843          * If this field is set to 2, then it indicates that pfc
5844          * is enabled.
5845          */
5846         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC \
5847                 UINT32_C(0x2)
5848         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_LAST \
5849                 HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_LLFC_PFC_PFC
5850         /* Indicates the physical port this llfc pfc change occur */
5851         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_MASK \
5852                 UINT32_C(0x1c)
5853         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_SFT \
5854                 2
5855         /* PORT ID */
5856         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_MASK \
5857                 UINT32_C(0x1fffe0)
5858         #define HWRM_ASYNC_EVENT_CMPL_LLFC_PFC_CHANGE_EVENT_DATA1_PORT_ID_SFT \
5859                 5
5860 } __attribute__((packed));
5861
5862 /* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */
5863 struct hwrm_async_event_cmpl_default_vnic_change {
5864         uint16_t        type;
5865         /*
5866          * This field indicates the exact type of the completion.
5867          * By convention, the LSB identifies the length of the
5868          * record in 16B units.  Even values indicate 16B
5869          * records.  Odd values indicate 32B
5870          * records.
5871          */
5872         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_MASK \
5873                 UINT32_C(0x3f)
5874         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_SFT \
5875                 0
5876         /* HWRM Asynchronous Event Information */
5877         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT \
5878                 UINT32_C(0x2e)
5879         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_LAST \
5880                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_TYPE_HWRM_ASYNC_EVENT
5881         /* unused1 is 10 b */
5882         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_MASK \
5883                 UINT32_C(0xffc0)
5884         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_UNUSED1_SFT \
5885                 6
5886         /* Identifiers of events. */
5887         uint16_t        event_id;
5888         /* Notification of a default vnic allocaiton or free */
5889         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION \
5890                 UINT32_C(0x35)
5891         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_LAST \
5892                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_ID_ALLOC_FREE_NOTIFICATION
5893         /* Event specific data */
5894         uint32_t        event_data2;
5895         uint8_t opaque_v;
5896         /*
5897          * This value is written by the NIC such that it will be different
5898          * for each pass through the completion queue.   The even passes
5899          * will write 1.  The odd passes will write 0.
5900          */
5901         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_V \
5902                 UINT32_C(0x1)
5903         /* opaque is 7 b */
5904         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_MASK \
5905                 UINT32_C(0xfe)
5906         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_OPAQUE_SFT 1
5907         /* 8-lsb timestamp from POR (100-msec resolution) */
5908         uint8_t timestamp_lo;
5909         /* 16-lsb timestamp from POR (100-msec resolution) */
5910         uint16_t        timestamp_hi;
5911         /* Event specific data */
5912         uint32_t        event_data1;
5913         /* Indicates default vnic configuration change */
5914         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_MASK \
5915                 UINT32_C(0x3)
5916         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_SFT \
5917                 0
5918         /*
5919          * If this field is set to 1, then it indicates that
5920          * a default VNIC has been allocate.
5921          */
5922         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_ALLOC \
5923                 UINT32_C(0x1)
5924         /*
5925          * If this field is set to 2, then it indicates that
5926          * a default VNIC has been freed.
5927          */
5928         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE \
5929                 UINT32_C(0x2)
5930         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_LAST \
5931                 HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_DEF_VNIC_STATE_DEF_VNIC_FREE
5932         /* Indicates the physical function this event occurred on. */
5933         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_MASK \
5934                 UINT32_C(0x3fc)
5935         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_PF_ID_SFT \
5936                 2
5937         /* Indicates the virtual function this event occurred on */
5938         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_MASK \
5939                 UINT32_C(0x3fffc00)
5940         #define HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT \
5941                 10
5942 } __attribute__((packed));
5943
5944 /* hwrm_async_event_cmpl_hw_flow_aged (size:128b/16B) */
5945 struct hwrm_async_event_cmpl_hw_flow_aged {
5946         uint16_t        type;
5947         /*
5948          * This field indicates the exact type of the completion.
5949          * By convention, the LSB identifies the length of the
5950          * record in 16B units.  Even values indicate 16B
5951          * records.  Odd values indicate 32B
5952          * records.
5953          */
5954         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_MASK \
5955                 UINT32_C(0x3f)
5956         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_SFT             0
5957         /* HWRM Asynchronous Event Information */
5958         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT \
5959                 UINT32_C(0x2e)
5960         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_LAST \
5961                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_TYPE_HWRM_ASYNC_EVENT
5962         /* Identifiers of events. */
5963         uint16_t        event_id;
5964         /* Notification of a hw flow aged */
5965         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED \
5966                 UINT32_C(0x36)
5967         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_LAST \
5968                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_ID_HW_FLOW_AGED
5969         /* Event specific data */
5970         uint32_t        event_data2;
5971         uint8_t opaque_v;
5972         /*
5973          * This value is written by the NIC such that it will be different
5974          * for each pass through the completion queue.   The even passes
5975          * will write 1.  The odd passes will write 0.
5976          */
5977         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_V          UINT32_C(0x1)
5978         /* opaque is 7 b */
5979         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_MASK UINT32_C(0xfe)
5980         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_OPAQUE_SFT 1
5981         /* 8-lsb timestamp from POR (100-msec resolution) */
5982         uint8_t timestamp_lo;
5983         /* 16-lsb timestamp from POR (100-msec resolution) */
5984         uint16_t        timestamp_hi;
5985         /* Event specific data */
5986         uint32_t        event_data1;
5987         /* Indicates flow ID this event occurred on. */
5988         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_MASK \
5989                 UINT32_C(0x7fffffff)
5990         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_ID_SFT \
5991                 0
5992         /* Indicates flow direction this event occurred on. */
5993         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION \
5994                 UINT32_C(0x80000000)
5995         /*
5996          * If this bit set to 0, then it indicates that the aged
5997          * event was rx flow.
5998          */
5999         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_RX \
6000                 (UINT32_C(0x0) << 31)
6001         /*
6002          * If this bit is set to 1, then it indicates that the aged
6003          * event was tx flow.
6004          */
6005         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX \
6006                 (UINT32_C(0x1) << 31)
6007         #define HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_LAST \
6008                 HWRM_ASYNC_EVENT_CMPL_HW_FLOW_AGED_EVENT_DATA1_FLOW_DIRECTION_TX
6009 } __attribute__((packed));
6010
6011 /* hwrm_async_event_cmpl_eem_cache_flush_req (size:128b/16B) */
6012 struct hwrm_async_event_cmpl_eem_cache_flush_req {
6013         uint16_t        type;
6014         /*
6015          * This field indicates the exact type of the completion.
6016          * By convention, the LSB identifies the length of the
6017          * record in 16B units.  Even values indicate 16B
6018          * records.  Odd values indicate 32B
6019          * records.
6020          */
6021         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_MASK \
6022                 UINT32_C(0x3f)
6023         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_SFT \
6024                 0
6025         /* HWRM Asynchronous Event Information */
6026         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT \
6027                 UINT32_C(0x2e)
6028         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_LAST \
6029                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_TYPE_HWRM_ASYNC_EVENT
6030         /* Identifiers of events. */
6031         uint16_t        event_id;
6032         /* Notification of a eem_cache_flush request */
6033         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ \
6034                 UINT32_C(0x38)
6035         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_LAST \
6036                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_EVENT_ID_EEM_CACHE_FLUSH_REQ
6037         /* Event specific data */
6038         uint32_t        event_data2;
6039         uint8_t opaque_v;
6040         /*
6041          * This value is written by the NIC such that it will be different
6042          * for each pass through the completion queue.   The even passes
6043          * will write 1.  The odd passes will write 0.
6044          */
6045         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_V \
6046                 UINT32_C(0x1)
6047         /* opaque is 7 b */
6048         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_MASK \
6049                 UINT32_C(0xfe)
6050         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_REQ_OPAQUE_SFT 1
6051         /* 8-lsb timestamp from POR (100-msec resolution) */
6052         uint8_t timestamp_lo;
6053         /* 16-lsb timestamp from POR (100-msec resolution) */
6054         uint16_t        timestamp_hi;
6055         /* Event specific data */
6056         uint32_t        event_data1;
6057 } __attribute__((packed));
6058
6059 /* hwrm_async_event_cmpl_eem_cache_flush_done (size:128b/16B) */
6060 struct hwrm_async_event_cmpl_eem_cache_flush_done {
6061         uint16_t        type;
6062         /*
6063          * This field indicates the exact type of the completion.
6064          * By convention, the LSB identifies the length of the
6065          * record in 16B units.  Even values indicate 16B
6066          * records.  Odd values indicate 32B
6067          * records.
6068          */
6069         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_MASK \
6070                 UINT32_C(0x3f)
6071         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_SFT \
6072                 0
6073         /* HWRM Asynchronous Event Information */
6074         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT \
6075                 UINT32_C(0x2e)
6076         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_LAST \
6077                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_TYPE_HWRM_ASYNC_EVENT
6078         /* Identifiers of events. */
6079         uint16_t        event_id;
6080         /*
6081          * Notification of a host eem_cache_flush has completed. This event
6082          * is generated by the host driver.
6083          */
6084         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE \
6085                 UINT32_C(0x39)
6086         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_LAST \
6087                 HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_ID_EEM_CACHE_FLUSH_DONE
6088         /* Event specific data */
6089         uint32_t        event_data2;
6090         uint8_t opaque_v;
6091         /*
6092          * This value is written by the NIC such that it will be different
6093          * for each pass through the completion queue.   The even passes
6094          * will write 1.  The odd passes will write 0.
6095          */
6096         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_V \
6097                 UINT32_C(0x1)
6098         /* opaque is 7 b */
6099         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_MASK \
6100                 UINT32_C(0xfe)
6101         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_OPAQUE_SFT 1
6102         /* 8-lsb timestamp from POR (100-msec resolution) */
6103         uint8_t timestamp_lo;
6104         /* 16-lsb timestamp from POR (100-msec resolution) */
6105         uint16_t        timestamp_hi;
6106         /* Event specific data */
6107         uint32_t        event_data1;
6108         /* Indicates function ID that this event occurred on. */
6109         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_MASK \
6110                 UINT32_C(0xffff)
6111         #define HWRM_ASYNC_EVENT_CMPL_EEM_CACHE_FLUSH_DONE_EVENT_DATA1_FID_SFT \
6112                 0
6113 } __attribute__((packed));
6114
6115 /* hwrm_async_event_cmpl_tcp_flag_action_change (size:128b/16B) */
6116 struct hwrm_async_event_cmpl_tcp_flag_action_change {
6117         uint16_t        type;
6118         /*
6119          * This field indicates the exact type of the completion.
6120          * By convention, the LSB identifies the length of the
6121          * record in 16B units.  Even values indicate 16B
6122          * records.  Odd values indicate 32B
6123          * records.
6124          */
6125         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_MASK \
6126                 UINT32_C(0x3f)
6127         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_SFT \
6128                 0
6129         /* HWRM Asynchronous Event Information */
6130         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT \
6131                 UINT32_C(0x2e)
6132         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_LAST \
6133                 HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_TYPE_HWRM_ASYNC_EVENT
6134         /* Identifiers of events. */
6135         uint16_t        event_id;
6136         /* Notification of tcp flag action change */
6137         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE \
6138                 UINT32_C(0x3a)
6139         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_LAST \
6140                 HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_EVENT_ID_TCP_FLAG_ACTION_CHANGE
6141         /* Event specific data */
6142         uint32_t        event_data2;
6143         uint8_t opaque_v;
6144         /*
6145          * This value is written by the NIC such that it will be different
6146          * for each pass through the completion queue.   The even passes
6147          * will write 1.  The odd passes will write 0.
6148          */
6149         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_V \
6150                 UINT32_C(0x1)
6151         /* opaque is 7 b */
6152         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_MASK \
6153                 UINT32_C(0xfe)
6154         #define HWRM_ASYNC_EVENT_CMPL_TCP_FLAG_ACTION_CHANGE_OPAQUE_SFT 1
6155         /* 8-lsb timestamp from POR (100-msec resolution) */
6156         uint8_t timestamp_lo;
6157         /* 16-lsb timestamp from POR (100-msec resolution) */
6158         uint16_t        timestamp_hi;
6159         /* Event specific data */
6160         uint32_t        event_data1;
6161 } __attribute__((packed));
6162
6163 /* hwrm_async_event_cmpl_eem_flow_active (size:128b/16B) */
6164 struct hwrm_async_event_cmpl_eem_flow_active {
6165         uint16_t        type;
6166         /*
6167          * This field indicates the exact type of the completion.
6168          * By convention, the LSB identifies the length of the
6169          * record in 16B units.  Even values indicate 16B
6170          * records.  Odd values indicate 32B
6171          * records.
6172          */
6173         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_MASK \
6174                 UINT32_C(0x3f)
6175         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_SFT             0
6176         /* HWRM Asynchronous Event Information */
6177         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT \
6178                 UINT32_C(0x2e)
6179         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_LAST \
6180                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_TYPE_HWRM_ASYNC_EVENT
6181         /* Identifiers of events. */
6182         uint16_t        event_id;
6183         /* Notification of an active eem flow */
6184         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE \
6185                 UINT32_C(0x3b)
6186         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_LAST \
6187                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_ID_EEM_FLOW_ACTIVE
6188         /* Event specific data */
6189         uint32_t        event_data2;
6190         /* Indicates the 2nd global id this event occurred on. */
6191         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_MASK \
6192                 UINT32_C(0x3fffffff)
6193         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_GLOBAL_ID_2_SFT \
6194                 0
6195         /*
6196          * Indicates flow direction of the flow identified by
6197          * the global_id_2.
6198          */
6199         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION \
6200                 UINT32_C(0x40000000)
6201         /* If this bit is set to 0, then it indicates that this rx flow. */
6202         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_RX \
6203                 (UINT32_C(0x0) << 30)
6204         /* If this bit is set to 1, then it indicates that this tx flow. */
6205         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX \
6206                 (UINT32_C(0x1) << 30)
6207         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_LAST \
6208                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA2_FLOW_DIRECTION_TX
6209         uint8_t opaque_v;
6210         /*
6211          * This value is written by the NIC such that it will be different
6212          * for each pass through the completion queue.   The even passes
6213          * will write 1.  The odd passes will write 0.
6214          */
6215         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_V          UINT32_C(0x1)
6216         /* opaque is 7 b */
6217         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_MASK \
6218                 UINT32_C(0xfe)
6219         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_OPAQUE_SFT 1
6220         /* 8-lsb timestamp from POR (100-msec resolution) */
6221         uint8_t timestamp_lo;
6222         /* 16-lsb timestamp from POR (100-msec resolution) */
6223         uint16_t        timestamp_hi;
6224         /* Event specific data */
6225         uint32_t        event_data1;
6226         /* Indicates the 1st global id this event occurred on. */
6227         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_MASK \
6228                 UINT32_C(0x3fffffff)
6229         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_GLOBAL_ID_1_SFT \
6230                 0
6231         /*
6232          * Indicates flow direction of the flow identified by the
6233          * global_id_1.
6234          */
6235         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION \
6236                 UINT32_C(0x40000000)
6237         /* If this bit is set to 0, then it indicates that this is rx flow. */
6238         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_RX \
6239                 (UINT32_C(0x0) << 30)
6240         /* If this bit is set to 1, then it indicates that this is tx flow. */
6241         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX \
6242                 (UINT32_C(0x1) << 30)
6243         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_LAST \
6244                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_FLOW_DIRECTION_TX
6245         /*
6246          * Indicates EEM flow aging mode this event occurred on. If
6247          * this bit is set to 0, the event_data1 is the EEM global
6248          * ID. If this bit is set to 1, the event_data1 is the number
6249          * of global ID in the context memory.
6250          */
6251         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE \
6252                 UINT32_C(0x80000000)
6253         /* EEM flow aging mode 0. */
6254         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_0 \
6255                 (UINT32_C(0x0) << 31)
6256         /* EEM flow aging mode 1. */
6257         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1 \
6258                 (UINT32_C(0x1) << 31)
6259         #define HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_LAST \
6260                 HWRM_ASYNC_EVENT_CMPL_EEM_FLOW_ACTIVE_EVENT_DATA1_MODE_1
6261 } __attribute__((packed));
6262
6263 /* hwrm_async_event_cmpl_eem_cfg_change (size:128b/16B) */
6264 struct hwrm_async_event_cmpl_eem_cfg_change {
6265         uint16_t        type;
6266         /*
6267          * This field indicates the exact type of the completion.
6268          * By convention, the LSB identifies the length of the
6269          * record in 16B units.  Even values indicate 16B
6270          * records.  Odd values indicate 32B
6271          * records.
6272          */
6273         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_MASK \
6274                 UINT32_C(0x3f)
6275         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_SFT             0
6276         /* HWRM Asynchronous Event Information */
6277         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT \
6278                 UINT32_C(0x2e)
6279         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_LAST \
6280                 HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT
6281         /* Identifiers of events. */
6282         uint16_t        event_id;
6283         /* Notification of EEM configuration change */
6284         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE \
6285                 UINT32_C(0x3c)
6286         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_LAST \
6287                 HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_ID_EEM_CFG_CHANGE
6288         /* Event specific data */
6289         uint32_t        event_data2;
6290         uint8_t opaque_v;
6291         /*
6292          * This value is written by the NIC such that it will be different
6293          * for each pass through the completion queue.   The even passes
6294          * will write 1.  The odd passes will write 0.
6295          */
6296         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_V          UINT32_C(0x1)
6297         /* opaque is 7 b */
6298         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_MASK UINT32_C(0xfe)
6299         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_OPAQUE_SFT 1
6300         /* 8-lsb timestamp from POR (100-msec resolution) */
6301         uint8_t timestamp_lo;
6302         /* 16-lsb timestamp from POR (100-msec resolution) */
6303         uint16_t        timestamp_hi;
6304         /* Event specific data */
6305         uint32_t        event_data1;
6306         /*
6307          * Value of 1 to indicate EEM TX configuration is enabled. Value of
6308          * 0 to indicate the EEM TX configuration is disabled.
6309          */
6310         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_TX_ENABLE \
6311                 UINT32_C(0x1)
6312         /*
6313          * Value of 1 to indicate EEM RX configuration is enabled. Value of 0
6314          * to indicate the EEM RX configuration is disabled.
6315          */
6316         #define HWRM_ASYNC_EVENT_CMPL_EEM_CFG_CHANGE_EVENT_DATA1_EEM_RX_ENABLE \
6317                 UINT32_C(0x2)
6318 } __attribute__((packed));
6319
6320 /* hwrm_async_event_cmpl_fw_trace_msg (size:128b/16B) */
6321 struct hwrm_async_event_cmpl_fw_trace_msg {
6322         uint16_t        type;
6323         /*
6324          * This field indicates the exact type of the completion.
6325          * By convention, the LSB identifies the length of the
6326          * record in 16B units.  Even values indicate 16B
6327          * records.  Odd values indicate 32B
6328          * records.
6329          */
6330         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_MASK \
6331                 UINT32_C(0x3f)
6332         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_SFT             0
6333         /* HWRM Asynchronous Event Information */
6334         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT \
6335                 UINT32_C(0x2e)
6336         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_LAST \
6337                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TYPE_HWRM_ASYNC_EVENT
6338         /* Identifiers of events. */
6339         uint16_t        event_id;
6340         /* Firmware trace log message */
6341         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG \
6342                 UINT32_C(0xfe)
6343         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_LAST \
6344                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_ID_FW_TRACE_MSG
6345         /* Trace byte 0 to 3 */
6346         uint32_t        event_data2;
6347         /* Trace byte0 */
6348         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_MASK \
6349                 UINT32_C(0xff)
6350         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE0_SFT 0
6351         /* Trace byte1 */
6352         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_MASK \
6353                 UINT32_C(0xff00)
6354         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE1_SFT 8
6355         /* Trace byte2 */
6356         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_MASK \
6357                 UINT32_C(0xff0000)
6358         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE2_SFT 16
6359         /* Trace byte3 */
6360         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_MASK \
6361                 UINT32_C(0xff000000)
6362         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA2_BYTE3_SFT 24
6363         uint8_t opaque_v;
6364         /*
6365          * This value is written by the NIC such that it will be different
6366          * for each pass through the completion queue.   The even passes
6367          * will write 1.  The odd passes will write 0.
6368          */
6369         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_V          UINT32_C(0x1)
6370         /* opaque is 7 b */
6371         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_MASK UINT32_C(0xfe)
6372         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_OPAQUE_SFT 1
6373         /* Trace flags */
6374         uint8_t timestamp_lo;
6375         /* Indicates if the string is partial or complete. */
6376         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING \
6377                 UINT32_C(0x1)
6378         /* Complete string */
6379         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_COMPLETE \
6380                 UINT32_C(0x0)
6381         /* Partial string */
6382         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL \
6383                 UINT32_C(0x1)
6384         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_LAST \
6385                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_STRING_PARTIAL
6386         /* Indicates the firmware that sent the trace message. */
6387         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE \
6388                 UINT32_C(0x2)
6389         /* Primary firmware */
6390         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_PRIMARY \
6391                 (UINT32_C(0x0) << 1)
6392         /* Secondary firmware */
6393         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY \
6394                 (UINT32_C(0x1) << 1)
6395         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_LAST \
6396                 HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_LO_FIRMWARE_SECONDARY
6397         /* Trace byte 4 to 5 */
6398         uint16_t        timestamp_hi;
6399         /* Trace byte4 */
6400         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_MASK \
6401                 UINT32_C(0xff)
6402         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE4_SFT 0
6403         /* Trace byte5 */
6404         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_MASK \
6405                 UINT32_C(0xff00)
6406         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_TIMESTAMP_HI_BYTE5_SFT 8
6407         /* Trace byte 6 to 9 */
6408         uint32_t        event_data1;
6409         /* Trace byte6 */
6410         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_MASK \
6411                 UINT32_C(0xff)
6412         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE6_SFT 0
6413         /* Trace byte7 */
6414         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_MASK \
6415                 UINT32_C(0xff00)
6416         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE7_SFT 8
6417         /* Trace byte8 */
6418         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_MASK \
6419                 UINT32_C(0xff0000)
6420         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE8_SFT 16
6421         /* Trace byte9 */
6422         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_MASK \
6423                 UINT32_C(0xff000000)
6424         #define HWRM_ASYNC_EVENT_CMPL_FW_TRACE_MSG_EVENT_DATA1_BYTE9_SFT 24
6425 } __attribute__((packed));
6426
6427 /* hwrm_async_event_cmpl_hwrm_error (size:128b/16B) */
6428 struct hwrm_async_event_cmpl_hwrm_error {
6429         uint16_t        type;
6430         /*
6431          * This field indicates the exact type of the completion.
6432          * By convention, the LSB identifies the length of the
6433          * record in 16B units.  Even values indicate 16B
6434          * records.  Odd values indicate 32B
6435          * records.
6436          */
6437         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK \
6438                 UINT32_C(0x3f)
6439         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT             0
6440         /* HWRM Asynchronous Event Information */
6441         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT \
6442                 UINT32_C(0x2e)
6443         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_LAST \
6444                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT
6445         /* Identifiers of events. */
6446         uint16_t        event_id;
6447         /* HWRM Error */
6448         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR \
6449                 UINT32_C(0xff)
6450         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_LAST \
6451                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR
6452         /* Event specific data */
6453         uint32_t        event_data2;
6454         /* Severity of HWRM Error */
6455         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK \
6456                 UINT32_C(0xff)
6457         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT     0
6458         /* Warning */
6459         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING \
6460                 UINT32_C(0x0)
6461         /* Non-fatal Error */
6462         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL \
6463                 UINT32_C(0x1)
6464         /* Fatal Error */
6465         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL \
6466                 UINT32_C(0x2)
6467         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST \
6468                 HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL
6469         uint8_t opaque_v;
6470         /*
6471          * This value is written by the NIC such that it will be different
6472          * for each pass through the completion queue.   The even passes
6473          * will write 1.  The odd passes will write 0.
6474          */
6475         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V          UINT32_C(0x1)
6476         /* opaque is 7 b */
6477         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK UINT32_C(0xfe)
6478         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT 1
6479         /* 8-lsb timestamp from POR (100-msec resolution) */
6480         uint8_t timestamp_lo;
6481         /* 16-lsb timestamp from POR (100-msec resolution) */
6482         uint16_t        timestamp_hi;
6483         /* Event specific data */
6484         uint32_t        event_data1;
6485         /* Time stamp for error event */
6486         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP \
6487                 UINT32_C(0x1)
6488 } __attribute__((packed));
6489
6490 /*******************
6491  * hwrm_func_reset *
6492  *******************/
6493
6494
6495 /* hwrm_func_reset_input (size:192b/24B) */
6496 struct hwrm_func_reset_input {
6497         /* The HWRM command request type. */
6498         uint16_t        req_type;
6499         /*
6500          * The completion ring to send the completion event on. This should
6501          * be the NQ ID returned from the `nq_alloc` HWRM command.
6502          */
6503         uint16_t        cmpl_ring;
6504         /*
6505          * The sequence ID is used by the driver for tracking multiple
6506          * commands. This ID is treated as opaque data by the firmware and
6507          * the value is returned in the `hwrm_resp_hdr` upon completion.
6508          */
6509         uint16_t        seq_id;
6510         /*
6511          * The target ID of the command:
6512          * * 0x0-0xFFF8 - The function ID
6513          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
6514          * * 0xFFFD - Reserved for user-space HWRM interface
6515          * * 0xFFFF - HWRM
6516          */
6517         uint16_t        target_id;
6518         /*
6519          * A physical address pointer pointing to a host buffer that the
6520          * command's response data will be written. This can be either a host
6521          * physical address (HPA) or a guest physical address (GPA) and must
6522          * point to a physically contiguous block of memory.
6523          */
6524         uint64_t        resp_addr;
6525         uint32_t        enables;
6526         /*
6527          * This bit must be '1' for the vf_id_valid field to be
6528          * configured.
6529          */
6530         #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
6531         /*
6532          * The ID of the VF that this PF is trying to reset.
6533          * Only the parent PF shall be allowed to reset a child VF.
6534          *
6535          * A parent PF driver shall use this field only when a specific child VF
6536          * is requested to be reset.
6537          */
6538         uint16_t        vf_id;
6539         /* This value indicates the level of a function reset. */
6540         uint8_t func_reset_level;
6541         /*
6542          * Reset the caller function and its children VFs (if any). If no
6543          * children functions exist, then reset the caller function only.
6544          */
6545         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL \
6546                 UINT32_C(0x0)
6547         /* Reset the caller function only */
6548         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME \
6549                 UINT32_C(0x1)
6550         /*
6551          * Reset all children VFs of the caller function driver if the
6552          * caller is a PF driver.
6553          * It is an error to specify this level by a VF driver.
6554          * It is an error to specify this level by a PF driver with
6555          * no children VFs.
6556          */
6557         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \
6558                 UINT32_C(0x2)
6559         /*
6560          * Reset a specific VF of the caller function driver if the caller
6561          * is the parent PF driver.
6562          * It is an error to specify this level by a VF driver.
6563          * It is an error to specify this level by a PF driver that is not
6564          * the parent of the VF that is being requested to reset.
6565          */
6566         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF \
6567                 UINT32_C(0x3)
6568         #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_LAST \
6569                 HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF
6570         uint8_t unused_0;
6571 } __attribute__((packed));
6572
6573 /* hwrm_func_reset_output (size:128b/16B) */
6574 struct hwrm_func_reset_output {
6575         /* The specific error status for the command. */
6576         uint16_t        error_code;
6577         /* The HWRM command request type. */
6578         uint16_t        req_type;
6579         /* The sequence ID from the original command. */
6580         uint16_t        seq_id;
6581         /* The length of the response data in number of bytes. */
6582         uint16_t        resp_len;
6583         uint8_t unused_0[7];
6584         /*
6585          * This field is used in Output records to indicate that the output
6586          * is completely written to RAM.  This field should be read as '1'
6587          * to indicate that the output has been completely written.
6588          * When writing a command completion or response to an internal processor,
6589          * the order of writes has to be such that this field is written last.
6590          */
6591         uint8_t valid;
6592 } __attribute__((packed));
6593
6594 /********************
6595  * hwrm_func_getfid *
6596  ********************/
6597
6598
6599 /* hwrm_func_getfid_input (size:192b/24B) */
6600 struct hwrm_func_getfid_input {
6601         /* The HWRM command request type. */
6602         uint16_t        req_type;
6603         /*
6604          * The completion ring to send the completion event on. This should
6605          * be the NQ ID returned from the `nq_alloc` HWRM command.
6606          */
6607         uint16_t        cmpl_ring;
6608         /*
6609          * The sequence ID is used by the driver for tracking multiple
6610          * commands. This ID is treated as opaque data by the firmware and
6611          * the value is returned in the `hwrm_resp_hdr` upon completion.
6612          */
6613         uint16_t        seq_id;
6614         /*
6615          * The target ID of the command:
6616          * * 0x0-0xFFF8 - The function ID
6617          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
6618          * * 0xFFFD - Reserved for user-space HWRM interface
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        enables;
6630         /*
6631          * This bit must be '1' for the pci_id field to be
6632          * configured.
6633          */
6634         #define HWRM_FUNC_GETFID_INPUT_ENABLES_PCI_ID     UINT32_C(0x1)
6635         /*
6636          * This value is the PCI ID of the queried function.
6637          * If ARI is enabled, then it is
6638          * Bus Number (8b):Function Number(8b). Otherwise, it is
6639          * Bus Number (8b):Device Number (5b):Function Number(3b).
6640          */
6641         uint16_t        pci_id;
6642         uint8_t unused_0[2];
6643 } __attribute__((packed));
6644
6645 /* hwrm_func_getfid_output (size:128b/16B) */
6646 struct hwrm_func_getfid_output {
6647         /* The specific error status for the command. */
6648         uint16_t        error_code;
6649         /* The HWRM command request type. */
6650         uint16_t        req_type;
6651         /* The sequence ID from the original command. */
6652         uint16_t        seq_id;
6653         /* The length of the response data in number of bytes. */
6654         uint16_t        resp_len;
6655         /*
6656          * FID value.  This value is used to identify operations on the PCI
6657          * bus as belonging to a particular PCI function.
6658          */
6659         uint16_t        fid;
6660         uint8_t unused_0[5];
6661         /*
6662          * This field is used in Output records to indicate that the output
6663          * is completely written to RAM.  This field should be read as '1'
6664          * to indicate that the output has been completely written.
6665          * When writing a command completion or response to an internal processor,
6666          * the order of writes has to be such that this field is written last.
6667          */
6668         uint8_t valid;
6669 } __attribute__((packed));
6670
6671 /**********************
6672  * hwrm_func_vf_alloc *
6673  **********************/
6674
6675
6676 /* hwrm_func_vf_alloc_input (size:192b/24B) */
6677 struct hwrm_func_vf_alloc_input {
6678         /* The HWRM command request type. */
6679         uint16_t        req_type;
6680         /*
6681          * The completion ring to send the completion event on. This should
6682          * be the NQ ID returned from the `nq_alloc` HWRM command.
6683          */
6684         uint16_t        cmpl_ring;
6685         /*
6686          * The sequence ID is used by the driver for tracking multiple
6687          * commands. This ID is treated as opaque data by the firmware and
6688          * the value is returned in the `hwrm_resp_hdr` upon completion.
6689          */
6690         uint16_t        seq_id;
6691         /*
6692          * The target ID of the command:
6693          * * 0x0-0xFFF8 - The function ID
6694          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
6695          * * 0xFFFD - Reserved for user-space HWRM interface
6696          * * 0xFFFF - HWRM
6697          */
6698         uint16_t        target_id;
6699         /*
6700          * A physical address pointer pointing to a host buffer that the
6701          * command's response data will be written. This can be either a host
6702          * physical address (HPA) or a guest physical address (GPA) and must
6703          * point to a physically contiguous block of memory.
6704          */
6705         uint64_t        resp_addr;
6706         uint32_t        enables;
6707         /*
6708          * This bit must be '1' for the first_vf_id field to be
6709          * configured.
6710          */
6711         #define HWRM_FUNC_VF_ALLOC_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
6712         /*
6713          * This value is used to identify a Virtual Function (VF).
6714          * The scope of VF ID is local within a PF.
6715          */
6716         uint16_t        first_vf_id;
6717         /* The number of virtual functions requested. */
6718         uint16_t        num_vfs;
6719 } __attribute__((packed));
6720
6721 /* hwrm_func_vf_alloc_output (size:128b/16B) */
6722 struct hwrm_func_vf_alloc_output {
6723         /* The specific error status for the command. */
6724         uint16_t        error_code;
6725         /* The HWRM command request type. */
6726         uint16_t        req_type;
6727         /* The sequence ID from the original command. */
6728         uint16_t        seq_id;
6729         /* The length of the response data in number of bytes. */
6730         uint16_t        resp_len;
6731         /* The ID of the first VF allocated. */
6732         uint16_t        first_vf_id;
6733         uint8_t unused_0[5];
6734         /*
6735          * This field is used in Output records to indicate that the output
6736          * is completely written to RAM.  This field should be read as '1'
6737          * to indicate that the output has been completely written.
6738          * When writing a command completion or response to an internal processor,
6739          * the order of writes has to be such that this field is written last.
6740          */
6741         uint8_t valid;
6742 } __attribute__((packed));
6743
6744 /*********************
6745  * hwrm_func_vf_free *
6746  *********************/
6747
6748
6749 /* hwrm_func_vf_free_input (size:192b/24B) */
6750 struct hwrm_func_vf_free_input {
6751         /* The HWRM command request type. */
6752         uint16_t        req_type;
6753         /*
6754          * The completion ring to send the completion event on. This should
6755          * be the NQ ID returned from the `nq_alloc` HWRM command.
6756          */
6757         uint16_t        cmpl_ring;
6758         /*
6759          * The sequence ID is used by the driver for tracking multiple
6760          * commands. This ID is treated as opaque data by the firmware and
6761          * the value is returned in the `hwrm_resp_hdr` upon completion.
6762          */
6763         uint16_t        seq_id;
6764         /*
6765          * The target ID of the command:
6766          * * 0x0-0xFFF8 - The function ID
6767          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
6768          * * 0xFFFD - Reserved for user-space HWRM interface
6769          * * 0xFFFF - HWRM
6770          */
6771         uint16_t        target_id;
6772         /*
6773          * A physical address pointer pointing to a host buffer that the
6774          * command's response data will be written. This can be either a host
6775          * physical address (HPA) or a guest physical address (GPA) and must
6776          * point to a physically contiguous block of memory.
6777          */
6778         uint64_t        resp_addr;
6779         uint32_t        enables;
6780         /*
6781          * This bit must be '1' for the first_vf_id field to be
6782          * configured.
6783          */
6784         #define HWRM_FUNC_VF_FREE_INPUT_ENABLES_FIRST_VF_ID     UINT32_C(0x1)
6785         /*
6786          * This value is used to identify a Virtual Function (VF).
6787          * The scope of VF ID is local within a PF.
6788          */
6789         uint16_t        first_vf_id;
6790         /*
6791          * The number of virtual functions requested.
6792          * 0xFFFF - Cleanup all children of this PF.
6793          */
6794         uint16_t        num_vfs;
6795 } __attribute__((packed));
6796
6797 /* hwrm_func_vf_free_output (size:128b/16B) */
6798 struct hwrm_func_vf_free_output {
6799         /* The specific error status for the command. */
6800         uint16_t        error_code;
6801         /* The HWRM command request type. */
6802         uint16_t        req_type;
6803         /* The sequence ID from the original command. */
6804         uint16_t        seq_id;
6805         /* The length of the response data in number of bytes. */
6806         uint16_t        resp_len;
6807         uint8_t unused_0[7];
6808         /*
6809          * This field is used in Output records to indicate that the output
6810          * is completely written to RAM.  This field should be read as '1'
6811          * to indicate that the output has been completely written.
6812          * When writing a command completion or response to an internal processor,
6813          * the order of writes has to be such that this field is written last.
6814          */
6815         uint8_t valid;
6816 } __attribute__((packed));
6817
6818 /********************
6819  * hwrm_func_vf_cfg *
6820  ********************/
6821
6822
6823 /* hwrm_func_vf_cfg_input (size:448b/56B) */
6824 struct hwrm_func_vf_cfg_input {
6825         /* The HWRM command request type. */
6826         uint16_t        req_type;
6827         /*
6828          * The completion ring to send the completion event on. This should
6829          * be the NQ ID returned from the `nq_alloc` HWRM command.
6830          */
6831         uint16_t        cmpl_ring;
6832         /*
6833          * The sequence ID is used by the driver for tracking multiple
6834          * commands. This ID is treated as opaque data by the firmware and
6835          * the value is returned in the `hwrm_resp_hdr` upon completion.
6836          */
6837         uint16_t        seq_id;
6838         /*
6839          * The target ID of the command:
6840          * * 0x0-0xFFF8 - The function ID
6841          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
6842          * * 0xFFFD - Reserved for user-space HWRM interface
6843          * * 0xFFFF - HWRM
6844          */
6845         uint16_t        target_id;
6846         /*
6847          * A physical address pointer pointing to a host buffer that the
6848          * command's response data will be written. This can be either a host
6849          * physical address (HPA) or a guest physical address (GPA) and must
6850          * point to a physically contiguous block of memory.
6851          */
6852         uint64_t        resp_addr;
6853         uint32_t        enables;
6854         /*
6855          * This bit must be '1' for the mtu field to be
6856          * configured.
6857          */
6858         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU \
6859                 UINT32_C(0x1)
6860         /*
6861          * This bit must be '1' for the guest_vlan field to be
6862          * configured.
6863          */
6864         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN \
6865                 UINT32_C(0x2)
6866         /*
6867          * This bit must be '1' for the async_event_cr field to be
6868          * configured.
6869          */
6870         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
6871                 UINT32_C(0x4)
6872         /*
6873          * This bit must be '1' for the dflt_mac_addr field to be
6874          * configured.
6875          */
6876         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
6877                 UINT32_C(0x8)
6878         /*
6879          * This bit must be '1' for the num_rsscos_ctxs field to be
6880          * configured.
6881          */
6882         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
6883                 UINT32_C(0x10)
6884         /*
6885          * This bit must be '1' for the num_cmpl_rings field to be
6886          * configured.
6887          */
6888         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
6889                 UINT32_C(0x20)
6890         /*
6891          * This bit must be '1' for the num_tx_rings field to be
6892          * configured.
6893          */
6894         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS \
6895                 UINT32_C(0x40)
6896         /*
6897          * This bit must be '1' for the num_rx_rings field to be
6898          * configured.
6899          */
6900         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS \
6901                 UINT32_C(0x80)
6902         /*
6903          * This bit must be '1' for the num_l2_ctxs field to be
6904          * configured.
6905          */
6906         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS \
6907                 UINT32_C(0x100)
6908         /*
6909          * This bit must be '1' for the num_vnics field to be
6910          * configured.
6911          */
6912         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS \
6913                 UINT32_C(0x200)
6914         /*
6915          * This bit must be '1' for the num_stat_ctxs field to be
6916          * configured.
6917          */
6918         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
6919                 UINT32_C(0x400)
6920         /*
6921          * This bit must be '1' for the num_hw_ring_grps field to be
6922          * configured.
6923          */
6924         #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
6925                 UINT32_C(0x800)
6926         /*
6927          * The maximum transmission unit requested on the function.
6928          * The HWRM should make sure that the mtu of
6929          * the function does not exceed the mtu of the physical
6930          * port that this function is associated with.
6931          *
6932          * In addition to requesting mtu per function, it is
6933          * possible to configure mtu per transmit ring.
6934          * By default, the mtu of each transmit ring associated
6935          * with a function is equal to the mtu of the function.
6936          * The HWRM should make sure that the mtu of each transmit
6937          * ring that is assigned to a function has a valid mtu.
6938          */
6939         uint16_t        mtu;
6940         /*
6941          * The guest VLAN for the function being configured.
6942          * This field's format is same as 802.1Q Tag's
6943          * Tag Control Information (TCI) format that includes both
6944          * Priority Code Point (PCP) and VLAN Identifier (VID).
6945          */
6946         uint16_t        guest_vlan;
6947         /*
6948          * ID of the target completion ring for receiving asynchronous
6949          * event completions. If this field is not valid, then the
6950          * HWRM shall use the default completion ring of the function
6951          * that is being configured as the target completion ring for
6952          * providing any asynchronous event completions for that
6953          * function.
6954          * If this field is valid, then the HWRM shall use the
6955          * completion ring identified by this ID as the target
6956          * completion ring for providing any asynchronous event
6957          * completions for the function that is being configured.
6958          */
6959         uint16_t        async_event_cr;
6960         /*
6961          * This value is the current MAC address requested by the VF
6962          * driver to be configured on this VF. A value of
6963          * 00-00-00-00-00-00 indicates no MAC address configuration
6964          * is requested by the VF driver.
6965          * The parent PF driver may reject or overwrite this
6966          * MAC address.
6967          */
6968         uint8_t dflt_mac_addr[6];
6969         uint32_t        flags;
6970         /*
6971          * This bit requests that the firmware test to see if all the assets
6972          * requested in this command (i.e. number of TX rings) are available.
6973          * The firmware will return an error if the requested assets are
6974          * not available. The firwmare will NOT reserve the assets if they
6975          * are available.
6976          */
6977         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
6978                 UINT32_C(0x1)
6979         /*
6980          * This bit requests that the firmware test to see if all the assets
6981          * requested in this command (i.e. number of RX rings) are available.
6982          * The firmware will return an error if the requested assets are
6983          * not available. The firwmare will NOT reserve the assets if they
6984          * are available.
6985          */
6986         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
6987                 UINT32_C(0x2)
6988         /*
6989          * This bit requests that the firmware test to see if all the assets
6990          * requested in this command (i.e. number of CMPL rings) are available.
6991          * The firmware will return an error if the requested assets are
6992          * not available. The firwmare will NOT reserve the assets if they
6993          * are available.
6994          */
6995         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
6996                 UINT32_C(0x4)
6997         /*
6998          * This bit requests that the firmware test to see if all the assets
6999          * requested in this command (i.e. number of RSS ctx) are available.
7000          * The firmware will return an error if the requested assets are
7001          * not available. The firwmare will NOT reserve the assets if they
7002          * are available.
7003          */
7004         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
7005                 UINT32_C(0x8)
7006         /*
7007          * This bit requests that the firmware test to see if all the assets
7008          * requested in this command (i.e. number of ring groups) are available.
7009          * The firmware will return an error if the requested assets are
7010          * not available. The firwmare will NOT reserve the assets if they
7011          * are available.
7012          */
7013         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
7014                 UINT32_C(0x10)
7015         /*
7016          * This bit requests that the firmware test to see if all the assets
7017          * requested in this command (i.e. number of stat ctx) are available.
7018          * The firmware will return an error if the requested assets are
7019          * not available. The firwmare will NOT reserve the assets if they
7020          * are available.
7021          */
7022         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
7023                 UINT32_C(0x20)
7024         /*
7025          * This bit requests that the firmware test to see if all the assets
7026          * requested in this command (i.e. number of VNICs) are available.
7027          * The firmware will return an error if the requested assets are
7028          * not available. The firwmare will NOT reserve the assets if they
7029          * are available.
7030          */
7031         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
7032                 UINT32_C(0x40)
7033         /*
7034          * This bit requests that the firmware test to see if all the assets
7035          * requested in this command (i.e. number of L2 ctx) are available.
7036          * The firmware will return an error if the requested assets are
7037          * not available. The firwmare will NOT reserve the assets if they
7038          * are available.
7039          */
7040         #define HWRM_FUNC_VF_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
7041                 UINT32_C(0x80)
7042         /* The number of RSS/COS contexts requested for the VF. */
7043         uint16_t        num_rsscos_ctxs;
7044         /* The number of completion rings requested for the VF. */
7045         uint16_t        num_cmpl_rings;
7046         /* The number of transmit rings requested for the VF. */
7047         uint16_t        num_tx_rings;
7048         /* The number of receive rings requested for the VF. */
7049         uint16_t        num_rx_rings;
7050         /* The number of L2 contexts requested for the VF. */
7051         uint16_t        num_l2_ctxs;
7052         /* The number of vnics requested for the VF. */
7053         uint16_t        num_vnics;
7054         /* The number of statistic contexts requested for the VF. */
7055         uint16_t        num_stat_ctxs;
7056         /* The number of HW ring groups requested for the VF. */
7057         uint16_t        num_hw_ring_grps;
7058         uint8_t unused_0[4];
7059 } __attribute__((packed));
7060
7061 /* hwrm_func_vf_cfg_output (size:128b/16B) */
7062 struct hwrm_func_vf_cfg_output {
7063         /* The specific error status for the command. */
7064         uint16_t        error_code;
7065         /* The HWRM command request type. */
7066         uint16_t        req_type;
7067         /* The sequence ID from the original command. */
7068         uint16_t        seq_id;
7069         /* The length of the response data in number of bytes. */
7070         uint16_t        resp_len;
7071         uint8_t unused_0[7];
7072         /*
7073          * This field is used in Output records to indicate that the output
7074          * is completely written to RAM.  This field should be read as '1'
7075          * to indicate that the output has been completely written.
7076          * When writing a command completion or response to an internal processor,
7077          * the order of writes has to be such that this field is written last.
7078          */
7079         uint8_t valid;
7080 } __attribute__((packed));
7081
7082 /*******************
7083  * hwrm_func_qcaps *
7084  *******************/
7085
7086
7087 /* hwrm_func_qcaps_input (size:192b/24B) */
7088 struct hwrm_func_qcaps_input {
7089         /* The HWRM command request type. */
7090         uint16_t        req_type;
7091         /*
7092          * The completion ring to send the completion event on. This should
7093          * be the NQ ID returned from the `nq_alloc` HWRM command.
7094          */
7095         uint16_t        cmpl_ring;
7096         /*
7097          * The sequence ID is used by the driver for tracking multiple
7098          * commands. This ID is treated as opaque data by the firmware and
7099          * the value is returned in the `hwrm_resp_hdr` upon completion.
7100          */
7101         uint16_t        seq_id;
7102         /*
7103          * The target ID of the command:
7104          * * 0x0-0xFFF8 - The function ID
7105          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
7106          * * 0xFFFD - Reserved for user-space HWRM interface
7107          * * 0xFFFF - HWRM
7108          */
7109         uint16_t        target_id;
7110         /*
7111          * A physical address pointer pointing to a host buffer that the
7112          * command's response data will be written. This can be either a host
7113          * physical address (HPA) or a guest physical address (GPA) and must
7114          * point to a physically contiguous block of memory.
7115          */
7116         uint64_t        resp_addr;
7117         /*
7118          * Function ID of the function that is being queried.
7119          * 0xFF... (All Fs) if the query is for the requesting
7120          * function.
7121          */
7122         uint16_t        fid;
7123         uint8_t unused_0[6];
7124 } __attribute__((packed));
7125
7126 /* hwrm_func_qcaps_output (size:640b/80B) */
7127 struct hwrm_func_qcaps_output {
7128         /* The specific error status for the command. */
7129         uint16_t        error_code;
7130         /* The HWRM command request type. */
7131         uint16_t        req_type;
7132         /* The sequence ID from the original command. */
7133         uint16_t        seq_id;
7134         /* The length of the response data in number of bytes. */
7135         uint16_t        resp_len;
7136         /*
7137          * FID value.  This value is used to identify operations on the PCI
7138          * bus as belonging to a particular PCI function.
7139          */
7140         uint16_t        fid;
7141         /*
7142          * Port ID of port that this function is associated with.
7143          * Valid only for the PF.
7144          * 0xFF... (All Fs) if this function is not associated with
7145          * any port.
7146          * 0xFF... (All Fs) if this function is called from a VF.
7147          */
7148         uint16_t        port_id;
7149         uint32_t        flags;
7150         /* If 1, then Push mode is supported on this function. */
7151         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED \
7152                 UINT32_C(0x1)
7153         /*
7154          * If 1, then the global MSI-X auto-masking is enabled for the
7155          * device.
7156          */
7157         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
7158                 UINT32_C(0x2)
7159         /*
7160          * If 1, then the Precision Time Protocol (PTP) processing
7161          * is supported on this function.
7162          * The HWRM should enable PTP on only a single Physical
7163          * Function (PF) per port.
7164          */
7165         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED \
7166                 UINT32_C(0x4)
7167         /*
7168          * If 1, then RDMA over Converged Ethernet (RoCE) v1
7169          * is supported on this function.
7170          */
7171         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED \
7172                 UINT32_C(0x8)
7173         /*
7174          * If 1, then RDMA over Converged Ethernet (RoCE) v2
7175          * is supported on this function.
7176          */
7177         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED \
7178                 UINT32_C(0x10)
7179         /*
7180          * If 1, then control and configuration of WoL magic packet
7181          * are supported on this function.
7182          */
7183         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED \
7184                 UINT32_C(0x20)
7185         /*
7186          * If 1, then control and configuration of bitmap pattern
7187          * packet are supported on this function.
7188          */
7189         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED \
7190                 UINT32_C(0x40)
7191         /*
7192          * If set to 1, then the control and configuration of rate limit
7193          * of an allocated TX ring on the queried function is supported.
7194          */
7195         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED \
7196                 UINT32_C(0x80)
7197         /*
7198          * If 1, then control and configuration of minimum and
7199          * maximum bandwidths are supported on the queried function.
7200          */
7201         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED \
7202                 UINT32_C(0x100)
7203         /*
7204          * If the query is for a VF, then this flag shall be ignored.
7205          * If this query is for a PF and this flag is set to 1,
7206          * then the PF has the capability to set the rate limits
7207          * on the TX rings of its children VFs.
7208          * If this query is for a PF and this flag is set to 0, then
7209          * the PF does not have the capability to set the rate limits
7210          * on the TX rings of its children VFs.
7211          */
7212         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED \
7213                 UINT32_C(0x200)
7214         /*
7215          * If the query is for a VF, then this flag shall be ignored.
7216          * If this query is for a PF and this flag is set to 1,
7217          * then the PF has the capability to set the minimum and/or
7218          * maximum bandwidths for its children VFs.
7219          * If this query is for a PF and this flag is set to 0, then
7220          * the PF does not have the capability to set the minimum or
7221          * maximum bandwidths for its children VFs.
7222          */
7223         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED \
7224                 UINT32_C(0x400)
7225         /*
7226          * Standard TX Ring mode is used for the allocation of TX ring
7227          * and underlying scheduling resources that allow bandwidth
7228          * reservation and limit settings on the queried function.
7229          * If set to 1, then standard TX ring mode is supported
7230          * on the queried function.
7231          * If set to 0, then standard TX ring mode is not available
7232          * on the queried function.
7233          */
7234         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED \
7235                 UINT32_C(0x800)
7236         /*
7237          * If the query is for a VF, then this flag shall be ignored,
7238          * If this query is for a PF and this flag is set to 1,
7239          * then the PF has the capability to detect GENEVE tunnel
7240          * flags.
7241          */
7242         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GENEVE_TUN_FLAGS_SUPPORTED \
7243                 UINT32_C(0x1000)
7244         /*
7245          * If the query is for a VF, then this flag shall be ignored,
7246          * If this query is for a PF and this flag is set to 1,
7247          * then the PF has the capability to detect NVGRE tunnel
7248          * flags.
7249          */
7250         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NVGRE_TUN_FLAGS_SUPPORTED \
7251                 UINT32_C(0x2000)
7252         /*
7253          * If the query is for a VF, then this flag shall be ignored,
7254          * If this query is for a PF and this flag is set to 1,
7255          * then the PF has the capability to detect GRE tunnel
7256          * flags.
7257          */
7258         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GRE_TUN_FLAGS_SUPPORTED \
7259                 UINT32_C(0x4000)
7260         /*
7261          * If the query is for a VF, then this flag shall be ignored,
7262          * If this query is for a PF and this flag is set to 1,
7263          * then the PF has the capability to detect MPLS tunnel
7264          * flags.
7265          */
7266         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_MPLS_TUN_FLAGS_SUPPORTED \
7267                 UINT32_C(0x8000)
7268         /*
7269          * If the query is for a VF, then this flag shall be ignored,
7270          * If this query is for a PF and this flag is set to 1,
7271          * then the PF has the capability to support pcie stats.
7272          */
7273         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PCIE_STATS_SUPPORTED \
7274                 UINT32_C(0x10000)
7275         /*
7276          * If the query is for a VF, then this flag shall be ignored,
7277          * If this query is for a PF and this flag is set to 1,
7278          * then the PF has the capability to adopt the VF's belonging
7279          * to another PF.
7280          */
7281         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADOPTED_PF_SUPPORTED \
7282                 UINT32_C(0x20000)
7283         /*
7284          * If the query is for a VF, then this flag shall be ignored,
7285          * If this query is for a PF and this flag is set to 1,
7286          * then the PF has the administrative privilege to configure another PF
7287          */
7288         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ADMIN_PF_SUPPORTED \
7289                 UINT32_C(0x40000)
7290         /*
7291          * If the query is for a VF, then this flag shall be ignored.
7292          * If this query is for a PF and this flag is set to 1, then
7293          * the PF will know that the firmware has the capability to track
7294          * the virtual link status.
7295          */
7296         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_LINK_ADMIN_STATUS_SUPPORTED \
7297                 UINT32_C(0x80000)
7298         /*
7299          * If 1, then this function supports the push mode that uses
7300          * write combine buffers and the long inline tx buffer descriptor.
7301          */
7302         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WCB_PUSH_MODE \
7303                 UINT32_C(0x100000)
7304         /*
7305          * If 1, then FW has capability to allocate TX rings dynamically
7306          * in ring alloc even if PF reserved pool is zero.
7307          * This bit will be used only for PFs.
7308          */
7309         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
7310                 UINT32_C(0x200000)
7311         /*
7312          * When this bit is '1', it indicates that core firmware is
7313          * capable of Hot Reset.
7314          */
7315         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE \
7316                 UINT32_C(0x400000)
7317         /*
7318          * This flag will be set to 1 by the FW if FW supports adapter error
7319          * recovery.
7320          */
7321         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERROR_RECOVERY_CAPABLE \
7322                 UINT32_C(0x800000)
7323         /*
7324          * If the query is for a VF, then this flag shall be ignored.
7325          * If this query is for a PF and this flag is set to 1, then
7326          * the PF has the capability to support extended stats.
7327          */
7328         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED \
7329                 UINT32_C(0x1000000)
7330         /*
7331          * This value is current MAC address configured for this
7332          * function. A value of 00-00-00-00-00-00 indicates no
7333          * MAC address is currently configured.
7334          */
7335         uint8_t mac_address[6];
7336         /*
7337          * The maximum number of RSS/COS contexts that can be
7338          * allocated to the function.
7339          */
7340         uint16_t        max_rsscos_ctx;
7341         /*
7342          * The maximum number of completion rings that can be
7343          * allocated to the function.
7344          */
7345         uint16_t        max_cmpl_rings;
7346         /*
7347          * The maximum number of transmit rings that can be
7348          * allocated to the function.
7349          */
7350         uint16_t        max_tx_rings;
7351         /*
7352          * The maximum number of receive rings that can be
7353          * allocated to the function.
7354          */
7355         uint16_t        max_rx_rings;
7356         /*
7357          * The maximum number of L2 contexts that can be
7358          * allocated to the function.
7359          */
7360         uint16_t        max_l2_ctxs;
7361         /*
7362          * The maximum number of VNICs that can be
7363          * allocated to the function.
7364          */
7365         uint16_t        max_vnics;
7366         /*
7367          * The identifier for the first VF enabled on a PF. This
7368          * is valid only on the PF with SR-IOV enabled.
7369          * 0xFF... (All Fs) if this command is called on a PF with
7370          * SR-IOV disabled or on a VF.
7371          */
7372         uint16_t        first_vf_id;
7373         /*
7374          * The maximum number of VFs that can be
7375          * allocated to the function. This is valid only on the
7376          * PF with SR-IOV enabled. 0xFF... (All Fs) if this
7377          * command is called on a PF with SR-IOV disabled or
7378          * on a VF.
7379          */
7380         uint16_t        max_vfs;
7381         /*
7382          * The maximum number of statistic contexts that can be
7383          * allocated to the function.
7384          */
7385         uint16_t        max_stat_ctx;
7386         /*
7387          * The maximum number of Encapsulation records that can be
7388          * offloaded by this function.
7389          */
7390         uint32_t        max_encap_records;
7391         /*
7392          * The maximum number of decapsulation records that can
7393          * be offloaded by this function.
7394          */
7395         uint32_t        max_decap_records;
7396         /*
7397          * The maximum number of Exact Match (EM) flows that can be
7398          * offloaded by this function on the TX side.
7399          */
7400         uint32_t        max_tx_em_flows;
7401         /*
7402          * The maximum number of Wildcard Match (WM) flows that can
7403          * be offloaded by this function on the TX side.
7404          */
7405         uint32_t        max_tx_wm_flows;
7406         /*
7407          * The maximum number of Exact Match (EM) flows that can be
7408          * offloaded by this function on the RX side.
7409          */
7410         uint32_t        max_rx_em_flows;
7411         /*
7412          * The maximum number of Wildcard Match (WM) flows that can
7413          * be offloaded by this function on the RX side.
7414          */
7415         uint32_t        max_rx_wm_flows;
7416         /*
7417          * The maximum number of multicast filters that can
7418          * be supported by this function on the RX side.
7419          */
7420         uint32_t        max_mcast_filters;
7421         /*
7422          * The maximum value of flow_id that can be supported
7423          * in completion records.
7424          */
7425         uint32_t        max_flow_id;
7426         /*
7427          * The maximum number of HW ring groups that can be
7428          * supported on this function.
7429          */
7430         uint32_t        max_hw_ring_grps;
7431         /*
7432          * The maximum number of strict priority transmit rings
7433          * that can be allocated to the function.
7434          * This number indicates the maximum number of TX rings
7435          * that can be assigned strict priorities out of the
7436          * maximum number of TX rings that can be allocated
7437          * (max_tx_rings) to the function.
7438          */
7439         uint16_t        max_sp_tx_rings;
7440         uint8_t unused_0;
7441         /*
7442          * This field is used in Output records to indicate that the output
7443          * is completely written to RAM.  This field should be read as '1'
7444          * to indicate that the output has been completely written.
7445          * When writing a command completion or response to an internal processor,
7446          * the order of writes has to be such that this field is written last.
7447          */
7448         uint8_t valid;
7449 } __attribute__((packed));
7450
7451 /******************
7452  * hwrm_func_qcfg *
7453  ******************/
7454
7455
7456 /* hwrm_func_qcfg_input (size:192b/24B) */
7457 struct hwrm_func_qcfg_input {
7458         /* The HWRM command request type. */
7459         uint16_t        req_type;
7460         /*
7461          * The completion ring to send the completion event on. This should
7462          * be the NQ ID returned from the `nq_alloc` HWRM command.
7463          */
7464         uint16_t        cmpl_ring;
7465         /*
7466          * The sequence ID is used by the driver for tracking multiple
7467          * commands. This ID is treated as opaque data by the firmware and
7468          * the value is returned in the `hwrm_resp_hdr` upon completion.
7469          */
7470         uint16_t        seq_id;
7471         /*
7472          * The target ID of the command:
7473          * * 0x0-0xFFF8 - The function ID
7474          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
7475          * * 0xFFFD - Reserved for user-space HWRM interface
7476          * * 0xFFFF - HWRM
7477          */
7478         uint16_t        target_id;
7479         /*
7480          * A physical address pointer pointing to a host buffer that the
7481          * command's response data will be written. This can be either a host
7482          * physical address (HPA) or a guest physical address (GPA) and must
7483          * point to a physically contiguous block of memory.
7484          */
7485         uint64_t        resp_addr;
7486         /*
7487          * Function ID of the function that is being queried.
7488          * 0xFF... (All Fs) if the query is for the requesting
7489          * function.
7490          */
7491         uint16_t        fid;
7492         uint8_t unused_0[6];
7493 } __attribute__((packed));
7494
7495 /* hwrm_func_qcfg_output (size:704b/88B) */
7496 struct hwrm_func_qcfg_output {
7497         /* The specific error status for the command. */
7498         uint16_t        error_code;
7499         /* The HWRM command request type. */
7500         uint16_t        req_type;
7501         /* The sequence ID from the original command. */
7502         uint16_t        seq_id;
7503         /* The length of the response data in number of bytes. */
7504         uint16_t        resp_len;
7505         /*
7506          * FID value.  This value is used to identify operations on the PCI
7507          * bus as belonging to a particular PCI function.
7508          */
7509         uint16_t        fid;
7510         /*
7511          * Port ID of port that this function is associated with.
7512          * 0xFF... (All Fs) if this function is not associated with
7513          * any port.
7514          */
7515         uint16_t        port_id;
7516         /*
7517          * This value is the current VLAN setting for this
7518          * function. The value of 0 for this field indicates
7519          * no priority tagging or VLAN is used.
7520          * This field's format is same as 802.1Q Tag's
7521          * Tag Control Information (TCI) format that includes both
7522          * Priority Code Point (PCP) and VLAN Identifier (VID).
7523          */
7524         uint16_t        vlan;
7525         uint16_t        flags;
7526         /*
7527          * If 1, then magic packet based Out-Of-Box WoL is enabled on
7528          * the port associated with this function.
7529          */
7530         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \
7531                 UINT32_C(0x1)
7532         /*
7533          * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled
7534          * on the port associated with this function.
7535          */
7536         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED \
7537                 UINT32_C(0x2)
7538         /*
7539          * If set to 1, then FW based DCBX agent is enabled and running on
7540          * the port associated with this function.
7541          * If set to 0, then DCBX agent is not running in the firmware.
7542          */
7543         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \
7544                 UINT32_C(0x4)
7545         /*
7546          * Standard TX Ring mode is used for the allocation of TX ring
7547          * and underlying scheduling resources that allow bandwidth
7548          * reservation and limit settings on the queried function.
7549          * If set to 1, then standard TX ring mode is enabled
7550          * on the queried function.
7551          * If set to 0, then the standard TX ring mode is disabled
7552          * on the queried function. In this extended TX ring resource
7553          * mode, the minimum and maximum bandwidth settings are not
7554          * supported to allow the allocation of TX rings to span multiple
7555          * scheduler nodes.
7556          */
7557         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \
7558                 UINT32_C(0x8)
7559         /*
7560          * If set to 1 then FW based LLDP agent is enabled and running on
7561          * the port associated with this function.
7562          * If set to 0 then the LLDP agent is not running in the firmware.
7563          */
7564         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED \
7565                 UINT32_C(0x10)
7566         /*
7567          * If set to 1, then multi-host mode is active for this function.
7568          * If set to 0, then multi-host mode is inactive for this function
7569          * or not applicable for this device.
7570          */
7571         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST \
7572                 UINT32_C(0x20)
7573         /*
7574          * If the function that is being queried is a PF, then the HWRM shall
7575          * set this field to 0 and the HWRM client shall ignore this field.
7576          * If the function that is being queried is a VF, then the HWRM shall
7577          * set this field to 1 if the queried VF is trusted, otherwise the HWRM
7578          * shall set this field to 0.
7579          */
7580         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF \
7581                 UINT32_C(0x40)
7582         /*
7583          * If set to 1, then secure mode is enabled for this function or device.
7584          * If set to 0, then secure mode is disabled (or normal mode) for this
7585          * function or device.
7586          */
7587         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_SECURE_MODE_ENABLED \
7588                 UINT32_C(0x80)
7589         /*
7590          * If set to 1, then this PF is enabled with a preboot driver that
7591          * requires access to the legacy L2 ring model and legacy 32b
7592          * doorbells. If set to 0, then this PF is not allowed to use
7593          * the legacy L2 rings. This feature is not allowed on VFs and
7594          * is only relevant for devices that require a context backing
7595          * store.
7596          */
7597         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \
7598                 UINT32_C(0x100)
7599         /*
7600          * This value is current MAC address configured for this
7601          * function. A value of 00-00-00-00-00-00 indicates no
7602          * MAC address is currently configured.
7603          */
7604         uint8_t mac_address[6];
7605         /*
7606          * This value is current PCI ID of this
7607          * function. If ARI is enabled, then it is
7608          * Bus Number (8b):Function Number(8b). Otherwise, it is
7609          * Bus Number (8b):Device Number (4b):Function Number(4b).
7610          * If multi-host mode is active, the 4 lsb will indicate
7611          * the PF index for this function.
7612          */
7613         uint16_t        pci_id;
7614         /*
7615          * The number of RSS/COS contexts currently
7616          * allocated to the function.
7617          */
7618         uint16_t        alloc_rsscos_ctx;
7619         /*
7620          * The number of completion rings currently allocated to
7621          * the function. This does not include the rings allocated
7622          * to any children functions if any.
7623          */
7624         uint16_t        alloc_cmpl_rings;
7625         /*
7626          * The number of transmit rings currently allocated to
7627          * the function. This does not include the rings allocated
7628          * to any children functions if any.
7629          */
7630         uint16_t        alloc_tx_rings;
7631         /*
7632          * The number of receive rings currently allocated to
7633          * the function. This does not include the rings allocated
7634          * to any children functions if any.
7635          */
7636         uint16_t        alloc_rx_rings;
7637         /* The allocated number of L2 contexts to the function. */
7638         uint16_t        alloc_l2_ctx;
7639         /* The allocated number of vnics to the function. */
7640         uint16_t        alloc_vnics;
7641         /*
7642          * The maximum transmission unit of the function.
7643          * If the reported mtu value is non-zero then it will used for the
7644          * rings allocated on this function. otherwise the default
7645          * value is used if ring MTU is not specified.
7646          */
7647         uint16_t        mtu;
7648         /*
7649          * The maximum receive unit of the function.
7650          * For vnics allocated on this function, this default
7651          * value is used if vnic MRU is not specified.
7652          */
7653         uint16_t        mru;
7654         /* The statistics context assigned to a function. */
7655         uint16_t        stat_ctx_id;
7656         /*
7657          * The HWRM shall return Unknown value for this field
7658          * when this command is used to query VF's configuration.
7659          */
7660         uint8_t port_partition_type;
7661         /* Single physical function */
7662         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF     UINT32_C(0x0)
7663         /* Multiple physical functions */
7664         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS    UINT32_C(0x1)
7665         /* Network Partitioning 1.0 */
7666         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
7667         /* Network Partitioning 1.5 */
7668         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
7669         /* Network Partitioning 2.0 */
7670         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
7671         /* Unknown */
7672         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN \
7673                 UINT32_C(0xff)
7674         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST \
7675                 HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN
7676         /*
7677          * This field will indicate number of physical functions on this port_partition.
7678          * HWRM shall return unavail (i.e. value of 0) for this field
7679          * when this command is used to query VF's configuration or
7680          * from older firmware that doesn't support this field.
7681          */
7682         uint8_t port_pf_cnt;
7683         /* number of PFs is not available */
7684         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
7685         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST \
7686                 HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL
7687         /*
7688          * The default VNIC ID assigned to a function that is
7689          * being queried.
7690          */
7691         uint16_t        dflt_vnic_id;
7692         uint16_t        max_mtu_configured;
7693         /*
7694          * Minimum BW allocated for this function.
7695          * The HWRM will translate this value into byte counter and
7696          * time interval used for the scheduler inside the device.
7697          * A value of 0 indicates the minimum bandwidth is not
7698          * configured.
7699          */
7700         uint32_t        min_bw;
7701         /* The bandwidth value. */
7702         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK \
7703                 UINT32_C(0xfffffff)
7704         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT              0
7705         /* The granularity of the value (bits or bytes). */
7706         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE \
7707                 UINT32_C(0x10000000)
7708         /* Value is in bits. */
7709         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS \
7710                 (UINT32_C(0x0) << 28)
7711         /* Value is in bytes. */
7712         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \
7713                 (UINT32_C(0x1) << 28)
7714         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \
7715                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
7716         /* bw_value_unit is 3 b */
7717         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \
7718                 UINT32_C(0xe0000000)
7719         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
7720         /* Value is in Mb or MB (base 10). */
7721         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
7722                 (UINT32_C(0x0) << 29)
7723         /* Value is in Kb or KB (base 10). */
7724         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \
7725                 (UINT32_C(0x2) << 29)
7726         /* Value is in bits or bytes. */
7727         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \
7728                 (UINT32_C(0x4) << 29)
7729         /* Value is in Gb or GB (base 10). */
7730         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
7731                 (UINT32_C(0x6) << 29)
7732         /* Value is in 1/100th of a percentage of total bandwidth. */
7733         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
7734                 (UINT32_C(0x1) << 29)
7735         /* Invalid unit */
7736         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
7737                 (UINT32_C(0x7) << 29)
7738         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \
7739                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
7740         /*
7741          * Maximum BW allocated for this function.
7742          * The HWRM will translate this value into byte counter and
7743          * time interval used for the scheduler inside the device.
7744          * A value of 0 indicates that the maximum bandwidth is not
7745          * configured.
7746          */
7747         uint32_t        max_bw;
7748         /* The bandwidth value. */
7749         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK \
7750                 UINT32_C(0xfffffff)
7751         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT              0
7752         /* The granularity of the value (bits or bytes). */
7753         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE \
7754                 UINT32_C(0x10000000)
7755         /* Value is in bits. */
7756         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS \
7757                 (UINT32_C(0x0) << 28)
7758         /* Value is in bytes. */
7759         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \
7760                 (UINT32_C(0x1) << 28)
7761         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \
7762                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
7763         /* bw_value_unit is 3 b */
7764         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \
7765                 UINT32_C(0xe0000000)
7766         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
7767         /* Value is in Mb or MB (base 10). */
7768         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
7769                 (UINT32_C(0x0) << 29)
7770         /* Value is in Kb or KB (base 10). */
7771         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \
7772                 (UINT32_C(0x2) << 29)
7773         /* Value is in bits or bytes. */
7774         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \
7775                 (UINT32_C(0x4) << 29)
7776         /* Value is in Gb or GB (base 10). */
7777         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
7778                 (UINT32_C(0x6) << 29)
7779         /* Value is in 1/100th of a percentage of total bandwidth. */
7780         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
7781                 (UINT32_C(0x1) << 29)
7782         /* Invalid unit */
7783         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
7784                 (UINT32_C(0x7) << 29)
7785         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \
7786                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
7787         /*
7788          * This value indicates the Edge virtual bridge mode for the
7789          * domain that this function belongs to.
7790          */
7791         uint8_t evb_mode;
7792         /* No Edge Virtual Bridging (EVB) */
7793         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
7794         /* Virtual Ethernet Bridge (VEB) */
7795         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB    UINT32_C(0x1)
7796         /* Virtual Ethernet Port Aggregator (VEPA) */
7797         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA   UINT32_C(0x2)
7798         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST \
7799                 HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA
7800         uint8_t options;
7801         /*
7802          * This value indicates the PCIE device cache line size.
7803          * The cache line size allows the DMA writes to terminate and
7804          * start at the cache boundary.
7805          */
7806         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK \
7807                 UINT32_C(0x3)
7808         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT          0
7809         /* Cache Line Size 64 bytes */
7810         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
7811                 UINT32_C(0x0)
7812         /* Cache Line Size 128 bytes */
7813         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
7814                 UINT32_C(0x1)
7815         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST \
7816                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
7817         /* This value is the virtual link admin state setting. */
7818         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
7819                 UINT32_C(0xc)
7820         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
7821         /* Admin link state is in forced down mode. */
7822         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
7823                 (UINT32_C(0x0) << 2)
7824         /* Admin link state is in forced up mode. */
7825         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
7826                 (UINT32_C(0x1) << 2)
7827         /* Admin link state is in auto mode  - follows the physical link state. */
7828         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
7829                 (UINT32_C(0x2) << 2)
7830         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
7831                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
7832         /* Reserved for future. */
7833         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK \
7834                 UINT32_C(0xf0)
7835         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT                    4
7836         /*
7837          * The number of VFs that are allocated to the function.
7838          * This is valid only on the PF with SR-IOV enabled.
7839          * 0xFF... (All Fs) if this command is called on a PF with
7840          * SR-IOV disabled or on a VF.
7841          */
7842         uint16_t        alloc_vfs;
7843         /*
7844          * The number of allocated multicast filters for this
7845          * function on the RX side.
7846          */
7847         uint32_t        alloc_mcast_filters;
7848         /*
7849          * The number of allocated HW ring groups for this
7850          * function.
7851          */
7852         uint32_t        alloc_hw_ring_grps;
7853         /*
7854          * The number of strict priority transmit rings out of
7855          * currently allocated TX rings to the function
7856          * (alloc_tx_rings).
7857          */
7858         uint16_t        alloc_sp_tx_rings;
7859         /*
7860          * The number of statistics contexts
7861          * currently reserved for the function.
7862          */
7863         uint16_t        alloc_stat_ctx;
7864         /*
7865          * This field specifies how many NQs are reserved for the PF.
7866          * Remaining NQs that belong to the PF are available for VFs.
7867          * Once a PF has created VFs, it cannot change how many NQs are
7868          * reserved for itself (since the NQs must be contiguous in HW).
7869          */
7870         uint16_t        alloc_msix;
7871         /*
7872          * The number of registered VF’s associated with the PF. This field
7873          * should be ignored when the request received on the VF interface.
7874          * This field will be updated on the PF interface to initiate
7875          * the unregister request on PF in the HOT Reset Process.
7876          */
7877         uint16_t        registered_vfs;
7878         /*
7879          * The size of the doorbell BAR in KBytes reserved for L2 including
7880          * any area that is shared between L2 and RoCE.  The L2 driver
7881          * should only map the L2 portion of the doorbell BAR.  Any rounding
7882          * of the BAR size to the native CPU page size should be performed
7883          * by the driver.  If the value is zero, no special partitioning
7884          * of the doorbell BAR between L2 and RoCE is required.
7885          */
7886         uint16_t        l2_doorbell_bar_size_kb;
7887         uint8_t unused_1;
7888         /*
7889          * For backward compatibility this field must be set to 1.
7890          * Older drivers might look for this field to be 1 before
7891          * processing the message.
7892          */
7893         uint8_t always_1;
7894         /*
7895          * This GRC address location is used by the Host driver interfaces to poll
7896          * the adapter ready state to re-initiate the registration process again
7897          * after receiving the RESET Notify event.
7898          */
7899         uint32_t        reset_addr_poll;
7900         uint8_t unused_2[3];
7901         /*
7902          * This field is used in Output records to indicate that the output
7903          * is completely written to RAM.  This field should be read as '1'
7904          * to indicate that the output has been completely written.
7905          * When writing a command completion or response to an internal processor,
7906          * the order of writes has to be such that this field is written last.
7907          */
7908         uint8_t valid;
7909 } __attribute__((packed));
7910
7911 /*****************
7912  * hwrm_func_cfg *
7913  *****************/
7914
7915
7916 /* hwrm_func_cfg_input (size:704b/88B) */
7917 struct hwrm_func_cfg_input {
7918         /* The HWRM command request type. */
7919         uint16_t        req_type;
7920         /*
7921          * The completion ring to send the completion event on. This should
7922          * be the NQ ID returned from the `nq_alloc` HWRM command.
7923          */
7924         uint16_t        cmpl_ring;
7925         /*
7926          * The sequence ID is used by the driver for tracking multiple
7927          * commands. This ID is treated as opaque data by the firmware and
7928          * the value is returned in the `hwrm_resp_hdr` upon completion.
7929          */
7930         uint16_t        seq_id;
7931         /*
7932          * The target ID of the command:
7933          * * 0x0-0xFFF8 - The function ID
7934          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
7935          * * 0xFFFD - Reserved for user-space HWRM interface
7936          * * 0xFFFF - HWRM
7937          */
7938         uint16_t        target_id;
7939         /*
7940          * A physical address pointer pointing to a host buffer that the
7941          * command's response data will be written. This can be either a host
7942          * physical address (HPA) or a guest physical address (GPA) and must
7943          * point to a physically contiguous block of memory.
7944          */
7945         uint64_t        resp_addr;
7946         /*
7947          * Function ID of the function that is being
7948          * configured.
7949          * If set to 0xFF... (All Fs), then the the configuration is
7950          * for the requesting function.
7951          */
7952         uint16_t        fid;
7953         /*
7954          * This field specifies how many NQs will be reserved for the PF.
7955          * Remaining NQs that belong to the PF become available for VFs.
7956          * Once a PF has created VFs, it cannot change how many NQs are
7957          * reserved for itself (since the NQs must be contiguous in HW).
7958          */
7959         uint16_t        num_msix;
7960         uint32_t        flags;
7961         /*
7962          * When this bit is '1', the function is disabled with
7963          * source MAC address check.
7964          * This is an anti-spoofing check. If this flag is set,
7965          * then the function shall be configured to disallow
7966          * transmission of frames with the source MAC address that
7967          * is configured for this function.
7968          */
7969         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \
7970                 UINT32_C(0x1)
7971         /*
7972          * When this bit is '1', the function is enabled with
7973          * source MAC address check.
7974          * This is an anti-spoofing check. If this flag is set,
7975          * then the function shall be configured to allow
7976          * transmission of frames with the source MAC address that
7977          * is configured for this function.
7978          */
7979         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \
7980                 UINT32_C(0x2)
7981         /* reserved. */
7982         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK \
7983                 UINT32_C(0x1fc)
7984         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT                       2
7985         /*
7986          * Standard TX Ring mode is used for the allocation of TX ring
7987          * and underlying scheduling resources that allow bandwidth
7988          * reservation and limit settings on the queried function.
7989          * If set to 1, then standard TX ring mode is requested to be
7990          * enabled on the function being configured.
7991          */
7992         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \
7993                 UINT32_C(0x200)
7994         /*
7995          * Standard TX Ring mode is used for the allocation of TX ring
7996          * and underlying scheduling resources that allow bandwidth
7997          * reservation and limit settings on the queried function.
7998          * If set to 1, then the standard TX ring mode is requested to
7999          * be disabled on the function being configured. In this extended
8000          * TX ring resource mode, the minimum and maximum bandwidth settings
8001          * are not supported to allow the allocation of TX rings to
8002          * span multiple scheduler nodes.
8003          */
8004         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \
8005                 UINT32_C(0x400)
8006         /*
8007          * If this bit is set, virtual mac address configured
8008          * in this command will be persistent over warm boot.
8009          */
8010         #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST \
8011                 UINT32_C(0x800)
8012         /*
8013          * This bit only applies to the VF. If this bit is set, the statistic
8014          * context counters will not be cleared when the statistic context is freed
8015          * or a function reset is called on VF. This bit will be cleared when the PF
8016          * is unloaded or a function reset is called on the PF.
8017          */
8018         #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC \
8019                 UINT32_C(0x1000)
8020         /*
8021          * This bit requests that the firmware test to see if all the assets
8022          * requested in this command (i.e. number of TX rings) are available.
8023          * The firmware will return an error if the requested assets are
8024          * not available. The firwmare will NOT reserve the assets if they
8025          * are available.
8026          */
8027         #define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
8028                 UINT32_C(0x2000)
8029         /*
8030          * This bit requests that the firmware test to see if all the assets
8031          * requested in this command (i.e. number of RX rings) are available.
8032          * The firmware will return an error if the requested assets are
8033          * not available. The firwmare will NOT reserve the assets if they
8034          * are available.
8035          */
8036         #define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
8037                 UINT32_C(0x4000)
8038         /*
8039          * This bit requests that the firmware test to see if all the assets
8040          * requested in this command (i.e. number of CMPL rings) are available.
8041          * The firmware will return an error if the requested assets are
8042          * not available. The firwmare will NOT reserve the assets if they
8043          * are available.
8044          */
8045         #define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
8046                 UINT32_C(0x8000)
8047         /*
8048          * This bit requests that the firmware test to see if all the assets
8049          * requested in this command (i.e. number of RSS ctx) are available.
8050          * The firmware will return an error if the requested assets are
8051          * not available. The firwmare will NOT reserve the assets if they
8052          * are available.
8053          */
8054         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
8055                 UINT32_C(0x10000)
8056         /*
8057          * This bit requests that the firmware test to see if all the assets
8058          * requested in this command (i.e. number of ring groups) are available.
8059          * The firmware will return an error if the requested assets are
8060          * not available. The firwmare will NOT reserve the assets if they
8061          * are available.
8062          */
8063         #define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
8064                 UINT32_C(0x20000)
8065         /*
8066          * This bit requests that the firmware test to see if all the assets
8067          * requested in this command (i.e. number of stat ctx) are available.
8068          * The firmware will return an error if the requested assets are
8069          * not available. The firwmare will NOT reserve the assets if they
8070          * are available.
8071          */
8072         #define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
8073                 UINT32_C(0x40000)
8074         /*
8075          * This bit requests that the firmware test to see if all the assets
8076          * requested in this command (i.e. number of VNICs) are available.
8077          * The firmware will return an error if the requested assets are
8078          * not available. The firwmare will NOT reserve the assets if they
8079          * are available.
8080          */
8081         #define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
8082                 UINT32_C(0x80000)
8083         /*
8084          * This bit requests that the firmware test to see if all the assets
8085          * requested in this command (i.e. number of L2 ctx) are available.
8086          * The firmware will return an error if the requested assets are
8087          * not available. The firwmare will NOT reserve the assets if they
8088          * are available.
8089          */
8090         #define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
8091                 UINT32_C(0x100000)
8092         /*
8093          * This configuration change can be initiated by a PF driver. This
8094          * configuration request shall be targeted to a VF. From local host
8095          * resident HWRM clients, only the parent PF driver shall be allowed
8096          * to initiate this change on one of its children VFs. If this bit is
8097          * set to 1, then the VF that is being configured is requested to be
8098          * trusted.
8099          */
8100         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_ENABLE \
8101                 UINT32_C(0x200000)
8102         /*
8103          * When this bit it set, even if PF reserved pool size is zero,
8104          * FW will allow driver to create TX rings in ring alloc,
8105          * by reserving TX ring, S3 node dynamically.
8106          */
8107         #define HWRM_FUNC_CFG_INPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
8108                 UINT32_C(0x400000)
8109         /*
8110          * This bit requests that the firmware test to see if all the assets
8111          * requested in this command (i.e. number of NQ rings) are available.
8112          * The firmware will return an error if the requested assets are
8113          * not available. The firwmare will NOT reserve the assets if they
8114          * are available.
8115          */
8116         #define HWRM_FUNC_CFG_INPUT_FLAGS_NQ_ASSETS_TEST \
8117                 UINT32_C(0x800000)
8118         /*
8119          * This configuration change can be initiated by a PF driver. This
8120          * configuration request shall be targeted to a VF. From local host
8121          * resident HWRM clients, only the parent PF driver shall be allowed
8122          * to initiate this change on one of its children VFs. If this bit is
8123          * set to 1, then the VF that is being configured is requested to be
8124          * untrusted.
8125          */
8126         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_DISABLE \
8127                 UINT32_C(0x1000000)
8128         /*
8129          * This bit is used by preboot drivers on a PF that require access
8130          * to the legacy L2 ring model and legacy 32b doorbells. This
8131          * feature is not allowed on VFs and is only relevant for devices
8132          * that require a context backing store.
8133          */
8134         #define HWRM_FUNC_CFG_INPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \
8135                 UINT32_C(0x2000000)
8136         uint32_t        enables;
8137         /*
8138          * This bit must be '1' for the mtu field to be
8139          * configured.
8140          */
8141         #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU \
8142                 UINT32_C(0x1)
8143         /*
8144          * This bit must be '1' for the mru field to be
8145          * configured.
8146          */
8147         #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU \
8148                 UINT32_C(0x2)
8149         /*
8150          * This bit must be '1' for the num_rsscos_ctxs field to be
8151          * configured.
8152          */
8153         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
8154                 UINT32_C(0x4)
8155         /*
8156          * This bit must be '1' for the num_cmpl_rings field to be
8157          * configured.
8158          */
8159         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
8160                 UINT32_C(0x8)
8161         /*
8162          * This bit must be '1' for the num_tx_rings field to be
8163          * configured.
8164          */
8165         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS \
8166                 UINT32_C(0x10)
8167         /*
8168          * This bit must be '1' for the num_rx_rings field to be
8169          * configured.
8170          */
8171         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS \
8172                 UINT32_C(0x20)
8173         /*
8174          * This bit must be '1' for the num_l2_ctxs field to be
8175          * configured.
8176          */
8177         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS \
8178                 UINT32_C(0x40)
8179         /*
8180          * This bit must be '1' for the num_vnics field to be
8181          * configured.
8182          */
8183         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS \
8184                 UINT32_C(0x80)
8185         /*
8186          * This bit must be '1' for the num_stat_ctxs field to be
8187          * configured.
8188          */
8189         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
8190                 UINT32_C(0x100)
8191         /*
8192          * This bit must be '1' for the dflt_mac_addr field to be
8193          * configured.
8194          */
8195         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
8196                 UINT32_C(0x200)
8197         /*
8198          * This bit must be '1' for the dflt_vlan field to be
8199          * configured.
8200          */
8201         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN \
8202                 UINT32_C(0x400)
8203         /*
8204          * This bit must be '1' for the dflt_ip_addr field to be
8205          * configured.
8206          */
8207         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR \
8208                 UINT32_C(0x800)
8209         /*
8210          * This bit must be '1' for the min_bw field to be
8211          * configured.
8212          */
8213         #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW \
8214                 UINT32_C(0x1000)
8215         /*
8216          * This bit must be '1' for the max_bw field to be
8217          * configured.
8218          */
8219         #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW \
8220                 UINT32_C(0x2000)
8221         /*
8222          * This bit must be '1' for the async_event_cr field to be
8223          * configured.
8224          */
8225         #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
8226                 UINT32_C(0x4000)
8227         /*
8228          * This bit must be '1' for the vlan_antispoof_mode field to be
8229          * configured.
8230          */
8231         #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE \
8232                 UINT32_C(0x8000)
8233         /*
8234          * This bit must be '1' for the allowed_vlan_pris field to be
8235          * configured.
8236          */
8237         #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS \
8238                 UINT32_C(0x10000)
8239         /*
8240          * This bit must be '1' for the evb_mode field to be
8241          * configured.
8242          */
8243         #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE \
8244                 UINT32_C(0x20000)
8245         /*
8246          * This bit must be '1' for the num_mcast_filters field to be
8247          * configured.
8248          */
8249         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS \
8250                 UINT32_C(0x40000)
8251         /*
8252          * This bit must be '1' for the num_hw_ring_grps field to be
8253          * configured.
8254          */
8255         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
8256                 UINT32_C(0x80000)
8257         /*
8258          * This bit must be '1' for the cache_linesize field to be
8259          * configured.
8260          */
8261         #define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE \
8262                 UINT32_C(0x100000)
8263         /*
8264          * This bit must be '1' for the num_msix field to be
8265          * configured.
8266          */
8267         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX \
8268                 UINT32_C(0x200000)
8269         /*
8270          * This bit must be '1' for the link admin state field to be
8271          * configured.
8272          */
8273         #define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE \
8274                 UINT32_C(0x400000)
8275         /*
8276          * The maximum transmission unit of the function.
8277          * The HWRM should make sure that the mtu of
8278          * the function does not exceed the mtu of the physical
8279          * port that this function is associated with.
8280          *
8281          * In addition to configuring mtu per function, it is
8282          * possible to configure mtu per transmit ring.
8283          * By default, the mtu of each transmit ring associated
8284          * with a function is equal to the mtu of the function.
8285          * The HWRM should make sure that the mtu of each transmit
8286          * ring that is assigned to a function has a valid mtu.
8287          */
8288         uint16_t        mtu;
8289         /*
8290          * The maximum receive unit of the function.
8291          * The HWRM should make sure that the mru of
8292          * the function does not exceed the mru of the physical
8293          * port that this function is associated with.
8294          *
8295          * In addition to configuring mru per function, it is
8296          * possible to configure mru per vnic.
8297          * By default, the mru of each vnic associated
8298          * with a function is equal to the mru of the function.
8299          * The HWRM should make sure that the mru of each vnic
8300          * that is assigned to a function has a valid mru.
8301          */
8302         uint16_t        mru;
8303         /*
8304          * The number of RSS/COS contexts requested for the
8305          * function.
8306          */
8307         uint16_t        num_rsscos_ctxs;
8308         /*
8309          * The number of completion rings requested for the
8310          * function. This does not include the rings allocated
8311          * to any children functions if any.
8312          */
8313         uint16_t        num_cmpl_rings;
8314         /*
8315          * The number of transmit rings requested for the function.
8316          * This does not include the rings allocated to any
8317          * children functions if any.
8318          */
8319         uint16_t        num_tx_rings;
8320         /*
8321          * The number of receive rings requested for the function.
8322          * This does not include the rings allocated
8323          * to any children functions if any.
8324          */
8325         uint16_t        num_rx_rings;
8326         /* The requested number of L2 contexts for the function. */
8327         uint16_t        num_l2_ctxs;
8328         /* The requested number of vnics for the function. */
8329         uint16_t        num_vnics;
8330         /* The requested number of statistic contexts for the function. */
8331         uint16_t        num_stat_ctxs;
8332         /*
8333          * The number of HW ring groups that should
8334          * be reserved for this function.
8335          */
8336         uint16_t        num_hw_ring_grps;
8337         /* The default MAC address for the function being configured. */
8338         uint8_t dflt_mac_addr[6];
8339         /*
8340          * The default VLAN for the function being configured.
8341          * This field's format is same as 802.1Q Tag's
8342          * Tag Control Information (TCI) format that includes both
8343          * Priority Code Point (PCP) and VLAN Identifier (VID).
8344          */
8345         uint16_t        dflt_vlan;
8346         /*
8347          * The default IP address for the function being configured.
8348          * This address is only used in enabling source property check.
8349          */
8350         uint32_t        dflt_ip_addr[4];
8351         /*
8352          * Minimum BW allocated for this function.
8353          * The HWRM will translate this value into byte counter and
8354          * time interval used for the scheduler inside the device.
8355          */
8356         uint32_t        min_bw;
8357         /* The bandwidth value. */
8358         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK \
8359                 UINT32_C(0xfffffff)
8360         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT              0
8361         /* The granularity of the value (bits or bytes). */
8362         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE \
8363                 UINT32_C(0x10000000)
8364         /* Value is in bits. */
8365         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS \
8366                 (UINT32_C(0x0) << 28)
8367         /* Value is in bytes. */
8368         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES \
8369                 (UINT32_C(0x1) << 28)
8370         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \
8371                 HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
8372         /* bw_value_unit is 3 b */
8373         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \
8374                 UINT32_C(0xe0000000)
8375         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
8376         /* Value is in Mb or MB (base 10). */
8377         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
8378                 (UINT32_C(0x0) << 29)
8379         /* Value is in Kb or KB (base 10). */
8380         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \
8381                 (UINT32_C(0x2) << 29)
8382         /* Value is in bits or bytes. */
8383         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \
8384                 (UINT32_C(0x4) << 29)
8385         /* Value is in Gb or GB (base 10). */
8386         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
8387                 (UINT32_C(0x6) << 29)
8388         /* Value is in 1/100th of a percentage of total bandwidth. */
8389         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
8390                 (UINT32_C(0x1) << 29)
8391         /* Invalid unit */
8392         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
8393                 (UINT32_C(0x7) << 29)
8394         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \
8395                 HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
8396         /*
8397          * Maximum BW allocated for this function.
8398          * The HWRM will translate this value into byte counter and
8399          * time interval used for the scheduler inside the device.
8400          */
8401         uint32_t        max_bw;
8402         /* The bandwidth value. */
8403         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \
8404                 UINT32_C(0xfffffff)
8405         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT              0
8406         /* The granularity of the value (bits or bytes). */
8407         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE \
8408                 UINT32_C(0x10000000)
8409         /* Value is in bits. */
8410         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS \
8411                 (UINT32_C(0x0) << 28)
8412         /* Value is in bytes. */
8413         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES \
8414                 (UINT32_C(0x1) << 28)
8415         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \
8416                 HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
8417         /* bw_value_unit is 3 b */
8418         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
8419                 UINT32_C(0xe0000000)
8420         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
8421         /* Value is in Mb or MB (base 10). */
8422         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
8423                 (UINT32_C(0x0) << 29)
8424         /* Value is in Kb or KB (base 10). */
8425         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
8426                 (UINT32_C(0x2) << 29)
8427         /* Value is in bits or bytes. */
8428         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
8429                 (UINT32_C(0x4) << 29)
8430         /* Value is in Gb or GB (base 10). */
8431         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
8432                 (UINT32_C(0x6) << 29)
8433         /* Value is in 1/100th of a percentage of total bandwidth. */
8434         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
8435                 (UINT32_C(0x1) << 29)
8436         /* Invalid unit */
8437         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
8438                 (UINT32_C(0x7) << 29)
8439         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
8440                 HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
8441         /*
8442          * ID of the target completion ring for receiving asynchronous
8443          * event completions. If this field is not valid, then the
8444          * HWRM shall use the default completion ring of the function
8445          * that is being configured as the target completion ring for
8446          * providing any asynchronous event completions for that
8447          * function.
8448          * If this field is valid, then the HWRM shall use the
8449          * completion ring identified by this ID as the target
8450          * completion ring for providing any asynchronous event
8451          * completions for the function that is being configured.
8452          */
8453         uint16_t        async_event_cr;
8454         /* VLAN Anti-spoofing mode. */
8455         uint8_t vlan_antispoof_mode;
8456         /* No VLAN anti-spoofing checks are enabled */
8457         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK \
8458                 UINT32_C(0x0)
8459         /* Validate VLAN against the configured VLAN(s) */
8460         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \
8461                 UINT32_C(0x1)
8462         /* Insert VLAN if it does not exist, otherwise discard */
8463         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \
8464                 UINT32_C(0x2)
8465         /* Insert VLAN if it does not exist, override VLAN if it exists */
8466         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \
8467                 UINT32_C(0x3)
8468         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST \
8469                 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN
8470         /*
8471          * This bit field defines VLAN PRIs that are allowed on
8472          * this function.
8473          * If nth bit is set, then VLAN PRI n is allowed on this
8474          * function.
8475          */
8476         uint8_t allowed_vlan_pris;
8477         /*
8478          * The HWRM shall allow a PF driver to change EVB mode for the
8479          * partition it belongs to.
8480          * The HWRM shall not allow a VF driver to change the EVB mode.
8481          * The HWRM shall take into account the switching of EVB mode
8482          * from one to another and reconfigure hardware resources as
8483          * appropriately.
8484          * The switching from VEB to VEPA mode requires
8485          * the disabling of the loopback traffic. Additionally,
8486          * source knock outs are handled differently in VEB and VEPA
8487          * modes.
8488          */
8489         uint8_t evb_mode;
8490         /* No Edge Virtual Bridging (EVB) */
8491         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
8492         /* Virtual Ethernet Bridge (VEB) */
8493         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB    UINT32_C(0x1)
8494         /* Virtual Ethernet Port Aggregator (VEPA) */
8495         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA   UINT32_C(0x2)
8496         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST \
8497                 HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA
8498         uint8_t options;
8499         /*
8500          * This value indicates the PCIE device cache line size.
8501          * The cache line size allows the DMA writes to terminate and
8502          * start at the cache boundary.
8503          */
8504         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK \
8505                 UINT32_C(0x3)
8506         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT          0
8507         /* Cache Line Size 64 bytes */
8508         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
8509                 UINT32_C(0x0)
8510         /* Cache Line Size 128 bytes */
8511         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
8512                 UINT32_C(0x1)
8513         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST \
8514                 HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
8515         /* This value is the virtual link admin state setting. */
8516         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
8517                 UINT32_C(0xc)
8518         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
8519         /* Admin state is forced down. */
8520         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
8521                 (UINT32_C(0x0) << 2)
8522         /* Admin state is forced up. */
8523         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
8524                 (UINT32_C(0x1) << 2)
8525         /* Admin state is in auto mode - is to follow the physical link state. */
8526         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
8527                 (UINT32_C(0x2) << 2)
8528         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
8529                 HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
8530         /* Reserved for future. */
8531         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK \
8532                 UINT32_C(0xf0)
8533         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT                    4
8534         /*
8535          * The number of multicast filters that should
8536          * be reserved for this function on the RX side.
8537          */
8538         uint16_t        num_mcast_filters;
8539 } __attribute__((packed));
8540
8541 /* hwrm_func_cfg_output (size:128b/16B) */
8542 struct hwrm_func_cfg_output {
8543         /* The specific error status for the command. */
8544         uint16_t        error_code;
8545         /* The HWRM command request type. */
8546         uint16_t        req_type;
8547         /* The sequence ID from the original command. */
8548         uint16_t        seq_id;
8549         /* The length of the response data in number of bytes. */
8550         uint16_t        resp_len;
8551         uint8_t unused_0[7];
8552         /*
8553          * This field is used in Output records to indicate that the output
8554          * is completely written to RAM.  This field should be read as '1'
8555          * to indicate that the output has been completely written.
8556          * When writing a command completion or response to an internal processor,
8557          * the order of writes has to be such that this field is written last.
8558          */
8559         uint8_t valid;
8560 } __attribute__((packed));
8561
8562 /********************
8563  * hwrm_func_qstats *
8564  ********************/
8565
8566
8567 /* hwrm_func_qstats_input (size:192b/24B) */
8568 struct hwrm_func_qstats_input {
8569         /* The HWRM command request type. */
8570         uint16_t        req_type;
8571         /*
8572          * The completion ring to send the completion event on. This should
8573          * be the NQ ID returned from the `nq_alloc` HWRM command.
8574          */
8575         uint16_t        cmpl_ring;
8576         /*
8577          * The sequence ID is used by the driver for tracking multiple
8578          * commands. This ID is treated as opaque data by the firmware and
8579          * the value is returned in the `hwrm_resp_hdr` upon completion.
8580          */
8581         uint16_t        seq_id;
8582         /*
8583          * The target ID of the command:
8584          * * 0x0-0xFFF8 - The function ID
8585          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8586          * * 0xFFFD - Reserved for user-space HWRM interface
8587          * * 0xFFFF - HWRM
8588          */
8589         uint16_t        target_id;
8590         /*
8591          * A physical address pointer pointing to a host buffer that the
8592          * command's response data will be written. This can be either a host
8593          * physical address (HPA) or a guest physical address (GPA) and must
8594          * point to a physically contiguous block of memory.
8595          */
8596         uint64_t        resp_addr;
8597         /*
8598          * Function ID of the function that is being queried.
8599          * 0xFF... (All Fs) if the query is for the requesting
8600          * function.
8601          */
8602         uint16_t        fid;
8603         uint8_t unused_0[6];
8604 } __attribute__((packed));
8605
8606 /* hwrm_func_qstats_output (size:1408b/176B) */
8607 struct hwrm_func_qstats_output {
8608         /* The specific error status for the command. */
8609         uint16_t        error_code;
8610         /* The HWRM command request type. */
8611         uint16_t        req_type;
8612         /* The sequence ID from the original command. */
8613         uint16_t        seq_id;
8614         /* The length of the response data in number of bytes. */
8615         uint16_t        resp_len;
8616         /* Number of transmitted unicast packets on the function. */
8617         uint64_t        tx_ucast_pkts;
8618         /* Number of transmitted multicast packets on the function. */
8619         uint64_t        tx_mcast_pkts;
8620         /* Number of transmitted broadcast packets on the function. */
8621         uint64_t        tx_bcast_pkts;
8622         /*
8623          * Number of transmitted packets that were discarded due to
8624          * internal NIC resource problems.  For transmit, this
8625          * can only happen if TMP is configured to allow dropping
8626          * in HOL blocking conditions, which is not a normal
8627          * configuration.
8628          */
8629         uint64_t        tx_discard_pkts;
8630         /*
8631          * Number of dropped packets on transmit path on the function.
8632          * These are packets that have been marked for drop by
8633          * the TE CFA block or are packets that exceeded the
8634          * transmit MTU limit for the function.
8635          */
8636         uint64_t        tx_drop_pkts;
8637         /* Number of transmitted bytes for unicast traffic on the function. */
8638         uint64_t        tx_ucast_bytes;
8639         /* Number of transmitted bytes for multicast traffic on the function. */
8640         uint64_t        tx_mcast_bytes;
8641         /* Number of transmitted bytes for broadcast traffic on the function. */
8642         uint64_t        tx_bcast_bytes;
8643         /* Number of received unicast packets on the function. */
8644         uint64_t        rx_ucast_pkts;
8645         /* Number of received multicast packets on the function. */
8646         uint64_t        rx_mcast_pkts;
8647         /* Number of received broadcast packets on the function. */
8648         uint64_t        rx_bcast_pkts;
8649         /*
8650          * Number of received packets that were discarded on the function
8651          * due to resource limitations.  This can happen for 3 reasons.
8652          * # The BD used for the packet has a bad format.
8653          * # There were no BDs available in the ring for the packet.
8654          * # There were no BDs available on-chip for the packet.
8655          */
8656         uint64_t        rx_discard_pkts;
8657         /*
8658          * Number of dropped packets on received path on the function.
8659          * These are packets that have been marked for drop by the
8660          * RE CFA.
8661          */
8662         uint64_t        rx_drop_pkts;
8663         /* Number of received bytes for unicast traffic on the function. */
8664         uint64_t        rx_ucast_bytes;
8665         /* Number of received bytes for multicast traffic on the function. */
8666         uint64_t        rx_mcast_bytes;
8667         /* Number of received bytes for broadcast traffic on the function. */
8668         uint64_t        rx_bcast_bytes;
8669         /* Number of aggregated unicast packets on the function. */
8670         uint64_t        rx_agg_pkts;
8671         /* Number of aggregated unicast bytes on the function. */
8672         uint64_t        rx_agg_bytes;
8673         /* Number of aggregation events on the function. */
8674         uint64_t        rx_agg_events;
8675         /* Number of aborted aggregations on the function. */
8676         uint64_t        rx_agg_aborts;
8677         uint8_t unused_0[7];
8678         /*
8679          * This field is used in Output records to indicate that the output
8680          * is completely written to RAM.  This field should be read as '1'
8681          * to indicate that the output has been completely written.
8682          * When writing a command completion or response to an internal processor,
8683          * the order of writes has to be such that this field is written last.
8684          */
8685         uint8_t valid;
8686 } __attribute__((packed));
8687
8688 /***********************
8689  * hwrm_func_clr_stats *
8690  ***********************/
8691
8692
8693 /* hwrm_func_clr_stats_input (size:192b/24B) */
8694 struct hwrm_func_clr_stats_input {
8695         /* The HWRM command request type. */
8696         uint16_t        req_type;
8697         /*
8698          * The completion ring to send the completion event on. This should
8699          * be the NQ ID returned from the `nq_alloc` HWRM command.
8700          */
8701         uint16_t        cmpl_ring;
8702         /*
8703          * The sequence ID is used by the driver for tracking multiple
8704          * commands. This ID is treated as opaque data by the firmware and
8705          * the value is returned in the `hwrm_resp_hdr` upon completion.
8706          */
8707         uint16_t        seq_id;
8708         /*
8709          * The target ID of the command:
8710          * * 0x0-0xFFF8 - The function ID
8711          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8712          * * 0xFFFD - Reserved for user-space HWRM interface
8713          * * 0xFFFF - HWRM
8714          */
8715         uint16_t        target_id;
8716         /*
8717          * A physical address pointer pointing to a host buffer that the
8718          * command's response data will be written. This can be either a host
8719          * physical address (HPA) or a guest physical address (GPA) and must
8720          * point to a physically contiguous block of memory.
8721          */
8722         uint64_t        resp_addr;
8723         /*
8724          * Function ID of the function.
8725          * 0xFF... (All Fs) if the query is for the requesting
8726          * function.
8727          */
8728         uint16_t        fid;
8729         uint8_t unused_0[6];
8730 } __attribute__((packed));
8731
8732 /* hwrm_func_clr_stats_output (size:128b/16B) */
8733 struct hwrm_func_clr_stats_output {
8734         /* The specific error status for the command. */
8735         uint16_t        error_code;
8736         /* The HWRM command request type. */
8737         uint16_t        req_type;
8738         /* The sequence ID from the original command. */
8739         uint16_t        seq_id;
8740         /* The length of the response data in number of bytes. */
8741         uint16_t        resp_len;
8742         uint8_t unused_0[7];
8743         /*
8744          * This field is used in Output records to indicate that the output
8745          * is completely written to RAM.  This field should be read as '1'
8746          * to indicate that the output has been completely written.
8747          * When writing a command completion or response to an internal processor,
8748          * the order of writes has to be such that this field is written last.
8749          */
8750         uint8_t valid;
8751 } __attribute__((packed));
8752
8753 /**************************
8754  * hwrm_func_vf_resc_free *
8755  **************************/
8756
8757
8758 /* hwrm_func_vf_resc_free_input (size:192b/24B) */
8759 struct hwrm_func_vf_resc_free_input {
8760         /* The HWRM command request type. */
8761         uint16_t        req_type;
8762         /*
8763          * The completion ring to send the completion event on. This should
8764          * be the NQ ID returned from the `nq_alloc` HWRM command.
8765          */
8766         uint16_t        cmpl_ring;
8767         /*
8768          * The sequence ID is used by the driver for tracking multiple
8769          * commands. This ID is treated as opaque data by the firmware and
8770          * the value is returned in the `hwrm_resp_hdr` upon completion.
8771          */
8772         uint16_t        seq_id;
8773         /*
8774          * The target ID of the command:
8775          * * 0x0-0xFFF8 - The function ID
8776          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8777          * * 0xFFFD - Reserved for user-space HWRM interface
8778          * * 0xFFFF - HWRM
8779          */
8780         uint16_t        target_id;
8781         /*
8782          * A physical address pointer pointing to a host buffer that the
8783          * command's response data will be written. This can be either a host
8784          * physical address (HPA) or a guest physical address (GPA) and must
8785          * point to a physically contiguous block of memory.
8786          */
8787         uint64_t        resp_addr;
8788         /*
8789          * This value is used to identify a Virtual Function (VF).
8790          * The scope of VF ID is local within a PF.
8791          */
8792         uint16_t        vf_id;
8793         uint8_t unused_0[6];
8794 } __attribute__((packed));
8795
8796 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
8797 struct hwrm_func_vf_resc_free_output {
8798         /* The specific error status for the command. */
8799         uint16_t        error_code;
8800         /* The HWRM command request type. */
8801         uint16_t        req_type;
8802         /* The sequence ID from the original command. */
8803         uint16_t        seq_id;
8804         /* The length of the response data in number of bytes. */
8805         uint16_t        resp_len;
8806         uint8_t unused_0[7];
8807         /*
8808          * This field is used in Output records to indicate that the output
8809          * is completely written to RAM.  This field should be read as '1'
8810          * to indicate that the output has been completely written.
8811          * When writing a command completion or response to an internal processor,
8812          * the order of writes has to be such that this field is written last.
8813          */
8814         uint8_t valid;
8815 } __attribute__((packed));
8816
8817 /**********************
8818  * hwrm_func_drv_rgtr *
8819  **********************/
8820
8821
8822 /* hwrm_func_drv_rgtr_input (size:896b/112B) */
8823 struct hwrm_func_drv_rgtr_input {
8824         /* The HWRM command request type. */
8825         uint16_t        req_type;
8826         /*
8827          * The completion ring to send the completion event on. This should
8828          * be the NQ ID returned from the `nq_alloc` HWRM command.
8829          */
8830         uint16_t        cmpl_ring;
8831         /*
8832          * The sequence ID is used by the driver for tracking multiple
8833          * commands. This ID is treated as opaque data by the firmware and
8834          * the value is returned in the `hwrm_resp_hdr` upon completion.
8835          */
8836         uint16_t        seq_id;
8837         /*
8838          * The target ID of the command:
8839          * * 0x0-0xFFF8 - The function ID
8840          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8841          * * 0xFFFD - Reserved for user-space HWRM interface
8842          * * 0xFFFF - HWRM
8843          */
8844         uint16_t        target_id;
8845         /*
8846          * A physical address pointer pointing to a host buffer that the
8847          * command's response data will be written. This can be either a host
8848          * physical address (HPA) or a guest physical address (GPA) and must
8849          * point to a physically contiguous block of memory.
8850          */
8851         uint64_t        resp_addr;
8852         uint32_t        flags;
8853         /*
8854          * When this bit is '1', the function driver is requesting
8855          * all requests from its children VF drivers to be
8856          * forwarded to itself.
8857          * This flag can only be set by the PF driver.
8858          * If a VF driver sets this flag, it should be ignored
8859          * by the HWRM.
8860          */
8861         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE \
8862                 UINT32_C(0x1)
8863         /*
8864          * When this bit is '1', the function is requesting none of
8865          * the requests from its children VF drivers to be
8866          * forwarded to itself.
8867          * This flag can only be set by the PF driver.
8868          * If a VF driver sets this flag, it should be ignored
8869          * by the HWRM.
8870          */
8871         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE \
8872                 UINT32_C(0x2)
8873         /*
8874          * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b
8875          * fields shall be ignored and ver_maj, ver_min, ver_upd
8876          * and ver_patch shall be used for the driver version information.
8877          * When this bit is '0', then ver_maj_8b, ver_min_8b, ver_upd_8b
8878          * fields shall be used for the driver version information and
8879          * ver_maj, ver_min, ver_upd and ver_patch shall be ignored.
8880          */
8881         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE \
8882                 UINT32_C(0x4)
8883         /*
8884          * When this bit is '1', the function is indicating support of
8885          * 64bit flow handle.  The firmware that only supports 64bit flow
8886          * handle should check this bit before allowing processing of
8887          * HWRM_CFA_FLOW_XXX commands from the requesting function as firmware
8888          * with 64bit flow handle support can only be compatible with drivers
8889          * that support 64bit flow handle. The legacy drivers that don't support
8890          * 64bit flow handle won't be able to use HWRM_CFA_FLOW_XXX commands when
8891          * running with new firmware that only supports 64bit flow handle. The new
8892          * firmware support 64bit flow handle returns HWRM_ERR_CODE_CMD_NOT_SUPPORTED
8893          * status to the legacy driver when encounters these commands.
8894          */
8895         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE \
8896                 UINT32_C(0x8)
8897         /*
8898          * When this bit is '1', the function is indicating support of
8899          * Hot Reset. The driver interface will destroy the resources,
8900          * unregister the function and register again up on receiving
8901          * the RESET_NOTIFY Async notification from the core firmware.
8902          * The core firmware will this use flag and trigger the Hot Reset
8903          * process only if all the registered driver instances are capable
8904          * of this support.
8905          */
8906         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT \
8907                 UINT32_C(0x10)
8908         /*
8909          * When this bit is 1, the function is indicating the support of the
8910          * error recovery capability. Error recovery support will be used by
8911          * firmware only if all the driver instances support error recovery
8912          * process. By setting this bit, driver is indicating support for
8913          * corresponding async event completion message. These will be
8914          * delivered to the driver even if they did not register for it.
8915          * If supported, after receiving reset notify async event with fatal
8916          * flag set in event data1, then all the drivers have to tear down
8917          * their resources without sending any HWRM commands to FW.
8918          */
8919         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT \
8920                 UINT32_C(0x20)
8921         uint32_t        enables;
8922         /*
8923          * This bit must be '1' for the os_type field to be
8924          * configured.
8925          */
8926         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE \
8927                 UINT32_C(0x1)
8928         /*
8929          * This bit must be '1' for the ver field to be
8930          * configured.
8931          */
8932         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER \
8933                 UINT32_C(0x2)
8934         /*
8935          * This bit must be '1' for the timestamp field to be
8936          * configured.
8937          */
8938         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP \
8939                 UINT32_C(0x4)
8940         /*
8941          * This bit must be '1' for the vf_req_fwd field to be
8942          * configured.
8943          */
8944         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD \
8945                 UINT32_C(0x8)
8946         /*
8947          * This bit must be '1' for the async_event_fwd field to be
8948          * configured.
8949          */
8950         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
8951                 UINT32_C(0x10)
8952         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
8953         uint16_t        os_type;
8954         /* Unknown */
8955         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
8956         /* Other OS not listed below. */
8957         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER     UINT32_C(0x1)
8958         /* MSDOS OS. */
8959         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
8960         /* Windows OS. */
8961         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
8962         /* Solaris OS. */
8963         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
8964         /* Linux OS. */
8965         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX     UINT32_C(0x24)
8966         /* FreeBSD OS. */
8967         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
8968         /* VMware ESXi OS. */
8969         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI      UINT32_C(0x68)
8970         /* Microsoft Windows 8 64-bit OS. */
8971         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864    UINT32_C(0x73)
8972         /* Microsoft Windows Server 2012 R2 OS. */
8973         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
8974         /* UEFI driver. */
8975         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
8976         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST \
8977                 HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
8978         /* This is the 8bit major version of the driver. */
8979         uint8_t ver_maj_8b;
8980         /* This is the 8bit minor version of the driver. */
8981         uint8_t ver_min_8b;
8982         /* This is the 8bit update version of the driver. */
8983         uint8_t ver_upd_8b;
8984         uint8_t unused_0[3];
8985         /*
8986          * This is a 32-bit timestamp provided by the driver for
8987          * keep alive.
8988          * The timestamp is in multiples of 1ms.
8989          */
8990         uint32_t        timestamp;
8991         uint8_t unused_1[4];
8992         /*
8993          * This is a 256-bit bit mask provided by the PF driver for
8994          * letting the HWRM know what commands issued by the VF driver
8995          * to the HWRM should be forwarded to the PF driver.
8996          * Nth bit refers to the Nth req_type.
8997          *
8998          * Setting Nth bit to 1 indicates that requests from the
8999          * VF driver with req_type equal to N shall be forwarded to
9000          * the parent PF driver.
9001          *
9002          * This field is not valid for the VF driver.
9003          */
9004         uint32_t        vf_req_fwd[8];
9005         /*
9006          * This is a 256-bit bit mask provided by the function driver
9007          * (PF or VF driver) to indicate the list of asynchronous event
9008          * completions to be forwarded.
9009          *
9010          * Nth bit refers to the Nth event_id.
9011          *
9012          * Setting Nth bit to 1 by the function driver shall result in
9013          * the HWRM forwarding asynchronous event completion with
9014          * event_id equal to N.
9015          *
9016          * If all bits are set to 0 (value of 0), then the HWRM shall
9017          * not forward any asynchronous event completion to this
9018          * function driver.
9019          */
9020         uint32_t        async_event_fwd[8];
9021         /* This is the 16bit major version of the driver. */
9022         uint16_t        ver_maj;
9023         /* This is the 16bit minor version of the driver. */
9024         uint16_t        ver_min;
9025         /* This is the 16bit update version of the driver. */
9026         uint16_t        ver_upd;
9027         /* This is the 16bit patch version of the driver. */
9028         uint16_t        ver_patch;
9029 } __attribute__((packed));
9030
9031 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
9032 struct hwrm_func_drv_rgtr_output {
9033         /* The specific error status for the command. */
9034         uint16_t        error_code;
9035         /* The HWRM command request type. */
9036         uint16_t        req_type;
9037         /* The sequence ID from the original command. */
9038         uint16_t        seq_id;
9039         /* The length of the response data in number of bytes. */
9040         uint16_t        resp_len;
9041         uint32_t        flags;
9042         /*
9043          * When this bit is '1', it indicates that the
9044          * HWRM_FUNC_DRV_IF_CHANGE call is supported.
9045          */
9046         #define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED \
9047                 UINT32_C(0x1)
9048         uint8_t unused_0[3];
9049         /*
9050          * This field is used in Output records to indicate that the output
9051          * is completely written to RAM.  This field should be read as '1'
9052          * to indicate that the output has been completely written.
9053          * When writing a command completion or response to an internal processor,
9054          * the order of writes has to be such that this field is written last.
9055          */
9056         uint8_t valid;
9057 } __attribute__((packed));
9058
9059 /************************
9060  * hwrm_func_drv_unrgtr *
9061  ************************/
9062
9063
9064 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
9065 struct hwrm_func_drv_unrgtr_input {
9066         /* The HWRM command request type. */
9067         uint16_t        req_type;
9068         /*
9069          * The completion ring to send the completion event on. This should
9070          * be the NQ ID returned from the `nq_alloc` HWRM command.
9071          */
9072         uint16_t        cmpl_ring;
9073         /*
9074          * The sequence ID is used by the driver for tracking multiple
9075          * commands. This ID is treated as opaque data by the firmware and
9076          * the value is returned in the `hwrm_resp_hdr` upon completion.
9077          */
9078         uint16_t        seq_id;
9079         /*
9080          * The target ID of the command:
9081          * * 0x0-0xFFF8 - The function ID
9082          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9083          * * 0xFFFD - Reserved for user-space HWRM interface
9084          * * 0xFFFF - HWRM
9085          */
9086         uint16_t        target_id;
9087         /*
9088          * A physical address pointer pointing to a host buffer that the
9089          * command's response data will be written. This can be either a host
9090          * physical address (HPA) or a guest physical address (GPA) and must
9091          * point to a physically contiguous block of memory.
9092          */
9093         uint64_t        resp_addr;
9094         uint32_t        flags;
9095         /*
9096          * When this bit is '1', the function driver is notifying
9097          * the HWRM to prepare for the shutdown.
9098          */
9099         #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
9100                 UINT32_C(0x1)
9101         uint8_t unused_0[4];
9102 } __attribute__((packed));
9103
9104 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
9105 struct hwrm_func_drv_unrgtr_output {
9106         /* The specific error status for the command. */
9107         uint16_t        error_code;
9108         /* The HWRM command request type. */
9109         uint16_t        req_type;
9110         /* The sequence ID from the original command. */
9111         uint16_t        seq_id;
9112         /* The length of the response data in number of bytes. */
9113         uint16_t        resp_len;
9114         uint8_t unused_0[7];
9115         /*
9116          * This field is used in Output records to indicate that the output
9117          * is completely written to RAM.  This field should be read as '1'
9118          * to indicate that the output has been completely written.
9119          * When writing a command completion or response to an internal processor,
9120          * the order of writes has to be such that this field is written last.
9121          */
9122         uint8_t valid;
9123 } __attribute__((packed));
9124
9125 /**********************
9126  * hwrm_func_buf_rgtr *
9127  **********************/
9128
9129
9130 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
9131 struct hwrm_func_buf_rgtr_input {
9132         /* The HWRM command request type. */
9133         uint16_t        req_type;
9134         /*
9135          * The completion ring to send the completion event on. This should
9136          * be the NQ ID returned from the `nq_alloc` HWRM command.
9137          */
9138         uint16_t        cmpl_ring;
9139         /*
9140          * The sequence ID is used by the driver for tracking multiple
9141          * commands. This ID is treated as opaque data by the firmware and
9142          * the value is returned in the `hwrm_resp_hdr` upon completion.
9143          */
9144         uint16_t        seq_id;
9145         /*
9146          * The target ID of the command:
9147          * * 0x0-0xFFF8 - The function ID
9148          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9149          * * 0xFFFD - Reserved for user-space HWRM interface
9150          * * 0xFFFF - HWRM
9151          */
9152         uint16_t        target_id;
9153         /*
9154          * A physical address pointer pointing to a host buffer that the
9155          * command's response data will be written. This can be either a host
9156          * physical address (HPA) or a guest physical address (GPA) and must
9157          * point to a physically contiguous block of memory.
9158          */
9159         uint64_t        resp_addr;
9160         uint32_t        enables;
9161         /*
9162          * This bit must be '1' for the vf_id field to be
9163          * configured.
9164          */
9165         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID            UINT32_C(0x1)
9166         /*
9167          * This bit must be '1' for the err_buf_addr field to be
9168          * configured.
9169          */
9170         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR     UINT32_C(0x2)
9171         /*
9172          * This value is used to identify a Virtual Function (VF).
9173          * The scope of VF ID is local within a PF.
9174          */
9175         uint16_t        vf_id;
9176         /*
9177          * This field represents the number of pages used for request
9178          * buffer(s).
9179          */
9180         uint16_t        req_buf_num_pages;
9181         /*
9182          * This field represents the page size used for request
9183          * buffer(s).
9184          */
9185         uint16_t        req_buf_page_size;
9186         /* 16 bytes */
9187         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
9188         /* 4 Kbytes */
9189         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K  UINT32_C(0xc)
9190         /* 8 Kbytes */
9191         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K  UINT32_C(0xd)
9192         /* 64 Kbytes */
9193         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
9194         /* 2 Mbytes */
9195         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M  UINT32_C(0x15)
9196         /* 4 Mbytes */
9197         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M  UINT32_C(0x16)
9198         /* 1 Gbytes */
9199         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G  UINT32_C(0x1e)
9200         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST \
9201                 HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
9202         /* The length of the request buffer per VF in bytes. */
9203         uint16_t        req_buf_len;
9204         /* The length of the response buffer in bytes. */
9205         uint16_t        resp_buf_len;
9206         uint8_t unused_0[2];
9207         /* This field represents the page address of page #0. */
9208         uint64_t        req_buf_page_addr0;
9209         /* This field represents the page address of page #1. */
9210         uint64_t        req_buf_page_addr1;
9211         /* This field represents the page address of page #2. */
9212         uint64_t        req_buf_page_addr2;
9213         /* This field represents the page address of page #3. */
9214         uint64_t        req_buf_page_addr3;
9215         /* This field represents the page address of page #4. */
9216         uint64_t        req_buf_page_addr4;
9217         /* This field represents the page address of page #5. */
9218         uint64_t        req_buf_page_addr5;
9219         /* This field represents the page address of page #6. */
9220         uint64_t        req_buf_page_addr6;
9221         /* This field represents the page address of page #7. */
9222         uint64_t        req_buf_page_addr7;
9223         /* This field represents the page address of page #8. */
9224         uint64_t        req_buf_page_addr8;
9225         /* This field represents the page address of page #9. */
9226         uint64_t        req_buf_page_addr9;
9227         /*
9228          * This field is used to receive the error reporting from
9229          * the chipset. Only applicable for PFs.
9230          */
9231         uint64_t        error_buf_addr;
9232         /*
9233          * This field is used to receive the response forwarded by the
9234          * HWRM.
9235          */
9236         uint64_t        resp_buf_addr;
9237 } __attribute__((packed));
9238
9239 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
9240 struct hwrm_func_buf_rgtr_output {
9241         /* The specific error status for the command. */
9242         uint16_t        error_code;
9243         /* The HWRM command request type. */
9244         uint16_t        req_type;
9245         /* The sequence ID from the original command. */
9246         uint16_t        seq_id;
9247         /* The length of the response data in number of bytes. */
9248         uint16_t        resp_len;
9249         uint8_t unused_0[7];
9250         /*
9251          * This field is used in Output records to indicate that the output
9252          * is completely written to RAM.  This field should be read as '1'
9253          * to indicate that the output has been completely written.
9254          * When writing a command completion or response to an internal processor,
9255          * the order of writes has to be such that this field is written last.
9256          */
9257         uint8_t valid;
9258 } __attribute__((packed));
9259
9260 /************************
9261  * hwrm_func_buf_unrgtr *
9262  ************************/
9263
9264
9265 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
9266 struct hwrm_func_buf_unrgtr_input {
9267         /* The HWRM command request type. */
9268         uint16_t        req_type;
9269         /*
9270          * The completion ring to send the completion event on. This should
9271          * be the NQ ID returned from the `nq_alloc` HWRM command.
9272          */
9273         uint16_t        cmpl_ring;
9274         /*
9275          * The sequence ID is used by the driver for tracking multiple
9276          * commands. This ID is treated as opaque data by the firmware and
9277          * the value is returned in the `hwrm_resp_hdr` upon completion.
9278          */
9279         uint16_t        seq_id;
9280         /*
9281          * The target ID of the command:
9282          * * 0x0-0xFFF8 - The function ID
9283          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9284          * * 0xFFFD - Reserved for user-space HWRM interface
9285          * * 0xFFFF - HWRM
9286          */
9287         uint16_t        target_id;
9288         /*
9289          * A physical address pointer pointing to a host buffer that the
9290          * command's response data will be written. This can be either a host
9291          * physical address (HPA) or a guest physical address (GPA) and must
9292          * point to a physically contiguous block of memory.
9293          */
9294         uint64_t        resp_addr;
9295         uint32_t        enables;
9296         /*
9297          * This bit must be '1' for the vf_id field to be
9298          * configured.
9299          */
9300         #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID     UINT32_C(0x1)
9301         /*
9302          * This value is used to identify a Virtual Function (VF).
9303          * The scope of VF ID is local within a PF.
9304          */
9305         uint16_t        vf_id;
9306         uint8_t unused_0[2];
9307 } __attribute__((packed));
9308
9309 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
9310 struct hwrm_func_buf_unrgtr_output {
9311         /* The specific error status for the command. */
9312         uint16_t        error_code;
9313         /* The HWRM command request type. */
9314         uint16_t        req_type;
9315         /* The sequence ID from the original command. */
9316         uint16_t        seq_id;
9317         /* The length of the response data in number of bytes. */
9318         uint16_t        resp_len;
9319         uint8_t unused_0[7];
9320         /*
9321          * This field is used in Output records to indicate that the output
9322          * is completely written to RAM.  This field should be read as '1'
9323          * to indicate that the output has been completely written.
9324          * When writing a command completion or response to an internal processor,
9325          * the order of writes has to be such that this field is written last.
9326          */
9327         uint8_t valid;
9328 } __attribute__((packed));
9329
9330 /**********************
9331  * hwrm_func_drv_qver *
9332  **********************/
9333
9334
9335 /* hwrm_func_drv_qver_input (size:192b/24B) */
9336 struct hwrm_func_drv_qver_input {
9337         /* The HWRM command request type. */
9338         uint16_t        req_type;
9339         /*
9340          * The completion ring to send the completion event on. This should
9341          * be the NQ ID returned from the `nq_alloc` HWRM command.
9342          */
9343         uint16_t        cmpl_ring;
9344         /*
9345          * The sequence ID is used by the driver for tracking multiple
9346          * commands. This ID is treated as opaque data by the firmware and
9347          * the value is returned in the `hwrm_resp_hdr` upon completion.
9348          */
9349         uint16_t        seq_id;
9350         /*
9351          * The target ID of the command:
9352          * * 0x0-0xFFF8 - The function ID
9353          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9354          * * 0xFFFD - Reserved for user-space HWRM interface
9355          * * 0xFFFF - HWRM
9356          */
9357         uint16_t        target_id;
9358         /*
9359          * A physical address pointer pointing to a host buffer that the
9360          * command's response data will be written. This can be either a host
9361          * physical address (HPA) or a guest physical address (GPA) and must
9362          * point to a physically contiguous block of memory.
9363          */
9364         uint64_t        resp_addr;
9365         /* Reserved for future use. */
9366         uint32_t        reserved;
9367         /*
9368          * Function ID of the function that is being queried.
9369          * 0xFF... (All Fs) if the query is for the requesting
9370          * function.
9371          */
9372         uint16_t        fid;
9373         uint8_t unused_0[2];
9374 } __attribute__((packed));
9375
9376 /* hwrm_func_drv_qver_output (size:256b/32B) */
9377 struct hwrm_func_drv_qver_output {
9378         /* The specific error status for the command. */
9379         uint16_t        error_code;
9380         /* The HWRM command request type. */
9381         uint16_t        req_type;
9382         /* The sequence ID from the original command. */
9383         uint16_t        seq_id;
9384         /* The length of the response data in number of bytes. */
9385         uint16_t        resp_len;
9386         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
9387         uint16_t        os_type;
9388         /* Unknown */
9389         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
9390         /* Other OS not listed below. */
9391         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER     UINT32_C(0x1)
9392         /* MSDOS OS. */
9393         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
9394         /* Windows OS. */
9395         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
9396         /* Solaris OS. */
9397         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
9398         /* Linux OS. */
9399         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX     UINT32_C(0x24)
9400         /* FreeBSD OS. */
9401         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
9402         /* VMware ESXi OS. */
9403         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI      UINT32_C(0x68)
9404         /* Microsoft Windows 8 64-bit OS. */
9405         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864    UINT32_C(0x73)
9406         /* Microsoft Windows Server 2012 R2 OS. */
9407         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
9408         /* UEFI driver. */
9409         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
9410         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST \
9411                 HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
9412         /* This is the 8bit major version of the driver. */
9413         uint8_t ver_maj_8b;
9414         /* This is the 8bit minor version of the driver. */
9415         uint8_t ver_min_8b;
9416         /* This is the 8bit update version of the driver. */
9417         uint8_t ver_upd_8b;
9418         uint8_t unused_0[3];
9419         /* This is the 16bit major version of the driver. */
9420         uint16_t        ver_maj;
9421         /* This is the 16bit minor version of the driver. */
9422         uint16_t        ver_min;
9423         /* This is the 16bit update version of the driver. */
9424         uint16_t        ver_upd;
9425         /* This is the 16bit patch version of the driver. */
9426         uint16_t        ver_patch;
9427         uint8_t unused_1[7];
9428         /*
9429          * This field is used in Output records to indicate that the output
9430          * is completely written to RAM.  This field should be read as '1'
9431          * to indicate that the output has been completely written.
9432          * When writing a command completion or response to an internal processor,
9433          * the order of writes has to be such that this field is written last.
9434          */
9435         uint8_t valid;
9436 } __attribute__((packed));
9437
9438 /****************************
9439  * hwrm_func_resource_qcaps *
9440  ****************************/
9441
9442
9443 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
9444 struct hwrm_func_resource_qcaps_input {
9445         /* The HWRM command request type. */
9446         uint16_t        req_type;
9447         /*
9448          * The completion ring to send the completion event on. This should
9449          * be the NQ ID returned from the `nq_alloc` HWRM command.
9450          */
9451         uint16_t        cmpl_ring;
9452         /*
9453          * The sequence ID is used by the driver for tracking multiple
9454          * commands. This ID is treated as opaque data by the firmware and
9455          * the value is returned in the `hwrm_resp_hdr` upon completion.
9456          */
9457         uint16_t        seq_id;
9458         /*
9459          * The target ID of the command:
9460          * * 0x0-0xFFF8 - The function ID
9461          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9462          * * 0xFFFD - Reserved for user-space HWRM interface
9463          * * 0xFFFF - HWRM
9464          */
9465         uint16_t        target_id;
9466         /*
9467          * A physical address pointer pointing to a host buffer that the
9468          * command's response data will be written. This can be either a host
9469          * physical address (HPA) or a guest physical address (GPA) and must
9470          * point to a physically contiguous block of memory.
9471          */
9472         uint64_t        resp_addr;
9473         /*
9474          * Function ID of the function that is being queried.
9475          * 0xFF... (All Fs) if the query is for the requesting
9476          * function.
9477          */
9478         uint16_t        fid;
9479         uint8_t unused_0[6];
9480 } __attribute__((packed));
9481
9482 /* hwrm_func_resource_qcaps_output (size:448b/56B) */
9483 struct hwrm_func_resource_qcaps_output {
9484         /* The specific error status for the command. */
9485         uint16_t        error_code;
9486         /* The HWRM command request type. */
9487         uint16_t        req_type;
9488         /* The sequence ID from the original command. */
9489         uint16_t        seq_id;
9490         /* The length of the response data in number of bytes. */
9491         uint16_t        resp_len;
9492         /* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */
9493         uint16_t        max_vfs;
9494         /* Maximum guaranteed number of MSI-X vectors supported by function */
9495         uint16_t        max_msix;
9496         /* Hint of strategy to be used by PF driver to reserve resources for its VF */
9497         uint16_t        vf_reservation_strategy;
9498         /* The PF driver should evenly divide its remaining resources among all VFs. */
9499         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL \
9500                 UINT32_C(0x0)
9501         /* The PF driver should only reserve minimal resources for each VF. */
9502         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL \
9503                 UINT32_C(0x1)
9504         /*
9505          * The PF driver should not reserve any resources for each VF until the
9506          * the VF interface is brought up.
9507          */
9508         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC \
9509                 UINT32_C(0x2)
9510         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST \
9511                 HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
9512         /* Minimum guaranteed number of RSS/COS contexts */
9513         uint16_t        min_rsscos_ctx;
9514         /* Maximum non-guaranteed number of RSS/COS contexts */
9515         uint16_t        max_rsscos_ctx;
9516         /* Minimum guaranteed number of completion rings */
9517         uint16_t        min_cmpl_rings;
9518         /* Maximum non-guaranteed number of completion rings */
9519         uint16_t        max_cmpl_rings;
9520         /* Minimum guaranteed number of transmit rings */
9521         uint16_t        min_tx_rings;
9522         /* Maximum non-guaranteed number of transmit rings */
9523         uint16_t        max_tx_rings;
9524         /* Minimum guaranteed number of receive rings */
9525         uint16_t        min_rx_rings;
9526         /* Maximum non-guaranteed number of receive rings */
9527         uint16_t        max_rx_rings;
9528         /* Minimum guaranteed number of L2 contexts */
9529         uint16_t        min_l2_ctxs;
9530         /* Maximum non-guaranteed number of L2 contexts */
9531         uint16_t        max_l2_ctxs;
9532         /* Minimum guaranteed number of VNICs */
9533         uint16_t        min_vnics;
9534         /* Maximum non-guaranteed number of VNICs */
9535         uint16_t        max_vnics;
9536         /* Minimum guaranteed number of statistic contexts */
9537         uint16_t        min_stat_ctx;
9538         /* Maximum non-guaranteed number of statistic contexts */
9539         uint16_t        max_stat_ctx;
9540         /* Minimum guaranteed number of ring groups */
9541         uint16_t        min_hw_ring_grps;
9542         /* Maximum non-guaranteed number of ring groups */
9543         uint16_t        max_hw_ring_grps;
9544         /*
9545          * Maximum number of inputs into the transmit scheduler for this function.
9546          * The number of TX rings assigned to the function cannot exceed this value.
9547          */
9548         uint16_t        max_tx_scheduler_inputs;
9549         uint16_t        flags;
9550         /*
9551          * When this bit is '1', it indicates that VF_RESOURCE_CFG supports
9552          * feature to reserve all minimum resources when minimum >= 1, otherwise
9553          * returns an error.
9554          */
9555         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED \
9556                 UINT32_C(0x1)
9557         uint8_t unused_0[5];
9558         /*
9559          * This field is used in Output records to indicate that the output
9560          * is completely written to RAM.  This field should be read as '1'
9561          * to indicate that the output has been completely written.
9562          * When writing a command completion or response to an internal processor,
9563          * the order of writes has to be such that this field is written last.
9564          */
9565         uint8_t valid;
9566 } __attribute__((packed));
9567
9568 /*********************************
9569  * hwrm_func_backing_store_qcaps *
9570  *********************************/
9571
9572
9573 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
9574 struct hwrm_func_backing_store_qcaps_input {
9575         /* The HWRM command request type. */
9576         uint16_t        req_type;
9577         /*
9578          * The completion ring to send the completion event on. This should
9579          * be the NQ ID returned from the `nq_alloc` HWRM command.
9580          */
9581         uint16_t        cmpl_ring;
9582         /*
9583          * The sequence ID is used by the driver for tracking multiple
9584          * commands. This ID is treated as opaque data by the firmware and
9585          * the value is returned in the `hwrm_resp_hdr` upon completion.
9586          */
9587         uint16_t        seq_id;
9588         /*
9589          * The target ID of the command:
9590          * * 0x0-0xFFF8 - The function ID
9591          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9592          * * 0xFFFD - Reserved for user-space HWRM interface
9593          * * 0xFFFF - HWRM
9594          */
9595         uint16_t        target_id;
9596         /*
9597          * A physical address pointer pointing to a host buffer that the
9598          * command's response data will be written. This can be either a host
9599          * physical address (HPA) or a guest physical address (GPA) and must
9600          * point to a physically contiguous block of memory.
9601          */
9602         uint64_t        resp_addr;
9603 } __attribute__((packed));
9604
9605 /* hwrm_func_backing_store_qcaps_output (size:576b/72B) */
9606 struct hwrm_func_backing_store_qcaps_output {
9607         /* The specific error status for the command. */
9608         uint16_t        error_code;
9609         /* The HWRM command request type. */
9610         uint16_t        req_type;
9611         /* The sequence ID from the original command. */
9612         uint16_t        seq_id;
9613         /* The length of the response data in number of bytes. */
9614         uint16_t        resp_len;
9615         /* Maximum number of QP context entries supported for this function. */
9616         uint32_t        qp_max_entries;
9617         /*
9618          * Minimum number of QP context entries that are needed to be reserved
9619          * for QP1 for the PF and its VFs. PF drivers must allocate at least
9620          * this many QP context entries, even if RoCE will not be used.
9621          */
9622         uint16_t        qp_min_qp1_entries;
9623         /* Maximum number of QP context entries that can be used for L2. */
9624         uint16_t        qp_max_l2_entries;
9625         /* Number of bytes that must be allocated for each context entry. */
9626         uint16_t        qp_entry_size;
9627         /* Maximum number of SRQ context entries that can be used for L2. */
9628         uint16_t        srq_max_l2_entries;
9629         /* Maximum number of SRQ context entries supported for this function. */
9630         uint32_t        srq_max_entries;
9631         /* Number of bytes that must be allocated for each context entry. */
9632         uint16_t        srq_entry_size;
9633         /* Maximum number of CQ context entries that can be used for L2. */
9634         uint16_t        cq_max_l2_entries;
9635         /* Maximum number of CQ context entries supported for this function. */
9636         uint32_t        cq_max_entries;
9637         /* Number of bytes that must be allocated for each context entry. */
9638         uint16_t        cq_entry_size;
9639         /* Maximum number of VNIC context entries supported for this function. */
9640         uint16_t        vnic_max_vnic_entries;
9641         /* Maximum number of Ring table context entries supported for this function. */
9642         uint16_t        vnic_max_ring_table_entries;
9643         /* Number of bytes that must be allocated for each context entry. */
9644         uint16_t        vnic_entry_size;
9645         /* Maximum number of statistic context entries supported for this function. */
9646         uint32_t        stat_max_entries;
9647         /* Number of bytes that must be allocated for each context entry. */
9648         uint16_t        stat_entry_size;
9649         /* Number of bytes that must be allocated for each context entry. */
9650         uint16_t        tqm_entry_size;
9651         /* Minimum number of TQM context entries required per ring. */
9652         uint32_t        tqm_min_entries_per_ring;
9653         /*
9654          * Maximum number of TQM context entries supported per ring. This is
9655          * actually a recommended TQM queue size based on worst case usage of
9656          * the TQM queue.
9657          *
9658          * TQM fastpath rings should be sized large enough to accommodate the
9659          * maximum number of QPs (either L2 or RoCE, or both if shared)
9660          * that can be enqueued to the TQM ring.
9661          *
9662          * TQM slowpath rings should be sized as follows:
9663          *
9664          * num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size
9665          *
9666          * Where:
9667          *   num_vnics is the number of VNICs allocated in the VNIC backing store
9668          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
9669          *   num_roce_qps is the number of RoCE QPs in the QP backing store
9670          *   tqm_min_size is tqm_min_entries_per_ring reported by
9671          *     HWRM_FUNC_BACKING_STORE_QCAPS
9672          *
9673          * Note that TQM ring sizes cannot be extended while the system is
9674          * operational. If a PF driver needs to extend a TQM ring, it needs
9675          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9676          * the backing store.
9677          */
9678         uint32_t        tqm_max_entries_per_ring;
9679         /*
9680          * Maximum number of MR plus AV context entries supported for this
9681          * function.
9682          */
9683         uint32_t        mrav_max_entries;
9684         /* Number of bytes that must be allocated for each context entry. */
9685         uint16_t        mrav_entry_size;
9686         /* Number of bytes that must be allocated for each context entry. */
9687         uint16_t        tim_entry_size;
9688         /* Maximum number of Timer context entries supported for this function. */
9689         uint32_t        tim_max_entries;
9690         /*
9691          * When this field is zero, the 32b `mrav_num_entries` field in the
9692          * `backing_store_cfg` and `backing_store_qcfg` commands represents
9693          * the total number of MR plus AV entries allowed in the MR/AV backing
9694          * store PBL.
9695          *
9696          * When this field is non-zero, the 32b `mrav_num_entries` field in
9697          * the `backing_store_cfg` and `backing_store_qcfg` commands is
9698          * logically divided into two 16b fields. Bits `[31:16]` represents
9699          * the `mr_num_entries` and bits `[15:0]` represents `av_num_entries`.
9700          * Both of these values are represented in a unit granularity
9701          * specified by this field. For example, if this field is 16 and
9702          * `mrav_num_entries` is `0x02000100`, then the number of MR entries
9703          * is 8192 and the number of AV entries is 4096.
9704          */
9705         uint16_t        mrav_num_entries_units;
9706         /*
9707          * The number of entries specified for any TQM ring must be a
9708          * multiple of this value to prevent any resource allocation
9709          * limitations.
9710          */
9711         uint8_t tqm_entries_multiple;
9712         /*
9713          * This field is used in Output records to indicate that the output
9714          * is completely written to RAM.  This field should be read as '1'
9715          * to indicate that the output has been completely written.
9716          * When writing a command completion or response to an internal processor,
9717          * the order of writes has to be such that this field is written last.
9718          */
9719         uint8_t valid;
9720 } __attribute__((packed));
9721
9722 /*******************************
9723  * hwrm_func_backing_store_cfg *
9724  *******************************/
9725
9726
9727 /* hwrm_func_backing_store_cfg_input (size:2048b/256B) */
9728 struct hwrm_func_backing_store_cfg_input {
9729         /* The HWRM command request type. */
9730         uint16_t        req_type;
9731         /*
9732          * The completion ring to send the completion event on. This should
9733          * be the NQ ID returned from the `nq_alloc` HWRM command.
9734          */
9735         uint16_t        cmpl_ring;
9736         /*
9737          * The sequence ID is used by the driver for tracking multiple
9738          * commands. This ID is treated as opaque data by the firmware and
9739          * the value is returned in the `hwrm_resp_hdr` upon completion.
9740          */
9741         uint16_t        seq_id;
9742         /*
9743          * The target ID of the command:
9744          * * 0x0-0xFFF8 - The function ID
9745          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9746          * * 0xFFFD - Reserved for user-space HWRM interface
9747          * * 0xFFFF - HWRM
9748          */
9749         uint16_t        target_id;
9750         /*
9751          * A physical address pointer pointing to a host buffer that the
9752          * command's response data will be written. This can be either a host
9753          * physical address (HPA) or a guest physical address (GPA) and must
9754          * point to a physically contiguous block of memory.
9755          */
9756         uint64_t        resp_addr;
9757         uint32_t        flags;
9758         /*
9759          * When set, the firmware only uses on-chip resources and does not
9760          * expect any backing store to be provided by the host driver. This
9761          * mode provides minimal L2 functionality (e.g. limited L2 resources,
9762          * no RoCE).
9763          */
9764         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE \
9765                 UINT32_C(0x1)
9766         /*
9767          * When set, the 32b `mrav_num_entries` field is logically divided
9768          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
9769          */
9770         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_MRAV_RESERVATION_SPLIT \
9771                 UINT32_C(0x2)
9772         uint32_t        enables;
9773         /*
9774          * This bit must be '1' for the qp fields to be
9775          * configured.
9776          */
9777         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP \
9778                 UINT32_C(0x1)
9779         /*
9780          * This bit must be '1' for the srq fields to be
9781          * configured.
9782          */
9783         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ \
9784                 UINT32_C(0x2)
9785         /*
9786          * This bit must be '1' for the cq fields to be
9787          * configured.
9788          */
9789         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ \
9790                 UINT32_C(0x4)
9791         /*
9792          * This bit must be '1' for the vnic fields to be
9793          * configured.
9794          */
9795         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC \
9796                 UINT32_C(0x8)
9797         /*
9798          * This bit must be '1' for the stat fields to be
9799          * configured.
9800          */
9801         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT \
9802                 UINT32_C(0x10)
9803         /*
9804          * This bit must be '1' for the tqm_sp fields to be
9805          * configured.
9806          */
9807         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP \
9808                 UINT32_C(0x20)
9809         /*
9810          * This bit must be '1' for the tqm_ring0 fields to be
9811          * configured.
9812          */
9813         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0 \
9814                 UINT32_C(0x40)
9815         /*
9816          * This bit must be '1' for the tqm_ring1 fields to be
9817          * configured.
9818          */
9819         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1 \
9820                 UINT32_C(0x80)
9821         /*
9822          * This bit must be '1' for the tqm_ring2 fields to be
9823          * configured.
9824          */
9825         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2 \
9826                 UINT32_C(0x100)
9827         /*
9828          * This bit must be '1' for the tqm_ring3 fields to be
9829          * configured.
9830          */
9831         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3 \
9832                 UINT32_C(0x200)
9833         /*
9834          * This bit must be '1' for the tqm_ring4 fields to be
9835          * configured.
9836          */
9837         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4 \
9838                 UINT32_C(0x400)
9839         /*
9840          * This bit must be '1' for the tqm_ring5 fields to be
9841          * configured.
9842          */
9843         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5 \
9844                 UINT32_C(0x800)
9845         /*
9846          * This bit must be '1' for the tqm_ring6 fields to be
9847          * configured.
9848          */
9849         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6 \
9850                 UINT32_C(0x1000)
9851         /*
9852          * This bit must be '1' for the tqm_ring7 fields to be
9853          * configured.
9854          */
9855         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7 \
9856                 UINT32_C(0x2000)
9857         /*
9858          * This bit must be '1' for the mrav fields to be
9859          * configured.
9860          */
9861         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV \
9862                 UINT32_C(0x4000)
9863         /*
9864          * This bit must be '1' for the tim fields to be
9865          * configured.
9866          */
9867         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM \
9868                 UINT32_C(0x8000)
9869         /* QPC page size and level. */
9870         uint8_t qpc_pg_size_qpc_lvl;
9871         /* QPC PBL indirect levels. */
9872         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK \
9873                 UINT32_C(0xf)
9874         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT       0
9875         /* PBL pointer is physical start address. */
9876         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0 \
9877                 UINT32_C(0x0)
9878         /* PBL pointer points to PTE table. */
9879         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1 \
9880                 UINT32_C(0x1)
9881         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9882         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 \
9883                 UINT32_C(0x2)
9884         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST \
9885                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
9886         /* QPC page size. */
9887         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK \
9888                 UINT32_C(0xf0)
9889         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT   4
9890         /* 4KB. */
9891         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K \
9892                 (UINT32_C(0x0) << 4)
9893         /* 8KB. */
9894         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K \
9895                 (UINT32_C(0x1) << 4)
9896         /* 64KB. */
9897         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K \
9898                 (UINT32_C(0x2) << 4)
9899         /* 2MB. */
9900         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M \
9901                 (UINT32_C(0x3) << 4)
9902         /* 8MB. */
9903         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M \
9904                 (UINT32_C(0x4) << 4)
9905         /* 1GB. */
9906         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G \
9907                 (UINT32_C(0x5) << 4)
9908         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST \
9909                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
9910         /* SRQ page size and level. */
9911         uint8_t srq_pg_size_srq_lvl;
9912         /* SRQ PBL indirect levels. */
9913         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK \
9914                 UINT32_C(0xf)
9915         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT       0
9916         /* PBL pointer is physical start address. */
9917         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0 \
9918                 UINT32_C(0x0)
9919         /* PBL pointer points to PTE table. */
9920         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1 \
9921                 UINT32_C(0x1)
9922         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9923         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 \
9924                 UINT32_C(0x2)
9925         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST \
9926                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
9927         /* SRQ page size. */
9928         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK \
9929                 UINT32_C(0xf0)
9930         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT   4
9931         /* 4KB. */
9932         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K \
9933                 (UINT32_C(0x0) << 4)
9934         /* 8KB. */
9935         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K \
9936                 (UINT32_C(0x1) << 4)
9937         /* 64KB. */
9938         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K \
9939                 (UINT32_C(0x2) << 4)
9940         /* 2MB. */
9941         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M \
9942                 (UINT32_C(0x3) << 4)
9943         /* 8MB. */
9944         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M \
9945                 (UINT32_C(0x4) << 4)
9946         /* 1GB. */
9947         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G \
9948                 (UINT32_C(0x5) << 4)
9949         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST \
9950                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
9951         /* CQ page size and level. */
9952         uint8_t cq_pg_size_cq_lvl;
9953         /* CQ PBL indirect levels. */
9954         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK \
9955                 UINT32_C(0xf)
9956         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT       0
9957         /* PBL pointer is physical start address. */
9958         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0 \
9959                 UINT32_C(0x0)
9960         /* PBL pointer points to PTE table. */
9961         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1 \
9962                 UINT32_C(0x1)
9963         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9964         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 \
9965                 UINT32_C(0x2)
9966         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST \
9967                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
9968         /* CQ page size. */
9969         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK \
9970                 UINT32_C(0xf0)
9971         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT   4
9972         /* 4KB. */
9973         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K \
9974                 (UINT32_C(0x0) << 4)
9975         /* 8KB. */
9976         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K \
9977                 (UINT32_C(0x1) << 4)
9978         /* 64KB. */
9979         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K \
9980                 (UINT32_C(0x2) << 4)
9981         /* 2MB. */
9982         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M \
9983                 (UINT32_C(0x3) << 4)
9984         /* 8MB. */
9985         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M \
9986                 (UINT32_C(0x4) << 4)
9987         /* 1GB. */
9988         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G \
9989                 (UINT32_C(0x5) << 4)
9990         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST \
9991                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
9992         /* VNIC page size and level. */
9993         uint8_t vnic_pg_size_vnic_lvl;
9994         /* VNIC PBL indirect levels. */
9995         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK \
9996                 UINT32_C(0xf)
9997         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT       0
9998         /* PBL pointer is physical start address. */
9999         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0 \
10000                 UINT32_C(0x0)
10001         /* PBL pointer points to PTE table. */
10002         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1 \
10003                 UINT32_C(0x1)
10004         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10005         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 \
10006                 UINT32_C(0x2)
10007         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST \
10008                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
10009         /* VNIC page size. */
10010         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK \
10011                 UINT32_C(0xf0)
10012         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT   4
10013         /* 4KB. */
10014         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K \
10015                 (UINT32_C(0x0) << 4)
10016         /* 8KB. */
10017         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K \
10018                 (UINT32_C(0x1) << 4)
10019         /* 64KB. */
10020         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K \
10021                 (UINT32_C(0x2) << 4)
10022         /* 2MB. */
10023         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M \
10024                 (UINT32_C(0x3) << 4)
10025         /* 8MB. */
10026         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M \
10027                 (UINT32_C(0x4) << 4)
10028         /* 1GB. */
10029         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G \
10030                 (UINT32_C(0x5) << 4)
10031         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST \
10032                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
10033         /* Stat page size and level. */
10034         uint8_t stat_pg_size_stat_lvl;
10035         /* Stat PBL indirect levels. */
10036         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK \
10037                 UINT32_C(0xf)
10038         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT       0
10039         /* PBL pointer is physical start address. */
10040         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0 \
10041                 UINT32_C(0x0)
10042         /* PBL pointer points to PTE table. */
10043         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1 \
10044                 UINT32_C(0x1)
10045         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10046         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 \
10047                 UINT32_C(0x2)
10048         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST \
10049                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
10050         /* Stat page size. */
10051         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK \
10052                 UINT32_C(0xf0)
10053         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT   4
10054         /* 4KB. */
10055         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K \
10056                 (UINT32_C(0x0) << 4)
10057         /* 8KB. */
10058         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K \
10059                 (UINT32_C(0x1) << 4)
10060         /* 64KB. */
10061         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K \
10062                 (UINT32_C(0x2) << 4)
10063         /* 2MB. */
10064         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M \
10065                 (UINT32_C(0x3) << 4)
10066         /* 8MB. */
10067         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M \
10068                 (UINT32_C(0x4) << 4)
10069         /* 1GB. */
10070         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G \
10071                 (UINT32_C(0x5) << 4)
10072         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST \
10073                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
10074         /* TQM slow path page size and level. */
10075         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
10076         /* TQM slow path PBL indirect levels. */
10077         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK \
10078                 UINT32_C(0xf)
10079         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT       0
10080         /* PBL pointer is physical start address. */
10081         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0 \
10082                 UINT32_C(0x0)
10083         /* PBL pointer points to PTE table. */
10084         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1 \
10085                 UINT32_C(0x1)
10086         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10087         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 \
10088                 UINT32_C(0x2)
10089         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST \
10090                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
10091         /* TQM slow path page size. */
10092         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK \
10093                 UINT32_C(0xf0)
10094         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT   4
10095         /* 4KB. */
10096         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K \
10097                 (UINT32_C(0x0) << 4)
10098         /* 8KB. */
10099         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K \
10100                 (UINT32_C(0x1) << 4)
10101         /* 64KB. */
10102         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K \
10103                 (UINT32_C(0x2) << 4)
10104         /* 2MB. */
10105         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M \
10106                 (UINT32_C(0x3) << 4)
10107         /* 8MB. */
10108         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M \
10109                 (UINT32_C(0x4) << 4)
10110         /* 1GB. */
10111         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G \
10112                 (UINT32_C(0x5) << 4)
10113         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST \
10114                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
10115         /* TQM ring 0 page size and level. */
10116         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
10117         /* TQM ring 0 PBL indirect levels. */
10118         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK \
10119                 UINT32_C(0xf)
10120         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT       0
10121         /* PBL pointer is physical start address. */
10122         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0 \
10123                 UINT32_C(0x0)
10124         /* PBL pointer points to PTE table. */
10125         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1 \
10126                 UINT32_C(0x1)
10127         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10128         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 \
10129                 UINT32_C(0x2)
10130         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST \
10131                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
10132         /* TQM ring 0 page size. */
10133         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK \
10134                 UINT32_C(0xf0)
10135         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT   4
10136         /* 4KB. */
10137         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K \
10138                 (UINT32_C(0x0) << 4)
10139         /* 8KB. */
10140         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K \
10141                 (UINT32_C(0x1) << 4)
10142         /* 64KB. */
10143         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K \
10144                 (UINT32_C(0x2) << 4)
10145         /* 2MB. */
10146         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M \
10147                 (UINT32_C(0x3) << 4)
10148         /* 8MB. */
10149         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M \
10150                 (UINT32_C(0x4) << 4)
10151         /* 1GB. */
10152         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G \
10153                 (UINT32_C(0x5) << 4)
10154         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST \
10155                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
10156         /* TQM ring 1 page size and level. */
10157         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
10158         /* TQM ring 1 PBL indirect levels. */
10159         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK \
10160                 UINT32_C(0xf)
10161         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT       0
10162         /* PBL pointer is physical start address. */
10163         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0 \
10164                 UINT32_C(0x0)
10165         /* PBL pointer points to PTE table. */
10166         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1 \
10167                 UINT32_C(0x1)
10168         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10169         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 \
10170                 UINT32_C(0x2)
10171         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST \
10172                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
10173         /* TQM ring 1 page size. */
10174         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK \
10175                 UINT32_C(0xf0)
10176         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT   4
10177         /* 4KB. */
10178         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K \
10179                 (UINT32_C(0x0) << 4)
10180         /* 8KB. */
10181         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K \
10182                 (UINT32_C(0x1) << 4)
10183         /* 64KB. */
10184         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K \
10185                 (UINT32_C(0x2) << 4)
10186         /* 2MB. */
10187         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M \
10188                 (UINT32_C(0x3) << 4)
10189         /* 8MB. */
10190         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M \
10191                 (UINT32_C(0x4) << 4)
10192         /* 1GB. */
10193         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G \
10194                 (UINT32_C(0x5) << 4)
10195         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST \
10196                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
10197         /* TQM ring 2 page size and level. */
10198         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
10199         /* TQM ring 2 PBL indirect levels. */
10200         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK \
10201                 UINT32_C(0xf)
10202         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT       0
10203         /* PBL pointer is physical start address. */
10204         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0 \
10205                 UINT32_C(0x0)
10206         /* PBL pointer points to PTE table. */
10207         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1 \
10208                 UINT32_C(0x1)
10209         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10210         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 \
10211                 UINT32_C(0x2)
10212         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST \
10213                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
10214         /* TQM ring 2 page size. */
10215         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK \
10216                 UINT32_C(0xf0)
10217         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT   4
10218         /* 4KB. */
10219         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K \
10220                 (UINT32_C(0x0) << 4)
10221         /* 8KB. */
10222         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K \
10223                 (UINT32_C(0x1) << 4)
10224         /* 64KB. */
10225         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K \
10226                 (UINT32_C(0x2) << 4)
10227         /* 2MB. */
10228         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M \
10229                 (UINT32_C(0x3) << 4)
10230         /* 8MB. */
10231         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M \
10232                 (UINT32_C(0x4) << 4)
10233         /* 1GB. */
10234         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G \
10235                 (UINT32_C(0x5) << 4)
10236         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST \
10237                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
10238         /* TQM ring 3 page size and level. */
10239         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
10240         /* TQM ring 3 PBL indirect levels. */
10241         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK \
10242                 UINT32_C(0xf)
10243         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT       0
10244         /* PBL pointer is physical start address. */
10245         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0 \
10246                 UINT32_C(0x0)
10247         /* PBL pointer points to PTE table. */
10248         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1 \
10249                 UINT32_C(0x1)
10250         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10251         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 \
10252                 UINT32_C(0x2)
10253         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST \
10254                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
10255         /* TQM ring 3 page size. */
10256         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK \
10257                 UINT32_C(0xf0)
10258         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT   4
10259         /* 4KB. */
10260         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K \
10261                 (UINT32_C(0x0) << 4)
10262         /* 8KB. */
10263         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K \
10264                 (UINT32_C(0x1) << 4)
10265         /* 64KB. */
10266         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K \
10267                 (UINT32_C(0x2) << 4)
10268         /* 2MB. */
10269         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M \
10270                 (UINT32_C(0x3) << 4)
10271         /* 8MB. */
10272         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M \
10273                 (UINT32_C(0x4) << 4)
10274         /* 1GB. */
10275         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G \
10276                 (UINT32_C(0x5) << 4)
10277         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST \
10278                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
10279         /* TQM ring 4 page size and level. */
10280         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
10281         /* TQM ring 4 PBL indirect levels. */
10282         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK \
10283                 UINT32_C(0xf)
10284         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT       0
10285         /* PBL pointer is physical start address. */
10286         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0 \
10287                 UINT32_C(0x0)
10288         /* PBL pointer points to PTE table. */
10289         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1 \
10290                 UINT32_C(0x1)
10291         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10292         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 \
10293                 UINT32_C(0x2)
10294         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST \
10295                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
10296         /* TQM ring 4 page size. */
10297         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK \
10298                 UINT32_C(0xf0)
10299         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT   4
10300         /* 4KB. */
10301         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K \
10302                 (UINT32_C(0x0) << 4)
10303         /* 8KB. */
10304         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K \
10305                 (UINT32_C(0x1) << 4)
10306         /* 64KB. */
10307         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K \
10308                 (UINT32_C(0x2) << 4)
10309         /* 2MB. */
10310         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M \
10311                 (UINT32_C(0x3) << 4)
10312         /* 8MB. */
10313         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M \
10314                 (UINT32_C(0x4) << 4)
10315         /* 1GB. */
10316         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G \
10317                 (UINT32_C(0x5) << 4)
10318         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST \
10319                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
10320         /* TQM ring 5 page size and level. */
10321         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
10322         /* TQM ring 5 PBL indirect levels. */
10323         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK \
10324                 UINT32_C(0xf)
10325         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT       0
10326         /* PBL pointer is physical start address. */
10327         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0 \
10328                 UINT32_C(0x0)
10329         /* PBL pointer points to PTE table. */
10330         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1 \
10331                 UINT32_C(0x1)
10332         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10333         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 \
10334                 UINT32_C(0x2)
10335         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST \
10336                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
10337         /* TQM ring 5 page size. */
10338         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK \
10339                 UINT32_C(0xf0)
10340         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT   4
10341         /* 4KB. */
10342         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K \
10343                 (UINT32_C(0x0) << 4)
10344         /* 8KB. */
10345         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K \
10346                 (UINT32_C(0x1) << 4)
10347         /* 64KB. */
10348         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K \
10349                 (UINT32_C(0x2) << 4)
10350         /* 2MB. */
10351         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M \
10352                 (UINT32_C(0x3) << 4)
10353         /* 8MB. */
10354         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M \
10355                 (UINT32_C(0x4) << 4)
10356         /* 1GB. */
10357         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G \
10358                 (UINT32_C(0x5) << 4)
10359         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST \
10360                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
10361         /* TQM ring 6 page size and level. */
10362         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
10363         /* TQM ring 6 PBL indirect levels. */
10364         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK \
10365                 UINT32_C(0xf)
10366         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT       0
10367         /* PBL pointer is physical start address. */
10368         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0 \
10369                 UINT32_C(0x0)
10370         /* PBL pointer points to PTE table. */
10371         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1 \
10372                 UINT32_C(0x1)
10373         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10374         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 \
10375                 UINT32_C(0x2)
10376         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST \
10377                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
10378         /* TQM ring 6 page size. */
10379         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK \
10380                 UINT32_C(0xf0)
10381         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT   4
10382         /* 4KB. */
10383         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K \
10384                 (UINT32_C(0x0) << 4)
10385         /* 8KB. */
10386         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K \
10387                 (UINT32_C(0x1) << 4)
10388         /* 64KB. */
10389         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K \
10390                 (UINT32_C(0x2) << 4)
10391         /* 2MB. */
10392         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M \
10393                 (UINT32_C(0x3) << 4)
10394         /* 8MB. */
10395         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M \
10396                 (UINT32_C(0x4) << 4)
10397         /* 1GB. */
10398         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G \
10399                 (UINT32_C(0x5) << 4)
10400         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST \
10401                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
10402         /* TQM ring 7 page size and level. */
10403         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
10404         /* TQM ring 7 PBL indirect levels. */
10405         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK \
10406                 UINT32_C(0xf)
10407         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT       0
10408         /* PBL pointer is physical start address. */
10409         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0 \
10410                 UINT32_C(0x0)
10411         /* PBL pointer points to PTE table. */
10412         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1 \
10413                 UINT32_C(0x1)
10414         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10415         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 \
10416                 UINT32_C(0x2)
10417         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST \
10418                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
10419         /* TQM ring 7 page size. */
10420         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK \
10421                 UINT32_C(0xf0)
10422         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT   4
10423         /* 4KB. */
10424         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K \
10425                 (UINT32_C(0x0) << 4)
10426         /* 8KB. */
10427         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K \
10428                 (UINT32_C(0x1) << 4)
10429         /* 64KB. */
10430         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K \
10431                 (UINT32_C(0x2) << 4)
10432         /* 2MB. */
10433         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M \
10434                 (UINT32_C(0x3) << 4)
10435         /* 8MB. */
10436         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M \
10437                 (UINT32_C(0x4) << 4)
10438         /* 1GB. */
10439         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G \
10440                 (UINT32_C(0x5) << 4)
10441         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST \
10442                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
10443         /* MR/AV page size and level. */
10444         uint8_t mrav_pg_size_mrav_lvl;
10445         /* MR/AV PBL indirect levels. */
10446         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK \
10447                 UINT32_C(0xf)
10448         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT       0
10449         /* PBL pointer is physical start address. */
10450         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0 \
10451                 UINT32_C(0x0)
10452         /* PBL pointer points to PTE table. */
10453         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1 \
10454                 UINT32_C(0x1)
10455         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10456         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 \
10457                 UINT32_C(0x2)
10458         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST \
10459                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
10460         /* MR/AV page size. */
10461         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK \
10462                 UINT32_C(0xf0)
10463         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT   4
10464         /* 4KB. */
10465         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K \
10466                 (UINT32_C(0x0) << 4)
10467         /* 8KB. */
10468         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K \
10469                 (UINT32_C(0x1) << 4)
10470         /* 64KB. */
10471         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K \
10472                 (UINT32_C(0x2) << 4)
10473         /* 2MB. */
10474         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M \
10475                 (UINT32_C(0x3) << 4)
10476         /* 8MB. */
10477         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M \
10478                 (UINT32_C(0x4) << 4)
10479         /* 1GB. */
10480         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G \
10481                 (UINT32_C(0x5) << 4)
10482         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST \
10483                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
10484         /* Timer page size and level. */
10485         uint8_t tim_pg_size_tim_lvl;
10486         /* Timer PBL indirect levels. */
10487         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK \
10488                 UINT32_C(0xf)
10489         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT       0
10490         /* PBL pointer is physical start address. */
10491         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0 \
10492                 UINT32_C(0x0)
10493         /* PBL pointer points to PTE table. */
10494         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1 \
10495                 UINT32_C(0x1)
10496         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10497         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 \
10498                 UINT32_C(0x2)
10499         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST \
10500                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
10501         /* Timer page size. */
10502         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK \
10503                 UINT32_C(0xf0)
10504         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT   4
10505         /* 4KB. */
10506         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K \
10507                 (UINT32_C(0x0) << 4)
10508         /* 8KB. */
10509         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K \
10510                 (UINT32_C(0x1) << 4)
10511         /* 64KB. */
10512         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K \
10513                 (UINT32_C(0x2) << 4)
10514         /* 2MB. */
10515         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M \
10516                 (UINT32_C(0x3) << 4)
10517         /* 8MB. */
10518         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M \
10519                 (UINT32_C(0x4) << 4)
10520         /* 1GB. */
10521         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G \
10522                 (UINT32_C(0x5) << 4)
10523         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST \
10524                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
10525         /* QP page directory. */
10526         uint64_t        qpc_page_dir;
10527         /* SRQ page directory. */
10528         uint64_t        srq_page_dir;
10529         /* CQ page directory. */
10530         uint64_t        cq_page_dir;
10531         /* VNIC page directory. */
10532         uint64_t        vnic_page_dir;
10533         /* Stat page directory. */
10534         uint64_t        stat_page_dir;
10535         /* TQM slowpath page directory. */
10536         uint64_t        tqm_sp_page_dir;
10537         /* TQM ring 0 page directory. */
10538         uint64_t        tqm_ring0_page_dir;
10539         /* TQM ring 1 page directory. */
10540         uint64_t        tqm_ring1_page_dir;
10541         /* TQM ring 2 page directory. */
10542         uint64_t        tqm_ring2_page_dir;
10543         /* TQM ring 3 page directory. */
10544         uint64_t        tqm_ring3_page_dir;
10545         /* TQM ring 4 page directory. */
10546         uint64_t        tqm_ring4_page_dir;
10547         /* TQM ring 5 page directory. */
10548         uint64_t        tqm_ring5_page_dir;
10549         /* TQM ring 6 page directory. */
10550         uint64_t        tqm_ring6_page_dir;
10551         /* TQM ring 7 page directory. */
10552         uint64_t        tqm_ring7_page_dir;
10553         /* MR/AV page directory. */
10554         uint64_t        mrav_page_dir;
10555         /* Timer page directory. */
10556         uint64_t        tim_page_dir;
10557         /* Number of QPs. */
10558         uint32_t        qp_num_entries;
10559         /* Number of SRQs. */
10560         uint32_t        srq_num_entries;
10561         /* Number of CQs. */
10562         uint32_t        cq_num_entries;
10563         /* Number of Stats. */
10564         uint32_t        stat_num_entries;
10565         /*
10566          * Number of TQM slowpath entries.
10567          *
10568          * TQM slowpath rings should be sized as follows:
10569          *
10570          * num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size
10571          *
10572          * Where:
10573          *   num_vnics is the number of VNICs allocated in the VNIC backing store
10574          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
10575          *   num_roce_qps is the number of RoCE QPs in the QP backing store
10576          *   tqm_min_size is tqm_min_entries_per_ring reported by
10577          *     HWRM_FUNC_BACKING_STORE_QCAPS
10578          *
10579          * Note that TQM ring sizes cannot be extended while the system is
10580          * operational. If a PF driver needs to extend a TQM ring, it needs
10581          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10582          * the backing store.
10583          */
10584         uint32_t        tqm_sp_num_entries;
10585         /*
10586          * Number of TQM ring 0 entries.
10587          *
10588          * TQM fastpath rings should be sized large enough to accommodate the
10589          * maximum number of QPs (either L2 or RoCE, or both if shared)
10590          * that can be enqueued to the TQM ring.
10591          *
10592          * Note that TQM ring sizes cannot be extended while the system is
10593          * operational. If a PF driver needs to extend a TQM ring, it needs
10594          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10595          * the backing store.
10596          */
10597         uint32_t        tqm_ring0_num_entries;
10598         /*
10599          * Number of TQM ring 1 entries.
10600          *
10601          * TQM fastpath rings should be sized large enough to accommodate the
10602          * maximum number of QPs (either L2 or RoCE, or both if shared)
10603          * that can be enqueued to the TQM ring.
10604          *
10605          * Note that TQM ring sizes cannot be extended while the system is
10606          * operational. If a PF driver needs to extend a TQM ring, it needs
10607          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10608          * the backing store.
10609          */
10610         uint32_t        tqm_ring1_num_entries;
10611         /*
10612          * Number of TQM ring 2 entries.
10613          *
10614          * TQM fastpath rings should be sized large enough to accommodate the
10615          * maximum number of QPs (either L2 or RoCE, or both if shared)
10616          * that can be enqueued to the TQM ring.
10617          *
10618          * Note that TQM ring sizes cannot be extended while the system is
10619          * operational. If a PF driver needs to extend a TQM ring, it needs
10620          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10621          * the backing store.
10622          */
10623         uint32_t        tqm_ring2_num_entries;
10624         /*
10625          * Number of TQM ring 3 entries.
10626          *
10627          * TQM fastpath rings should be sized large enough to accommodate the
10628          * maximum number of QPs (either L2 or RoCE, or both if shared)
10629          * that can be enqueued to the TQM ring.
10630          *
10631          * Note that TQM ring sizes cannot be extended while the system is
10632          * operational. If a PF driver needs to extend a TQM ring, it needs
10633          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10634          * the backing store.
10635          */
10636         uint32_t        tqm_ring3_num_entries;
10637         /*
10638          * Number of TQM ring 4 entries.
10639          *
10640          * TQM fastpath rings should be sized large enough to accommodate the
10641          * maximum number of QPs (either L2 or RoCE, or both if shared)
10642          * that can be enqueued to the TQM ring.
10643          *
10644          * Note that TQM ring sizes cannot be extended while the system is
10645          * operational. If a PF driver needs to extend a TQM ring, it needs
10646          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10647          * the backing store.
10648          */
10649         uint32_t        tqm_ring4_num_entries;
10650         /*
10651          * Number of TQM ring 5 entries.
10652          *
10653          * TQM fastpath rings should be sized large enough to accommodate the
10654          * maximum number of QPs (either L2 or RoCE, or both if shared)
10655          * that can be enqueued to the TQM ring.
10656          *
10657          * Note that TQM ring sizes cannot be extended while the system is
10658          * operational. If a PF driver needs to extend a TQM ring, it needs
10659          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10660          * the backing store.
10661          */
10662         uint32_t        tqm_ring5_num_entries;
10663         /*
10664          * Number of TQM ring 6 entries.
10665          *
10666          * TQM fastpath rings should be sized large enough to accommodate the
10667          * maximum number of QPs (either L2 or RoCE, or both if shared)
10668          * that can be enqueued to the TQM ring.
10669          *
10670          * Note that TQM ring sizes cannot be extended while the system is
10671          * operational. If a PF driver needs to extend a TQM ring, it needs
10672          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10673          * the backing store.
10674          */
10675         uint32_t        tqm_ring6_num_entries;
10676         /*
10677          * Number of TQM ring 7 entries.
10678          *
10679          * TQM fastpath rings should be sized large enough to accommodate the
10680          * maximum number of QPs (either L2 or RoCE, or both if shared)
10681          * that can be enqueued to the TQM ring.
10682          *
10683          * Note that TQM ring sizes cannot be extended while the system is
10684          * operational. If a PF driver needs to extend a TQM ring, it needs
10685          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10686          * the backing store.
10687          */
10688         uint32_t        tqm_ring7_num_entries;
10689         /*
10690          * If the MR/AV split reservation flag is not set, then this field
10691          * represents the total number of MR plus AV entries. For versions
10692          * of firmware that support the split reservation, when it is not
10693          * specified half of the entries will be reserved for MRs and the
10694          * other half for AVs.
10695          *
10696          * If the MR/AV split reservation flag is set, then this
10697          * field is logically divided into two 16b fields. Bits `[31:16]`
10698          * represents the `mr_num_entries` and bits `[15:0]` represents
10699          * `av_num_entries`. The granularity of these values is defined by
10700          * the `mrav_num_entries_unit` field returned by the
10701          * `backing_store_qcaps` command.
10702          */
10703         uint32_t        mrav_num_entries;
10704         /* Number of Timer entries. */
10705         uint32_t        tim_num_entries;
10706         /* Number of entries to reserve for QP1 */
10707         uint16_t        qp_num_qp1_entries;
10708         /* Number of entries to reserve for L2 */
10709         uint16_t        qp_num_l2_entries;
10710         /* Number of bytes that have been allocated for each context entry. */
10711         uint16_t        qp_entry_size;
10712         /* Number of entries to reserve for L2 */
10713         uint16_t        srq_num_l2_entries;
10714         /* Number of bytes that have been allocated for each context entry. */
10715         uint16_t        srq_entry_size;
10716         /* Number of entries to reserve for L2 */
10717         uint16_t        cq_num_l2_entries;
10718         /* Number of bytes that have been allocated for each context entry. */
10719         uint16_t        cq_entry_size;
10720         /* Number of entries to reserve for VNIC entries */
10721         uint16_t        vnic_num_vnic_entries;
10722         /* Number of entries to reserve for Ring table entries */
10723         uint16_t        vnic_num_ring_table_entries;
10724         /* Number of bytes that have been allocated for each context entry. */
10725         uint16_t        vnic_entry_size;
10726         /* Number of bytes that have been allocated for each context entry. */
10727         uint16_t        stat_entry_size;
10728         /* Number of bytes that have been allocated for each context entry. */
10729         uint16_t        tqm_entry_size;
10730         /* Number of bytes that have been allocated for each context entry. */
10731         uint16_t        mrav_entry_size;
10732         /* Number of bytes that have been allocated for each context entry. */
10733         uint16_t        tim_entry_size;
10734 } __attribute__((packed));
10735
10736 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
10737 struct hwrm_func_backing_store_cfg_output {
10738         /* The specific error status for the command. */
10739         uint16_t        error_code;
10740         /* The HWRM command request type. */
10741         uint16_t        req_type;
10742         /* The sequence ID from the original command. */
10743         uint16_t        seq_id;
10744         /* The length of the response data in number of bytes. */
10745         uint16_t        resp_len;
10746         uint8_t unused_0[7];
10747         /*
10748          * This field is used in Output records to indicate that the output
10749          * is completely written to RAM.  This field should be read as '1'
10750          * to indicate that the output has been completely written.
10751          * When writing a command completion or response to an internal processor,
10752          * the order of writes has to be such that this field is written last.
10753          */
10754         uint8_t valid;
10755 } __attribute__((packed));
10756
10757 /********************************
10758  * hwrm_func_backing_store_qcfg *
10759  ********************************/
10760
10761
10762 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
10763 struct hwrm_func_backing_store_qcfg_input {
10764         /* The HWRM command request type. */
10765         uint16_t        req_type;
10766         /*
10767          * The completion ring to send the completion event on. This should
10768          * be the NQ ID returned from the `nq_alloc` HWRM command.
10769          */
10770         uint16_t        cmpl_ring;
10771         /*
10772          * The sequence ID is used by the driver for tracking multiple
10773          * commands. This ID is treated as opaque data by the firmware and
10774          * the value is returned in the `hwrm_resp_hdr` upon completion.
10775          */
10776         uint16_t        seq_id;
10777         /*
10778          * The target ID of the command:
10779          * * 0x0-0xFFF8 - The function ID
10780          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10781          * * 0xFFFD - Reserved for user-space HWRM interface
10782          * * 0xFFFF - HWRM
10783          */
10784         uint16_t        target_id;
10785         /*
10786          * A physical address pointer pointing to a host buffer that the
10787          * command's response data will be written. This can be either a host
10788          * physical address (HPA) or a guest physical address (GPA) and must
10789          * point to a physically contiguous block of memory.
10790          */
10791         uint64_t        resp_addr;
10792 } __attribute__((packed));
10793
10794 /* hwrm_func_backing_store_qcfg_output (size:1920b/240B) */
10795 struct hwrm_func_backing_store_qcfg_output {
10796         /* The specific error status for the command. */
10797         uint16_t        error_code;
10798         /* The HWRM command request type. */
10799         uint16_t        req_type;
10800         /* The sequence ID from the original command. */
10801         uint16_t        seq_id;
10802         /* The length of the response data in number of bytes. */
10803         uint16_t        resp_len;
10804         uint32_t        flags;
10805         /*
10806          * When set, the firmware only uses on-chip resources and does not
10807          * expect any backing store to be provided by the host driver. This
10808          * mode provides minimal L2 functionality (e.g. limited L2 resources,
10809          * no RoCE).
10810          */
10811         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE \
10812                 UINT32_C(0x1)
10813         /*
10814          * When set, the 32b `mrav_num_entries` field is logically divided
10815          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
10816          */
10817         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_MRAV_RESERVATION_SPLIT \
10818                 UINT32_C(0x2)
10819         uint8_t unused_0[4];
10820         /*
10821          * This bit must be '1' for the qp fields to be
10822          * configured.
10823          */
10824         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_QP \
10825                 UINT32_C(0x1)
10826         /*
10827          * This bit must be '1' for the srq fields to be
10828          * configured.
10829          */
10830         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_SRQ \
10831                 UINT32_C(0x2)
10832         /*
10833          * This bit must be '1' for the cq fields to be
10834          * configured.
10835          */
10836         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_CQ \
10837                 UINT32_C(0x4)
10838         /*
10839          * This bit must be '1' for the vnic fields to be
10840          * configured.
10841          */
10842         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_VNIC \
10843                 UINT32_C(0x8)
10844         /*
10845          * This bit must be '1' for the stat fields to be
10846          * configured.
10847          */
10848         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_STAT \
10849                 UINT32_C(0x10)
10850         /*
10851          * This bit must be '1' for the tqm_sp fields to be
10852          * configured.
10853          */
10854         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_SP \
10855                 UINT32_C(0x20)
10856         /*
10857          * This bit must be '1' for the tqm_ring0 fields to be
10858          * configured.
10859          */
10860         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING0 \
10861                 UINT32_C(0x40)
10862         /*
10863          * This bit must be '1' for the tqm_ring1 fields to be
10864          * configured.
10865          */
10866         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING1 \
10867                 UINT32_C(0x80)
10868         /*
10869          * This bit must be '1' for the tqm_ring2 fields to be
10870          * configured.
10871          */
10872         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING2 \
10873                 UINT32_C(0x100)
10874         /*
10875          * This bit must be '1' for the tqm_ring3 fields to be
10876          * configured.
10877          */
10878         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING3 \
10879                 UINT32_C(0x200)
10880         /*
10881          * This bit must be '1' for the tqm_ring4 fields to be
10882          * configured.
10883          */
10884         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING4 \
10885                 UINT32_C(0x400)
10886         /*
10887          * This bit must be '1' for the tqm_ring5 fields to be
10888          * configured.
10889          */
10890         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING5 \
10891                 UINT32_C(0x800)
10892         /*
10893          * This bit must be '1' for the tqm_ring6 fields to be
10894          * configured.
10895          */
10896         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING6 \
10897                 UINT32_C(0x1000)
10898         /*
10899          * This bit must be '1' for the tqm_ring7 fields to be
10900          * configured.
10901          */
10902         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING7 \
10903                 UINT32_C(0x2000)
10904         /*
10905          * This bit must be '1' for the mrav fields to be
10906          * configured.
10907          */
10908         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_MRAV \
10909                 UINT32_C(0x4000)
10910         /*
10911          * This bit must be '1' for the tim fields to be
10912          * configured.
10913          */
10914         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TIM \
10915                 UINT32_C(0x8000)
10916         /* QPC page size and level. */
10917         uint8_t qpc_pg_size_qpc_lvl;
10918         /* QPC PBL indirect levels. */
10919         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK \
10920                 UINT32_C(0xf)
10921         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT       0
10922         /* PBL pointer is physical start address. */
10923         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0 \
10924                 UINT32_C(0x0)
10925         /* PBL pointer points to PTE table. */
10926         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1 \
10927                 UINT32_C(0x1)
10928         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10929         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 \
10930                 UINT32_C(0x2)
10931         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST \
10932                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
10933         /* QPC page size. */
10934         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK \
10935                 UINT32_C(0xf0)
10936         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT   4
10937         /* 4KB. */
10938         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K \
10939                 (UINT32_C(0x0) << 4)
10940         /* 8KB. */
10941         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K \
10942                 (UINT32_C(0x1) << 4)
10943         /* 64KB. */
10944         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K \
10945                 (UINT32_C(0x2) << 4)
10946         /* 2MB. */
10947         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M \
10948                 (UINT32_C(0x3) << 4)
10949         /* 8MB. */
10950         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M \
10951                 (UINT32_C(0x4) << 4)
10952         /* 1GB. */
10953         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G \
10954                 (UINT32_C(0x5) << 4)
10955         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST \
10956                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
10957         /* SRQ page size and level. */
10958         uint8_t srq_pg_size_srq_lvl;
10959         /* SRQ PBL indirect levels. */
10960         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK \
10961                 UINT32_C(0xf)
10962         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT       0
10963         /* PBL pointer is physical start address. */
10964         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0 \
10965                 UINT32_C(0x0)
10966         /* PBL pointer points to PTE table. */
10967         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1 \
10968                 UINT32_C(0x1)
10969         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10970         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 \
10971                 UINT32_C(0x2)
10972         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST \
10973                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
10974         /* SRQ page size. */
10975         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK \
10976                 UINT32_C(0xf0)
10977         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT   4
10978         /* 4KB. */
10979         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K \
10980                 (UINT32_C(0x0) << 4)
10981         /* 8KB. */
10982         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K \
10983                 (UINT32_C(0x1) << 4)
10984         /* 64KB. */
10985         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K \
10986                 (UINT32_C(0x2) << 4)
10987         /* 2MB. */
10988         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M \
10989                 (UINT32_C(0x3) << 4)
10990         /* 8MB. */
10991         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M \
10992                 (UINT32_C(0x4) << 4)
10993         /* 1GB. */
10994         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G \
10995                 (UINT32_C(0x5) << 4)
10996         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST \
10997                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
10998         /* CQ page size and level. */
10999         uint8_t cq_pg_size_cq_lvl;
11000         /* CQ PBL indirect levels. */
11001         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK \
11002                 UINT32_C(0xf)
11003         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT       0
11004         /* PBL pointer is physical start address. */
11005         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0 \
11006                 UINT32_C(0x0)
11007         /* PBL pointer points to PTE table. */
11008         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1 \
11009                 UINT32_C(0x1)
11010         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11011         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 \
11012                 UINT32_C(0x2)
11013         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST \
11014                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
11015         /* CQ page size. */
11016         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK \
11017                 UINT32_C(0xf0)
11018         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT   4
11019         /* 4KB. */
11020         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K \
11021                 (UINT32_C(0x0) << 4)
11022         /* 8KB. */
11023         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K \
11024                 (UINT32_C(0x1) << 4)
11025         /* 64KB. */
11026         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K \
11027                 (UINT32_C(0x2) << 4)
11028         /* 2MB. */
11029         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M \
11030                 (UINT32_C(0x3) << 4)
11031         /* 8MB. */
11032         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M \
11033                 (UINT32_C(0x4) << 4)
11034         /* 1GB. */
11035         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G \
11036                 (UINT32_C(0x5) << 4)
11037         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST \
11038                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
11039         /* VNIC page size and level. */
11040         uint8_t vnic_pg_size_vnic_lvl;
11041         /* VNIC PBL indirect levels. */
11042         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK \
11043                 UINT32_C(0xf)
11044         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT       0
11045         /* PBL pointer is physical start address. */
11046         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0 \
11047                 UINT32_C(0x0)
11048         /* PBL pointer points to PTE table. */
11049         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1 \
11050                 UINT32_C(0x1)
11051         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11052         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 \
11053                 UINT32_C(0x2)
11054         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST \
11055                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
11056         /* VNIC page size. */
11057         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK \
11058                 UINT32_C(0xf0)
11059         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT   4
11060         /* 4KB. */
11061         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K \
11062                 (UINT32_C(0x0) << 4)
11063         /* 8KB. */
11064         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K \
11065                 (UINT32_C(0x1) << 4)
11066         /* 64KB. */
11067         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K \
11068                 (UINT32_C(0x2) << 4)
11069         /* 2MB. */
11070         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M \
11071                 (UINT32_C(0x3) << 4)
11072         /* 8MB. */
11073         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M \
11074                 (UINT32_C(0x4) << 4)
11075         /* 1GB. */
11076         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G \
11077                 (UINT32_C(0x5) << 4)
11078         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST \
11079                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
11080         /* Stat page size and level. */
11081         uint8_t stat_pg_size_stat_lvl;
11082         /* Stat PBL indirect levels. */
11083         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK \
11084                 UINT32_C(0xf)
11085         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT       0
11086         /* PBL pointer is physical start address. */
11087         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0 \
11088                 UINT32_C(0x0)
11089         /* PBL pointer points to PTE table. */
11090         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1 \
11091                 UINT32_C(0x1)
11092         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11093         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 \
11094                 UINT32_C(0x2)
11095         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST \
11096                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
11097         /* Stat page size. */
11098         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK \
11099                 UINT32_C(0xf0)
11100         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT   4
11101         /* 4KB. */
11102         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K \
11103                 (UINT32_C(0x0) << 4)
11104         /* 8KB. */
11105         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K \
11106                 (UINT32_C(0x1) << 4)
11107         /* 64KB. */
11108         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K \
11109                 (UINT32_C(0x2) << 4)
11110         /* 2MB. */
11111         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M \
11112                 (UINT32_C(0x3) << 4)
11113         /* 8MB. */
11114         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M \
11115                 (UINT32_C(0x4) << 4)
11116         /* 1GB. */
11117         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G \
11118                 (UINT32_C(0x5) << 4)
11119         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST \
11120                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
11121         /* TQM slow path page size and level. */
11122         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
11123         /* TQM slow path PBL indirect levels. */
11124         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK \
11125                 UINT32_C(0xf)
11126         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT       0
11127         /* PBL pointer is physical start address. */
11128         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0 \
11129                 UINT32_C(0x0)
11130         /* PBL pointer points to PTE table. */
11131         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1 \
11132                 UINT32_C(0x1)
11133         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11134         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 \
11135                 UINT32_C(0x2)
11136         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST \
11137                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
11138         /* TQM slow path page size. */
11139         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK \
11140                 UINT32_C(0xf0)
11141         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT   4
11142         /* 4KB. */
11143         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K \
11144                 (UINT32_C(0x0) << 4)
11145         /* 8KB. */
11146         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K \
11147                 (UINT32_C(0x1) << 4)
11148         /* 64KB. */
11149         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K \
11150                 (UINT32_C(0x2) << 4)
11151         /* 2MB. */
11152         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M \
11153                 (UINT32_C(0x3) << 4)
11154         /* 8MB. */
11155         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M \
11156                 (UINT32_C(0x4) << 4)
11157         /* 1GB. */
11158         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G \
11159                 (UINT32_C(0x5) << 4)
11160         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST \
11161                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
11162         /* TQM ring 0 page size and level. */
11163         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
11164         /* TQM ring 0 PBL indirect levels. */
11165         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK \
11166                 UINT32_C(0xf)
11167         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT       0
11168         /* PBL pointer is physical start address. */
11169         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0 \
11170                 UINT32_C(0x0)
11171         /* PBL pointer points to PTE table. */
11172         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1 \
11173                 UINT32_C(0x1)
11174         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11175         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 \
11176                 UINT32_C(0x2)
11177         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST \
11178                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
11179         /* TQM ring 0 page size. */
11180         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK \
11181                 UINT32_C(0xf0)
11182         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT   4
11183         /* 4KB. */
11184         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K \
11185                 (UINT32_C(0x0) << 4)
11186         /* 8KB. */
11187         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K \
11188                 (UINT32_C(0x1) << 4)
11189         /* 64KB. */
11190         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K \
11191                 (UINT32_C(0x2) << 4)
11192         /* 2MB. */
11193         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M \
11194                 (UINT32_C(0x3) << 4)
11195         /* 8MB. */
11196         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M \
11197                 (UINT32_C(0x4) << 4)
11198         /* 1GB. */
11199         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G \
11200                 (UINT32_C(0x5) << 4)
11201         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST \
11202                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
11203         /* TQM ring 1 page size and level. */
11204         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
11205         /* TQM ring 1 PBL indirect levels. */
11206         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK \
11207                 UINT32_C(0xf)
11208         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT       0
11209         /* PBL pointer is physical start address. */
11210         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0 \
11211                 UINT32_C(0x0)
11212         /* PBL pointer points to PTE table. */
11213         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1 \
11214                 UINT32_C(0x1)
11215         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11216         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 \
11217                 UINT32_C(0x2)
11218         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST \
11219                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
11220         /* TQM ring 1 page size. */
11221         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK \
11222                 UINT32_C(0xf0)
11223         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT   4
11224         /* 4KB. */
11225         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K \
11226                 (UINT32_C(0x0) << 4)
11227         /* 8KB. */
11228         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K \
11229                 (UINT32_C(0x1) << 4)
11230         /* 64KB. */
11231         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K \
11232                 (UINT32_C(0x2) << 4)
11233         /* 2MB. */
11234         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M \
11235                 (UINT32_C(0x3) << 4)
11236         /* 8MB. */
11237         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M \
11238                 (UINT32_C(0x4) << 4)
11239         /* 1GB. */
11240         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G \
11241                 (UINT32_C(0x5) << 4)
11242         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST \
11243                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
11244         /* TQM ring 2 page size and level. */
11245         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
11246         /* TQM ring 2 PBL indirect levels. */
11247         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK \
11248                 UINT32_C(0xf)
11249         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT       0
11250         /* PBL pointer is physical start address. */
11251         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0 \
11252                 UINT32_C(0x0)
11253         /* PBL pointer points to PTE table. */
11254         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1 \
11255                 UINT32_C(0x1)
11256         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11257         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 \
11258                 UINT32_C(0x2)
11259         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST \
11260                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
11261         /* TQM ring 2 page size. */
11262         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK \
11263                 UINT32_C(0xf0)
11264         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT   4
11265         /* 4KB. */
11266         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K \
11267                 (UINT32_C(0x0) << 4)
11268         /* 8KB. */
11269         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K \
11270                 (UINT32_C(0x1) << 4)
11271         /* 64KB. */
11272         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K \
11273                 (UINT32_C(0x2) << 4)
11274         /* 2MB. */
11275         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M \
11276                 (UINT32_C(0x3) << 4)
11277         /* 8MB. */
11278         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M \
11279                 (UINT32_C(0x4) << 4)
11280         /* 1GB. */
11281         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G \
11282                 (UINT32_C(0x5) << 4)
11283         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST \
11284                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
11285         /* TQM ring 3 page size and level. */
11286         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
11287         /* TQM ring 3 PBL indirect levels. */
11288         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK \
11289                 UINT32_C(0xf)
11290         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT       0
11291         /* PBL pointer is physical start address. */
11292         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0 \
11293                 UINT32_C(0x0)
11294         /* PBL pointer points to PTE table. */
11295         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1 \
11296                 UINT32_C(0x1)
11297         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11298         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 \
11299                 UINT32_C(0x2)
11300         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST \
11301                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
11302         /* TQM ring 3 page size. */
11303         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK \
11304                 UINT32_C(0xf0)
11305         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT   4
11306         /* 4KB. */
11307         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K \
11308                 (UINT32_C(0x0) << 4)
11309         /* 8KB. */
11310         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K \
11311                 (UINT32_C(0x1) << 4)
11312         /* 64KB. */
11313         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K \
11314                 (UINT32_C(0x2) << 4)
11315         /* 2MB. */
11316         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M \
11317                 (UINT32_C(0x3) << 4)
11318         /* 8MB. */
11319         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M \
11320                 (UINT32_C(0x4) << 4)
11321         /* 1GB. */
11322         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G \
11323                 (UINT32_C(0x5) << 4)
11324         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST \
11325                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
11326         /* TQM ring 4 page size and level. */
11327         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
11328         /* TQM ring 4 PBL indirect levels. */
11329         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK \
11330                 UINT32_C(0xf)
11331         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT       0
11332         /* PBL pointer is physical start address. */
11333         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0 \
11334                 UINT32_C(0x0)
11335         /* PBL pointer points to PTE table. */
11336         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1 \
11337                 UINT32_C(0x1)
11338         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11339         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 \
11340                 UINT32_C(0x2)
11341         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST \
11342                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
11343         /* TQM ring 4 page size. */
11344         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK \
11345                 UINT32_C(0xf0)
11346         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT   4
11347         /* 4KB. */
11348         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K \
11349                 (UINT32_C(0x0) << 4)
11350         /* 8KB. */
11351         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K \
11352                 (UINT32_C(0x1) << 4)
11353         /* 64KB. */
11354         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K \
11355                 (UINT32_C(0x2) << 4)
11356         /* 2MB. */
11357         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M \
11358                 (UINT32_C(0x3) << 4)
11359         /* 8MB. */
11360         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M \
11361                 (UINT32_C(0x4) << 4)
11362         /* 1GB. */
11363         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G \
11364                 (UINT32_C(0x5) << 4)
11365         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST \
11366                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
11367         /* TQM ring 5 page size and level. */
11368         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
11369         /* TQM ring 5 PBL indirect levels. */
11370         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK \
11371                 UINT32_C(0xf)
11372         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT       0
11373         /* PBL pointer is physical start address. */
11374         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0 \
11375                 UINT32_C(0x0)
11376         /* PBL pointer points to PTE table. */
11377         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1 \
11378                 UINT32_C(0x1)
11379         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11380         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 \
11381                 UINT32_C(0x2)
11382         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST \
11383                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
11384         /* TQM ring 5 page size. */
11385         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK \
11386                 UINT32_C(0xf0)
11387         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT   4
11388         /* 4KB. */
11389         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K \
11390                 (UINT32_C(0x0) << 4)
11391         /* 8KB. */
11392         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K \
11393                 (UINT32_C(0x1) << 4)
11394         /* 64KB. */
11395         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K \
11396                 (UINT32_C(0x2) << 4)
11397         /* 2MB. */
11398         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M \
11399                 (UINT32_C(0x3) << 4)
11400         /* 8MB. */
11401         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M \
11402                 (UINT32_C(0x4) << 4)
11403         /* 1GB. */
11404         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G \
11405                 (UINT32_C(0x5) << 4)
11406         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST \
11407                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
11408         /* TQM ring 6 page size and level. */
11409         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
11410         /* TQM ring 6 PBL indirect levels. */
11411         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK \
11412                 UINT32_C(0xf)
11413         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT       0
11414         /* PBL pointer is physical start address. */
11415         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0 \
11416                 UINT32_C(0x0)
11417         /* PBL pointer points to PTE table. */
11418         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1 \
11419                 UINT32_C(0x1)
11420         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11421         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 \
11422                 UINT32_C(0x2)
11423         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST \
11424                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
11425         /* TQM ring 6 page size. */
11426         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK \
11427                 UINT32_C(0xf0)
11428         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT   4
11429         /* 4KB. */
11430         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K \
11431                 (UINT32_C(0x0) << 4)
11432         /* 8KB. */
11433         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K \
11434                 (UINT32_C(0x1) << 4)
11435         /* 64KB. */
11436         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K \
11437                 (UINT32_C(0x2) << 4)
11438         /* 2MB. */
11439         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M \
11440                 (UINT32_C(0x3) << 4)
11441         /* 8MB. */
11442         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M \
11443                 (UINT32_C(0x4) << 4)
11444         /* 1GB. */
11445         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G \
11446                 (UINT32_C(0x5) << 4)
11447         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST \
11448                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
11449         /* TQM ring 7 page size and level. */
11450         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
11451         /* TQM ring 7 PBL indirect levels. */
11452         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK \
11453                 UINT32_C(0xf)
11454         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT       0
11455         /* PBL pointer is physical start address. */
11456         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0 \
11457                 UINT32_C(0x0)
11458         /* PBL pointer points to PTE table. */
11459         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1 \
11460                 UINT32_C(0x1)
11461         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11462         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 \
11463                 UINT32_C(0x2)
11464         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST \
11465                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
11466         /* TQM ring 7 page size. */
11467         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK \
11468                 UINT32_C(0xf0)
11469         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT   4
11470         /* 4KB. */
11471         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K \
11472                 (UINT32_C(0x0) << 4)
11473         /* 8KB. */
11474         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K \
11475                 (UINT32_C(0x1) << 4)
11476         /* 64KB. */
11477         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K \
11478                 (UINT32_C(0x2) << 4)
11479         /* 2MB. */
11480         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M \
11481                 (UINT32_C(0x3) << 4)
11482         /* 8MB. */
11483         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M \
11484                 (UINT32_C(0x4) << 4)
11485         /* 1GB. */
11486         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G \
11487                 (UINT32_C(0x5) << 4)
11488         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST \
11489                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
11490         /* MR/AV page size and level. */
11491         uint8_t mrav_pg_size_mrav_lvl;
11492         /* MR/AV PBL indirect levels. */
11493         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK \
11494                 UINT32_C(0xf)
11495         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT       0
11496         /* PBL pointer is physical start address. */
11497         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0 \
11498                 UINT32_C(0x0)
11499         /* PBL pointer points to PTE table. */
11500         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1 \
11501                 UINT32_C(0x1)
11502         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11503         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 \
11504                 UINT32_C(0x2)
11505         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST \
11506                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
11507         /* MR/AV page size. */
11508         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK \
11509                 UINT32_C(0xf0)
11510         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT   4
11511         /* 4KB. */
11512         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K \
11513                 (UINT32_C(0x0) << 4)
11514         /* 8KB. */
11515         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K \
11516                 (UINT32_C(0x1) << 4)
11517         /* 64KB. */
11518         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K \
11519                 (UINT32_C(0x2) << 4)
11520         /* 2MB. */
11521         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M \
11522                 (UINT32_C(0x3) << 4)
11523         /* 8MB. */
11524         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M \
11525                 (UINT32_C(0x4) << 4)
11526         /* 1GB. */
11527         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G \
11528                 (UINT32_C(0x5) << 4)
11529         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST \
11530                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
11531         /* Timer page size and level. */
11532         uint8_t tim_pg_size_tim_lvl;
11533         /* Timer PBL indirect levels. */
11534         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK \
11535                 UINT32_C(0xf)
11536         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT       0
11537         /* PBL pointer is physical start address. */
11538         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0 \
11539                 UINT32_C(0x0)
11540         /* PBL pointer points to PTE table. */
11541         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1 \
11542                 UINT32_C(0x1)
11543         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11544         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 \
11545                 UINT32_C(0x2)
11546         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST \
11547                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
11548         /* Timer page size. */
11549         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK \
11550                 UINT32_C(0xf0)
11551         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT   4
11552         /* 4KB. */
11553         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K \
11554                 (UINT32_C(0x0) << 4)
11555         /* 8KB. */
11556         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K \
11557                 (UINT32_C(0x1) << 4)
11558         /* 64KB. */
11559         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K \
11560                 (UINT32_C(0x2) << 4)
11561         /* 2MB. */
11562         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M \
11563                 (UINT32_C(0x3) << 4)
11564         /* 8MB. */
11565         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M \
11566                 (UINT32_C(0x4) << 4)
11567         /* 1GB. */
11568         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G \
11569                 (UINT32_C(0x5) << 4)
11570         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST \
11571                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
11572         /* QP page directory. */
11573         uint64_t        qpc_page_dir;
11574         /* SRQ page directory. */
11575         uint64_t        srq_page_dir;
11576         /* CQ page directory. */
11577         uint64_t        cq_page_dir;
11578         /* VNIC page directory. */
11579         uint64_t        vnic_page_dir;
11580         /* Stat page directory. */
11581         uint64_t        stat_page_dir;
11582         /* TQM slowpath page directory. */
11583         uint64_t        tqm_sp_page_dir;
11584         /* TQM ring 0 page directory. */
11585         uint64_t        tqm_ring0_page_dir;
11586         /* TQM ring 1 page directory. */
11587         uint64_t        tqm_ring1_page_dir;
11588         /* TQM ring 2 page directory. */
11589         uint64_t        tqm_ring2_page_dir;
11590         /* TQM ring 3 page directory. */
11591         uint64_t        tqm_ring3_page_dir;
11592         /* TQM ring 4 page directory. */
11593         uint64_t        tqm_ring4_page_dir;
11594         /* TQM ring 5 page directory. */
11595         uint64_t        tqm_ring5_page_dir;
11596         /* TQM ring 6 page directory. */
11597         uint64_t        tqm_ring6_page_dir;
11598         /* TQM ring 7 page directory. */
11599         uint64_t        tqm_ring7_page_dir;
11600         /* MR/AV page directory. */
11601         uint64_t        mrav_page_dir;
11602         /* Timer page directory. */
11603         uint64_t        tim_page_dir;
11604         /* Number of entries to reserve for QP1 */
11605         uint16_t        qp_num_qp1_entries;
11606         /* Number of entries to reserve for L2 */
11607         uint16_t        qp_num_l2_entries;
11608         /* Number of QPs. */
11609         uint32_t        qp_num_entries;
11610         /* Number of SRQs. */
11611         uint32_t        srq_num_entries;
11612         /* Number of entries to reserve for L2 */
11613         uint16_t        srq_num_l2_entries;
11614         /* Number of entries to reserve for L2 */
11615         uint16_t        cq_num_l2_entries;
11616         /* Number of CQs. */
11617         uint32_t        cq_num_entries;
11618         /* Number of entries to reserve for VNIC entries */
11619         uint16_t        vnic_num_vnic_entries;
11620         /* Number of entries to reserve for Ring table entries */
11621         uint16_t        vnic_num_ring_table_entries;
11622         /* Number of Stats. */
11623         uint32_t        stat_num_entries;
11624         /* Number of TQM slowpath entries. */
11625         uint32_t        tqm_sp_num_entries;
11626         /* Number of TQM ring 0 entries. */
11627         uint32_t        tqm_ring0_num_entries;
11628         /* Number of TQM ring 1 entries. */
11629         uint32_t        tqm_ring1_num_entries;
11630         /* Number of TQM ring 2 entries. */
11631         uint32_t        tqm_ring2_num_entries;
11632         /* Number of TQM ring 3 entries. */
11633         uint32_t        tqm_ring3_num_entries;
11634         /* Number of TQM ring 4 entries. */
11635         uint32_t        tqm_ring4_num_entries;
11636         /* Number of TQM ring 5 entries. */
11637         uint32_t        tqm_ring5_num_entries;
11638         /* Number of TQM ring 6 entries. */
11639         uint32_t        tqm_ring6_num_entries;
11640         /* Number of TQM ring 7 entries. */
11641         uint32_t        tqm_ring7_num_entries;
11642         /*
11643          * If the MR/AV split reservation flag is not set, then this field
11644          * represents the total number of MR plus AV entries. For versions
11645          * of firmware that support the split reservation, when it is not
11646          * specified half of the entries will be reserved for MRs and the
11647          * other half for AVs.
11648          *
11649          * If the MR/AV split reservation flag is set, then this
11650          * field is logically divided into two 16b fields. Bits `[31:16]`
11651          * represents the `mr_num_entries` and bits `[15:0]` represents
11652          * `av_num_entries`. The granularity of these values is defined by
11653          * the `mrav_num_entries_unit` field returned by the
11654          * `backing_store_qcaps` command.
11655          */
11656         uint32_t        mrav_num_entries;
11657         /* Number of Timer entries. */
11658         uint32_t        tim_num_entries;
11659         uint8_t unused_1[7];
11660         /*
11661          * This field is used in Output records to indicate that the output
11662          * is completely written to RAM.  This field should be read as 1
11663          * to indicate that the output has been completely written.
11664          * When writing a command completion or response to an internal
11665          * processor, the order of writes has to be such that this field
11666          * is written last.
11667          */
11668         uint8_t valid;
11669 } __attribute__((packed));
11670
11671 /****************************
11672  * hwrm_error_recovery_qcfg *
11673  ****************************/
11674
11675
11676 /* hwrm_error_recovery_qcfg_input (size:192b/24B) */
11677 struct hwrm_error_recovery_qcfg_input {
11678         /* The HWRM command request type. */
11679         uint16_t        req_type;
11680         /*
11681          * The completion ring to send the completion event on. This should
11682          * be the NQ ID returned from the `nq_alloc` HWRM command.
11683          */
11684         uint16_t        cmpl_ring;
11685         /*
11686          * The sequence ID is used by the driver for tracking multiple
11687          * commands. This ID is treated as opaque data by the firmware and
11688          * the value is returned in the `hwrm_resp_hdr` upon completion.
11689          */
11690         uint16_t        seq_id;
11691         /*
11692          * The target ID of the command:
11693          * * 0x0-0xFFF8 - The function ID
11694          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11695          * * 0xFFFD - Reserved for user-space HWRM interface
11696          * * 0xFFFF - HWRM
11697          */
11698         uint16_t        target_id;
11699         /*
11700          * A physical address pointer pointing to a host buffer that the
11701          * command's response data will be written. This can be either a host
11702          * physical address (HPA) or a guest physical address (GPA) and must
11703          * point to a physically contiguous block of memory.
11704          */
11705         uint64_t        resp_addr;
11706         uint8_t unused_0[8];
11707 } __attribute__((packed));
11708
11709 /* hwrm_error_recovery_qcfg_output (size:1664b/208B) */
11710 struct hwrm_error_recovery_qcfg_output {
11711         /* The specific error status for the command. */
11712         uint16_t        error_code;
11713         /* The HWRM command request type. */
11714         uint16_t        req_type;
11715         /* The sequence ID from the original command. */
11716         uint16_t        seq_id;
11717         /* The length of the response data in number of bytes. */
11718         uint16_t        resp_len;
11719         uint32_t        flags;
11720         /*
11721          * When this flag is set to 1, error recovery will be initiated
11722          * through master function driver.
11723          */
11724         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST       UINT32_C(0x1)
11725         /*
11726          * When this flag is set to 1, error recovery will be performed
11727          * through Co processor.
11728          */
11729         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU     UINT32_C(0x2)
11730         /*
11731          * Driver Polling frequency. This value is in units of 100msec.
11732          * Typical value would be 10 to indicate 1sec.
11733          * Drivers can poll FW health status, Heartbeat, reset_counter with
11734          * this frequency.
11735          */
11736         uint32_t        driver_polling_freq;
11737         /*
11738          * This value is in units of 100msec.
11739          * Typical value would be 30 to indicate 3sec.
11740          * Master function wait period from detecting a fatal error to
11741          * initiating reset. In this time period Master PF expects every
11742          * active driver will detect fatal error.
11743          */
11744         uint32_t        master_func_wait_period;
11745         /*
11746          * This value is in units of 100msec.
11747          * Typical value would be 50 to indicate 5sec.
11748          * Normal function wait period from fatal error detection to
11749          * polling FW health status. In this time period, drivers should not
11750          * do any PCIe MMIO transaction and should not send any HWRM commands.
11751          */
11752         uint32_t        normal_func_wait_period;
11753         /*
11754          * This value is in units of 100msec.
11755          * Typical value would be 20 to indicate 2sec.
11756          * This field indicates that, master function wait period after chip
11757          * reset. After this time, master function should reinitialize with
11758          * FW.
11759          */
11760         uint32_t        master_func_wait_period_after_reset;
11761         /*
11762          * This value is in units of 100msec.
11763          * Typical value would be 60 to indicate 6sec.
11764          * This field is applicable to both master and normal functions.
11765          * Even after chip reset, if FW status not changed to ready,
11766          * then all the functions can poll for this much time and bailout.
11767          */
11768         uint32_t        max_bailout_time_after_reset;
11769         /*
11770          * FW health status register.
11771          * Lower 2 bits indicates address space location and upper 30 bits
11772          * indicates upper 30bits of the register address.
11773          * A value of 0xFFFF-FFFF indicates this register does not exist.
11774          */
11775         uint32_t        fw_health_status_reg;
11776         /* Lower 2 bits indicates address space location. */
11777         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_MASK \
11778                 UINT32_C(0x3)
11779         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_SFT \
11780                 0
11781         /*
11782          * If value is 0, this register is located in PCIe config space.
11783          * Drivers have to map appropriate window to access this
11784          * register.
11785          */
11786         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_PCIE_CFG \
11787                 UINT32_C(0x0)
11788         /*
11789          * If value is 1, this register is located in GRC address space.
11790          * Drivers have to map appropriate window to access this
11791          * register.
11792          */
11793         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_GRC \
11794                 UINT32_C(0x1)
11795         /*
11796          * If value is 2, this register is located in first BAR address
11797          * space. Drivers have to map appropriate window to access this
11798          * register.
11799          */
11800         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR0 \
11801                 UINT32_C(0x2)
11802         /*
11803          * If value is 3, this register is located in second BAR address
11804          * space. Drivers have to map appropriate window to access this
11805          * Drivers have to map appropriate window to access this
11806          * register.
11807          */
11808         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1 \
11809                 UINT32_C(0x3)
11810         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_LAST \
11811                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1
11812         /* Upper 30bits of the register address. */
11813         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_MASK \
11814                 UINT32_C(0xfffffffc)
11815         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SFT \
11816                 2
11817         /*
11818          * FW HeartBeat register.
11819          * Lower 2 bits indicates address space location and upper 30 bits
11820          * indicates actual address.
11821          * A value of 0xFFFF-FFFF indicates this register does not exist.
11822          */
11823         uint32_t        fw_heartbeat_reg;
11824         /* Lower 2 bits indicates address space location. */
11825         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_MASK \
11826                 UINT32_C(0x3)
11827         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_SFT \
11828                 0
11829         /*
11830          * If value is 0, this register is located in PCIe config space.
11831          * Drivers have to map appropriate window to access this
11832          * register.
11833          */
11834         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_PCIE_CFG \
11835                 UINT32_C(0x0)
11836         /*
11837          * If value is 1, this register is located in GRC address space.
11838          * Drivers have to map appropriate window to access this
11839          * register.
11840          */
11841         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_GRC \
11842                 UINT32_C(0x1)
11843         /*
11844          * If value is 2, this register is located in first BAR address
11845          * space. Drivers have to map appropriate window to access this
11846          * register.
11847          */
11848         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR0 \
11849                 UINT32_C(0x2)
11850         /*
11851          * If value is 3, this register is located in second BAR address
11852          * space. Drivers have to map appropriate window to access this
11853          * register.
11854          */
11855         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1 \
11856                 UINT32_C(0x3)
11857         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_LAST \
11858                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1
11859         /* Upper 30bits of the register address. */
11860         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_MASK \
11861                 UINT32_C(0xfffffffc)
11862         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SFT \
11863                 2
11864         /*
11865          * FW reset counter.
11866          * Lower 2 bits indicates address space location and upper 30 bits
11867          * indicates actual address.
11868          * A value of 0xFFFF-FFFF indicates this register does not exist.
11869          */
11870         uint32_t        fw_reset_cnt_reg;
11871         /* Lower 2 bits indicates address space location. */
11872         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_MASK \
11873                 UINT32_C(0x3)
11874         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_SFT \
11875                 0
11876         /*
11877          * If value is 0, this register is located in PCIe config space.
11878          * Drivers have to map appropriate window to access this
11879          * register.
11880          */
11881         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_PCIE_CFG \
11882                 UINT32_C(0x0)
11883         /*
11884          * If value is 1, this register is located in GRC address space.
11885          * Drivers have to map appropriate window to access this
11886          * register.
11887          */
11888         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_GRC \
11889                 UINT32_C(0x1)
11890         /*
11891          * If value is 2, this register is located in first BAR address
11892          * space. Drivers have to map appropriate window to access this
11893          * register.
11894          */
11895         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR0 \
11896                 UINT32_C(0x2)
11897         /*
11898          * If value is 3, this register is located in second BAR address
11899          * space. Drivers have to map appropriate window to access this
11900          * register.
11901          */
11902         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1 \
11903                 UINT32_C(0x3)
11904         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_LAST \
11905                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1
11906         /* Upper 30bits of the register address. */
11907         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_MASK \
11908                 UINT32_C(0xfffffffc)
11909         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SFT \
11910                 2
11911         /*
11912          * Reset Inprogress Register address for PFs.
11913          * Lower 2 bits indicates address space location and upper 30 bits
11914          * indicates actual address.
11915          * A value of 0xFFFF-FFFF indicates this register does not exist.
11916          */
11917         uint32_t        reset_inprogress_reg;
11918         /* Lower 2 bits indicates address space location. */
11919         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_MASK \
11920                 UINT32_C(0x3)
11921         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_SFT \
11922                 0
11923         /*
11924          * If value is 0, this register is located in PCIe config space.
11925          * Drivers have to map appropriate window to access this
11926          * register.
11927          */
11928         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_PCIE_CFG \
11929                 UINT32_C(0x0)
11930         /*
11931          * If value is 1, this register is located in GRC address space.
11932          * Drivers have to map appropriate window to access this
11933          * register.
11934          */
11935         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_GRC \
11936                 UINT32_C(0x1)
11937         /*
11938          * If value is 2, this register is located in first BAR address
11939          * space. Drivers have to map appropriate window to access this
11940          * register.
11941          */
11942         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR0 \
11943                 UINT32_C(0x2)
11944         /*
11945          * If value is 3, this register is located in second BAR address
11946          * space. Drivers have to map appropriate window to access this
11947          * register.
11948          */
11949         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1 \
11950                 UINT32_C(0x3)
11951         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_LAST \
11952                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1
11953         /* Upper 30bits of the register address. */
11954         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_MASK \
11955                 UINT32_C(0xfffffffc)
11956         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SFT \
11957                 2
11958         /* This field indicates the mask value for reset_inprogress_reg. */
11959         uint32_t        reset_inprogress_reg_mask;
11960         uint8_t unused_0[3];
11961         /*
11962          * Array of registers and value count to reset the Chip
11963          * Each array count has reset_reg, reset_reg_val, delay_after_reset
11964          * in TLV format. Depending upon Chip type, number of reset registers
11965          * will vary. Drivers have to write reset_reg_val in the reset_reg
11966          * location in the same sequence in order to recover from a fatal
11967          * error.
11968          */
11969         uint8_t reg_array_cnt;
11970         /*
11971          * Reset register.
11972          * Lower 2 bits indicates address space location and upper 30 bits
11973          * indicates actual address.
11974          * A value of 0xFFFF-FFFF indicates this register does not exist.
11975          */
11976         uint32_t        reset_reg[16];
11977         /* Lower 2 bits indicates address space location. */
11978         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_MASK \
11979                 UINT32_C(0x3)
11980         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_SFT     0
11981         /*
11982          * If value is 0, this register is located in PCIe config space.
11983          * Drivers have to map appropriate window to access this
11984          * register.
11985          */
11986         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_PCIE_CFG \
11987                 UINT32_C(0x0)
11988         /*
11989          * If value is 1, this register is located in GRC address space.
11990          * Drivers have to map appropriate window to access this
11991          * register.
11992          */
11993         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_GRC \
11994                 UINT32_C(0x1)
11995         /*
11996          * If value is 2, this register is located in first BAR address
11997          * space. Drivers have to map appropriate window to access this
11998          * register.
11999          */
12000         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR0 \
12001                 UINT32_C(0x2)
12002         /*
12003          * If value is 3, this register is located in second BAR address
12004          * space. Drivers have to map appropriate window to access this
12005          * register.
12006          */
12007         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1 \
12008                 UINT32_C(0x3)
12009         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_LAST \
12010                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1
12011         /* Upper 30bits of the register address. */
12012         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_MASK \
12013                 UINT32_C(0xfffffffc)
12014         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SFT           2
12015         /* Value to be written in reset_reg to reset the controller. */
12016         uint32_t        reset_reg_val[16];
12017         /*
12018          * This value is in units of 1msec.
12019          * Typical value would be 10 to indicate 10msec.
12020          * Some of the operations like Core reset require delay before
12021          * accessing PCIE MMIO register space.
12022          * If this value is non-zero, drivers have to wait for
12023          * this much time after writing reset_reg_val in reset_reg.
12024          */
12025         uint8_t delay_after_reset[16];
12026         uint8_t unused_1[7];
12027         /*
12028          * This field is used in Output records to indicate that the output
12029          * is completely written to RAM.  This field should be read as '1'
12030          * to indicate that the output has been completely written.
12031          * When writing a command completion or response to an internal
12032          * processor, the order of writes has to be such that this field
12033          * is written last.
12034          */
12035         uint8_t valid;
12036 } __attribute__((packed));
12037
12038 /***********************
12039  * hwrm_func_vlan_qcfg *
12040  ***********************/
12041
12042
12043 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
12044 struct hwrm_func_vlan_qcfg_input {
12045         /* The HWRM command request type. */
12046         uint16_t        req_type;
12047         /*
12048          * The completion ring to send the completion event on. This should
12049          * be the NQ ID returned from the `nq_alloc` HWRM command.
12050          */
12051         uint16_t        cmpl_ring;
12052         /*
12053          * The sequence ID is used by the driver for tracking multiple
12054          * commands. This ID is treated as opaque data by the firmware and
12055          * the value is returned in the `hwrm_resp_hdr` upon completion.
12056          */
12057         uint16_t        seq_id;
12058         /*
12059          * The target ID of the command:
12060          * * 0x0-0xFFF8 - The function ID
12061          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12062          * * 0xFFFD - Reserved for user-space HWRM interface
12063          * * 0xFFFF - HWRM
12064          */
12065         uint16_t        target_id;
12066         /*
12067          * A physical address pointer pointing to a host buffer that the
12068          * command's response data will be written. This can be either a host
12069          * physical address (HPA) or a guest physical address (GPA) and must
12070          * point to a physically contiguous block of memory.
12071          */
12072         uint64_t        resp_addr;
12073         /*
12074          * Function ID of the function that is being
12075          * configured.
12076          * If set to 0xFF... (All Fs), then the configuration is
12077          * for the requesting function.
12078          */
12079         uint16_t        fid;
12080         uint8_t unused_0[6];
12081 } __attribute__((packed));
12082
12083 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
12084 struct hwrm_func_vlan_qcfg_output {
12085         /* The specific error status for the command. */
12086         uint16_t        error_code;
12087         /* The HWRM command request type. */
12088         uint16_t        req_type;
12089         /* The sequence ID from the original command. */
12090         uint16_t        seq_id;
12091         /* The length of the response data in number of bytes. */
12092         uint16_t        resp_len;
12093         uint64_t        unused_0;
12094         /* S-TAG VLAN identifier configured for the function. */
12095         uint16_t        stag_vid;
12096         /* S-TAG PCP value configured for the function. */
12097         uint8_t stag_pcp;
12098         uint8_t unused_1;
12099         /*
12100          * S-TAG TPID value configured for the function. This field is specified in
12101          * network byte order.
12102          */
12103         uint16_t        stag_tpid;
12104         /* C-TAG VLAN identifier configured for the function. */
12105         uint16_t        ctag_vid;
12106         /* C-TAG PCP value configured for the function. */
12107         uint8_t ctag_pcp;
12108         uint8_t unused_2;
12109         /*
12110          * C-TAG TPID value configured for the function. This field is specified in
12111          * network byte order.
12112          */
12113         uint16_t        ctag_tpid;
12114         /* Future use. */
12115         uint32_t        rsvd2;
12116         /* Future use. */
12117         uint32_t        rsvd3;
12118         uint8_t unused_3[3];
12119         /*
12120          * This field is used in Output records to indicate that the output
12121          * is completely written to RAM.  This field should be read as '1'
12122          * to indicate that the output has been completely written.
12123          * When writing a command completion or response to an internal processor,
12124          * the order of writes has to be such that this field is written last.
12125          */
12126         uint8_t valid;
12127 } __attribute__((packed));
12128
12129 /**********************
12130  * hwrm_func_vlan_cfg *
12131  **********************/
12132
12133
12134 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
12135 struct hwrm_func_vlan_cfg_input {
12136         /* The HWRM command request type. */
12137         uint16_t        req_type;
12138         /*
12139          * The completion ring to send the completion event on. This should
12140          * be the NQ ID returned from the `nq_alloc` HWRM command.
12141          */
12142         uint16_t        cmpl_ring;
12143         /*
12144          * The sequence ID is used by the driver for tracking multiple
12145          * commands. This ID is treated as opaque data by the firmware and
12146          * the value is returned in the `hwrm_resp_hdr` upon completion.
12147          */
12148         uint16_t        seq_id;
12149         /*
12150          * The target ID of the command:
12151          * * 0x0-0xFFF8 - The function ID
12152          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12153          * * 0xFFFD - Reserved for user-space HWRM interface
12154          * * 0xFFFF - HWRM
12155          */
12156         uint16_t        target_id;
12157         /*
12158          * A physical address pointer pointing to a host buffer that the
12159          * command's response data will be written. This can be either a host
12160          * physical address (HPA) or a guest physical address (GPA) and must
12161          * point to a physically contiguous block of memory.
12162          */
12163         uint64_t        resp_addr;
12164         /*
12165          * Function ID of the function that is being
12166          * configured.
12167          * If set to 0xFF... (All Fs), then the configuration is
12168          * for the requesting function.
12169          */
12170         uint16_t        fid;
12171         uint8_t unused_0[2];
12172         uint32_t        enables;
12173         /*
12174          * This bit must be '1' for the stag_vid field to be
12175          * configured.
12176          */
12177         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID      UINT32_C(0x1)
12178         /*
12179          * This bit must be '1' for the ctag_vid field to be
12180          * configured.
12181          */
12182         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID      UINT32_C(0x2)
12183         /*
12184          * This bit must be '1' for the stag_pcp field to be
12185          * configured.
12186          */
12187         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP      UINT32_C(0x4)
12188         /*
12189          * This bit must be '1' for the ctag_pcp field to be
12190          * configured.
12191          */
12192         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP      UINT32_C(0x8)
12193         /*
12194          * This bit must be '1' for the stag_tpid field to be
12195          * configured.
12196          */
12197         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID     UINT32_C(0x10)
12198         /*
12199          * This bit must be '1' for the ctag_tpid field to be
12200          * configured.
12201          */
12202         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID     UINT32_C(0x20)
12203         /* S-TAG VLAN identifier configured for the function. */
12204         uint16_t        stag_vid;
12205         /* S-TAG PCP value configured for the function. */
12206         uint8_t stag_pcp;
12207         uint8_t unused_1;
12208         /*
12209          * S-TAG TPID value configured for the function. This field is specified in
12210          * network byte order.
12211          */
12212         uint16_t        stag_tpid;
12213         /* C-TAG VLAN identifier configured for the function. */
12214         uint16_t        ctag_vid;
12215         /* C-TAG PCP value configured for the function. */
12216         uint8_t ctag_pcp;
12217         uint8_t unused_2;
12218         /*
12219          * C-TAG TPID value configured for the function. This field is specified in
12220          * network byte order.
12221          */
12222         uint16_t        ctag_tpid;
12223         /* Future use. */
12224         uint32_t        rsvd1;
12225         /* Future use. */
12226         uint32_t        rsvd2;
12227         uint8_t unused_3[4];
12228 } __attribute__((packed));
12229
12230 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
12231 struct hwrm_func_vlan_cfg_output {
12232         /* The specific error status for the command. */
12233         uint16_t        error_code;
12234         /* The HWRM command request type. */
12235         uint16_t        req_type;
12236         /* The sequence ID from the original command. */
12237         uint16_t        seq_id;
12238         /* The length of the response data in number of bytes. */
12239         uint16_t        resp_len;
12240         uint8_t unused_0[7];
12241         /*
12242          * This field is used in Output records to indicate that the output
12243          * is completely written to RAM.  This field should be read as '1'
12244          * to indicate that the output has been completely written.
12245          * When writing a command completion or response to an internal processor,
12246          * the order of writes has to be such that this field is written last.
12247          */
12248         uint8_t valid;
12249 } __attribute__((packed));
12250
12251 /*******************************
12252  * hwrm_func_vf_vnic_ids_query *
12253  *******************************/
12254
12255
12256 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
12257 struct hwrm_func_vf_vnic_ids_query_input {
12258         /* The HWRM command request type. */
12259         uint16_t        req_type;
12260         /*
12261          * The completion ring to send the completion event on. This should
12262          * be the NQ ID returned from the `nq_alloc` HWRM command.
12263          */
12264         uint16_t        cmpl_ring;
12265         /*
12266          * The sequence ID is used by the driver for tracking multiple
12267          * commands. This ID is treated as opaque data by the firmware and
12268          * the value is returned in the `hwrm_resp_hdr` upon completion.
12269          */
12270         uint16_t        seq_id;
12271         /*
12272          * The target ID of the command:
12273          * * 0x0-0xFFF8 - The function ID
12274          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12275          * * 0xFFFD - Reserved for user-space HWRM interface
12276          * * 0xFFFF - HWRM
12277          */
12278         uint16_t        target_id;
12279         /*
12280          * A physical address pointer pointing to a host buffer that the
12281          * command's response data will be written. This can be either a host
12282          * physical address (HPA) or a guest physical address (GPA) and must
12283          * point to a physically contiguous block of memory.
12284          */
12285         uint64_t        resp_addr;
12286         /*
12287          * This value is used to identify a Virtual Function (VF).
12288          * The scope of VF ID is local within a PF.
12289          */
12290         uint16_t        vf_id;
12291         uint8_t unused_0[2];
12292         /* Max number of vnic ids in vnic id table */
12293         uint32_t        max_vnic_id_cnt;
12294         /* This is the address for VF VNIC ID table */
12295         uint64_t        vnic_id_tbl_addr;
12296 } __attribute__((packed));
12297
12298 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
12299 struct hwrm_func_vf_vnic_ids_query_output {
12300         /* The specific error status for the command. */
12301         uint16_t        error_code;
12302         /* The HWRM command request type. */
12303         uint16_t        req_type;
12304         /* The sequence ID from the original command. */
12305         uint16_t        seq_id;
12306         /* The length of the response data in number of bytes. */
12307         uint16_t        resp_len;
12308         /*
12309          * Actual number of vnic ids
12310          *
12311          * Each VNIC ID is written as a 32-bit number.
12312          */
12313         uint32_t        vnic_id_cnt;
12314         uint8_t unused_0[3];
12315         /*
12316          * This field is used in Output records to indicate that the output
12317          * is completely written to RAM.  This field should be read as '1'
12318          * to indicate that the output has been completely written.
12319          * When writing a command completion or response to an internal processor,
12320          * the order of writes has to be such that this field is written last.
12321          */
12322         uint8_t valid;
12323 } __attribute__((packed));
12324
12325 /***********************
12326  * hwrm_func_vf_bw_cfg *
12327  ***********************/
12328
12329
12330 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */
12331 struct hwrm_func_vf_bw_cfg_input {
12332         /* The HWRM command request type. */
12333         uint16_t        req_type;
12334         /*
12335          * The completion ring to send the completion event on. This should
12336          * be the NQ ID returned from the `nq_alloc` HWRM command.
12337          */
12338         uint16_t        cmpl_ring;
12339         /*
12340          * The sequence ID is used by the driver for tracking multiple
12341          * commands. This ID is treated as opaque data by the firmware and
12342          * the value is returned in the `hwrm_resp_hdr` upon completion.
12343          */
12344         uint16_t        seq_id;
12345         /*
12346          * The target ID of the command:
12347          * * 0x0-0xFFF8 - The function ID
12348          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12349          * * 0xFFFD - Reserved for user-space HWRM interface
12350          * * 0xFFFF - HWRM
12351          */
12352         uint16_t        target_id;
12353         /*
12354          * A physical address pointer pointing to a host buffer that the
12355          * command's response data will be written. This can be either a host
12356          * physical address (HPA) or a guest physical address (GPA) and must
12357          * point to a physically contiguous block of memory.
12358          */
12359         uint64_t        resp_addr;
12360         /*
12361          * The number of VF functions that are being configured.
12362          * The cmd space allows up to 50 VFs' BW to be configured with one cmd.
12363          */
12364         uint16_t        num_vfs;
12365         uint16_t        unused[3];
12366         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
12367         uint16_t        vfn[48];
12368         /* The physical VF id the adjustment will be made to. */
12369         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK     UINT32_C(0xfff)
12370         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT      0
12371         /*
12372          * This field configures the rate scale percentage of the VF as specified
12373          * by the physical VF id.
12374          */
12375         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK     UINT32_C(0xf000)
12376         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT      12
12377         /* 0% of the max tx rate */
12378         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0 \
12379                 (UINT32_C(0x0) << 12)
12380         /* 6.66% of the max tx rate */
12381         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66 \
12382                 (UINT32_C(0x1) << 12)
12383         /* 13.33% of the max tx rate */
12384         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33 \
12385                 (UINT32_C(0x2) << 12)
12386         /* 20% of the max tx rate */
12387         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20 \
12388                 (UINT32_C(0x3) << 12)
12389         /* 26.66% of the max tx rate */
12390         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66 \
12391                 (UINT32_C(0x4) << 12)
12392         /* 33% of the max tx rate */
12393         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33 \
12394                 (UINT32_C(0x5) << 12)
12395         /* 40% of the max tx rate */
12396         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40 \
12397                 (UINT32_C(0x6) << 12)
12398         /* 46.66% of the max tx rate */
12399         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66 \
12400                 (UINT32_C(0x7) << 12)
12401         /* 53.33% of the max tx rate */
12402         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33 \
12403                 (UINT32_C(0x8) << 12)
12404         /* 60% of the max tx rate */
12405         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60 \
12406                 (UINT32_C(0x9) << 12)
12407         /* 66.66% of the max tx rate */
12408         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66 \
12409                 (UINT32_C(0xa) << 12)
12410         /* 53.33% of the max tx rate */
12411         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33 \
12412                 (UINT32_C(0xb) << 12)
12413         /* 80% of the max tx rate */
12414         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80 \
12415                 (UINT32_C(0xc) << 12)
12416         /* 86.66% of the max tx rate */
12417         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66 \
12418                 (UINT32_C(0xd) << 12)
12419         /* 93.33% of the max tx rate */
12420         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33 \
12421                 (UINT32_C(0xe) << 12)
12422         /* 100% of the max tx rate */
12423         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100 \
12424                 (UINT32_C(0xf) << 12)
12425         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST \
12426                 HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
12427 } __attribute__((packed));
12428
12429 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
12430 struct hwrm_func_vf_bw_cfg_output {
12431         /* The specific error status for the command. */
12432         uint16_t        error_code;
12433         /* The HWRM command request type. */
12434         uint16_t        req_type;
12435         /* The sequence ID from the original command. */
12436         uint16_t        seq_id;
12437         /* The length of the response data in number of bytes. */
12438         uint16_t        resp_len;
12439         uint8_t unused_0[7];
12440         /*
12441          * This field is used in Output records to indicate that the output
12442          * is completely written to RAM.  This field should be read as '1'
12443          * to indicate that the output has been completely written.
12444          * When writing a command completion or response to an internal processor,
12445          * the order of writes has to be such that this field is written last.
12446          */
12447         uint8_t valid;
12448 } __attribute__((packed));
12449
12450 /************************
12451  * hwrm_func_vf_bw_qcfg *
12452  ************************/
12453
12454
12455 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */
12456 struct hwrm_func_vf_bw_qcfg_input {
12457         /* The HWRM command request type. */
12458         uint16_t        req_type;
12459         /*
12460          * The completion ring to send the completion event on. This should
12461          * be the NQ ID returned from the `nq_alloc` HWRM command.
12462          */
12463         uint16_t        cmpl_ring;
12464         /*
12465          * The sequence ID is used by the driver for tracking multiple
12466          * commands. This ID is treated as opaque data by the firmware and
12467          * the value is returned in the `hwrm_resp_hdr` upon completion.
12468          */
12469         uint16_t        seq_id;
12470         /*
12471          * The target ID of the command:
12472          * * 0x0-0xFFF8 - The function ID
12473          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12474          * * 0xFFFD - Reserved for user-space HWRM interface
12475          * * 0xFFFF - HWRM
12476          */
12477         uint16_t        target_id;
12478         /*
12479          * A physical address pointer pointing to a host buffer that the
12480          * command's response data will be written. This can be either a host
12481          * physical address (HPA) or a guest physical address (GPA) and must
12482          * point to a physically contiguous block of memory.
12483          */
12484         uint64_t        resp_addr;
12485         /*
12486          * The number of VF functions that are being queried.
12487          * The inline response space allows the host to query up to 50 VFs'
12488          * rate scale percentage
12489          */
12490         uint16_t        num_vfs;
12491         uint16_t        unused[3];
12492         /* These 16-bit fields contain the VF fid */
12493         uint16_t        vfn[48];
12494         /* The physical VF id of interest */
12495         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
12496         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
12497 } __attribute__((packed));
12498
12499 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
12500 struct hwrm_func_vf_bw_qcfg_output {
12501         /* The specific error status for the command. */
12502         uint16_t        error_code;
12503         /* The HWRM command request type. */
12504         uint16_t        req_type;
12505         /* The sequence ID from the original command. */
12506         uint16_t        seq_id;
12507         /* The length of the response data in number of bytes. */
12508         uint16_t        resp_len;
12509         /*
12510          * The number of VF functions that are being queried.
12511          * The inline response space allows the host to query up to 50 VFs' rate
12512          * scale percentage
12513          */
12514         uint16_t        num_vfs;
12515         uint16_t        unused[3];
12516         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
12517         uint16_t        vfn[48];
12518         /* The physical VF id the adjustment will be made to. */
12519         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK     UINT32_C(0xfff)
12520         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT      0
12521         /*
12522          * This field configures the rate scale percentage of the VF as specified
12523          * by the physical VF id.
12524          */
12525         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK     UINT32_C(0xf000)
12526         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT      12
12527         /* 0% of the max tx rate */
12528         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0 \
12529                 (UINT32_C(0x0) << 12)
12530         /* 6.66% of the max tx rate */
12531         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66 \
12532                 (UINT32_C(0x1) << 12)
12533         /* 13.33% of the max tx rate */
12534         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33 \
12535                 (UINT32_C(0x2) << 12)
12536         /* 20% of the max tx rate */
12537         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20 \
12538                 (UINT32_C(0x3) << 12)
12539         /* 26.66% of the max tx rate */
12540         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66 \
12541                 (UINT32_C(0x4) << 12)
12542         /* 33% of the max tx rate */
12543         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33 \
12544                 (UINT32_C(0x5) << 12)
12545         /* 40% of the max tx rate */
12546         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40 \
12547                 (UINT32_C(0x6) << 12)
12548         /* 46.66% of the max tx rate */
12549         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66 \
12550                 (UINT32_C(0x7) << 12)
12551         /* 53.33% of the max tx rate */
12552         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33 \
12553                 (UINT32_C(0x8) << 12)
12554         /* 60% of the max tx rate */
12555         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60 \
12556                 (UINT32_C(0x9) << 12)
12557         /* 66.66% of the max tx rate */
12558         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66 \
12559                 (UINT32_C(0xa) << 12)
12560         /* 53.33% of the max tx rate */
12561         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33 \
12562                 (UINT32_C(0xb) << 12)
12563         /* 80% of the max tx rate */
12564         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80 \
12565                 (UINT32_C(0xc) << 12)
12566         /* 86.66% of the max tx rate */
12567         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66 \
12568                 (UINT32_C(0xd) << 12)
12569         /* 93.33% of the max tx rate */
12570         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33 \
12571                 (UINT32_C(0xe) << 12)
12572         /* 100% of the max tx rate */
12573         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100 \
12574                 (UINT32_C(0xf) << 12)
12575         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST \
12576                 HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100
12577         uint8_t unused_0[7];
12578         /*
12579          * This field is used in Output records to indicate that the output
12580          * is completely written to RAM.  This field should be read as '1'
12581          * to indicate that the output has been completely written.
12582          * When writing a command completion or response to an internal processor,
12583          * the order of writes has to be such that this field is written last.
12584          */
12585         uint8_t valid;
12586 } __attribute__((packed));
12587
12588 /***************************
12589  * hwrm_func_drv_if_change *
12590  ***************************/
12591
12592
12593 /* hwrm_func_drv_if_change_input (size:192b/24B) */
12594 struct hwrm_func_drv_if_change_input {
12595         /* The HWRM command request type. */
12596         uint16_t        req_type;
12597         /*
12598          * The completion ring to send the completion event on. This should
12599          * be the NQ ID returned from the `nq_alloc` HWRM command.
12600          */
12601         uint16_t        cmpl_ring;
12602         /*
12603          * The sequence ID is used by the driver for tracking multiple
12604          * commands. This ID is treated as opaque data by the firmware and
12605          * the value is returned in the `hwrm_resp_hdr` upon completion.
12606          */
12607         uint16_t        seq_id;
12608         /*
12609          * The target ID of the command:
12610          * * 0x0-0xFFF8 - The function ID
12611          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12612          * * 0xFFFD - Reserved for user-space HWRM interface
12613          * * 0xFFFF - HWRM
12614          */
12615         uint16_t        target_id;
12616         /*
12617          * A physical address pointer pointing to a host buffer that the
12618          * command's response data will be written. This can be either a host
12619          * physical address (HPA) or a guest physical address (GPA) and must
12620          * point to a physically contiguous block of memory.
12621          */
12622         uint64_t        resp_addr;
12623         uint32_t        flags;
12624         /*
12625          * When this bit is '1', the function driver is indicating
12626          * that the IF state is changing to UP state.  The call should
12627          * be made at the beginning of the driver's open call before
12628          * resources are allocated.  After making the call, the driver
12629          * should check the response to see if any resources may have
12630          * changed (see the response below).  If the driver fails
12631          * the open call, the driver should make this call again with
12632          * this bit cleared to indicate that the IF state is not UP.
12633          * During the driver's close call when the IF state is changing
12634          * to DOWN, the driver should make this call with the bit cleared
12635          * after all resources have been freed.
12636          */
12637         #define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP     UINT32_C(0x1)
12638         uint32_t        unused;
12639 } __attribute__((packed));
12640
12641 /* hwrm_func_drv_if_change_output (size:128b/16B) */
12642 struct hwrm_func_drv_if_change_output {
12643         /* The specific error status for the command. */
12644         uint16_t        error_code;
12645         /* The HWRM command request type. */
12646         uint16_t        req_type;
12647         /* The sequence ID from the original command. */
12648         uint16_t        seq_id;
12649         /* The length of the response data in number of bytes. */
12650         uint16_t        resp_len;
12651         uint32_t        flags;
12652         /*
12653          * When this bit is '1', it indicates that the resources reserved
12654          * for this function may have changed.  The driver should check
12655          * resource capabilities and reserve resources again before
12656          * allocating resources.
12657          */
12658         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE \
12659                 UINT32_C(0x1)
12660         /*
12661          * When this bit is '1', it indicates that the firmware got changed / reset.
12662          * The driver should do complete re-initialization when that bit is set.
12663          */
12664         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE \
12665                 UINT32_C(0x2)
12666         uint8_t unused_0[3];
12667         /*
12668          * This field is used in Output records to indicate that the output
12669          * is completely written to RAM.  This field should be read as '1'
12670          * to indicate that the output has been completely written.
12671          * When writing a command completion or response to an internal processor,
12672          * the order of writes has to be such that this field is written last.
12673          */
12674         uint8_t valid;
12675 } __attribute__((packed));
12676
12677 /*******************************
12678  * hwrm_func_host_pf_ids_query *
12679  *******************************/
12680
12681
12682 /* hwrm_func_host_pf_ids_query_input (size:192b/24B) */
12683 struct hwrm_func_host_pf_ids_query_input {
12684         /* The HWRM command request type. */
12685         uint16_t        req_type;
12686         /*
12687          * The completion ring to send the completion event on. This should
12688          * be the NQ ID returned from the `nq_alloc` HWRM command.
12689          */
12690         uint16_t        cmpl_ring;
12691         /*
12692          * The sequence ID is used by the driver for tracking multiple
12693          * commands. This ID is treated as opaque data by the firmware and
12694          * the value is returned in the `hwrm_resp_hdr` upon completion.
12695          */
12696         uint16_t        seq_id;
12697         /*
12698          * The target ID of the command:
12699          * * 0x0-0xFFF8 - The function ID
12700          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12701          * * 0xFFFD - Reserved for user-space HWRM interface
12702          * * 0xFFFF - HWRM
12703          */
12704         uint16_t        target_id;
12705         /*
12706          * A physical address pointer pointing to a host buffer that the
12707          * command's response data will be written. This can be either a host
12708          * physical address (HPA) or a guest physical address (GPA) and must
12709          * point to a physically contiguous block of memory.
12710          */
12711         uint64_t        resp_addr;
12712         uint8_t host;
12713         /*
12714          * # If this bit is set to '1', the query will contain PF(s)
12715          * belongs to SOC host.
12716          */
12717         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_SOC      UINT32_C(0x1)
12718         /*
12719          * # If this bit is set to '1', the query will contain PF(s)
12720          * belongs to EP0 host.
12721          */
12722         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_0     UINT32_C(0x2)
12723         /*
12724          * # If this bit is set to '1', the query will contain PF(s)
12725          * belongs to EP1 host.
12726          */
12727         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_1     UINT32_C(0x4)
12728         /*
12729          * # If this bit is set to '1', the query will contain PF(s)
12730          * belongs to EP2 host.
12731          */
12732         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_2     UINT32_C(0x8)
12733         /*
12734          * # If this bit is set to '1', the query will contain PF(s)
12735          * belongs to EP3 host.
12736          */
12737         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_3     UINT32_C(0x10)
12738         /*
12739          * This provides a filter of what PF(s) will be returned in the
12740          * query..
12741          */
12742         uint8_t filter;
12743         /*
12744          * all available PF(s) belong to the host(s) (defined in the
12745          * host field). This includes the hidden PFs.
12746          */
12747         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ALL  UINT32_C(0x0)
12748         /*
12749          * all available PF(s) belong to the host(s) (defined in the
12750          * host field) that is available for L2 traffic.
12751          */
12752         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_L2   UINT32_C(0x1)
12753         /*
12754          * all available PF(s) belong to the host(s) (defined in the
12755          * host field) that is available for ROCE traffic.
12756          */
12757         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE UINT32_C(0x2)
12758         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_LAST \
12759                 HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE
12760         uint8_t unused_1[6];
12761 } __attribute__((packed));
12762
12763 /* hwrm_func_host_pf_ids_query_output (size:128b/16B) */
12764 struct hwrm_func_host_pf_ids_query_output {
12765         /* The specific error status for the command. */
12766         uint16_t        error_code;
12767         /* The HWRM command request type. */
12768         uint16_t        req_type;
12769         /* The sequence ID from the original command. */
12770         uint16_t        seq_id;
12771         /* The length of the response data in number of bytes. */
12772         uint16_t        resp_len;
12773         /* This provides the first PF ID of the device. */
12774         uint16_t        first_pf_id;
12775         uint16_t        pf_ordinal_mask;
12776         /*
12777          * When this bit is '1', it indicates first PF belongs to one of
12778          * the hosts defined in the input request.
12779          */
12780         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_0 \
12781                 UINT32_C(0x1)
12782         /*
12783          * When this bit is '1', it indicates 2nd PF belongs to one of the
12784          * hosts defined in the input request.
12785          */
12786         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_1 \
12787                 UINT32_C(0x2)
12788         /*
12789          * When this bit is '1', it indicates 3rd PF belongs to one of the
12790          * hosts defined in the input request.
12791          */
12792         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_2 \
12793                 UINT32_C(0x4)
12794         /*
12795          * When this bit is '1', it indicates 4th PF belongs to one of the
12796          * hosts defined in the input request.
12797          */
12798         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_3 \
12799                 UINT32_C(0x8)
12800         /*
12801          * When this bit is '1', it indicates 5th PF belongs to one of the
12802          * hosts defined in the input request.
12803          */
12804         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_4 \
12805                 UINT32_C(0x10)
12806         /*
12807          * When this bit is '1', it indicates 6th PF belongs to one of the
12808          * hosts defined in the input request.
12809          */
12810         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_5 \
12811                 UINT32_C(0x20)
12812         /*
12813          * When this bit is '1', it indicates 7th PF belongs to one of the
12814          * hosts defined in the input request.
12815          */
12816         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_6 \
12817                 UINT32_C(0x40)
12818         /*
12819          * When this bit is '1', it indicates 8th PF belongs to one of the
12820          * hosts defined in the input request.
12821          */
12822         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_7 \
12823                 UINT32_C(0x80)
12824         /*
12825          * When this bit is '1', it indicates 9th PF belongs to one of the
12826          * hosts defined in the input request.
12827          */
12828         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_8 \
12829                 UINT32_C(0x100)
12830         /*
12831          * When this bit is '1', it indicates 10th PF belongs to one of the
12832          * hosts defined in the input request.
12833          */
12834         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_9 \
12835                 UINT32_C(0x200)
12836         /*
12837          * When this bit is '1', it indicates 11th PF belongs to one of the
12838          * hosts defined in the input request.
12839          */
12840         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_10 \
12841                 UINT32_C(0x400)
12842         /*
12843          * When this bit is '1', it indicates 12th PF belongs to one of the
12844          * hosts defined in the input request.
12845          */
12846         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_11 \
12847                 UINT32_C(0x800)
12848         /*
12849          * When this bit is '1', it indicates 13th PF belongs to one of the
12850          * hosts defined in the input request.
12851          */
12852         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_12 \
12853                 UINT32_C(0x1000)
12854         /*
12855          * When this bit is '1', it indicates 14th PF belongs to one of the
12856          * hosts defined in the input request.
12857          */
12858         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_13 \
12859                 UINT32_C(0x2000)
12860         /*
12861          * When this bit is '1', it indicates 15th PF belongs to one of the
12862          * hosts defined in the input request.
12863          */
12864         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_14 \
12865                 UINT32_C(0x4000)
12866         /*
12867          * When this bit is '1', it indicates 16th PF belongs to one of the
12868          * hosts defined in the input request.
12869          */
12870         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_15 \
12871                 UINT32_C(0x8000)
12872         uint8_t unused_1[3];
12873         /*
12874          * This field is used in Output records to indicate that the output
12875          * is completely written to RAM.  This field should be read as '1'
12876          * to indicate that the output has been completely written.
12877          * When writing a command completion or response to an internal processor,
12878          * the order of writes has to be such that this field is written last.
12879          */
12880         uint8_t valid;
12881 } __attribute__((packed));
12882
12883 /*********************
12884  * hwrm_port_phy_cfg *
12885  *********************/
12886
12887
12888 /* hwrm_port_phy_cfg_input (size:448b/56B) */
12889 struct hwrm_port_phy_cfg_input {
12890         /* The HWRM command request type. */
12891         uint16_t        req_type;
12892         /*
12893          * The completion ring to send the completion event on. This should
12894          * be the NQ ID returned from the `nq_alloc` HWRM command.
12895          */
12896         uint16_t        cmpl_ring;
12897         /*
12898          * The sequence ID is used by the driver for tracking multiple
12899          * commands. This ID is treated as opaque data by the firmware and
12900          * the value is returned in the `hwrm_resp_hdr` upon completion.
12901          */
12902         uint16_t        seq_id;
12903         /*
12904          * The target ID of the command:
12905          * * 0x0-0xFFF8 - The function ID
12906          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12907          * * 0xFFFD - Reserved for user-space HWRM interface
12908          * * 0xFFFF - HWRM
12909          */
12910         uint16_t        target_id;
12911         /*
12912          * A physical address pointer pointing to a host buffer that the
12913          * command's response data will be written. This can be either a host
12914          * physical address (HPA) or a guest physical address (GPA) and must
12915          * point to a physically contiguous block of memory.
12916          */
12917         uint64_t        resp_addr;
12918         uint32_t        flags;
12919         /*
12920          * When this bit is set to '1', the PHY for the port shall
12921          * be reset.
12922          *
12923          * # If this bit is set to 1, then the HWRM shall reset the
12924          * PHY after applying PHY configuration changes specified
12925          * in this command.
12926          * # In order to guarantee that PHY configuration changes
12927          * specified in this command take effect, the HWRM
12928          * client should set this flag to 1.
12929          * # If this bit is not set to 1, then the HWRM may reset
12930          * the PHY depending on the current PHY configuration and
12931          * settings specified in this command.
12932          */
12933         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY \
12934                 UINT32_C(0x1)
12935         /* deprecated bit.  Do not use!!! */
12936         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED \
12937                 UINT32_C(0x2)
12938         /*
12939          * When this bit is set to '1', the link shall be forced to
12940          * the force_link_speed value.
12941          *
12942          * When this bit is set to '1', the HWRM client should
12943          * not enable any of the auto negotiation related
12944          * fields represented by auto_XXX fields in this command.
12945          * When this bit is set to '1' and the HWRM client has
12946          * enabled a auto_XXX field in this command, then the
12947          * HWRM shall ignore the enabled auto_XXX field.
12948          *
12949          * When this bit is set to zero, the link
12950          * shall be allowed to autoneg.
12951          */
12952         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE \
12953                 UINT32_C(0x4)
12954         /*
12955          * When this bit is set to '1', the auto-negotiation process
12956          * shall be restarted on the link.
12957          */
12958         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG \
12959                 UINT32_C(0x8)
12960         /*
12961          * When this bit is set to '1', Energy Efficient Ethernet
12962          * (EEE) is requested to be enabled on this link.
12963          * If EEE is not supported on this port, then this flag
12964          * shall be ignored by the HWRM.
12965          */
12966         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE \
12967                 UINT32_C(0x10)
12968         /*
12969          * When this bit is set to '1', Energy Efficient Ethernet
12970          * (EEE) is requested to be disabled on this link.
12971          * If EEE is not supported on this port, then this flag
12972          * shall be ignored by the HWRM.
12973          */
12974         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE \
12975                 UINT32_C(0x20)
12976         /*
12977          * When this bit is set to '1' and EEE is enabled on this
12978          * link, then TX LPI is requested to be enabled on the link.
12979          * If EEE is not supported on this port, then this flag
12980          * shall be ignored by the HWRM.
12981          * If EEE is disabled on this port, then this flag shall be
12982          * ignored by the HWRM.
12983          */
12984         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE \
12985                 UINT32_C(0x40)
12986         /*
12987          * When this bit is set to '1' and EEE is enabled on this
12988          * link, then TX LPI is requested to be disabled on the link.
12989          * If EEE is not supported on this port, then this flag
12990          * shall be ignored by the HWRM.
12991          * If EEE is disabled on this port, then this flag shall be
12992          * ignored by the HWRM.
12993          */
12994         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE \
12995                 UINT32_C(0x80)
12996         /*
12997          * When set to 1, then the HWRM shall enable FEC autonegotitation
12998          * on this port if supported.
12999          * When set to 0, then this flag shall be ignored.
13000          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
13001          * flag.
13002          */
13003         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE \
13004                 UINT32_C(0x100)
13005         /*
13006          * When set to 1, then the HWRM shall disable FEC autonegotiation
13007          * on this port if supported.
13008          * When set to 0, then this flag shall be ignored.
13009          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
13010          * flag.
13011          */
13012         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
13013                 UINT32_C(0x200)
13014         /*
13015          * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
13016          * on this port if supported.
13017          * When set to 0, then this flag shall be ignored.
13018          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
13019          * flag.
13020          */
13021         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
13022                 UINT32_C(0x400)
13023         /*
13024          * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
13025          * on this port if supported.
13026          * When set to 0, then this flag shall be ignored.
13027          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
13028          * flag.
13029          */
13030         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
13031                 UINT32_C(0x800)
13032         /*
13033          * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed Solomon)
13034          * on this port if supported.
13035          * When set to 0, then this flag shall be ignored.
13036          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
13037          * flag.
13038          */
13039         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
13040                 UINT32_C(0x1000)
13041         /*
13042          * When set to 1, then the HWRM shall disable FEC CLAUSE 91 (Reed Solomon)
13043          * on this port if supported.
13044          * When set to 0, then this flag shall be ignored.
13045          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
13046          * flag.
13047          */
13048         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
13049                 UINT32_C(0x2000)
13050         /*
13051          * When this bit is set to '1', the link shall be forced to
13052          * be taken down.
13053          *
13054          * # When this bit is set to '1", all other
13055          * command input settings related to the link speed shall
13056          * be ignored.
13057          * Once the link state is forced down, it can be
13058          * explicitly cleared from that state by setting this flag
13059          * to '0'.
13060          * # If this flag is set to '0', then the link shall be
13061          * cleared from forced down state if the link is in forced
13062          * down state.
13063          * There may be conditions (e.g. out-of-band or sideband
13064          * configuration changes for the link) outside the scope
13065          * of the HWRM implementation that may clear forced down
13066          * link state.
13067          */
13068         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN \
13069                 UINT32_C(0x4000)
13070         uint32_t        enables;
13071         /*
13072          * This bit must be '1' for the auto_mode field to be
13073          * configured.
13074          */
13075         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE \
13076                 UINT32_C(0x1)
13077         /*
13078          * This bit must be '1' for the auto_duplex field to be
13079          * configured.
13080          */
13081         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX \
13082                 UINT32_C(0x2)
13083         /*
13084          * This bit must be '1' for the auto_pause field to be
13085          * configured.
13086          */
13087         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE \
13088                 UINT32_C(0x4)
13089         /*
13090          * This bit must be '1' for the auto_link_speed field to be
13091          * configured.
13092          */
13093         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED \
13094                 UINT32_C(0x8)
13095         /*
13096          * This bit must be '1' for the auto_link_speed_mask field to be
13097          * configured.
13098          */
13099         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
13100                 UINT32_C(0x10)
13101         /*
13102          * This bit must be '1' for the wirespeed field to be
13103          * configured.
13104          */
13105         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED \
13106                 UINT32_C(0x20)
13107         /*
13108          * This bit must be '1' for the lpbk field to be
13109          * configured.
13110          */
13111         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK \
13112                 UINT32_C(0x40)
13113         /*
13114          * This bit must be '1' for the preemphasis field to be
13115          * configured.
13116          */
13117         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS \
13118                 UINT32_C(0x80)
13119         /*
13120          * This bit must be '1' for the force_pause field to be
13121          * configured.
13122          */
13123         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE \
13124                 UINT32_C(0x100)
13125         /*
13126          * This bit must be '1' for the eee_link_speed_mask field to be
13127          * configured.
13128          */
13129         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
13130                 UINT32_C(0x200)
13131         /*
13132          * This bit must be '1' for the tx_lpi_timer field to be
13133          * configured.
13134          */
13135         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER \
13136                 UINT32_C(0x400)
13137         /* Port ID of port that is to be configured. */
13138         uint16_t        port_id;
13139         /*
13140          * This is the speed that will be used if the force
13141          * bit is '1'.  If unsupported speed is selected, an error
13142          * will be generated.
13143          */
13144         uint16_t        force_link_speed;
13145         /* 100Mb link speed */
13146         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
13147         /* 1Gb link speed */
13148         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
13149         /* 2Gb link speed */
13150         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
13151         /* 25Gb link speed */
13152         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
13153         /* 10Gb link speed */
13154         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
13155         /* 20Mb link speed */
13156         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
13157         /* 25Gb link speed */
13158         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
13159         /* 40Gb link speed */
13160         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
13161         /* 50Gb link speed */
13162         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
13163         /* 100Gb link speed */
13164         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
13165         /* 200Gb link speed */
13166         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_200GB UINT32_C(0x7d0)
13167         /* 10Mb link speed */
13168         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
13169         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST \
13170                 HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
13171         /*
13172          * This value is used to identify what autoneg mode is
13173          * used when the link speed is not being forced.
13174          */
13175         uint8_t auto_mode;
13176         /* Disable autoneg or autoneg disabled. No speeds are selected. */
13177         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE         UINT32_C(0x0)
13178         /* Select all possible speeds for autoneg mode. */
13179         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
13180         /*
13181          * Select only the auto_link_speed speed for autoneg mode. This mode has
13182          * been DEPRECATED. An HWRM client should not use this mode.
13183          */
13184         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
13185         /*
13186          * Select the auto_link_speed or any speed below that speed for autoneg.
13187          * This mode has been DEPRECATED. An HWRM client should not use this mode.
13188          */
13189         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
13190         /*
13191          * Select the speeds based on the corresponding link speed mask value
13192          * that is provided.
13193          */
13194         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
13195         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST \
13196                 HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
13197         /*
13198          * This is the duplex setting that will be used if the autoneg_mode
13199          * is "one_speed" or "one_or_below".
13200          */
13201         uint8_t auto_duplex;
13202         /* Half Duplex will be requested. */
13203         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
13204         /* Full duplex will be requested. */
13205         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
13206         /* Both Half and Full dupex will be requested. */
13207         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
13208         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST \
13209                 HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
13210         /*
13211          * This value is used to configure the pause that will be
13212          * used for autonegotiation.
13213          * Add text on the usage of auto_pause and force_pause.
13214          */
13215         uint8_t auto_pause;
13216         /*
13217          * When this bit is '1', Generation of tx pause messages
13218          * has been requested. Disabled otherwise.
13219          */
13220         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX \
13221                 UINT32_C(0x1)
13222         /*
13223          * When this bit is '1', Reception of rx pause messages
13224          * has been requested. Disabled otherwise.
13225          */
13226         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX \
13227                 UINT32_C(0x2)
13228         /*
13229          * When set to 1, the advertisement of pause is enabled.
13230          *
13231          * # When the auto_mode is not set to none and this flag is
13232          * set to 1, then the auto_pause bits on this port are being
13233          * advertised and autoneg pause results are being interpreted.
13234          * # When the auto_mode is not set to none and this
13235          * flag is set to 0, the pause is forced as indicated in
13236          * force_pause, and also advertised as auto_pause bits, but
13237          * the autoneg results are not interpreted since the pause
13238          * configuration is being forced.
13239          * # When the auto_mode is set to none and this flag is set to
13240          * 1, auto_pause bits should be ignored and should be set to 0.
13241          */
13242         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE \
13243                 UINT32_C(0x4)
13244         uint8_t unused_0;
13245         /*
13246          * This is the speed that will be used if the autoneg_mode
13247          * is "one_speed" or "one_or_below".  If an unsupported speed
13248          * is selected, an error will be generated.
13249          */
13250         uint16_t        auto_link_speed;
13251         /* 100Mb link speed */
13252         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
13253         /* 1Gb link speed */
13254         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
13255         /* 2Gb link speed */
13256         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
13257         /* 25Gb link speed */
13258         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
13259         /* 10Gb link speed */
13260         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
13261         /* 20Mb link speed */
13262         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
13263         /* 25Gb link speed */
13264         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
13265         /* 40Gb link speed */
13266         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
13267         /* 50Gb link speed */
13268         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
13269         /* 100Gb link speed */
13270         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
13271         /* 200Gb link speed */
13272         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_200GB UINT32_C(0x7d0)
13273         /* 10Mb link speed */
13274         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
13275         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST \
13276                 HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
13277         /*
13278          * This is a mask of link speeds that will be used if
13279          * autoneg_mode is "mask".  If unsupported speed is enabled
13280          * an error will be generated.
13281          */
13282         uint16_t        auto_link_speed_mask;
13283         /* 100Mb link speed (Half-duplex) */
13284         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
13285                 UINT32_C(0x1)
13286         /* 100Mb link speed (Full-duplex) */
13287         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
13288                 UINT32_C(0x2)
13289         /* 1Gb link speed (Half-duplex) */
13290         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
13291                 UINT32_C(0x4)
13292         /* 1Gb link speed (Full-duplex) */
13293         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
13294                 UINT32_C(0x8)
13295         /* 2Gb link speed */
13296         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
13297                 UINT32_C(0x10)
13298         /* 25Gb link speed */
13299         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
13300                 UINT32_C(0x20)
13301         /* 10Gb link speed */
13302         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
13303                 UINT32_C(0x40)
13304         /* 20Gb link speed */
13305         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
13306                 UINT32_C(0x80)
13307         /* 25Gb link speed */
13308         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
13309                 UINT32_C(0x100)
13310         /* 40Gb link speed */
13311         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
13312                 UINT32_C(0x200)
13313         /* 50Gb link speed */
13314         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
13315                 UINT32_C(0x400)
13316         /* 100Gb link speed */
13317         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
13318                 UINT32_C(0x800)
13319         /* 10Mb link speed (Half-duplex) */
13320         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
13321                 UINT32_C(0x1000)
13322         /* 10Mb link speed (Full-duplex) */
13323         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
13324                 UINT32_C(0x2000)
13325         /* 200Gb link speed */
13326         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_200GB \
13327                 UINT32_C(0x4000)
13328         /* This value controls the wirespeed feature. */
13329         uint8_t wirespeed;
13330         /* Wirespeed feature is disabled. */
13331         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
13332         /* Wirespeed feature is enabled. */
13333         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON  UINT32_C(0x1)
13334         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST \
13335                 HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
13336         /* This value controls the loopback setting for the PHY. */
13337         uint8_t lpbk;
13338         /* No loopback is selected.  Normal operation. */
13339         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE     UINT32_C(0x0)
13340         /*
13341          * The HW will be configured with local loopback such that
13342          * host data is sent back to the host without modification.
13343          */
13344         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL    UINT32_C(0x1)
13345         /*
13346          * The HW will be configured with remote loopback such that
13347          * port logic will send packets back out the transmitter that
13348          * are received.
13349          */
13350         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE   UINT32_C(0x2)
13351         /*
13352          * The HW will be configured with external loopback such that
13353          * host data is sent on the trasmitter and based on the external
13354          * loopback connection the data will be received without modification.
13355          */
13356         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
13357         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST \
13358                 HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
13359         /*
13360          * This value is used to configure the pause that will be
13361          * used for force mode.
13362          */
13363         uint8_t force_pause;
13364         /*
13365          * When this bit is '1', Generation of tx pause messages
13366          * is supported. Disabled otherwise.
13367          */
13368         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
13369         /*
13370          * When this bit is '1', Reception of rx pause messages
13371          * is supported. Disabled otherwise.
13372          */
13373         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
13374         uint8_t unused_1;
13375         /*
13376          * This value controls the pre-emphasis to be used for the
13377          * link.  Driver should not set this value (use
13378          * enable.preemphasis = 0) unless driver is sure of setting.
13379          * Normally HWRM FW will determine proper pre-emphasis.
13380          */
13381         uint32_t        preemphasis;
13382         /*
13383          * Setting for link speed mask that is used to
13384          * advertise speeds during autonegotiation when EEE is enabled.
13385          * This field is valid only when EEE is enabled.
13386          * The speeds specified in this field shall be a subset of
13387          * speeds specified in auto_link_speed_mask.
13388          * If EEE is enabled,then at least one speed shall be provided
13389          * in this mask.
13390          */
13391         uint16_t        eee_link_speed_mask;
13392         /* Reserved */
13393         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 \
13394                 UINT32_C(0x1)
13395         /* 100Mb link speed (Full-duplex) */
13396         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB \
13397                 UINT32_C(0x2)
13398         /* Reserved */
13399         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 \
13400                 UINT32_C(0x4)
13401         /* 1Gb link speed (Full-duplex) */
13402         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB \
13403                 UINT32_C(0x8)
13404         /* Reserved */
13405         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
13406                 UINT32_C(0x10)
13407         /* Reserved */
13408         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
13409                 UINT32_C(0x20)
13410         /* 10Gb link speed */
13411         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
13412                 UINT32_C(0x40)
13413         uint8_t unused_2[2];
13414         /*
13415          * Reuested setting of TX LPI timer in microseconds.
13416          * This field is valid only when EEE is enabled and TX LPI is
13417          * enabled.
13418          */
13419         uint32_t        tx_lpi_timer;
13420         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
13421         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
13422         uint32_t        unused_3;
13423 } __attribute__((packed));
13424
13425 /* hwrm_port_phy_cfg_output (size:128b/16B) */
13426 struct hwrm_port_phy_cfg_output {
13427         /* The specific error status for the command. */
13428         uint16_t        error_code;
13429         /* The HWRM command request type. */
13430         uint16_t        req_type;
13431         /* The sequence ID from the original command. */
13432         uint16_t        seq_id;
13433         /* The length of the response data in number of bytes. */
13434         uint16_t        resp_len;
13435         uint8_t unused_0[7];
13436         /*
13437          * This field is used in Output records to indicate that the output
13438          * is completely written to RAM.  This field should be read as '1'
13439          * to indicate that the output has been completely written.
13440          * When writing a command completion or response to an internal processor,
13441          * the order of writes has to be such that this field is written last.
13442          */
13443         uint8_t valid;
13444 } __attribute__((packed));
13445
13446 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
13447 struct hwrm_port_phy_cfg_cmd_err {
13448         /*
13449          * command specific error codes that goes to
13450          * the cmd_err field in Common HWRM Error Response.
13451          */
13452         uint8_t code;
13453         /* Unknown error */
13454         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
13455         /* Unable to complete operation due to invalid speed */
13456         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
13457         /*
13458          * retry the command since the phy is not ready.
13459          * retry count is returned in opaque_0.
13460          * This is only valid for the first command and
13461          * this value will not change for successive calls.
13462          * but if a 0 is returned at any time then this should
13463          * be treated as an un recoverable failure,
13464          *
13465          * retry interval in milli seconds is returned in opaque_1.
13466          * This specifies the time that user should wait before
13467          * issuing the next port_phy_cfg command.
13468          */
13469         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY         UINT32_C(0x2)
13470         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST \
13471                 HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
13472         uint8_t unused_0[7];
13473 } __attribute__((packed));
13474
13475 /**********************
13476  * hwrm_port_phy_qcfg *
13477  **********************/
13478
13479
13480 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
13481 struct hwrm_port_phy_qcfg_input {
13482         /* The HWRM command request type. */
13483         uint16_t        req_type;
13484         /*
13485          * The completion ring to send the completion event on. This should
13486          * be the NQ ID returned from the `nq_alloc` HWRM command.
13487          */
13488         uint16_t        cmpl_ring;
13489         /*
13490          * The sequence ID is used by the driver for tracking multiple
13491          * commands. This ID is treated as opaque data by the firmware and
13492          * the value is returned in the `hwrm_resp_hdr` upon completion.
13493          */
13494         uint16_t        seq_id;
13495         /*
13496          * The target ID of the command:
13497          * * 0x0-0xFFF8 - The function ID
13498          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13499          * * 0xFFFD - Reserved for user-space HWRM interface
13500          * * 0xFFFF - HWRM
13501          */
13502         uint16_t        target_id;
13503         /*
13504          * A physical address pointer pointing to a host buffer that the
13505          * command's response data will be written. This can be either a host
13506          * physical address (HPA) or a guest physical address (GPA) and must
13507          * point to a physically contiguous block of memory.
13508          */
13509         uint64_t        resp_addr;
13510         /* Port ID of port that is to be queried. */
13511         uint16_t        port_id;
13512         uint8_t unused_0[6];
13513 } __attribute__((packed));
13514
13515 /* hwrm_port_phy_qcfg_output (size:768b/96B) */
13516 struct hwrm_port_phy_qcfg_output {
13517         /* The specific error status for the command. */
13518         uint16_t        error_code;
13519         /* The HWRM command request type. */
13520         uint16_t        req_type;
13521         /* The sequence ID from the original command. */
13522         uint16_t        seq_id;
13523         /* The length of the response data in number of bytes. */
13524         uint16_t        resp_len;
13525         /* This value indicates the current link status. */
13526         uint8_t link;
13527         /* There is no link or cable detected. */
13528         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
13529         /* There is no link, but a cable has been detected. */
13530         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL  UINT32_C(0x1)
13531         /* There is a link. */
13532         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK    UINT32_C(0x2)
13533         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST \
13534                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
13535         uint8_t unused_0;
13536         /* This value indicates the current link speed of the connection. */
13537         uint16_t        link_speed;
13538         /* 100Mb link speed */
13539         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
13540         /* 1Gb link speed */
13541         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB   UINT32_C(0xa)
13542         /* 2Gb link speed */
13543         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB   UINT32_C(0x14)
13544         /* 25Gb link speed */
13545         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
13546         /* 10Gb link speed */
13547         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB  UINT32_C(0x64)
13548         /* 20Mb link speed */
13549         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB  UINT32_C(0xc8)
13550         /* 25Gb link speed */
13551         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB  UINT32_C(0xfa)
13552         /* 40Gb link speed */
13553         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB  UINT32_C(0x190)
13554         /* 50Gb link speed */
13555         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB  UINT32_C(0x1f4)
13556         /* 100Gb link speed */
13557         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
13558         /* 200Gb link speed */
13559         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB UINT32_C(0x7d0)
13560         /* 10Mb link speed */
13561         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB  UINT32_C(0xffff)
13562         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST \
13563                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
13564         /*
13565          * This value is indicates the duplex of the current
13566          * configuration.
13567          */
13568         uint8_t duplex_cfg;
13569         /* Half Duplex connection. */
13570         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
13571         /* Full duplex connection. */
13572         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
13573         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST \
13574                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
13575         /*
13576          * This value is used to indicate the current
13577          * pause configuration. When autoneg is enabled, this value
13578          * represents the autoneg results of pause configuration.
13579          */
13580         uint8_t pause;
13581         /*
13582          * When this bit is '1', Generation of tx pause messages
13583          * is supported. Disabled otherwise.
13584          */
13585         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX     UINT32_C(0x1)
13586         /*
13587          * When this bit is '1', Reception of rx pause messages
13588          * is supported. Disabled otherwise.
13589          */
13590         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX     UINT32_C(0x2)
13591         /*
13592          * The supported speeds for the port. This is a bit mask.
13593          * For each speed that is supported, the corrresponding
13594          * bit will be set to '1'.
13595          */
13596         uint16_t        support_speeds;
13597         /* 100Mb link speed (Half-duplex) */
13598         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD \
13599                 UINT32_C(0x1)
13600         /* 100Mb link speed (Full-duplex) */
13601         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB \
13602                 UINT32_C(0x2)
13603         /* 1Gb link speed (Half-duplex) */
13604         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD \
13605                 UINT32_C(0x4)
13606         /* 1Gb link speed (Full-duplex) */
13607         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB \
13608                 UINT32_C(0x8)
13609         /* 2Gb link speed */
13610         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB \
13611                 UINT32_C(0x10)
13612         /* 25Gb link speed */
13613         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB \
13614                 UINT32_C(0x20)
13615         /* 10Gb link speed */
13616         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB \
13617                 UINT32_C(0x40)
13618         /* 20Gb link speed */
13619         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB \
13620                 UINT32_C(0x80)
13621         /* 25Gb link speed */
13622         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB \
13623                 UINT32_C(0x100)
13624         /* 40Gb link speed */
13625         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB \
13626                 UINT32_C(0x200)
13627         /* 50Gb link speed */
13628         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB \
13629                 UINT32_C(0x400)
13630         /* 100Gb link speed */
13631         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB \
13632                 UINT32_C(0x800)
13633         /* 10Mb link speed (Half-duplex) */
13634         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD \
13635                 UINT32_C(0x1000)
13636         /* 10Mb link speed (Full-duplex) */
13637         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB \
13638                 UINT32_C(0x2000)
13639         /* 200Gb link speed */
13640         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_200GB \
13641                 UINT32_C(0x4000)
13642         /*
13643          * Current setting of forced link speed.
13644          * When the link speed is not being forced, this
13645          * value shall be set to 0.
13646          */
13647         uint16_t        force_link_speed;
13648         /* 100Mb link speed */
13649         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
13650         /* 1Gb link speed */
13651         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
13652         /* 2Gb link speed */
13653         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
13654         /* 25Gb link speed */
13655         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
13656         /* 10Gb link speed */
13657         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
13658         /* 20Mb link speed */
13659         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
13660         /* 25Gb link speed */
13661         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
13662         /* 40Gb link speed */
13663         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB \
13664                 UINT32_C(0x190)
13665         /* 50Gb link speed */
13666         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB \
13667                 UINT32_C(0x1f4)
13668         /* 100Gb link speed */
13669         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB \
13670                 UINT32_C(0x3e8)
13671         /* 200Gb link speed */
13672         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_200GB \
13673                 UINT32_C(0x7d0)
13674         /* 10Mb link speed */
13675         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB \
13676                 UINT32_C(0xffff)
13677         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST \
13678                 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
13679         /* Current setting of auto negotiation mode. */
13680         uint8_t auto_mode;
13681         /* Disable autoneg or autoneg disabled. No speeds are selected. */
13682         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE         UINT32_C(0x0)
13683         /* Select all possible speeds for autoneg mode. */
13684         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
13685         /*
13686          * Select only the auto_link_speed speed for autoneg mode. This mode has
13687          * been DEPRECATED. An HWRM client should not use this mode.
13688          */
13689         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
13690         /*
13691          * Select the auto_link_speed or any speed below that speed for autoneg.
13692          * This mode has been DEPRECATED. An HWRM client should not use this mode.
13693          */
13694         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
13695         /*
13696          * Select the speeds based on the corresponding link speed mask value
13697          * that is provided.
13698          */
13699         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
13700         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST \
13701                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
13702         /*
13703          * Current setting of pause autonegotiation.
13704          * Move autoneg_pause flag here.
13705          */
13706         uint8_t auto_pause;
13707         /*
13708          * When this bit is '1', Generation of tx pause messages
13709          * has been requested. Disabled otherwise.
13710          */
13711         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX \
13712                 UINT32_C(0x1)
13713         /*
13714          * When this bit is '1', Reception of rx pause messages
13715          * has been requested. Disabled otherwise.
13716          */
13717         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX \
13718                 UINT32_C(0x2)
13719         /*
13720          * When set to 1, the advertisement of pause is enabled.
13721          *
13722          * # When the auto_mode is not set to none and this flag is
13723          * set to 1, then the auto_pause bits on this port are being
13724          * advertised and autoneg pause results are being interpreted.
13725          * # When the auto_mode is not set to none and this
13726          * flag is set to 0, the pause is forced as indicated in
13727          * force_pause, and also advertised as auto_pause bits, but
13728          * the autoneg results are not interpreted since the pause
13729          * configuration is being forced.
13730          * # When the auto_mode is set to none and this flag is set to
13731          * 1, auto_pause bits should be ignored and should be set to 0.
13732          */
13733         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE \
13734                 UINT32_C(0x4)
13735         /*
13736          * Current setting for auto_link_speed. This field is only
13737          * valid when auto_mode is set to "one_speed" or "one_or_below".
13738          */
13739         uint16_t        auto_link_speed;
13740         /* 100Mb link speed */
13741         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
13742         /* 1Gb link speed */
13743         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
13744         /* 2Gb link speed */
13745         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
13746         /* 25Gb link speed */
13747         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
13748         /* 10Gb link speed */
13749         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
13750         /* 20Mb link speed */
13751         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
13752         /* 25Gb link speed */
13753         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
13754         /* 40Gb link speed */
13755         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
13756         /* 50Gb link speed */
13757         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
13758         /* 100Gb link speed */
13759         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
13760         /* 200Gb link speed */
13761         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_200GB UINT32_C(0x7d0)
13762         /* 10Mb link speed */
13763         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB \
13764                 UINT32_C(0xffff)
13765         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST \
13766                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
13767         /*
13768          * Current setting for auto_link_speed_mask that is used to
13769          * advertise speeds during autonegotiation.
13770          * This field is only valid when auto_mode is set to "mask".
13771          * The speeds specified in this field shall be a subset of
13772          * supported speeds on this port.
13773          */
13774         uint16_t        auto_link_speed_mask;
13775         /* 100Mb link speed (Half-duplex) */
13776         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
13777                 UINT32_C(0x1)
13778         /* 100Mb link speed (Full-duplex) */
13779         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
13780                 UINT32_C(0x2)
13781         /* 1Gb link speed (Half-duplex) */
13782         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
13783                 UINT32_C(0x4)
13784         /* 1Gb link speed (Full-duplex) */
13785         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB \
13786                 UINT32_C(0x8)
13787         /* 2Gb link speed */
13788         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
13789                 UINT32_C(0x10)
13790         /* 25Gb link speed */
13791         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
13792                 UINT32_C(0x20)
13793         /* 10Gb link speed */
13794         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
13795                 UINT32_C(0x40)
13796         /* 20Gb link speed */
13797         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
13798                 UINT32_C(0x80)
13799         /* 25Gb link speed */
13800         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
13801                 UINT32_C(0x100)
13802         /* 40Gb link speed */
13803         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
13804                 UINT32_C(0x200)
13805         /* 50Gb link speed */
13806         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
13807                 UINT32_C(0x400)
13808         /* 100Gb link speed */
13809         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
13810                 UINT32_C(0x800)
13811         /* 10Mb link speed (Half-duplex) */
13812         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
13813                 UINT32_C(0x1000)
13814         /* 10Mb link speed (Full-duplex) */
13815         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
13816                 UINT32_C(0x2000)
13817         /* 200Gb link speed */
13818         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_200GB \
13819                 UINT32_C(0x4000)
13820         /* Current setting for wirespeed. */
13821         uint8_t wirespeed;
13822         /* Wirespeed feature is disabled. */
13823         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
13824         /* Wirespeed feature is enabled. */
13825         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON  UINT32_C(0x1)
13826         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST \
13827                 HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
13828         /* Current setting for loopback. */
13829         uint8_t lpbk;
13830         /* No loopback is selected.  Normal operation. */
13831         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE     UINT32_C(0x0)
13832         /*
13833          * The HW will be configured with local loopback such that
13834          * host data is sent back to the host without modification.
13835          */
13836         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL    UINT32_C(0x1)
13837         /*
13838          * The HW will be configured with remote loopback such that
13839          * port logic will send packets back out the transmitter that
13840          * are received.
13841          */
13842         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE   UINT32_C(0x2)
13843         /*
13844          * The HW will be configured with external loopback such that
13845          * host data is sent on the trasmitter and based on the external
13846          * loopback connection the data will be received without modification.
13847          */
13848         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
13849         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST \
13850                 HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
13851         /*
13852          * Current setting of forced pause.
13853          * When the pause configuration is not being forced, then
13854          * this value shall be set to 0.
13855          */
13856         uint8_t force_pause;
13857         /*
13858          * When this bit is '1', Generation of tx pause messages
13859          * is supported. Disabled otherwise.
13860          */
13861         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
13862         /*
13863          * When this bit is '1', Reception of rx pause messages
13864          * is supported. Disabled otherwise.
13865          */
13866         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
13867         /*
13868          * This value indicates the current status of the optics module on
13869          * this port.
13870          */
13871         uint8_t module_status;
13872         /* Module is inserted and accepted */
13873         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE \
13874                 UINT32_C(0x0)
13875         /* Module is rejected and transmit side Laser is disabled. */
13876         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX \
13877                 UINT32_C(0x1)
13878         /* Module mismatch warning. */
13879         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG \
13880                 UINT32_C(0x2)
13881         /* Module is rejected and powered down. */
13882         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN \
13883                 UINT32_C(0x3)
13884         /* Module is not inserted. */
13885         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
13886                 UINT32_C(0x4)
13887         /* Module status is not applicable. */
13888         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
13889                 UINT32_C(0xff)
13890         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST \
13891                 HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
13892         /* Current setting for preemphasis. */
13893         uint32_t        preemphasis;
13894         /* This field represents the major version of the PHY. */
13895         uint8_t phy_maj;
13896         /* This field represents the minor version of the PHY. */
13897         uint8_t phy_min;
13898         /* This field represents the build version of the PHY. */
13899         uint8_t phy_bld;
13900         /* This value represents a PHY type. */
13901         uint8_t phy_type;
13902         /* Unknown */
13903         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN \
13904                 UINT32_C(0x0)
13905         /* BASE-CR */
13906         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR \
13907                 UINT32_C(0x1)
13908         /* BASE-KR4 (Deprecated) */
13909         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 \
13910                 UINT32_C(0x2)
13911         /* BASE-LR */
13912         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR \
13913                 UINT32_C(0x3)
13914         /* BASE-SR */
13915         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR \
13916                 UINT32_C(0x4)
13917         /* BASE-KR2 (Deprecated) */
13918         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 \
13919                 UINT32_C(0x5)
13920         /* BASE-KX */
13921         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX \
13922                 UINT32_C(0x6)
13923         /* BASE-KR */
13924         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR \
13925                 UINT32_C(0x7)
13926         /* BASE-T */
13927         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET \
13928                 UINT32_C(0x8)
13929         /* EEE capable BASE-T */
13930         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE \
13931                 UINT32_C(0x9)
13932         /* SGMII connected external PHY */
13933         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY \
13934                 UINT32_C(0xa)
13935         /* 25G_BASECR_CA_L */
13936         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L \
13937                 UINT32_C(0xb)
13938         /* 25G_BASECR_CA_S */
13939         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S \
13940                 UINT32_C(0xc)
13941         /* 25G_BASECR_CA_N */
13942         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N \
13943                 UINT32_C(0xd)
13944         /* 25G_BASESR */
13945         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR \
13946                 UINT32_C(0xe)
13947         /* 100G_BASECR4 */
13948         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 \
13949                 UINT32_C(0xf)
13950         /* 100G_BASESR4 */
13951         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 \
13952                 UINT32_C(0x10)
13953         /* 100G_BASELR4 */
13954         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 \
13955                 UINT32_C(0x11)
13956         /* 100G_BASEER4 */
13957         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 \
13958                 UINT32_C(0x12)
13959         /* 100G_BASESR10 */
13960         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 \
13961                 UINT32_C(0x13)
13962         /* 40G_BASECR4 */
13963         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 \
13964                 UINT32_C(0x14)
13965         /* 40G_BASESR4 */
13966         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 \
13967                 UINT32_C(0x15)
13968         /* 40G_BASELR4 */
13969         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 \
13970                 UINT32_C(0x16)
13971         /* 40G_BASEER4 */
13972         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 \
13973                 UINT32_C(0x17)
13974         /* 40G_ACTIVE_CABLE */
13975         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
13976                 UINT32_C(0x18)
13977         /* 1G_baseT */
13978         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET \
13979                 UINT32_C(0x19)
13980         /* 1G_baseSX */
13981         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX \
13982                 UINT32_C(0x1a)
13983         /* 1G_baseCX */
13984         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX \
13985                 UINT32_C(0x1b)
13986         /* 100G_BASECR4 */
13987         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4 \
13988                 UINT32_C(0x1c)
13989         /* 100G_BASESR4 */
13990         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4 \
13991                 UINT32_C(0x1d)
13992         /* 100G_BASELR4 */
13993         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4 \
13994                 UINT32_C(0x1e)
13995         /* 100G_BASEER4 */
13996         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4 \
13997                 UINT32_C(0x1f)
13998         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST \
13999                 HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4
14000         /* This value represents a media type. */
14001         uint8_t media_type;
14002         /* Unknown */
14003         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
14004         /* Twisted Pair */
14005         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP      UINT32_C(0x1)
14006         /* Direct Attached Copper */
14007         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC     UINT32_C(0x2)
14008         /* Fiber */
14009         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE   UINT32_C(0x3)
14010         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST \
14011                 HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
14012         /* This value represents a transceiver type. */
14013         uint8_t xcvr_pkg_type;
14014         /* PHY and MAC are in the same package */
14015         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
14016                 UINT32_C(0x1)
14017         /* PHY and MAC are in different packages */
14018         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
14019                 UINT32_C(0x2)
14020         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST \
14021                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
14022         uint8_t eee_config_phy_addr;
14023         /* This field represents PHY address. */
14024         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK \
14025                 UINT32_C(0x1f)
14026         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT               0
14027         /*
14028          * This field represents flags related to EEE configuration.
14029          * These EEE configuration flags are valid only when the
14030          * auto_mode is not set to none (in other words autonegotiation
14031          * is enabled).
14032          */
14033         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK \
14034                 UINT32_C(0xe0)
14035         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT             5
14036         /*
14037          * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
14038          * Speeds for autoneg with EEE mode enabled
14039          * are based on eee_link_speed_mask.
14040          */
14041         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED \
14042                 UINT32_C(0x20)
14043         /*
14044          * This flag is valid only when eee_enabled is set to 1.
14045          *
14046          * # If eee_enabled is set to 0, then EEE mode is disabled
14047          * and this flag shall be ignored.
14048          * # If eee_enabled is set to 1 and this flag is set to 1,
14049          * then Energy Efficient Ethernet (EEE) mode is enabled
14050          * and in use.
14051          * # If eee_enabled is set to 1 and this flag is set to 0,
14052          * then Energy Efficient Ethernet (EEE) mode is enabled
14053          * but is currently not in use.
14054          */
14055         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE \
14056                 UINT32_C(0x40)
14057         /*
14058          * This flag is valid only when eee_enabled is set to 1.
14059          *
14060          * # If eee_enabled is set to 0, then EEE mode is disabled
14061          * and this flag shall be ignored.
14062          * # If eee_enabled is set to 1 and this flag is set to 1,
14063          * then Energy Efficient Ethernet (EEE) mode is enabled
14064          * and TX LPI is enabled.
14065          * # If eee_enabled is set to 1 and this flag is set to 0,
14066          * then Energy Efficient Ethernet (EEE) mode is enabled
14067          * but TX LPI is disabled.
14068          */
14069         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI \
14070                 UINT32_C(0x80)
14071         /*
14072          * When set to 1, the parallel detection is used to determine
14073          * the speed of the link partner.
14074          *
14075          * Parallel detection is used when a autonegotiation capable
14076          * device is connected to a link parter that is not capable
14077          * of autonegotiation.
14078          */
14079         uint8_t parallel_detect;
14080         /*
14081          * When set to 1, the parallel detection is used to determine
14082          * the speed of the link partner.
14083          *
14084          * Parallel detection is used when a autonegotiation capable
14085          * device is connected to a link parter that is not capable
14086          * of autonegotiation.
14087          */
14088         #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT     UINT32_C(0x1)
14089         /*
14090          * The advertised speeds for the port by the link partner.
14091          * Each advertised speed will be set to '1'.
14092          */
14093         uint16_t        link_partner_adv_speeds;
14094         /* 100Mb link speed (Half-duplex) */
14095         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
14096                 UINT32_C(0x1)
14097         /* 100Mb link speed (Full-duplex) */
14098         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
14099                 UINT32_C(0x2)
14100         /* 1Gb link speed (Half-duplex) */
14101         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
14102                 UINT32_C(0x4)
14103         /* 1Gb link speed (Full-duplex) */
14104         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
14105                 UINT32_C(0x8)
14106         /* 2Gb link speed */
14107         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
14108                 UINT32_C(0x10)
14109         /* 25Gb link speed */
14110         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
14111                 UINT32_C(0x20)
14112         /* 10Gb link speed */
14113         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
14114                 UINT32_C(0x40)
14115         /* 20Gb link speed */
14116         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
14117                 UINT32_C(0x80)
14118         /* 25Gb link speed */
14119         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
14120                 UINT32_C(0x100)
14121         /* 40Gb link speed */
14122         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
14123                 UINT32_C(0x200)
14124         /* 50Gb link speed */
14125         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
14126                 UINT32_C(0x400)
14127         /* 100Gb link speed */
14128         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
14129                 UINT32_C(0x800)
14130         /* 10Mb link speed (Half-duplex) */
14131         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
14132                 UINT32_C(0x1000)
14133         /* 10Mb link speed (Full-duplex) */
14134         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
14135                 UINT32_C(0x2000)
14136         /*
14137          * The advertised autoneg for the port by the link partner.
14138          * This field is deprecated and should be set to 0.
14139          */
14140         uint8_t link_partner_adv_auto_mode;
14141         /* Disable autoneg or autoneg disabled. No speeds are selected. */
14142         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
14143                 UINT32_C(0x0)
14144         /* Select all possible speeds for autoneg mode. */
14145         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
14146                 UINT32_C(0x1)
14147         /*
14148          * Select only the auto_link_speed speed for autoneg mode. This mode has
14149          * been DEPRECATED. An HWRM client should not use this mode.
14150          */
14151         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
14152                 UINT32_C(0x2)
14153         /*
14154          * Select the auto_link_speed or any speed below that speed for autoneg.
14155          * This mode has been DEPRECATED. An HWRM client should not use this mode.
14156          */
14157         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
14158                 UINT32_C(0x3)
14159         /*
14160          * Select the speeds based on the corresponding link speed mask value
14161          * that is provided.
14162          */
14163         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
14164                 UINT32_C(0x4)
14165         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST \
14166                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
14167         /* The advertised pause settings on the port by the link partner. */
14168         uint8_t link_partner_adv_pause;
14169         /*
14170          * When this bit is '1', Generation of tx pause messages
14171          * is supported. Disabled otherwise.
14172          */
14173         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
14174                 UINT32_C(0x1)
14175         /*
14176          * When this bit is '1', Reception of rx pause messages
14177          * is supported. Disabled otherwise.
14178          */
14179         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
14180                 UINT32_C(0x2)
14181         /*
14182          * Current setting for link speed mask that is used to
14183          * advertise speeds during autonegotiation when EEE is enabled.
14184          * This field is valid only when eee_enabled flags is set to 1.
14185          * The speeds specified in this field shall be a subset of
14186          * speeds specified in auto_link_speed_mask.
14187          */
14188         uint16_t        adv_eee_link_speed_mask;
14189         /* Reserved */
14190         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
14191                 UINT32_C(0x1)
14192         /* 100Mb link speed (Full-duplex) */
14193         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
14194                 UINT32_C(0x2)
14195         /* Reserved */
14196         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
14197                 UINT32_C(0x4)
14198         /* 1Gb link speed (Full-duplex) */
14199         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
14200                 UINT32_C(0x8)
14201         /* Reserved */
14202         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
14203                 UINT32_C(0x10)
14204         /* Reserved */
14205         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
14206                 UINT32_C(0x20)
14207         /* 10Gb link speed */
14208         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
14209                 UINT32_C(0x40)
14210         /*
14211          * Current setting for link speed mask that is advertised by
14212          * the link partner when EEE is enabled.
14213          * This field is valid only when eee_enabled flags is set to 1.
14214          */
14215         uint16_t        link_partner_adv_eee_link_speed_mask;
14216         /* Reserved */
14217         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
14218                 UINT32_C(0x1)
14219         /* 100Mb link speed (Full-duplex) */
14220         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
14221                 UINT32_C(0x2)
14222         /* Reserved */
14223         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
14224                 UINT32_C(0x4)
14225         /* 1Gb link speed (Full-duplex) */
14226         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
14227                 UINT32_C(0x8)
14228         /* Reserved */
14229         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
14230                 UINT32_C(0x10)
14231         /* Reserved */
14232         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
14233                 UINT32_C(0x20)
14234         /* 10Gb link speed */
14235         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
14236                 UINT32_C(0x40)
14237         uint32_t        xcvr_identifier_type_tx_lpi_timer;
14238         /*
14239          * Current setting of TX LPI timer in microseconds.
14240          * This field is valid only when_eee_enabled flag is set to 1
14241          * and tx_lpi_enabled is set to 1.
14242          */
14243         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK \
14244                 UINT32_C(0xffffff)
14245         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT             0
14246         /* This value represents transceiver identifier type. */
14247         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
14248                 UINT32_C(0xff000000)
14249         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT     24
14250         /* Unknown */
14251         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
14252                 (UINT32_C(0x0) << 24)
14253         /* SFP/SFP+/SFP28 */
14254         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
14255                 (UINT32_C(0x3) << 24)
14256         /* QSFP+ */
14257         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
14258                 (UINT32_C(0xc) << 24)
14259         /* QSFP+ */
14260         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
14261                 (UINT32_C(0xd) << 24)
14262         /* QSFP28 */
14263         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
14264                 (UINT32_C(0x11) << 24)
14265         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST \
14266                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28
14267         /*
14268          * This value represents the current configuration of
14269          * Forward Error Correction (FEC) on the port.
14270          */
14271         uint16_t        fec_cfg;
14272         /*
14273          * When set to 1, then FEC is not supported on this port. If this flag
14274          * is set to 1, then all other FEC configuration flags shall be ignored.
14275          * When set to 0, then FEC is supported as indicated by other
14276          * configuration flags.
14277          * If no cable is attached and the HWRM does not yet know the FEC
14278          * capability, then the HWRM shall set this flag to 1 when reporting
14279          * FEC capability.
14280          */
14281         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
14282                 UINT32_C(0x1)
14283         /*
14284          * When set to 1, then FEC autonegotiation is supported on this port.
14285          * When set to 0, then FEC autonegotiation is not supported on this port.
14286          */
14287         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
14288                 UINT32_C(0x2)
14289         /*
14290          * When set to 1, then FEC autonegotiation is enabled on this port.
14291          * When set to 0, then FEC autonegotiation is disabled if supported.
14292          * This flag should be ignored if FEC autonegotiation is not supported on this port.
14293          */
14294         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
14295                 UINT32_C(0x4)
14296         /*
14297          * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port.
14298          * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port.
14299          */
14300         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
14301                 UINT32_C(0x8)
14302         /*
14303          * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this port.
14304          * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported.
14305          * This flag should be ignored if FEC CLAUSE 74 is not supported on this port.
14306          */
14307         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
14308                 UINT32_C(0x10)
14309         /*
14310          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported on this port.
14311          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is not supported on this port.
14312          */
14313         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
14314                 UINT32_C(0x20)
14315         /*
14316          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled on this port.
14317          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is disabled if supported.
14318          * This flag should be ignored if FEC CLAUSE 91 is not supported on this port.
14319          */
14320         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
14321                 UINT32_C(0x40)
14322         /*
14323          * This value is indicates the duplex of the current
14324          * connection state.
14325          */
14326         uint8_t duplex_state;
14327         /* Half Duplex connection. */
14328         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
14329         /* Full duplex connection. */
14330         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
14331         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST \
14332                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
14333         /* Option flags fields. */
14334         uint8_t option_flags;
14335         /* When this bit is '1', Media auto detect is enabled. */
14336         #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT \
14337                 UINT32_C(0x1)
14338         /*
14339          * Up to 16 bytes of null padded ASCII string representing
14340          * PHY vendor.
14341          * If the string is set to null, then the vendor name is not
14342          * available.
14343          */
14344         char    phy_vendor_name[16];
14345         /*
14346          * Up to 16 bytes of null padded ASCII string that
14347          * identifies vendor specific part number of the PHY.
14348          * If the string is set to null, then the vendor specific
14349          * part number is not available.
14350          */
14351         char    phy_vendor_partnumber[16];
14352         uint8_t unused_2[7];
14353         /*
14354          * This field is used in Output records to indicate that the output
14355          * is completely written to RAM.  This field should be read as '1'
14356          * to indicate that the output has been completely written.
14357          * When writing a command completion or response to an internal processor,
14358          * the order of writes has to be such that this field is written last.
14359          */
14360         uint8_t valid;
14361 } __attribute__((packed));
14362
14363 /*********************
14364  * hwrm_port_mac_cfg *
14365  *********************/
14366
14367
14368 /* hwrm_port_mac_cfg_input (size:384b/48B) */
14369 struct hwrm_port_mac_cfg_input {
14370         /* The HWRM command request type. */
14371         uint16_t        req_type;
14372         /*
14373          * The completion ring to send the completion event on. This should
14374          * be the NQ ID returned from the `nq_alloc` HWRM command.
14375          */
14376         uint16_t        cmpl_ring;
14377         /*
14378          * The sequence ID is used by the driver for tracking multiple
14379          * commands. This ID is treated as opaque data by the firmware and
14380          * the value is returned in the `hwrm_resp_hdr` upon completion.
14381          */
14382         uint16_t        seq_id;
14383         /*
14384          * The target ID of the command:
14385          * * 0x0-0xFFF8 - The function ID
14386          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14387          * * 0xFFFD - Reserved for user-space HWRM interface
14388          * * 0xFFFF - HWRM
14389          */
14390         uint16_t        target_id;
14391         /*
14392          * A physical address pointer pointing to a host buffer that the
14393          * command's response data will be written. This can be either a host
14394          * physical address (HPA) or a guest physical address (GPA) and must
14395          * point to a physically contiguous block of memory.
14396          */
14397         uint64_t        resp_addr;
14398         /*
14399          * In this field, there are a number of CoS mappings related flags
14400          * that are used to configure CoS mappings and their corresponding
14401          * priorities in the hardware.
14402          * For the priorities of CoS mappings, the HWRM uses the following
14403          * priority order (high to low) by default:
14404          * # vlan pri
14405          * # ip_dscp
14406          * # tunnel_vlan_pri
14407          * # default cos
14408          *
14409          * A subset of CoS mappings can be enabled.
14410          * If a priority is not specified for an enabled CoS mapping, the
14411          * priority will be assigned in the above order for the enabled CoS
14412          * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
14413          * enabled and their priorities are not specified, the following
14414          * priority order (high to low) will be used by the HWRM:
14415          * # vlan_pri
14416          * # ip_dscp
14417          * # default cos
14418          *
14419          * vlan_pri CoS mapping together with default CoS with lower priority
14420          * are enabled by default by the HWRM.
14421          */
14422         uint32_t        flags;
14423         /*
14424          * When this bit is '1', this command will configure
14425          * the MAC to match the current link state of the PHY.
14426          * If the link is not established on the PHY, then this
14427          * bit has no effect.
14428          */
14429         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK \
14430                 UINT32_C(0x1)
14431         /*
14432          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
14433          * is requested to be enabled.
14434          */
14435         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE \
14436                 UINT32_C(0x2)
14437         /*
14438          * When this bit is set to '1', tunnel VLAN PRI field to
14439          * CoS mapping is requested to be enabled.
14440          */
14441         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
14442                 UINT32_C(0x4)
14443         /*
14444          * When this bit is set to '1', the IP DSCP to CoS mapping is
14445          * requested to be enabled.
14446          */
14447         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE \
14448                 UINT32_C(0x8)
14449         /*
14450          * When this bit is '1', the HWRM is requested to
14451          * enable timestamp capture capability on the receive side
14452          * of this port.
14453          */
14454         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
14455                 UINT32_C(0x10)
14456         /*
14457          * When this bit is '1', the HWRM is requested to
14458          * disable timestamp capture capability on the receive side
14459          * of this port.
14460          */
14461         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE \
14462                 UINT32_C(0x20)
14463         /*
14464          * When this bit is '1', the HWRM is requested to
14465          * enable timestamp capture capability on the transmit side
14466          * of this port.
14467          */
14468         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
14469                 UINT32_C(0x40)
14470         /*
14471          * When this bit is '1', the HWRM is requested to
14472          * disable timestamp capture capability on the transmit side
14473          * of this port.
14474          */
14475         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE \
14476                 UINT32_C(0x80)
14477         /*
14478          * When this bit is '1', the Out-Of-Box WoL is requested to
14479          * be enabled on this port.
14480          */
14481         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE \
14482                 UINT32_C(0x100)
14483         /*
14484          * When this bit is '1', the the Out-Of-Box WoL is requested to
14485          * be disabled on this port.
14486          */
14487         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE \
14488                 UINT32_C(0x200)
14489         /*
14490          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
14491          * is requested to be disabled.
14492          */
14493         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE \
14494                 UINT32_C(0x400)
14495         /*
14496          * When this bit is set to '1', tunnel VLAN PRI field to
14497          * CoS mapping is requested to be disabled.
14498          */
14499         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE \
14500                 UINT32_C(0x800)
14501         /*
14502          * When this bit is set to '1', the IP DSCP to CoS mapping is
14503          * requested to be disabled.
14504          */
14505         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE \
14506                 UINT32_C(0x1000)
14507         /*
14508          * When this bit is set to '1', and the ptp_tx_ts_capture_enable
14509          * bit is set, then the device uses one step Tx timestamping.
14510          * This bit is temporary and used for experimental purposes.
14511          */
14512         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_ONE_STEP_TX_TS \
14513                 UINT32_C(0x2000)
14514         uint32_t        enables;
14515         /*
14516          * This bit must be '1' for the ipg field to be
14517          * configured.
14518          */
14519         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG \
14520                 UINT32_C(0x1)
14521         /*
14522          * This bit must be '1' for the lpbk field to be
14523          * configured.
14524          */
14525         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK \
14526                 UINT32_C(0x2)
14527         /*
14528          * This bit must be '1' for the vlan_pri2cos_map_pri field to be
14529          * configured.
14530          */
14531         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI \
14532                 UINT32_C(0x4)
14533         /*
14534          * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
14535          * configured.
14536          */
14537         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI \
14538                 UINT32_C(0x10)
14539         /*
14540          * This bit must be '1' for the dscp2cos_map_pri field to be
14541          * configured.
14542          */
14543         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI \
14544                 UINT32_C(0x20)
14545         /*
14546          * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
14547          * configured.
14548          */
14549         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE \
14550                 UINT32_C(0x40)
14551         /*
14552          * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
14553          * configured.
14554          */
14555         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE \
14556                 UINT32_C(0x80)
14557         /*
14558          * This bit must be '1' for the cos_field_cfg field to be
14559          * configured.
14560          */
14561         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG \
14562                 UINT32_C(0x100)
14563         /*
14564          * This bit must be '1' for the ptp_freq_adj_ppb field to be
14565          * configured.
14566          */
14567         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_PPB \
14568                 UINT32_C(0x200)
14569         /* Port ID of port that is to be configured. */
14570         uint16_t        port_id;
14571         /*
14572          * This value is used to configure the minimum IPG that will
14573          * be sent between packets by this port.
14574          */
14575         uint8_t ipg;
14576         /* This value controls the loopback setting for the MAC. */
14577         uint8_t lpbk;
14578         /* No loopback is selected.  Normal operation. */
14579         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE   UINT32_C(0x0)
14580         /*
14581          * The HW will be configured with local loopback such that
14582          * host data is sent back to the host without modification.
14583          */
14584         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL  UINT32_C(0x1)
14585         /*
14586          * The HW will be configured with remote loopback such that
14587          * port logic will send packets back out the transmitter that
14588          * are received.
14589          */
14590         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
14591         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST \
14592                 HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
14593         /*
14594          * This value controls the priority setting of VLAN PRI to CoS
14595          * mapping based on VLAN Tags of inner packet headers of
14596          * tunneled packets or packet headers of non-tunneled packets.
14597          *
14598          * # Each XXX_pri variable shall have a unique priority value
14599          * when it is being specified.
14600          * # When comparing priorities of mappings, higher value
14601          * indicates higher priority.
14602          * For example, a value of 0-3 is returned where 0 is being
14603          * the lowest priority and 3 is being the highest priority.
14604          */
14605         uint8_t vlan_pri2cos_map_pri;
14606         /* Reserved field. */
14607         uint8_t reserved1;
14608         /*
14609          * This value controls the priority setting of VLAN PRI to CoS
14610          * mapping based on VLAN Tags of tunneled header.
14611          * This mapping only applies when tunneled headers
14612          * are present.
14613          *
14614          * # Each XXX_pri variable shall have a unique priority value
14615          * when it is being specified.
14616          * # When comparing priorities of mappings, higher value
14617          * indicates higher priority.
14618          * For example, a value of 0-3 is returned where 0 is being
14619          * the lowest priority and 3 is being the highest priority.
14620          */
14621         uint8_t tunnel_pri2cos_map_pri;
14622         /*
14623          * This value controls the priority setting of IP DSCP to CoS
14624          * mapping based on inner IP header of tunneled packets or
14625          * IP header of non-tunneled packets.
14626          *
14627          * # Each XXX_pri variable shall have a unique priority value
14628          * when it is being specified.
14629          * # When comparing priorities of mappings, higher value
14630          * indicates higher priority.
14631          * For example, a value of 0-3 is returned where 0 is being
14632          * the lowest priority and 3 is being the highest priority.
14633          */
14634         uint8_t dscp2pri_map_pri;
14635         /*
14636          * This is a 16-bit bit mask that is used to request a
14637          * specific configuration of time stamp capture of PTP messages
14638          * on the receive side of this port.
14639          * This field shall be ignored if the ptp_rx_ts_capture_enable
14640          * flag is not set in this command.
14641          * Otherwise, if bit 'i' is set, then the HWRM is being
14642          * requested to configure the receive side of the port to
14643          * capture the time stamp of every received PTP message
14644          * with messageType field value set to i.
14645          */
14646         uint16_t        rx_ts_capture_ptp_msg_type;
14647         /*
14648          * This is a 16-bit bit mask that is used to request a
14649          * specific configuration of time stamp capture of PTP messages
14650          * on the transmit side of this port.
14651          * This field shall be ignored if the ptp_tx_ts_capture_enable
14652          * flag is not set in this command.
14653          * Otherwise, if bit 'i' is set, then the HWRM is being
14654          * requested to configure the transmit sied of the port to
14655          * capture the time stamp of every transmitted PTP message
14656          * with messageType field value set to i.
14657          */
14658         uint16_t        tx_ts_capture_ptp_msg_type;
14659         /* Configuration of CoS fields. */
14660         uint8_t cos_field_cfg;
14661         /* Reserved */
14662         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1 \
14663                 UINT32_C(0x1)
14664         /*
14665          * This field is used to specify selection of VLAN PRI value
14666          * based on whether one or two VLAN Tags are present in
14667          * the inner packet headers of tunneled packets or
14668          * non-tunneled packets.
14669          * This field is valid only if inner VLAN PRI to CoS mapping
14670          * is enabled.
14671          * If VLAN PRI to CoS mapping is not enabled, then this
14672          * field shall be ignored.
14673          */
14674         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
14675                 UINT32_C(0x6)
14676         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
14677                 1
14678         /*
14679          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
14680          * present in the inner packet headers
14681          */
14682         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
14683                 (UINT32_C(0x0) << 1)
14684         /*
14685          * Select outer VLAN Tag PRI when 2 VLAN Tags are
14686          * present in the inner packet headers.
14687          * No VLAN PRI shall be selected for this configuration
14688          * if only one VLAN Tag is present in the inner
14689          * packet headers.
14690          */
14691         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
14692                 (UINT32_C(0x1) << 1)
14693         /*
14694          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
14695          * are present in the inner packet headers
14696          */
14697         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
14698                 (UINT32_C(0x2) << 1)
14699         /* Unspecified */
14700         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
14701                 (UINT32_C(0x3) << 1)
14702         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
14703                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
14704         /*
14705          * This field is used to specify selection of tunnel VLAN
14706          * PRI value based on whether one or two VLAN Tags are
14707          * present in tunnel headers.
14708          * This field is valid only if tunnel VLAN PRI to CoS mapping
14709          * is enabled.
14710          * If tunnel VLAN PRI to CoS mapping is not enabled, then this
14711          * field shall be ignored.
14712          */
14713         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
14714                 UINT32_C(0x18)
14715         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
14716                 3
14717         /*
14718          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
14719          * present in the tunnel packet headers
14720          */
14721         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
14722                 (UINT32_C(0x0) << 3)
14723         /*
14724          * Select outer VLAN Tag PRI when 2 VLAN Tags are
14725          * present in the tunnel packet headers.
14726          * No tunnel VLAN PRI shall be selected for this
14727          * configuration if only one VLAN Tag is present in
14728          * the tunnel packet headers.
14729          */
14730         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
14731                 (UINT32_C(0x1) << 3)
14732         /*
14733          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
14734          * are present in the tunnel packet headers
14735          */
14736         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
14737                 (UINT32_C(0x2) << 3)
14738         /* Unspecified */
14739         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
14740                 (UINT32_C(0x3) << 3)
14741         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
14742                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
14743         /*
14744          * This field shall be used to provide default CoS value
14745          * that has been configured on this port.
14746          * This field is valid only if default CoS mapping
14747          * is enabled.
14748          * If default CoS mapping is not enabled, then this
14749          * field shall be ignored.
14750          */
14751         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
14752                 UINT32_C(0xe0)
14753         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
14754                 5
14755         uint8_t unused_0[3];
14756         /*
14757          * This signed field specifies by how much to adjust the frequency
14758          * of sync timer updates (measured in parts per billion).
14759          */
14760         int32_t ptp_freq_adj_ppb;
14761         uint8_t unused_1[4];
14762 } __attribute__((packed));
14763
14764 /* hwrm_port_mac_cfg_output (size:128b/16B) */
14765 struct hwrm_port_mac_cfg_output {
14766         /* The specific error status for the command. */
14767         uint16_t        error_code;
14768         /* The HWRM command request type. */
14769         uint16_t        req_type;
14770         /* The sequence ID from the original command. */
14771         uint16_t        seq_id;
14772         /* The length of the response data in number of bytes. */
14773         uint16_t        resp_len;
14774         /*
14775          * This is the configured maximum length of Ethernet packet
14776          * payload that is allowed to be received on the port.
14777          * This value does not include the number of bytes used by
14778          * Ethernet header and trailer (CRC).
14779          */
14780         uint16_t        mru;
14781         /*
14782          * This is the configured maximum length of Ethernet packet
14783          * payload that is allowed to be transmitted on the port.
14784          * This value does not include the number of bytes used by
14785          * Ethernet header and trailer (CRC).
14786          */
14787         uint16_t        mtu;
14788         /* Current configuration of the IPG value. */
14789         uint8_t ipg;
14790         /* Current value of the loopback value. */
14791         uint8_t lpbk;
14792         /* No loopback is selected.  Normal operation. */
14793         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
14794         /*
14795          * The HW will be configured with local loopback such that
14796          * host data is sent back to the host without modification.
14797          */
14798         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
14799         /*
14800          * The HW will be configured with remote loopback such that
14801          * port logic will send packets back out the transmitter that
14802          * are received.
14803          */
14804         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
14805         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST \
14806                 HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
14807         uint8_t unused_0;
14808         /*
14809          * This field is used in Output records to indicate that the output
14810          * is completely written to RAM.  This field should be read as '1'
14811          * to indicate that the output has been completely written.
14812          * When writing a command completion or response to an internal processor,
14813          * the order of writes has to be such that this field is written last.
14814          */
14815         uint8_t valid;
14816 } __attribute__((packed));
14817
14818 /**********************
14819  * hwrm_port_mac_qcfg *
14820  **********************/
14821
14822
14823 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
14824 struct hwrm_port_mac_qcfg_input {
14825         /* The HWRM command request type. */
14826         uint16_t        req_type;
14827         /*
14828          * The completion ring to send the completion event on. This should
14829          * be the NQ ID returned from the `nq_alloc` HWRM command.
14830          */
14831         uint16_t        cmpl_ring;
14832         /*
14833          * The sequence ID is used by the driver for tracking multiple
14834          * commands. This ID is treated as opaque data by the firmware and
14835          * the value is returned in the `hwrm_resp_hdr` upon completion.
14836          */
14837         uint16_t        seq_id;
14838         /*
14839          * The target ID of the command:
14840          * * 0x0-0xFFF8 - The function ID
14841          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14842          * * 0xFFFD - Reserved for user-space HWRM interface
14843          * * 0xFFFF - HWRM
14844          */
14845         uint16_t        target_id;
14846         /*
14847          * A physical address pointer pointing to a host buffer that the
14848          * command's response data will be written. This can be either a host
14849          * physical address (HPA) or a guest physical address (GPA) and must
14850          * point to a physically contiguous block of memory.
14851          */
14852         uint64_t        resp_addr;
14853         /* Port ID of port that is to be configured. */
14854         uint16_t        port_id;
14855         uint8_t unused_0[6];
14856 } __attribute__((packed));
14857
14858 /* hwrm_port_mac_qcfg_output (size:192b/24B) */
14859 struct hwrm_port_mac_qcfg_output {
14860         /* The specific error status for the command. */
14861         uint16_t        error_code;
14862         /* The HWRM command request type. */
14863         uint16_t        req_type;
14864         /* The sequence ID from the original command. */
14865         uint16_t        seq_id;
14866         /* The length of the response data in number of bytes. */
14867         uint16_t        resp_len;
14868         /*
14869          * This is the configured maximum length of Ethernet packet
14870          * payload that is allowed to be received on the port.
14871          * This value does not include the number of bytes used by the
14872          * Ethernet header and trailer (CRC).
14873          */
14874         uint16_t        mru;
14875         /*
14876          * This is the configured maximum length of Ethernet packet
14877          * payload that is allowed to be transmitted on the port.
14878          * This value does not include the number of bytes used by the
14879          * Ethernet header and trailer (CRC).
14880          */
14881         uint16_t        mtu;
14882         /*
14883          * The minimum IPG that will
14884          * be sent between packets by this port.
14885          */
14886         uint8_t ipg;
14887         /* The loopback setting for the MAC. */
14888         uint8_t lpbk;
14889         /* No loopback is selected.  Normal operation. */
14890         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
14891         /*
14892          * The HW will be configured with local loopback such that
14893          * host data is sent back to the host without modification.
14894          */
14895         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
14896         /*
14897          * The HW will be configured with remote loopback such that
14898          * port logic will send packets back out the transmitter that
14899          * are received.
14900          */
14901         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
14902         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST \
14903                 HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
14904         /*
14905          * Priority setting for VLAN PRI to CoS mapping.
14906          * # Each XXX_pri variable shall have a unique priority value
14907          * when it is being used.
14908          * # When comparing priorities of mappings, higher value
14909          * indicates higher priority.
14910          * For example, a value of 0-3 is returned where 0 is being
14911          * the lowest priority and 3 is being the highest priority.
14912          * # If the correspoding CoS mapping is not enabled, then this
14913          * field should be ignored.
14914          * # This value indicates the normalized priority value retained
14915          * in the HWRM.
14916          */
14917         uint8_t vlan_pri2cos_map_pri;
14918         /*
14919          * In this field, a number of CoS mappings related flags
14920          * are used to indicate configured CoS mappings.
14921          */
14922         uint8_t flags;
14923         /*
14924          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
14925          * is enabled.
14926          */
14927         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE \
14928                 UINT32_C(0x1)
14929         /*
14930          * When this bit is set to '1', tunnel VLAN PRI field to
14931          * CoS mapping is enabled.
14932          */
14933         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
14934                 UINT32_C(0x2)
14935         /*
14936          * When this bit is set to '1', the IP DSCP to CoS mapping is
14937          * enabled.
14938          */
14939         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE \
14940                 UINT32_C(0x4)
14941         /*
14942          * When this bit is '1', the Out-Of-Box WoL is enabled on this
14943          * port.
14944          */
14945         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE \
14946                 UINT32_C(0x8)
14947         /* When this bit is '1', PTP is enabled for RX on this port. */
14948         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
14949                 UINT32_C(0x10)
14950         /* When this bit is '1', PTP is enabled for TX on this port. */
14951         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
14952                 UINT32_C(0x20)
14953         /*
14954          * Priority setting for tunnel VLAN PRI to CoS mapping.
14955          * # Each XXX_pri variable shall have a unique priority value
14956          * when it is being used.
14957          * # When comparing priorities of mappings, higher value
14958          * indicates higher priority.
14959          * For example, a value of 0-3 is returned where 0 is being
14960          * the lowest priority and 3 is being the highest priority.
14961          * # If the correspoding CoS mapping is not enabled, then this
14962          * field should be ignored.
14963          * # This value indicates the normalized priority value retained
14964          * in the HWRM.
14965          */
14966         uint8_t tunnel_pri2cos_map_pri;
14967         /*
14968          * Priority setting for DSCP to PRI mapping.
14969          * # Each XXX_pri variable shall have a unique priority value
14970          * when it is being used.
14971          * # When comparing priorities of mappings, higher value
14972          * indicates higher priority.
14973          * For example, a value of 0-3 is returned where 0 is being
14974          * the lowest priority and 3 is being the highest priority.
14975          * # If the correspoding CoS mapping is not enabled, then this
14976          * field should be ignored.
14977          * # This value indicates the normalized priority value retained
14978          * in the HWRM.
14979          */
14980         uint8_t dscp2pri_map_pri;
14981         /*
14982          * This is a 16-bit bit mask that represents the
14983          * current configuration of time stamp capture of PTP messages
14984          * on the receive side of this port.
14985          * If bit 'i' is set, then the receive side of the port
14986          * is configured to capture the time stamp of every
14987          * received PTP message with messageType field value set
14988          * to i.
14989          * If all bits are set to 0 (i.e. field value set 0),
14990          * then the receive side of the port is not configured
14991          * to capture timestamp for PTP messages.
14992          * If all bits are set to 1, then the receive side of the
14993          * port is configured to capture timestamp for all PTP
14994          * messages.
14995          */
14996         uint16_t        rx_ts_capture_ptp_msg_type;
14997         /*
14998          * This is a 16-bit bit mask that represents the
14999          * current configuration of time stamp capture of PTP messages
15000          * on the transmit side of this port.
15001          * If bit 'i' is set, then the transmit side of the port
15002          * is configured to capture the time stamp of every
15003          * received PTP message with messageType field value set
15004          * to i.
15005          * If all bits are set to 0 (i.e. field value set 0),
15006          * then the transmit side of the port is not configured
15007          * to capture timestamp for PTP messages.
15008          * If all bits are set to 1, then the transmit side of the
15009          * port is configured to capture timestamp for all PTP
15010          * messages.
15011          */
15012         uint16_t        tx_ts_capture_ptp_msg_type;
15013         /* Configuration of CoS fields. */
15014         uint8_t cos_field_cfg;
15015         /* Reserved */
15016         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD \
15017                 UINT32_C(0x1)
15018         /*
15019          * This field is used for selecting VLAN PRI value
15020          * based on whether one or two VLAN Tags are present in
15021          * the inner packet headers of tunneled packets or
15022          * non-tunneled packets.
15023          */
15024         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
15025                 UINT32_C(0x6)
15026         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
15027                 1
15028         /*
15029          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
15030          * present in the inner packet headers
15031          */
15032         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
15033                 (UINT32_C(0x0) << 1)
15034         /*
15035          * Select outer VLAN Tag PRI when 2 VLAN Tags are
15036          * present in the inner packet headers.
15037          * No VLAN PRI is selected for this configuration
15038          * if only one VLAN Tag is present in the inner
15039          * packet headers.
15040          */
15041         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
15042                 (UINT32_C(0x1) << 1)
15043         /*
15044          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
15045          * are present in the inner packet headers
15046          */
15047         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
15048                 (UINT32_C(0x2) << 1)
15049         /* Unspecified */
15050         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
15051                 (UINT32_C(0x3) << 1)
15052         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
15053                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
15054         /*
15055          * This field is used for selecting tunnel VLAN PRI value
15056          * based on whether one or two VLAN Tags are present in
15057          * the tunnel headers of tunneled packets. This selection
15058          * does not apply to non-tunneled packets.
15059          */
15060         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
15061                 UINT32_C(0x18)
15062         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
15063                 3
15064         /*
15065          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
15066          * present in the tunnel packet headers
15067          */
15068         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
15069                 (UINT32_C(0x0) << 3)
15070         /*
15071          * Select outer VLAN Tag PRI when 2 VLAN Tags are
15072          * present in the tunnel packet headers.
15073          * No VLAN PRI is selected for this configuration
15074          * if only one VLAN Tag is present in the tunnel
15075          * packet headers.
15076          */
15077         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
15078                 (UINT32_C(0x1) << 3)
15079         /*
15080          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
15081          * are present in the tunnel packet headers
15082          */
15083         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
15084                 (UINT32_C(0x2) << 3)
15085         /* Unspecified */
15086         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
15087                 (UINT32_C(0x3) << 3)
15088         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
15089                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
15090         /*
15091          * This field is used to provide default CoS value that
15092          * has been configured on this port.
15093          */
15094         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
15095                 UINT32_C(0xe0)
15096         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
15097                 5
15098         /*
15099          * This field is used in Output records to indicate that the output
15100          * is completely written to RAM.  This field should be read as '1'
15101          * to indicate that the output has been completely written.
15102          * When writing a command completion or response to an internal processor,
15103          * the order of writes has to be such that this field is written last.
15104          */
15105         uint8_t valid;
15106 } __attribute__((packed));
15107
15108 /**************************
15109  * hwrm_port_mac_ptp_qcfg *
15110  **************************/
15111
15112
15113 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
15114 struct hwrm_port_mac_ptp_qcfg_input {
15115         /* The HWRM command request type. */
15116         uint16_t        req_type;
15117         /*
15118          * The completion ring to send the completion event on. This should
15119          * be the NQ ID returned from the `nq_alloc` HWRM command.
15120          */
15121         uint16_t        cmpl_ring;
15122         /*
15123          * The sequence ID is used by the driver for tracking multiple
15124          * commands. This ID is treated as opaque data by the firmware and
15125          * the value is returned in the `hwrm_resp_hdr` upon completion.
15126          */
15127         uint16_t        seq_id;
15128         /*
15129          * The target ID of the command:
15130          * * 0x0-0xFFF8 - The function ID
15131          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15132          * * 0xFFFD - Reserved for user-space HWRM interface
15133          * * 0xFFFF - HWRM
15134          */
15135         uint16_t        target_id;
15136         /*
15137          * A physical address pointer pointing to a host buffer that the
15138          * command's response data will be written. This can be either a host
15139          * physical address (HPA) or a guest physical address (GPA) and must
15140          * point to a physically contiguous block of memory.
15141          */
15142         uint64_t        resp_addr;
15143         /* Port ID of port that is being queried. */
15144         uint16_t        port_id;
15145         uint8_t unused_0[6];
15146 } __attribute__((packed));
15147
15148 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */
15149 struct hwrm_port_mac_ptp_qcfg_output {
15150         /* The specific error status for the command. */
15151         uint16_t        error_code;
15152         /* The HWRM command request type. */
15153         uint16_t        req_type;
15154         /* The sequence ID from the original command. */
15155         uint16_t        seq_id;
15156         /* The length of the response data in number of bytes. */
15157         uint16_t        resp_len;
15158         /*
15159          * In this field, a number of PTP related flags
15160          * are used to indicate configured PTP capabilities.
15161          */
15162         uint8_t flags;
15163         /*
15164          * When this bit is set to '1', the PTP related registers are
15165          * directly accessible by the host.
15166          */
15167         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS \
15168                 UINT32_C(0x1)
15169         /*
15170          * When this bit is set to '1', the PTP information is accessible
15171          * via HWRM commands.
15172          */
15173         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS \
15174                 UINT32_C(0x2)
15175         /*
15176          * When this bit is set to '1', the device supports one-step
15177          * Tx timestamping.
15178          */
15179         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS \
15180                 UINT32_C(0x4)
15181         uint8_t unused_0[3];
15182         /* Offset of the PTP register for the lower 32 bits of timestamp for RX. */
15183         uint32_t        rx_ts_reg_off_lower;
15184         /* Offset of the PTP register for the upper 32 bits of timestamp for RX. */
15185         uint32_t        rx_ts_reg_off_upper;
15186         /* Offset of the PTP register for the sequence ID for RX. */
15187         uint32_t        rx_ts_reg_off_seq_id;
15188         /* Offset of the first PTP source ID for RX. */
15189         uint32_t        rx_ts_reg_off_src_id_0;
15190         /* Offset of the second PTP source ID for RX. */
15191         uint32_t        rx_ts_reg_off_src_id_1;
15192         /* Offset of the third PTP source ID for RX. */
15193         uint32_t        rx_ts_reg_off_src_id_2;
15194         /* Offset of the domain ID for RX. */
15195         uint32_t        rx_ts_reg_off_domain_id;
15196         /* Offset of the PTP FIFO register for RX. */
15197         uint32_t        rx_ts_reg_off_fifo;
15198         /* Offset of the PTP advance FIFO register for RX. */
15199         uint32_t        rx_ts_reg_off_fifo_adv;
15200         /* PTP timestamp granularity for RX. */
15201         uint32_t        rx_ts_reg_off_granularity;
15202         /* Offset of the PTP register for the lower 32 bits of timestamp for TX. */
15203         uint32_t        tx_ts_reg_off_lower;
15204         /* Offset of the PTP register for the upper 32 bits of timestamp for TX. */
15205         uint32_t        tx_ts_reg_off_upper;
15206         /* Offset of the PTP register for the sequence ID for TX. */
15207         uint32_t        tx_ts_reg_off_seq_id;
15208         /* Offset of the PTP FIFO register for TX. */
15209         uint32_t        tx_ts_reg_off_fifo;
15210         /* PTP timestamp granularity for TX. */
15211         uint32_t        tx_ts_reg_off_granularity;
15212         uint8_t unused_1[7];
15213         /*
15214          * This field is used in Output records to indicate that the output
15215          * is completely written to RAM.  This field should be read as '1'
15216          * to indicate that the output has been completely written.
15217          * When writing a command completion or response to an internal processor,
15218          * the order of writes has to be such that this field is written last.
15219          */
15220         uint8_t valid;
15221 } __attribute__((packed));
15222
15223 /* Port Tx Statistics Formats */
15224 /* tx_port_stats (size:3264b/408B) */
15225 struct tx_port_stats {
15226         /* Total Number of 64 Bytes frames transmitted */
15227         uint64_t        tx_64b_frames;
15228         /* Total Number of 65-127 Bytes frames transmitted */
15229         uint64_t        tx_65b_127b_frames;
15230         /* Total Number of 128-255 Bytes frames transmitted */
15231         uint64_t        tx_128b_255b_frames;
15232         /* Total Number of 256-511 Bytes frames transmitted */
15233         uint64_t        tx_256b_511b_frames;
15234         /* Total Number of 512-1023 Bytes frames transmitted */
15235         uint64_t        tx_512b_1023b_frames;
15236         /* Total Number of 1024-1518 Bytes frames transmitted */
15237         uint64_t        tx_1024b_1518b_frames;
15238         /*
15239          * Total Number of each good VLAN (exludes FCS errors)
15240          * frame transmitted which is 1519 to 1522 bytes in length
15241          * inclusive (excluding framing bits but including FCS bytes).
15242          */
15243         uint64_t        tx_good_vlan_frames;
15244         /* Total Number of 1519-2047 Bytes frames transmitted */
15245         uint64_t        tx_1519b_2047b_frames;
15246         /* Total Number of 2048-4095 Bytes frames transmitted */
15247         uint64_t        tx_2048b_4095b_frames;
15248         /* Total Number of 4096-9216 Bytes frames transmitted */
15249         uint64_t        tx_4096b_9216b_frames;
15250         /* Total Number of 9217-16383 Bytes frames transmitted */
15251         uint64_t        tx_9217b_16383b_frames;
15252         /* Total Number of good frames transmitted */
15253         uint64_t        tx_good_frames;
15254         /* Total Number of frames transmitted */
15255         uint64_t        tx_total_frames;
15256         /* Total number of unicast frames transmitted */
15257         uint64_t        tx_ucast_frames;
15258         /* Total number of multicast frames transmitted */
15259         uint64_t        tx_mcast_frames;
15260         /* Total number of broadcast frames transmitted */
15261         uint64_t        tx_bcast_frames;
15262         /* Total number of PAUSE control frames transmitted */
15263         uint64_t        tx_pause_frames;
15264         /*
15265          * Total number of PFC/per-priority PAUSE
15266          * control frames transmitted
15267          */
15268         uint64_t        tx_pfc_frames;
15269         /* Total number of jabber frames transmitted */
15270         uint64_t        tx_jabber_frames;
15271         /* Total number of frames transmitted with FCS error */
15272         uint64_t        tx_fcs_err_frames;
15273         /* Total number of control frames transmitted */
15274         uint64_t        tx_control_frames;
15275         /* Total number of over-sized frames transmitted */
15276         uint64_t        tx_oversz_frames;
15277         /* Total number of frames with single deferral */
15278         uint64_t        tx_single_dfrl_frames;
15279         /* Total number of frames with multiple deferrals */
15280         uint64_t        tx_multi_dfrl_frames;
15281         /* Total number of frames with single collision */
15282         uint64_t        tx_single_coll_frames;
15283         /* Total number of frames with multiple collisions */
15284         uint64_t        tx_multi_coll_frames;
15285         /* Total number of frames with late collisions */
15286         uint64_t        tx_late_coll_frames;
15287         /* Total number of frames with excessive collisions */
15288         uint64_t        tx_excessive_coll_frames;
15289         /* Total number of fragmented frames transmitted */
15290         uint64_t        tx_frag_frames;
15291         /* Total number of transmit errors */
15292         uint64_t        tx_err;
15293         /* Total number of single VLAN tagged frames transmitted */
15294         uint64_t        tx_tagged_frames;
15295         /* Total number of double VLAN tagged frames transmitted */
15296         uint64_t        tx_dbl_tagged_frames;
15297         /* Total number of runt frames transmitted */
15298         uint64_t        tx_runt_frames;
15299         /* Total number of TX FIFO under runs */
15300         uint64_t        tx_fifo_underruns;
15301         /*
15302          * Total number of PFC frames with PFC enabled bit for
15303          * Pri 0 transmitted
15304          */
15305         uint64_t        tx_pfc_ena_frames_pri0;
15306         /*
15307          * Total number of PFC frames with PFC enabled bit for
15308          * Pri 1 transmitted
15309          */
15310         uint64_t        tx_pfc_ena_frames_pri1;
15311         /*
15312          * Total number of PFC frames with PFC enabled bit for
15313          * Pri 2 transmitted
15314          */
15315         uint64_t        tx_pfc_ena_frames_pri2;
15316         /*
15317          * Total number of PFC frames with PFC enabled bit for
15318          * Pri 3 transmitted
15319          */
15320         uint64_t        tx_pfc_ena_frames_pri3;
15321         /*
15322          * Total number of PFC frames with PFC enabled bit for
15323          * Pri 4 transmitted
15324          */
15325         uint64_t        tx_pfc_ena_frames_pri4;
15326         /*
15327          * Total number of PFC frames with PFC enabled bit for
15328          * Pri 5 transmitted
15329          */
15330         uint64_t        tx_pfc_ena_frames_pri5;
15331         /*
15332          * Total number of PFC frames with PFC enabled bit for
15333          * Pri 6 transmitted
15334          */
15335         uint64_t        tx_pfc_ena_frames_pri6;
15336         /*
15337          * Total number of PFC frames with PFC enabled bit for
15338          * Pri 7 transmitted
15339          */
15340         uint64_t        tx_pfc_ena_frames_pri7;
15341         /* Total number of EEE LPI Events on TX */
15342         uint64_t        tx_eee_lpi_events;
15343         /* EEE LPI Duration Counter on TX */
15344         uint64_t        tx_eee_lpi_duration;
15345         /*
15346          * Total number of Link Level Flow Control (LLFC) messages
15347          * transmitted
15348          */
15349         uint64_t        tx_llfc_logical_msgs;
15350         /* Total number of HCFC messages transmitted */
15351         uint64_t        tx_hcfc_msgs;
15352         /* Total number of TX collisions */
15353         uint64_t        tx_total_collisions;
15354         /* Total number of transmitted bytes */
15355         uint64_t        tx_bytes;
15356         /* Total number of end-to-end HOL frames */
15357         uint64_t        tx_xthol_frames;
15358         /* Total Tx Drops per Port reported by STATS block */
15359         uint64_t        tx_stat_discard;
15360         /* Total Tx Error Drops per Port reported by STATS block */
15361         uint64_t        tx_stat_error;
15362 } __attribute__((packed));
15363
15364 /* Port Rx Statistics Formats */
15365 /* rx_port_stats (size:4224b/528B) */
15366 struct rx_port_stats {
15367         /* Total Number of 64 Bytes frames received */
15368         uint64_t        rx_64b_frames;
15369         /* Total Number of 65-127 Bytes frames received */
15370         uint64_t        rx_65b_127b_frames;
15371         /* Total Number of 128-255 Bytes frames received */
15372         uint64_t        rx_128b_255b_frames;
15373         /* Total Number of 256-511 Bytes frames received */
15374         uint64_t        rx_256b_511b_frames;
15375         /* Total Number of 512-1023 Bytes frames received */
15376         uint64_t        rx_512b_1023b_frames;
15377         /* Total Number of 1024-1518 Bytes frames received */
15378         uint64_t        rx_1024b_1518b_frames;
15379         /*
15380          * Total Number of each good VLAN (exludes FCS errors)
15381          * frame received which is 1519 to 1522 bytes in length
15382          * inclusive (excluding framing bits but including FCS bytes).
15383          */
15384         uint64_t        rx_good_vlan_frames;
15385         /* Total Number of 1519-2047 Bytes frames received */
15386         uint64_t        rx_1519b_2047b_frames;
15387         /* Total Number of 2048-4095 Bytes frames received */
15388         uint64_t        rx_2048b_4095b_frames;
15389         /* Total Number of 4096-9216 Bytes frames received */
15390         uint64_t        rx_4096b_9216b_frames;
15391         /* Total Number of 9217-16383 Bytes frames received */
15392         uint64_t        rx_9217b_16383b_frames;
15393         /* Total number of frames received */
15394         uint64_t        rx_total_frames;
15395         /* Total number of unicast frames received */
15396         uint64_t        rx_ucast_frames;
15397         /* Total number of multicast frames received */
15398         uint64_t        rx_mcast_frames;
15399         /* Total number of broadcast frames received */
15400         uint64_t        rx_bcast_frames;
15401         /* Total number of received frames with FCS error */
15402         uint64_t        rx_fcs_err_frames;
15403         /* Total number of control frames received */
15404         uint64_t        rx_ctrl_frames;
15405         /* Total number of PAUSE frames received */
15406         uint64_t        rx_pause_frames;
15407         /* Total number of PFC frames received */
15408         uint64_t        rx_pfc_frames;
15409         /*
15410          * Total number of frames received with an unsupported
15411          * opcode
15412          */
15413         uint64_t        rx_unsupported_opcode_frames;
15414         /*
15415          * Total number of frames received with an unsupported
15416          * DA for pause and PFC
15417          */
15418         uint64_t        rx_unsupported_da_pausepfc_frames;
15419         /* Total number of frames received with an unsupported SA */
15420         uint64_t        rx_wrong_sa_frames;
15421         /* Total number of received packets with alignment error */
15422         uint64_t        rx_align_err_frames;
15423         /* Total number of received frames with out-of-range length */
15424         uint64_t        rx_oor_len_frames;
15425         /* Total number of received frames with error termination */
15426         uint64_t        rx_code_err_frames;
15427         /*
15428          * Total number of received frames with a false carrier is
15429          * detected during idle, as defined by RX_ER samples active
15430          * and RXD is 0xE. The event is reported along with the
15431          * statistics generated on the next received frame. Only
15432          * one false carrier condition can be detected and logged
15433          * between frames.
15434          *
15435          * Carrier event, valid for 10M/100M speed modes only.
15436          */
15437         uint64_t        rx_false_carrier_frames;
15438         /* Total number of over-sized frames received */
15439         uint64_t        rx_ovrsz_frames;
15440         /* Total number of jabber packets received */
15441         uint64_t        rx_jbr_frames;
15442         /* Total number of received frames with MTU error */
15443         uint64_t        rx_mtu_err_frames;
15444         /* Total number of received frames with CRC match */
15445         uint64_t        rx_match_crc_frames;
15446         /* Total number of frames received promiscuously */
15447         uint64_t        rx_promiscuous_frames;
15448         /*
15449          * Total number of received frames with one or two VLAN
15450          * tags
15451          */
15452         uint64_t        rx_tagged_frames;
15453         /* Total number of received frames with two VLAN tags */
15454         uint64_t        rx_double_tagged_frames;
15455         /* Total number of truncated frames received */
15456         uint64_t        rx_trunc_frames;
15457         /* Total number of good frames (without errors) received */
15458         uint64_t        rx_good_frames;
15459         /*
15460          * Total number of received PFC frames with transition from
15461          * XON to XOFF on Pri 0
15462          */
15463         uint64_t        rx_pfc_xon2xoff_frames_pri0;
15464         /*
15465          * Total number of received PFC frames with transition from
15466          * XON to XOFF on Pri 1
15467          */
15468         uint64_t        rx_pfc_xon2xoff_frames_pri1;
15469         /*
15470          * Total number of received PFC frames with transition from
15471          * XON to XOFF on Pri 2
15472          */
15473         uint64_t        rx_pfc_xon2xoff_frames_pri2;
15474         /*
15475          * Total number of received PFC frames with transition from
15476          * XON to XOFF on Pri 3
15477          */
15478         uint64_t        rx_pfc_xon2xoff_frames_pri3;
15479         /*
15480          * Total number of received PFC frames with transition from
15481          * XON to XOFF on Pri 4
15482          */
15483         uint64_t        rx_pfc_xon2xoff_frames_pri4;
15484         /*
15485          * Total number of received PFC frames with transition from
15486          * XON to XOFF on Pri 5
15487          */
15488         uint64_t        rx_pfc_xon2xoff_frames_pri5;
15489         /*
15490          * Total number of received PFC frames with transition from
15491          * XON to XOFF on Pri 6
15492          */
15493         uint64_t        rx_pfc_xon2xoff_frames_pri6;
15494         /*
15495          * Total number of received PFC frames with transition from
15496          * XON to XOFF on Pri 7
15497          */
15498         uint64_t        rx_pfc_xon2xoff_frames_pri7;
15499         /*
15500          * Total number of received PFC frames with PFC enabled
15501          * bit for Pri 0
15502          */
15503         uint64_t        rx_pfc_ena_frames_pri0;
15504         /*
15505          * Total number of received PFC frames with PFC enabled
15506          * bit for Pri 1
15507          */
15508         uint64_t        rx_pfc_ena_frames_pri1;
15509         /*
15510          * Total number of received PFC frames with PFC enabled
15511          * bit for Pri 2
15512          */
15513         uint64_t        rx_pfc_ena_frames_pri2;
15514         /*
15515          * Total number of received PFC frames with PFC enabled
15516          * bit for Pri 3
15517          */
15518         uint64_t        rx_pfc_ena_frames_pri3;
15519         /*
15520          * Total number of received PFC frames with PFC enabled
15521          * bit for Pri 4
15522          */
15523         uint64_t        rx_pfc_ena_frames_pri4;
15524         /*
15525          * Total number of received PFC frames with PFC enabled
15526          * bit for Pri 5
15527          */
15528         uint64_t        rx_pfc_ena_frames_pri5;
15529         /*
15530          * Total number of received PFC frames with PFC enabled
15531          * bit for Pri 6
15532          */
15533         uint64_t        rx_pfc_ena_frames_pri6;
15534         /*
15535          * Total number of received PFC frames with PFC enabled
15536          * bit for Pri 7
15537          */
15538         uint64_t        rx_pfc_ena_frames_pri7;
15539         /* Total Number of frames received with SCH CRC error */
15540         uint64_t        rx_sch_crc_err_frames;
15541         /* Total Number of under-sized frames received */
15542         uint64_t        rx_undrsz_frames;
15543         /* Total Number of fragmented frames received */
15544         uint64_t        rx_frag_frames;
15545         /* Total number of RX EEE LPI Events */
15546         uint64_t        rx_eee_lpi_events;
15547         /* EEE LPI Duration Counter on RX */
15548         uint64_t        rx_eee_lpi_duration;
15549         /*
15550          * Total number of physical type Link Level Flow Control
15551          * (LLFC) messages received
15552          */
15553         uint64_t        rx_llfc_physical_msgs;
15554         /*
15555          * Total number of logical type Link Level Flow Control
15556          * (LLFC) messages received
15557          */
15558         uint64_t        rx_llfc_logical_msgs;
15559         /*
15560          * Total number of logical type Link Level Flow Control
15561          * (LLFC) messages received with CRC error
15562          */
15563         uint64_t        rx_llfc_msgs_with_crc_err;
15564         /* Total number of HCFC messages received */
15565         uint64_t        rx_hcfc_msgs;
15566         /* Total number of HCFC messages received with CRC error */
15567         uint64_t        rx_hcfc_msgs_with_crc_err;
15568         /* Total number of received bytes */
15569         uint64_t        rx_bytes;
15570         /* Total number of bytes received in runt frames */
15571         uint64_t        rx_runt_bytes;
15572         /* Total number of runt frames received */
15573         uint64_t        rx_runt_frames;
15574         /* Total Rx Discards per Port reported by STATS block */
15575         uint64_t        rx_stat_discard;
15576         uint64_t        rx_stat_err;
15577 } __attribute__((packed));
15578
15579 /********************
15580  * hwrm_port_qstats *
15581  ********************/
15582
15583
15584 /* hwrm_port_qstats_input (size:320b/40B) */
15585 struct hwrm_port_qstats_input {
15586         /* The HWRM command request type. */
15587         uint16_t        req_type;
15588         /*
15589          * The completion ring to send the completion event on. This should
15590          * be the NQ ID returned from the `nq_alloc` HWRM command.
15591          */
15592         uint16_t        cmpl_ring;
15593         /*
15594          * The sequence ID is used by the driver for tracking multiple
15595          * commands. This ID is treated as opaque data by the firmware and
15596          * the value is returned in the `hwrm_resp_hdr` upon completion.
15597          */
15598         uint16_t        seq_id;
15599         /*
15600          * The target ID of the command:
15601          * * 0x0-0xFFF8 - The function ID
15602          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15603          * * 0xFFFD - Reserved for user-space HWRM interface
15604          * * 0xFFFF - HWRM
15605          */
15606         uint16_t        target_id;
15607         /*
15608          * A physical address pointer pointing to a host buffer that the
15609          * command's response data will be written. This can be either a host
15610          * physical address (HPA) or a guest physical address (GPA) and must
15611          * point to a physically contiguous block of memory.
15612          */
15613         uint64_t        resp_addr;
15614         /* Port ID of port that is being queried. */
15615         uint16_t        port_id;
15616         uint8_t unused_0[6];
15617         /*
15618          * This is the host address where
15619          * Tx port statistics will be stored
15620          */
15621         uint64_t        tx_stat_host_addr;
15622         /*
15623          * This is the host address where
15624          * Rx port statistics will be stored
15625          */
15626         uint64_t        rx_stat_host_addr;
15627 } __attribute__((packed));
15628
15629 /* hwrm_port_qstats_output (size:128b/16B) */
15630 struct hwrm_port_qstats_output {
15631         /* The specific error status for the command. */
15632         uint16_t        error_code;
15633         /* The HWRM command request type. */
15634         uint16_t        req_type;
15635         /* The sequence ID from the original command. */
15636         uint16_t        seq_id;
15637         /* The length of the response data in number of bytes. */
15638         uint16_t        resp_len;
15639         /* The size of TX port statistics block in bytes. */
15640         uint16_t        tx_stat_size;
15641         /* The size of RX port statistics block in bytes. */
15642         uint16_t        rx_stat_size;
15643         uint8_t unused_0[3];
15644         /*
15645          * This field is used in Output records to indicate that the output
15646          * is completely written to RAM.  This field should be read as '1'
15647          * to indicate that the output has been completely written.
15648          * When writing a command completion or response to an internal processor,
15649          * the order of writes has to be such that this field is written last.
15650          */
15651         uint8_t valid;
15652 } __attribute__((packed));
15653
15654 /* Port Tx Statistics extended Formats */
15655 /* tx_port_stats_ext (size:2048b/256B) */
15656 struct tx_port_stats_ext {
15657         /* Total number of tx bytes count on cos queue 0 */
15658         uint64_t        tx_bytes_cos0;
15659         /* Total number of tx bytes count on cos queue 1 */
15660         uint64_t        tx_bytes_cos1;
15661         /* Total number of tx bytes count on cos queue 2 */
15662         uint64_t        tx_bytes_cos2;
15663         /* Total number of tx bytes count on cos queue 3 */
15664         uint64_t        tx_bytes_cos3;
15665         /* Total number of tx bytes count on cos queue 4 */
15666         uint64_t        tx_bytes_cos4;
15667         /* Total number of tx bytes count on cos queue 5 */
15668         uint64_t        tx_bytes_cos5;
15669         /* Total number of tx bytes count on cos queue 6 */
15670         uint64_t        tx_bytes_cos6;
15671         /* Total number of tx bytes count on cos queue 7 */
15672         uint64_t        tx_bytes_cos7;
15673         /* Total number of tx packets count on cos queue 0 */
15674         uint64_t        tx_packets_cos0;
15675         /* Total number of tx packets count on cos queue 1 */
15676         uint64_t        tx_packets_cos1;
15677         /* Total number of tx packets count on cos queue 2 */
15678         uint64_t        tx_packets_cos2;
15679         /* Total number of tx packets count on cos queue 3 */
15680         uint64_t        tx_packets_cos3;
15681         /* Total number of tx packets count on cos queue 4 */
15682         uint64_t        tx_packets_cos4;
15683         /* Total number of tx packets count on cos queue 5 */
15684         uint64_t        tx_packets_cos5;
15685         /* Total number of tx packets count on cos queue 6 */
15686         uint64_t        tx_packets_cos6;
15687         /* Total number of tx packets count on cos queue 7 */
15688         uint64_t        tx_packets_cos7;
15689         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
15690         uint64_t        pfc_pri0_tx_duration_us;
15691         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
15692         uint64_t        pfc_pri0_tx_transitions;
15693         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
15694         uint64_t        pfc_pri1_tx_duration_us;
15695         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
15696         uint64_t        pfc_pri1_tx_transitions;
15697         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
15698         uint64_t        pfc_pri2_tx_duration_us;
15699         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
15700         uint64_t        pfc_pri2_tx_transitions;
15701         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
15702         uint64_t        pfc_pri3_tx_duration_us;
15703         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
15704         uint64_t        pfc_pri3_tx_transitions;
15705         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
15706         uint64_t        pfc_pri4_tx_duration_us;
15707         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
15708         uint64_t        pfc_pri4_tx_transitions;
15709         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
15710         uint64_t        pfc_pri5_tx_duration_us;
15711         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
15712         uint64_t        pfc_pri5_tx_transitions;
15713         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
15714         uint64_t        pfc_pri6_tx_duration_us;
15715         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
15716         uint64_t        pfc_pri6_tx_transitions;
15717         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
15718         uint64_t        pfc_pri7_tx_duration_us;
15719         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
15720         uint64_t        pfc_pri7_tx_transitions;
15721 } __attribute__((packed));
15722
15723 /* Port Rx Statistics extended Formats */
15724 /* rx_port_stats_ext (size:3648b/456B) */
15725 struct rx_port_stats_ext {
15726         /* Number of times link state changed to down */
15727         uint64_t        link_down_events;
15728         /* Number of times the idle rings with pause bit are found */
15729         uint64_t        continuous_pause_events;
15730         /* Number of times the active rings pause bit resumed back */
15731         uint64_t        resume_pause_events;
15732         /* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */
15733         uint64_t        continuous_roce_pause_events;
15734         /* Number of times, the ROCE cos queue PFC is enabled back */
15735         uint64_t        resume_roce_pause_events;
15736         /* Total number of rx bytes count on cos queue 0 */
15737         uint64_t        rx_bytes_cos0;
15738         /* Total number of rx bytes count on cos queue 1 */
15739         uint64_t        rx_bytes_cos1;
15740         /* Total number of rx bytes count on cos queue 2 */
15741         uint64_t        rx_bytes_cos2;
15742         /* Total number of rx bytes count on cos queue 3 */
15743         uint64_t        rx_bytes_cos3;
15744         /* Total number of rx bytes count on cos queue 4 */
15745         uint64_t        rx_bytes_cos4;
15746         /* Total number of rx bytes count on cos queue 5 */
15747         uint64_t        rx_bytes_cos5;
15748         /* Total number of rx bytes count on cos queue 6 */
15749         uint64_t        rx_bytes_cos6;
15750         /* Total number of rx bytes count on cos queue 7 */
15751         uint64_t        rx_bytes_cos7;
15752         /* Total number of rx packets count on cos queue 0 */
15753         uint64_t        rx_packets_cos0;
15754         /* Total number of rx packets count on cos queue 1 */
15755         uint64_t        rx_packets_cos1;
15756         /* Total number of rx packets count on cos queue 2 */
15757         uint64_t        rx_packets_cos2;
15758         /* Total number of rx packets count on cos queue 3 */
15759         uint64_t        rx_packets_cos3;
15760         /* Total number of rx packets count on cos queue 4 */
15761         uint64_t        rx_packets_cos4;
15762         /* Total number of rx packets count on cos queue 5 */
15763         uint64_t        rx_packets_cos5;
15764         /* Total number of rx packets count on cos queue 6 */
15765         uint64_t        rx_packets_cos6;
15766         /* Total number of rx packets count on cos queue 7 */
15767         uint64_t        rx_packets_cos7;
15768         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
15769         uint64_t        pfc_pri0_rx_duration_us;
15770         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
15771         uint64_t        pfc_pri0_rx_transitions;
15772         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
15773         uint64_t        pfc_pri1_rx_duration_us;
15774         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
15775         uint64_t        pfc_pri1_rx_transitions;
15776         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
15777         uint64_t        pfc_pri2_rx_duration_us;
15778         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
15779         uint64_t        pfc_pri2_rx_transitions;
15780         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
15781         uint64_t        pfc_pri3_rx_duration_us;
15782         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
15783         uint64_t        pfc_pri3_rx_transitions;
15784         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
15785         uint64_t        pfc_pri4_rx_duration_us;
15786         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
15787         uint64_t        pfc_pri4_rx_transitions;
15788         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
15789         uint64_t        pfc_pri5_rx_duration_us;
15790         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
15791         uint64_t        pfc_pri5_rx_transitions;
15792         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
15793         uint64_t        pfc_pri6_rx_duration_us;
15794         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
15795         uint64_t        pfc_pri6_rx_transitions;
15796         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
15797         uint64_t        pfc_pri7_rx_duration_us;
15798         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
15799         uint64_t        pfc_pri7_rx_transitions;
15800         /* Total number of received bits */
15801         uint64_t        rx_bits;
15802         /* The number of events where the port receive buffer was over 85% full */
15803         uint64_t        rx_buffer_passed_threshold;
15804         /*
15805          * The number of symbol errors that wasn't corrected by FEC correction
15806          * alogirithm
15807          */
15808         uint64_t        rx_pcs_symbol_err;
15809         /* The number of corrected bits on the port according to active FEC */
15810         uint64_t        rx_corrected_bits;
15811         /* Total number of rx discard bytes count on cos queue 0 */
15812         uint64_t        rx_discard_bytes_cos0;
15813         /* Total number of rx discard bytes count on cos queue 1 */
15814         uint64_t        rx_discard_bytes_cos1;
15815         /* Total number of rx discard bytes count on cos queue 2 */
15816         uint64_t        rx_discard_bytes_cos2;
15817         /* Total number of rx discard bytes count on cos queue 3 */
15818         uint64_t        rx_discard_bytes_cos3;
15819         /* Total number of rx discard bytes count on cos queue 4 */
15820         uint64_t        rx_discard_bytes_cos4;
15821         /* Total number of rx discard bytes count on cos queue 5 */
15822         uint64_t        rx_discard_bytes_cos5;
15823         /* Total number of rx discard bytes count on cos queue 6 */
15824         uint64_t        rx_discard_bytes_cos6;
15825         /* Total number of rx discard bytes count on cos queue 7 */
15826         uint64_t        rx_discard_bytes_cos7;
15827         /* Total number of rx discard packets count on cos queue 0 */
15828         uint64_t        rx_discard_packets_cos0;
15829         /* Total number of rx discard packets count on cos queue 1 */
15830         uint64_t        rx_discard_packets_cos1;
15831         /* Total number of rx discard packets count on cos queue 2 */
15832         uint64_t        rx_discard_packets_cos2;
15833         /* Total number of rx discard packets count on cos queue 3 */
15834         uint64_t        rx_discard_packets_cos3;
15835         /* Total number of rx discard packets count on cos queue 4 */
15836         uint64_t        rx_discard_packets_cos4;
15837         /* Total number of rx discard packets count on cos queue 5 */
15838         uint64_t        rx_discard_packets_cos5;
15839         /* Total number of rx discard packets count on cos queue 6 */
15840         uint64_t        rx_discard_packets_cos6;
15841         /* Total number of rx discard packets count on cos queue 7 */
15842         uint64_t        rx_discard_packets_cos7;
15843 } __attribute__((packed));
15844
15845 /************************
15846  * hwrm_port_qstats_ext *
15847  ************************/
15848
15849
15850 /* hwrm_port_qstats_ext_input (size:320b/40B) */
15851 struct hwrm_port_qstats_ext_input {
15852         /* The HWRM command request type. */
15853         uint16_t        req_type;
15854         /*
15855          * The completion ring to send the completion event on. This should
15856          * be the NQ ID returned from the `nq_alloc` HWRM command.
15857          */
15858         uint16_t        cmpl_ring;
15859         /*
15860          * The sequence ID is used by the driver for tracking multiple
15861          * commands. This ID is treated as opaque data by the firmware and
15862          * the value is returned in the `hwrm_resp_hdr` upon completion.
15863          */
15864         uint16_t        seq_id;
15865         /*
15866          * The target ID of the command:
15867          * * 0x0-0xFFF8 - The function ID
15868          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15869          * * 0xFFFD - Reserved for user-space HWRM interface
15870          * * 0xFFFF - HWRM
15871          */
15872         uint16_t        target_id;
15873         /*
15874          * A physical address pointer pointing to a host buffer that the
15875          * command's response data will be written. This can be either a host
15876          * physical address (HPA) or a guest physical address (GPA) and must
15877          * point to a physically contiguous block of memory.
15878          */
15879         uint64_t        resp_addr;
15880         /* Port ID of port that is being queried. */
15881         uint16_t        port_id;
15882         /*
15883          * The size of TX port extended
15884          * statistics block in bytes.
15885          */
15886         uint16_t        tx_stat_size;
15887         /*
15888          * The size of RX port extended
15889          * statistics block in bytes
15890          */
15891         uint16_t        rx_stat_size;
15892         uint8_t unused_0[2];
15893         /*
15894          * This is the host address where
15895          * Tx port statistics will be stored
15896          */
15897         uint64_t        tx_stat_host_addr;
15898         /*
15899          * This is the host address where
15900          * Rx port statistics will be stored
15901          */
15902         uint64_t        rx_stat_host_addr;
15903 } __attribute__((packed));
15904
15905 /* hwrm_port_qstats_ext_output (size:128b/16B) */
15906 struct hwrm_port_qstats_ext_output {
15907         /* The specific error status for the command. */
15908         uint16_t        error_code;
15909         /* The HWRM command request type. */
15910         uint16_t        req_type;
15911         /* The sequence ID from the original command. */
15912         uint16_t        seq_id;
15913         /* The length of the response data in number of bytes. */
15914         uint16_t        resp_len;
15915         /* The size of TX port statistics block in bytes. */
15916         uint16_t        tx_stat_size;
15917         /* The size of RX port statistics block in bytes. */
15918         uint16_t        rx_stat_size;
15919         /* Total number of active cos queues available. */
15920         uint16_t        total_active_cos_queues;
15921         uint8_t flags;
15922         /*
15923          * If set to 1, then this field indicates that clear
15924          * roce specific counters is supported.
15925          */
15926         #define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED \
15927                 UINT32_C(0x1)
15928         /*
15929          * This field is used in Output records to indicate that the output
15930          * is completely written to RAM.  This field should be read as '1'
15931          * to indicate that the output has been completely written.
15932          * When writing a command completion or response to an internal processor,
15933          * the order of writes has to be such that this field is written last.
15934          */
15935         uint8_t valid;
15936 } __attribute__((packed));
15937
15938 /*************************
15939  * hwrm_port_lpbk_qstats *
15940  *************************/
15941
15942
15943 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */
15944 struct hwrm_port_lpbk_qstats_input {
15945         /* The HWRM command request type. */
15946         uint16_t        req_type;
15947         /*
15948          * The completion ring to send the completion event on. This should
15949          * be the NQ ID returned from the `nq_alloc` HWRM command.
15950          */
15951         uint16_t        cmpl_ring;
15952         /*
15953          * The sequence ID is used by the driver for tracking multiple
15954          * commands. This ID is treated as opaque data by the firmware and
15955          * the value is returned in the `hwrm_resp_hdr` upon completion.
15956          */
15957         uint16_t        seq_id;
15958         /*
15959          * The target ID of the command:
15960          * * 0x0-0xFFF8 - The function ID
15961          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15962          * * 0xFFFD - Reserved for user-space HWRM interface
15963          * * 0xFFFF - HWRM
15964          */
15965         uint16_t        target_id;
15966         /*
15967          * A physical address pointer pointing to a host buffer that the
15968          * command's response data will be written. This can be either a host
15969          * physical address (HPA) or a guest physical address (GPA) and must
15970          * point to a physically contiguous block of memory.
15971          */
15972         uint64_t        resp_addr;
15973 } __attribute__((packed));
15974
15975 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
15976 struct hwrm_port_lpbk_qstats_output {
15977         /* The specific error status for the command. */
15978         uint16_t        error_code;
15979         /* The HWRM command request type. */
15980         uint16_t        req_type;
15981         /* The sequence ID from the original command. */
15982         uint16_t        seq_id;
15983         /* The length of the response data in number of bytes. */
15984         uint16_t        resp_len;
15985         /* Number of transmitted unicast frames */
15986         uint64_t        lpbk_ucast_frames;
15987         /* Number of transmitted multicast frames */
15988         uint64_t        lpbk_mcast_frames;
15989         /* Number of transmitted broadcast frames */
15990         uint64_t        lpbk_bcast_frames;
15991         /* Number of transmitted bytes for unicast traffic */
15992         uint64_t        lpbk_ucast_bytes;
15993         /* Number of transmitted bytes for multicast traffic */
15994         uint64_t        lpbk_mcast_bytes;
15995         /* Number of transmitted bytes for broadcast traffic */
15996         uint64_t        lpbk_bcast_bytes;
15997         /* Total Tx Drops for loopback traffic reported by STATS block */
15998         uint64_t        tx_stat_discard;
15999         /* Total Tx Error Drops for loopback traffic reported by STATS block */
16000         uint64_t        tx_stat_error;
16001         /* Total Rx Drops for loopback traffic reported by STATS block */
16002         uint64_t        rx_stat_discard;
16003         /* Total Rx Error Drops for loopback traffic reported by STATS block */
16004         uint64_t        rx_stat_error;
16005         uint8_t unused_0[7];
16006         /*
16007          * This field is used in Output records to indicate that the output
16008          * is completely written to RAM.  This field should be read as '1'
16009          * to indicate that the output has been completely written.
16010          * When writing a command completion or response to an internal processor,
16011          * the order of writes has to be such that this field is written last.
16012          */
16013         uint8_t valid;
16014 } __attribute__((packed));
16015
16016 /***********************
16017  * hwrm_port_clr_stats *
16018  ***********************/
16019
16020
16021 /* hwrm_port_clr_stats_input (size:192b/24B) */
16022 struct hwrm_port_clr_stats_input {
16023         /* The HWRM command request type. */
16024         uint16_t        req_type;
16025         /*
16026          * The completion ring to send the completion event on. This should
16027          * be the NQ ID returned from the `nq_alloc` HWRM command.
16028          */
16029         uint16_t        cmpl_ring;
16030         /*
16031          * The sequence ID is used by the driver for tracking multiple
16032          * commands. This ID is treated as opaque data by the firmware and
16033          * the value is returned in the `hwrm_resp_hdr` upon completion.
16034          */
16035         uint16_t        seq_id;
16036         /*
16037          * The target ID of the command:
16038          * * 0x0-0xFFF8 - The function ID
16039          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16040          * * 0xFFFD - Reserved for user-space HWRM interface
16041          * * 0xFFFF - HWRM
16042          */
16043         uint16_t        target_id;
16044         /*
16045          * A physical address pointer pointing to a host buffer that the
16046          * command's response data will be written. This can be either a host
16047          * physical address (HPA) or a guest physical address (GPA) and must
16048          * point to a physically contiguous block of memory.
16049          */
16050         uint64_t        resp_addr;
16051         /* Port ID of port that is being queried. */
16052         uint16_t        port_id;
16053         uint8_t flags;
16054         /*
16055          * If set to 1, then this field indicates clear the following RoCE
16056          * specific counters.
16057          * RoCE associated TX/RX cos counters
16058          * CNP associated TX/RX cos counters
16059          * RoCE/CNP specific TX/RX flow counters
16060          * Firmware will determine the RoCE/CNP cos queue based on qos profile.
16061          * This flag is honored only when RoCE is enabled on that port.
16062          */
16063         #define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS     UINT32_C(0x1)
16064         uint8_t unused_0[5];
16065 } __attribute__((packed));
16066
16067 /* hwrm_port_clr_stats_output (size:128b/16B) */
16068 struct hwrm_port_clr_stats_output {
16069         /* The specific error status for the command. */
16070         uint16_t        error_code;
16071         /* The HWRM command request type. */
16072         uint16_t        req_type;
16073         /* The sequence ID from the original command. */
16074         uint16_t        seq_id;
16075         /* The length of the response data in number of bytes. */
16076         uint16_t        resp_len;
16077         uint8_t unused_0[7];
16078         /*
16079          * This field is used in Output records to indicate that the output
16080          * is completely written to RAM.  This field should be read as '1'
16081          * to indicate that the output has been completely written.
16082          * When writing a command completion or response to an internal processor,
16083          * the order of writes has to be such that this field is written last.
16084          */
16085         uint8_t valid;
16086 } __attribute__((packed));
16087
16088 /***********************
16089  * hwrm_port_phy_qcaps *
16090  ***********************/
16091
16092
16093 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
16094 struct hwrm_port_phy_qcaps_input {
16095         /* The HWRM command request type. */
16096         uint16_t        req_type;
16097         /*
16098          * The completion ring to send the completion event on. This should
16099          * be the NQ ID returned from the `nq_alloc` HWRM command.
16100          */
16101         uint16_t        cmpl_ring;
16102         /*
16103          * The sequence ID is used by the driver for tracking multiple
16104          * commands. This ID is treated as opaque data by the firmware and
16105          * the value is returned in the `hwrm_resp_hdr` upon completion.
16106          */
16107         uint16_t        seq_id;
16108         /*
16109          * The target ID of the command:
16110          * * 0x0-0xFFF8 - The function ID
16111          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16112          * * 0xFFFD - Reserved for user-space HWRM interface
16113          * * 0xFFFF - HWRM
16114          */
16115         uint16_t        target_id;
16116         /*
16117          * A physical address pointer pointing to a host buffer that the
16118          * command's response data will be written. This can be either a host
16119          * physical address (HPA) or a guest physical address (GPA) and must
16120          * point to a physically contiguous block of memory.
16121          */
16122         uint64_t        resp_addr;
16123         /* Port ID of port that is being queried. */
16124         uint16_t        port_id;
16125         uint8_t unused_0[6];
16126 } __attribute__((packed));
16127
16128 /* hwrm_port_phy_qcaps_output (size:192b/24B) */
16129 struct hwrm_port_phy_qcaps_output {
16130         /* The specific error status for the command. */
16131         uint16_t        error_code;
16132         /* The HWRM command request type. */
16133         uint16_t        req_type;
16134         /* The sequence ID from the original command. */
16135         uint16_t        seq_id;
16136         /* The length of the response data in number of bytes. */
16137         uint16_t        resp_len;
16138         /* PHY capability flags */
16139         uint8_t flags;
16140         /*
16141          * If set to 1, then this field indicates that the
16142          * link is capable of supporting EEE.
16143          */
16144         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED \
16145                 UINT32_C(0x1)
16146         /*
16147          * If set to 1, then this field indicates that the
16148          * PHY is capable of supporting external loopback.
16149          */
16150         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED \
16151                 UINT32_C(0x2)
16152         /*
16153          * Reserved field. The HWRM shall set this field to 0.
16154          * An HWRM client shall ignore this field.
16155          */
16156         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_MASK \
16157                 UINT32_C(0xfc)
16158         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_SFT                   2
16159         /* Number of front panel ports for this device. */
16160         uint8_t port_cnt;
16161         /* Not supported or unknown */
16162         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
16163         /* single port device */
16164         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1       UINT32_C(0x1)
16165         /* 2-port device */
16166         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2       UINT32_C(0x2)
16167         /* 3-port device */
16168         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3       UINT32_C(0x3)
16169         /* 4-port device */
16170         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4       UINT32_C(0x4)
16171         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST \
16172                 HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4
16173         /*
16174          * This is a bit mask to indicate what speeds are supported
16175          * as forced speeds on this link.
16176          * For each speed that can be forced on this link, the
16177          * corresponding mask bit shall be set to '1'.
16178          */
16179         uint16_t        supported_speeds_force_mode;
16180         /* 100Mb link speed (Half-duplex) */
16181         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD \
16182                 UINT32_C(0x1)
16183         /* 100Mb link speed (Full-duplex) */
16184         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB \
16185                 UINT32_C(0x2)
16186         /* 1Gb link speed (Half-duplex) */
16187         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD \
16188                 UINT32_C(0x4)
16189         /* 1Gb link speed (Full-duplex) */
16190         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB \
16191                 UINT32_C(0x8)
16192         /* 2Gb link speed */
16193         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB \
16194                 UINT32_C(0x10)
16195         /* 25Gb link speed */
16196         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB \
16197                 UINT32_C(0x20)
16198         /* 10Gb link speed */
16199         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB \
16200                 UINT32_C(0x40)
16201         /* 20Gb link speed */
16202         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB \
16203                 UINT32_C(0x80)
16204         /* 25Gb link speed */
16205         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB \
16206                 UINT32_C(0x100)
16207         /* 40Gb link speed */
16208         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB \
16209                 UINT32_C(0x200)
16210         /* 50Gb link speed */
16211         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB \
16212                 UINT32_C(0x400)
16213         /* 100Gb link speed */
16214         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB \
16215                 UINT32_C(0x800)
16216         /* 10Mb link speed (Half-duplex) */
16217         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD \
16218                 UINT32_C(0x1000)
16219         /* 10Mb link speed (Full-duplex) */
16220         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB \
16221                 UINT32_C(0x2000)
16222         /* 200Gb link speed */
16223         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_200GB \
16224                 UINT32_C(0x4000)
16225         /*
16226          * This is a bit mask to indicate what speeds are supported
16227          * for autonegotiation on this link.
16228          * For each speed that can be autonegotiated on this link, the
16229          * corresponding mask bit shall be set to '1'.
16230          */
16231         uint16_t        supported_speeds_auto_mode;
16232         /* 100Mb link speed (Half-duplex) */
16233         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD \
16234                 UINT32_C(0x1)
16235         /* 100Mb link speed (Full-duplex) */
16236         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB \
16237                 UINT32_C(0x2)
16238         /* 1Gb link speed (Half-duplex) */
16239         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD \
16240                 UINT32_C(0x4)
16241         /* 1Gb link speed (Full-duplex) */
16242         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB \
16243                 UINT32_C(0x8)
16244         /* 2Gb link speed */
16245         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB \
16246                 UINT32_C(0x10)
16247         /* 25Gb link speed */
16248         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB \
16249                 UINT32_C(0x20)
16250         /* 10Gb link speed */
16251         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB \
16252                 UINT32_C(0x40)
16253         /* 20Gb link speed */
16254         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB \
16255                 UINT32_C(0x80)
16256         /* 25Gb link speed */
16257         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB \
16258                 UINT32_C(0x100)
16259         /* 40Gb link speed */
16260         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB \
16261                 UINT32_C(0x200)
16262         /* 50Gb link speed */
16263         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB \
16264                 UINT32_C(0x400)
16265         /* 100Gb link speed */
16266         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB \
16267                 UINT32_C(0x800)
16268         /* 10Mb link speed (Half-duplex) */
16269         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD \
16270                 UINT32_C(0x1000)
16271         /* 10Mb link speed (Full-duplex) */
16272         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB \
16273                 UINT32_C(0x2000)
16274         /* 200Gb link speed */
16275         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_200GB \
16276                 UINT32_C(0x4000)
16277         /*
16278          * This is a bit mask to indicate what speeds are supported
16279          * for EEE on this link.
16280          * For each speed that can be autonegotiated when EEE is enabled
16281          * on this link, the corresponding mask bit shall be set to '1'.
16282          * This field is only valid when the eee_suppotred is set to '1'.
16283          */
16284         uint16_t        supported_speeds_eee_mode;
16285         /* Reserved */
16286         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 \
16287                 UINT32_C(0x1)
16288         /* 100Mb link speed (Full-duplex) */
16289         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB \
16290                 UINT32_C(0x2)
16291         /* Reserved */
16292         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 \
16293                 UINT32_C(0x4)
16294         /* 1Gb link speed (Full-duplex) */
16295         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB \
16296                 UINT32_C(0x8)
16297         /* Reserved */
16298         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 \
16299                 UINT32_C(0x10)
16300         /* Reserved */
16301         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 \
16302                 UINT32_C(0x20)
16303         /* 10Gb link speed */
16304         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB \
16305                 UINT32_C(0x40)
16306         uint32_t        tx_lpi_timer_low;
16307         /*
16308          * The lowest value of TX LPI timer that can be set on this link
16309          * when EEE is enabled. This value is in microseconds.
16310          * This field is valid only when_eee_supported is set to '1'.
16311          */
16312         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK \
16313                 UINT32_C(0xffffff)
16314         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
16315         /*
16316          * Reserved field. The HWRM shall set this field to 0.
16317          * An HWRM client shall ignore this field.
16318          */
16319         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK \
16320                 UINT32_C(0xff000000)
16321         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT            24
16322         uint32_t        valid_tx_lpi_timer_high;
16323         /*
16324          * The highest value of TX LPI timer that can be set on this link
16325          * when EEE is enabled. This value is in microseconds.
16326          * This field is valid only when_eee_supported is set to '1'.
16327          */
16328         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK \
16329                 UINT32_C(0xffffff)
16330         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
16331         /*
16332          * This field is used in Output records to indicate that the output
16333          * is completely written to RAM.  This field should be read as '1'
16334          * to indicate that the output has been completely written.
16335          * When writing a command completion or response to an internal processor,
16336          * the order of writes has to be such that this field is written last.
16337          */
16338         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_MASK \
16339                 UINT32_C(0xff000000)
16340         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_SFT             24
16341 } __attribute__((packed));
16342
16343 /****************************
16344  * hwrm_port_phy_mdio_write *
16345  ****************************/
16346
16347
16348 /* hwrm_port_phy_mdio_write_input (size:320b/40B) */
16349 struct hwrm_port_phy_mdio_write_input {
16350         /* The HWRM command request type. */
16351         uint16_t        req_type;
16352         /*
16353          * The completion ring to send the completion event on. This should
16354          * be the NQ ID returned from the `nq_alloc` HWRM command.
16355          */
16356         uint16_t        cmpl_ring;
16357         /*
16358          * The sequence ID is used by the driver for tracking multiple
16359          * commands. This ID is treated as opaque data by the firmware and
16360          * the value is returned in the `hwrm_resp_hdr` upon completion.
16361          */
16362         uint16_t        seq_id;
16363         /*
16364          * The target ID of the command:
16365          * * 0x0-0xFFF8 - The function ID
16366          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16367          * * 0xFFFD - Reserved for user-space HWRM interface
16368          * * 0xFFFF - HWRM
16369          */
16370         uint16_t        target_id;
16371         /*
16372          * A physical address pointer pointing to a host buffer that the
16373          * command's response data will be written. This can be either a host
16374          * physical address (HPA) or a guest physical address (GPA) and must
16375          * point to a physically contiguous block of memory.
16376          */
16377         uint64_t        resp_addr;
16378         /* Reserved for future use. */
16379         uint32_t        unused_0[2];
16380         /* Port ID of port. */
16381         uint16_t        port_id;
16382         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
16383         uint8_t phy_addr;
16384         /* 8-bit device address. */
16385         uint8_t dev_addr;
16386         /* 16-bit register address. */
16387         uint16_t        reg_addr;
16388         /* 16-bit register data. */
16389         uint16_t        reg_data;
16390         /*
16391          * When this bit is set to 1 a Clause 45 mdio access is done.
16392          * when this bit is set to 0 a Clause 22 mdio access is done.
16393          */
16394         uint8_t cl45_mdio;
16395         /*  */
16396         uint8_t unused_1[7];
16397 } __attribute__((packed));
16398
16399 /* hwrm_port_phy_mdio_write_output (size:128b/16B) */
16400 struct hwrm_port_phy_mdio_write_output {
16401         /* The specific error status for the command. */
16402         uint16_t        error_code;
16403         /* The HWRM command request type. */
16404         uint16_t        req_type;
16405         /* The sequence ID from the original command. */
16406         uint16_t        seq_id;
16407         /* The length of the response data in number of bytes. */
16408         uint16_t        resp_len;
16409         uint8_t unused_0[7];
16410         /*
16411          * This field is used in Output records to indicate that the output
16412          * is completely written to RAM.  This field should be read as '1'
16413          * to indicate that the output has been completely written.
16414          * When writing a command completion or response to an internal processor,
16415          * the order of writes has to be such that this field is written last.
16416          */
16417         uint8_t valid;
16418 } __attribute__((packed));
16419
16420 /***************************
16421  * hwrm_port_phy_mdio_read *
16422  ***************************/
16423
16424
16425 /* hwrm_port_phy_mdio_read_input (size:256b/32B) */
16426 struct hwrm_port_phy_mdio_read_input {
16427         /* The HWRM command request type. */
16428         uint16_t        req_type;
16429         /*
16430          * The completion ring to send the completion event on. This should
16431          * be the NQ ID returned from the `nq_alloc` HWRM command.
16432          */
16433         uint16_t        cmpl_ring;
16434         /*
16435          * The sequence ID is used by the driver for tracking multiple
16436          * commands. This ID is treated as opaque data by the firmware and
16437          * the value is returned in the `hwrm_resp_hdr` upon completion.
16438          */
16439         uint16_t        seq_id;
16440         /*
16441          * The target ID of the command:
16442          * * 0x0-0xFFF8 - The function ID
16443          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16444          * * 0xFFFD - Reserved for user-space HWRM interface
16445          * * 0xFFFF - HWRM
16446          */
16447         uint16_t        target_id;
16448         /*
16449          * A physical address pointer pointing to a host buffer that the
16450          * command's response data will be written. This can be either a host
16451          * physical address (HPA) or a guest physical address (GPA) and must
16452          * point to a physically contiguous block of memory.
16453          */
16454         uint64_t        resp_addr;
16455         /* Reserved for future use. */
16456         uint32_t        unused_0[2];
16457         /* Port ID of port. */
16458         uint16_t        port_id;
16459         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
16460         uint8_t phy_addr;
16461         /* 8-bit device address. */
16462         uint8_t dev_addr;
16463         /* 16-bit register address. */
16464         uint16_t        reg_addr;
16465         /*
16466          * When this bit is set to 1 a Clause 45 mdio access is done.
16467          * when this bit is set to 0 a Clause 22 mdio access is done.
16468          */
16469         uint8_t cl45_mdio;
16470         /*  */
16471         uint8_t unused_1;
16472 } __attribute__((packed));
16473
16474 /* hwrm_port_phy_mdio_read_output (size:128b/16B) */
16475 struct hwrm_port_phy_mdio_read_output {
16476         /* The specific error status for the command. */
16477         uint16_t        error_code;
16478         /* The HWRM command request type. */
16479         uint16_t        req_type;
16480         /* The sequence ID from the original command. */
16481         uint16_t        seq_id;
16482         /* The length of the response data in number of bytes. */
16483         uint16_t        resp_len;
16484         /* 16-bit register data. */
16485         uint16_t        reg_data;
16486         uint8_t unused_0[5];
16487         /*
16488          * This field is used in Output records to indicate that the output
16489          * is completely written to RAM.  This field should be read as '1'
16490          * to indicate that the output has been completely written.
16491          * When writing a command completion or response to an internal processor,
16492          * the order of writes has to be such that this field is written last.
16493          */
16494         uint8_t valid;
16495 } __attribute__((packed));
16496
16497 /*********************
16498  * hwrm_port_led_cfg *
16499  *********************/
16500
16501
16502 /* hwrm_port_led_cfg_input (size:512b/64B) */
16503 struct hwrm_port_led_cfg_input {
16504         /* The HWRM command request type. */
16505         uint16_t        req_type;
16506         /*
16507          * The completion ring to send the completion event on. This should
16508          * be the NQ ID returned from the `nq_alloc` HWRM command.
16509          */
16510         uint16_t        cmpl_ring;
16511         /*
16512          * The sequence ID is used by the driver for tracking multiple
16513          * commands. This ID is treated as opaque data by the firmware and
16514          * the value is returned in the `hwrm_resp_hdr` upon completion.
16515          */
16516         uint16_t        seq_id;
16517         /*
16518          * The target ID of the command:
16519          * * 0x0-0xFFF8 - The function ID
16520          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16521          * * 0xFFFD - Reserved for user-space HWRM interface
16522          * * 0xFFFF - HWRM
16523          */
16524         uint16_t        target_id;
16525         /*
16526          * A physical address pointer pointing to a host buffer that the
16527          * command's response data will be written. This can be either a host
16528          * physical address (HPA) or a guest physical address (GPA) and must
16529          * point to a physically contiguous block of memory.
16530          */
16531         uint64_t        resp_addr;
16532         uint32_t        enables;
16533         /*
16534          * This bit must be '1' for the led0_id field to be
16535          * configured.
16536          */
16537         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID \
16538                 UINT32_C(0x1)
16539         /*
16540          * This bit must be '1' for the led0_state field to be
16541          * configured.
16542          */
16543         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE \
16544                 UINT32_C(0x2)
16545         /*
16546          * This bit must be '1' for the led0_color field to be
16547          * configured.
16548          */
16549         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR \
16550                 UINT32_C(0x4)
16551         /*
16552          * This bit must be '1' for the led0_blink_on field to be
16553          * configured.
16554          */
16555         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON \
16556                 UINT32_C(0x8)
16557         /*
16558          * This bit must be '1' for the led0_blink_off field to be
16559          * configured.
16560          */
16561         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF \
16562                 UINT32_C(0x10)
16563         /*
16564          * This bit must be '1' for the led0_group_id field to be
16565          * configured.
16566          */
16567         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID \
16568                 UINT32_C(0x20)
16569         /*
16570          * This bit must be '1' for the led1_id field to be
16571          * configured.
16572          */
16573         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID \
16574                 UINT32_C(0x40)
16575         /*
16576          * This bit must be '1' for the led1_state field to be
16577          * configured.
16578          */
16579         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE \
16580                 UINT32_C(0x80)
16581         /*
16582          * This bit must be '1' for the led1_color field to be
16583          * configured.
16584          */
16585         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR \
16586                 UINT32_C(0x100)
16587         /*
16588          * This bit must be '1' for the led1_blink_on field to be
16589          * configured.
16590          */
16591         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON \
16592                 UINT32_C(0x200)
16593         /*
16594          * This bit must be '1' for the led1_blink_off field to be
16595          * configured.
16596          */
16597         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF \
16598                 UINT32_C(0x400)
16599         /*
16600          * This bit must be '1' for the led1_group_id field to be
16601          * configured.
16602          */
16603         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID \
16604                 UINT32_C(0x800)
16605         /*
16606          * This bit must be '1' for the led2_id field to be
16607          * configured.
16608          */
16609         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID \
16610                 UINT32_C(0x1000)
16611         /*
16612          * This bit must be '1' for the led2_state field to be
16613          * configured.
16614          */
16615         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE \
16616                 UINT32_C(0x2000)
16617         /*
16618          * This bit must be '1' for the led2_color field to be
16619          * configured.
16620          */
16621         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR \
16622                 UINT32_C(0x4000)
16623         /*
16624          * This bit must be '1' for the led2_blink_on field to be
16625          * configured.
16626          */
16627         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON \
16628                 UINT32_C(0x8000)
16629         /*
16630          * This bit must be '1' for the led2_blink_off field to be
16631          * configured.
16632          */
16633         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF \
16634                 UINT32_C(0x10000)
16635         /*
16636          * This bit must be '1' for the led2_group_id field to be
16637          * configured.
16638          */
16639         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID \
16640                 UINT32_C(0x20000)
16641         /*
16642          * This bit must be '1' for the led3_id field to be
16643          * configured.
16644          */
16645         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID \
16646                 UINT32_C(0x40000)
16647         /*
16648          * This bit must be '1' for the led3_state field to be
16649          * configured.
16650          */
16651         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE \
16652                 UINT32_C(0x80000)
16653         /*
16654          * This bit must be '1' for the led3_color field to be
16655          * configured.
16656          */
16657         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR \
16658                 UINT32_C(0x100000)
16659         /*
16660          * This bit must be '1' for the led3_blink_on field to be
16661          * configured.
16662          */
16663         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON \
16664                 UINT32_C(0x200000)
16665         /*
16666          * This bit must be '1' for the led3_blink_off field to be
16667          * configured.
16668          */
16669         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \
16670                 UINT32_C(0x400000)
16671         /*
16672          * This bit must be '1' for the led3_group_id field to be
16673          * configured.
16674          */
16675         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID \
16676                 UINT32_C(0x800000)
16677         /* Port ID of port whose LEDs are configured. */
16678         uint16_t        port_id;
16679         /*
16680          * The number of LEDs that are being configured.
16681          * Up to 4 LEDs can be configured with this command.
16682          */
16683         uint8_t num_leds;
16684         /* Reserved field. */
16685         uint8_t rsvd;
16686         /* An identifier for the LED #0. */
16687         uint8_t led0_id;
16688         /* The requested state of the LED #0. */
16689         uint8_t led0_state;
16690         /* Default state of the LED */
16691         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
16692         /* Off */
16693         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF      UINT32_C(0x1)
16694         /* On */
16695         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON       UINT32_C(0x2)
16696         /* Blink */
16697         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK    UINT32_C(0x3)
16698         /* Blink Alternately */
16699         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
16700         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST \
16701                 HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
16702         /* The requested color of LED #0. */
16703         uint8_t led0_color;
16704         /* Default */
16705         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
16706         /* Amber */
16707         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
16708         /* Green */
16709         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
16710         /* Green or Amber */
16711         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
16712         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST \
16713                 HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
16714         uint8_t unused_0;
16715         /*
16716          * If the LED #0 state is "blink" or "blinkalt", then
16717          * this field represents the requested time in milliseconds
16718          * to keep LED on between cycles.
16719          */
16720         uint16_t        led0_blink_on;
16721         /*
16722          * If the LED #0 state is "blink" or "blinkalt", then
16723          * this field represents the requested time in milliseconds
16724          * to keep LED off between cycles.
16725          */
16726         uint16_t        led0_blink_off;
16727         /*
16728          * An identifier for the group of LEDs that LED #0 belongs
16729          * to.
16730          * If set to 0, then the LED #0 shall not be grouped and
16731          * shall be treated as an individual resource.
16732          * For all other non-zero values of this field, LED #0 shall
16733          * be grouped together with the LEDs with the same group ID
16734          * value.
16735          */
16736         uint8_t led0_group_id;
16737         /* Reserved field. */
16738         uint8_t rsvd0;
16739         /* An identifier for the LED #1. */
16740         uint8_t led1_id;
16741         /* The requested state of the LED #1. */
16742         uint8_t led1_state;
16743         /* Default state of the LED */
16744         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
16745         /* Off */
16746         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF      UINT32_C(0x1)
16747         /* On */
16748         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON       UINT32_C(0x2)
16749         /* Blink */
16750         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK    UINT32_C(0x3)
16751         /* Blink Alternately */
16752         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
16753         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST \
16754                 HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
16755         /* The requested color of LED #1. */
16756         uint8_t led1_color;
16757         /* Default */
16758         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
16759         /* Amber */
16760         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
16761         /* Green */
16762         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
16763         /* Green or Amber */
16764         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
16765         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST \
16766                 HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
16767         uint8_t unused_1;
16768         /*
16769          * If the LED #1 state is "blink" or "blinkalt", then
16770          * this field represents the requested time in milliseconds
16771          * to keep LED on between cycles.
16772          */
16773         uint16_t        led1_blink_on;
16774         /*
16775          * If the LED #1 state is "blink" or "blinkalt", then
16776          * this field represents the requested time in milliseconds
16777          * to keep LED off between cycles.
16778          */
16779         uint16_t        led1_blink_off;
16780         /*
16781          * An identifier for the group of LEDs that LED #1 belongs
16782          * to.
16783          * If set to 0, then the LED #1 shall not be grouped and
16784          * shall be treated as an individual resource.
16785          * For all other non-zero values of this field, LED #1 shall
16786          * be grouped together with the LEDs with the same group ID
16787          * value.
16788          */
16789         uint8_t led1_group_id;
16790         /* Reserved field. */
16791         uint8_t rsvd1;
16792         /* An identifier for the LED #2. */
16793         uint8_t led2_id;
16794         /* The requested state of the LED #2. */
16795         uint8_t led2_state;
16796         /* Default state of the LED */
16797         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
16798         /* Off */
16799         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF      UINT32_C(0x1)
16800         /* On */
16801         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON       UINT32_C(0x2)
16802         /* Blink */
16803         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK    UINT32_C(0x3)
16804         /* Blink Alternately */
16805         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
16806         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST \
16807                 HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
16808         /* The requested color of LED #2. */
16809         uint8_t led2_color;
16810         /* Default */
16811         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
16812         /* Amber */
16813         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
16814         /* Green */
16815         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
16816         /* Green or Amber */
16817         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
16818         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST \
16819                 HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
16820         uint8_t unused_2;
16821         /*
16822          * If the LED #2 state is "blink" or "blinkalt", then
16823          * this field represents the requested time in milliseconds
16824          * to keep LED on between cycles.
16825          */
16826         uint16_t        led2_blink_on;
16827         /*
16828          * If the LED #2 state is "blink" or "blinkalt", then
16829          * this field represents the requested time in milliseconds
16830          * to keep LED off between cycles.
16831          */
16832         uint16_t        led2_blink_off;
16833         /*
16834          * An identifier for the group of LEDs that LED #2 belongs
16835          * to.
16836          * If set to 0, then the LED #2 shall not be grouped and
16837          * shall be treated as an individual resource.
16838          * For all other non-zero values of this field, LED #2 shall
16839          * be grouped together with the LEDs with the same group ID
16840          * value.
16841          */
16842         uint8_t led2_group_id;
16843         /* Reserved field. */
16844         uint8_t rsvd2;
16845         /* An identifier for the LED #3. */
16846         uint8_t led3_id;
16847         /* The requested state of the LED #3. */
16848         uint8_t led3_state;
16849         /* Default state of the LED */
16850         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
16851         /* Off */
16852         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF      UINT32_C(0x1)
16853         /* On */
16854         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON       UINT32_C(0x2)
16855         /* Blink */
16856         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK    UINT32_C(0x3)
16857         /* Blink Alternately */
16858         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
16859         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST \
16860                 HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
16861         /* The requested color of LED #3. */
16862         uint8_t led3_color;
16863         /* Default */
16864         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
16865         /* Amber */
16866         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
16867         /* Green */
16868         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
16869         /* Green or Amber */
16870         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
16871         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST \
16872                 HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
16873         uint8_t unused_3;
16874         /*
16875          * If the LED #3 state is "blink" or "blinkalt", then
16876          * this field represents the requested time in milliseconds
16877          * to keep LED on between cycles.
16878          */
16879         uint16_t        led3_blink_on;
16880         /*
16881          * If the LED #3 state is "blink" or "blinkalt", then
16882          * this field represents the requested time in milliseconds
16883          * to keep LED off between cycles.
16884          */
16885         uint16_t        led3_blink_off;
16886         /*
16887          * An identifier for the group of LEDs that LED #3 belongs
16888          * to.
16889          * If set to 0, then the LED #3 shall not be grouped and
16890          * shall be treated as an individual resource.
16891          * For all other non-zero values of this field, LED #3 shall
16892          * be grouped together with the LEDs with the same group ID
16893          * value.
16894          */
16895         uint8_t led3_group_id;
16896         /* Reserved field. */
16897         uint8_t rsvd3;
16898 } __attribute__((packed));
16899
16900 /* hwrm_port_led_cfg_output (size:128b/16B) */
16901 struct hwrm_port_led_cfg_output {
16902         /* The specific error status for the command. */
16903         uint16_t        error_code;
16904         /* The HWRM command request type. */
16905         uint16_t        req_type;
16906         /* The sequence ID from the original command. */
16907         uint16_t        seq_id;
16908         /* The length of the response data in number of bytes. */
16909         uint16_t        resp_len;
16910         uint8_t unused_0[7];
16911         /*
16912          * This field is used in Output records to indicate that the output
16913          * is completely written to RAM.  This field should be read as '1'
16914          * to indicate that the output has been completely written.
16915          * When writing a command completion or response to an internal processor,
16916          * the order of writes has to be such that this field is written last.
16917          */
16918         uint8_t valid;
16919 } __attribute__((packed));
16920
16921 /**********************
16922  * hwrm_port_led_qcfg *
16923  **********************/
16924
16925
16926 /* hwrm_port_led_qcfg_input (size:192b/24B) */
16927 struct hwrm_port_led_qcfg_input {
16928         /* The HWRM command request type. */
16929         uint16_t        req_type;
16930         /*
16931          * The completion ring to send the completion event on. This should
16932          * be the NQ ID returned from the `nq_alloc` HWRM command.
16933          */
16934         uint16_t        cmpl_ring;
16935         /*
16936          * The sequence ID is used by the driver for tracking multiple
16937          * commands. This ID is treated as opaque data by the firmware and
16938          * the value is returned in the `hwrm_resp_hdr` upon completion.
16939          */
16940         uint16_t        seq_id;
16941         /*
16942          * The target ID of the command:
16943          * * 0x0-0xFFF8 - The function ID
16944          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16945          * * 0xFFFD - Reserved for user-space HWRM interface
16946          * * 0xFFFF - HWRM
16947          */
16948         uint16_t        target_id;
16949         /*
16950          * A physical address pointer pointing to a host buffer that the
16951          * command's response data will be written. This can be either a host
16952          * physical address (HPA) or a guest physical address (GPA) and must
16953          * point to a physically contiguous block of memory.
16954          */
16955         uint64_t        resp_addr;
16956         /* Port ID of port whose LED configuration is being queried. */
16957         uint16_t        port_id;
16958         uint8_t unused_0[6];
16959 } __attribute__((packed));
16960
16961 /* hwrm_port_led_qcfg_output (size:448b/56B) */
16962 struct hwrm_port_led_qcfg_output {
16963         /* The specific error status for the command. */
16964         uint16_t        error_code;
16965         /* The HWRM command request type. */
16966         uint16_t        req_type;
16967         /* The sequence ID from the original command. */
16968         uint16_t        seq_id;
16969         /* The length of the response data in number of bytes. */
16970         uint16_t        resp_len;
16971         /*
16972          * The number of LEDs that are configured on this port.
16973          * Up to 4 LEDs can be returned in the response.
16974          */
16975         uint8_t num_leds;
16976         /* An identifier for the LED #0. */
16977         uint8_t led0_id;
16978         /* The type of LED #0. */
16979         uint8_t led0_type;
16980         /* Speed LED */
16981         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
16982         /* Activity LED */
16983         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
16984         /* Invalid */
16985         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
16986         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST \
16987                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
16988         /* The current state of the LED #0. */
16989         uint8_t led0_state;
16990         /* Default state of the LED */
16991         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
16992         /* Off */
16993         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF      UINT32_C(0x1)
16994         /* On */
16995         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON       UINT32_C(0x2)
16996         /* Blink */
16997         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK    UINT32_C(0x3)
16998         /* Blink Alternately */
16999         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
17000         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST \
17001                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
17002         /* The color of LED #0. */
17003         uint8_t led0_color;
17004         /* Default */
17005         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
17006         /* Amber */
17007         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
17008         /* Green */
17009         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
17010         /* Green or Amber */
17011         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
17012         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST \
17013                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
17014         uint8_t unused_0;
17015         /*
17016          * If the LED #0 state is "blink" or "blinkalt", then
17017          * this field represents the requested time in milliseconds
17018          * to keep LED on between cycles.
17019          */
17020         uint16_t        led0_blink_on;
17021         /*
17022          * If the LED #0 state is "blink" or "blinkalt", then
17023          * this field represents the requested time in milliseconds
17024          * to keep LED off between cycles.
17025          */
17026         uint16_t        led0_blink_off;
17027         /*
17028          * An identifier for the group of LEDs that LED #0 belongs
17029          * to.
17030          * If set to 0, then the LED #0 is not grouped.
17031          * For all other non-zero values of this field, LED #0 is
17032          * grouped together with the LEDs with the same group ID
17033          * value.
17034          */
17035         uint8_t led0_group_id;
17036         /* An identifier for the LED #1. */
17037         uint8_t led1_id;
17038         /* The type of LED #1. */
17039         uint8_t led1_type;
17040         /* Speed LED */
17041         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
17042         /* Activity LED */
17043         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
17044         /* Invalid */
17045         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
17046         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST \
17047                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
17048         /* The current state of the LED #1. */
17049         uint8_t led1_state;
17050         /* Default state of the LED */
17051         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
17052         /* Off */
17053         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF      UINT32_C(0x1)
17054         /* On */
17055         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON       UINT32_C(0x2)
17056         /* Blink */
17057         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK    UINT32_C(0x3)
17058         /* Blink Alternately */
17059         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
17060         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST \
17061                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
17062         /* The color of LED #1. */
17063         uint8_t led1_color;
17064         /* Default */
17065         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
17066         /* Amber */
17067         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
17068         /* Green */
17069         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
17070         /* Green or Amber */
17071         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
17072         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST \
17073                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
17074         uint8_t unused_1;
17075         /*
17076          * If the LED #1 state is "blink" or "blinkalt", then
17077          * this field represents the requested time in milliseconds
17078          * to keep LED on between cycles.
17079          */
17080         uint16_t        led1_blink_on;
17081         /*
17082          * If the LED #1 state is "blink" or "blinkalt", then
17083          * this field represents the requested time in milliseconds
17084          * to keep LED off between cycles.
17085          */
17086         uint16_t        led1_blink_off;
17087         /*
17088          * An identifier for the group of LEDs that LED #1 belongs
17089          * to.
17090          * If set to 0, then the LED #1 is not grouped.
17091          * For all other non-zero values of this field, LED #1 is
17092          * grouped together with the LEDs with the same group ID
17093          * value.
17094          */
17095         uint8_t led1_group_id;
17096         /* An identifier for the LED #2. */
17097         uint8_t led2_id;
17098         /* The type of LED #2. */
17099         uint8_t led2_type;
17100         /* Speed LED */
17101         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
17102         /* Activity LED */
17103         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
17104         /* Invalid */
17105         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
17106         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST \
17107                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
17108         /* The current state of the LED #2. */
17109         uint8_t led2_state;
17110         /* Default state of the LED */
17111         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
17112         /* Off */
17113         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF      UINT32_C(0x1)
17114         /* On */
17115         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON       UINT32_C(0x2)
17116         /* Blink */
17117         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK    UINT32_C(0x3)
17118         /* Blink Alternately */
17119         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
17120         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST \
17121                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
17122         /* The color of LED #2. */
17123         uint8_t led2_color;
17124         /* Default */
17125         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
17126         /* Amber */
17127         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
17128         /* Green */
17129         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
17130         /* Green or Amber */
17131         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
17132         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST \
17133                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
17134         uint8_t unused_2;
17135         /*
17136          * If the LED #2 state is "blink" or "blinkalt", then
17137          * this field represents the requested time in milliseconds
17138          * to keep LED on between cycles.
17139          */
17140         uint16_t        led2_blink_on;
17141         /*
17142          * If the LED #2 state is "blink" or "blinkalt", then
17143          * this field represents the requested time in milliseconds
17144          * to keep LED off between cycles.
17145          */
17146         uint16_t        led2_blink_off;
17147         /*
17148          * An identifier for the group of LEDs that LED #2 belongs
17149          * to.
17150          * If set to 0, then the LED #2 is not grouped.
17151          * For all other non-zero values of this field, LED #2 is
17152          * grouped together with the LEDs with the same group ID
17153          * value.
17154          */
17155         uint8_t led2_group_id;
17156         /* An identifier for the LED #3. */
17157         uint8_t led3_id;
17158         /* The type of LED #3. */
17159         uint8_t led3_type;
17160         /* Speed LED */
17161         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
17162         /* Activity LED */
17163         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
17164         /* Invalid */
17165         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
17166         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST \
17167                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
17168         /* The current state of the LED #3. */
17169         uint8_t led3_state;
17170         /* Default state of the LED */
17171         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
17172         /* Off */
17173         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF      UINT32_C(0x1)
17174         /* On */
17175         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON       UINT32_C(0x2)
17176         /* Blink */
17177         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK    UINT32_C(0x3)
17178         /* Blink Alternately */
17179         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
17180         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST \
17181                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
17182         /* The color of LED #3. */
17183         uint8_t led3_color;
17184         /* Default */
17185         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
17186         /* Amber */
17187         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
17188         /* Green */
17189         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
17190         /* Green or Amber */
17191         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
17192         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST \
17193                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
17194         uint8_t unused_3;
17195         /*
17196          * If the LED #3 state is "blink" or "blinkalt", then
17197          * this field represents the requested time in milliseconds
17198          * to keep LED on between cycles.
17199          */
17200         uint16_t        led3_blink_on;
17201         /*
17202          * If the LED #3 state is "blink" or "blinkalt", then
17203          * this field represents the requested time in milliseconds
17204          * to keep LED off between cycles.
17205          */
17206         uint16_t        led3_blink_off;
17207         /*
17208          * An identifier for the group of LEDs that LED #3 belongs
17209          * to.
17210          * If set to 0, then the LED #3 is not grouped.
17211          * For all other non-zero values of this field, LED #3 is
17212          * grouped together with the LEDs with the same group ID
17213          * value.
17214          */
17215         uint8_t led3_group_id;
17216         uint8_t unused_4[6];
17217         /*
17218          * This field is used in Output records to indicate that the output
17219          * is completely written to RAM.  This field should be read as '1'
17220          * to indicate that the output has been completely written.
17221          * When writing a command completion or response to an internal processor,
17222          * the order of writes has to be such that this field is written last.
17223          */
17224         uint8_t valid;
17225 } __attribute__((packed));
17226
17227 /***********************
17228  * hwrm_port_led_qcaps *
17229  ***********************/
17230
17231
17232 /* hwrm_port_led_qcaps_input (size:192b/24B) */
17233 struct hwrm_port_led_qcaps_input {
17234         /* The HWRM command request type. */
17235         uint16_t        req_type;
17236         /*
17237          * The completion ring to send the completion event on. This should
17238          * be the NQ ID returned from the `nq_alloc` HWRM command.
17239          */
17240         uint16_t        cmpl_ring;
17241         /*
17242          * The sequence ID is used by the driver for tracking multiple
17243          * commands. This ID is treated as opaque data by the firmware and
17244          * the value is returned in the `hwrm_resp_hdr` upon completion.
17245          */
17246         uint16_t        seq_id;
17247         /*
17248          * The target ID of the command:
17249          * * 0x0-0xFFF8 - The function ID
17250          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17251          * * 0xFFFD - Reserved for user-space HWRM interface
17252          * * 0xFFFF - HWRM
17253          */
17254         uint16_t        target_id;
17255         /*
17256          * A physical address pointer pointing to a host buffer that the
17257          * command's response data will be written. This can be either a host
17258          * physical address (HPA) or a guest physical address (GPA) and must
17259          * point to a physically contiguous block of memory.
17260          */
17261         uint64_t        resp_addr;
17262         /* Port ID of port whose LED configuration is being queried. */
17263         uint16_t        port_id;
17264         uint8_t unused_0[6];
17265 } __attribute__((packed));
17266
17267 /* hwrm_port_led_qcaps_output (size:384b/48B) */
17268 struct hwrm_port_led_qcaps_output {
17269         /* The specific error status for the command. */
17270         uint16_t        error_code;
17271         /* The HWRM command request type. */
17272         uint16_t        req_type;
17273         /* The sequence ID from the original command. */
17274         uint16_t        seq_id;
17275         /* The length of the response data in number of bytes. */
17276         uint16_t        resp_len;
17277         /*
17278          * The number of LEDs that are configured on this port.
17279          * Up to 4 LEDs can be returned in the response.
17280          */
17281         uint8_t num_leds;
17282         /* Reserved for future use. */
17283         uint8_t unused[3];
17284         /* An identifier for the LED #0. */
17285         uint8_t led0_id;
17286         /* The type of LED #0. */
17287         uint8_t led0_type;
17288         /* Speed LED */
17289         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
17290         /* Activity LED */
17291         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
17292         /* Invalid */
17293         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
17294         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST \
17295                 HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
17296         /*
17297          * An identifier for the group of LEDs that LED #0 belongs
17298          * to.
17299          * If set to 0, then the LED #0 cannot be grouped.
17300          * For all other non-zero values of this field, LED #0 is
17301          * grouped together with the LEDs with the same group ID
17302          * value.
17303          */
17304         uint8_t led0_group_id;
17305         uint8_t unused_0;
17306         /* The states supported by LED #0. */
17307         uint16_t        led0_state_caps;
17308         /*
17309          * If set to 1, this LED is enabled.
17310          * If set to 0, this LED is disabled.
17311          */
17312         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED \
17313                 UINT32_C(0x1)
17314         /*
17315          * If set to 1, off state is supported on this LED.
17316          * If set to 0, off state is not supported on this LED.
17317          */
17318         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \
17319                 UINT32_C(0x2)
17320         /*
17321          * If set to 1, on state is supported on this LED.
17322          * If set to 0, on state is not supported on this LED.
17323          */
17324         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \
17325                 UINT32_C(0x4)
17326         /*
17327          * If set to 1, blink state is supported on this LED.
17328          * If set to 0, blink state is not supported on this LED.
17329          */
17330         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \
17331                 UINT32_C(0x8)
17332         /*
17333          * If set to 1, blink_alt state is supported on this LED.
17334          * If set to 0, blink_alt state is not supported on this LED.
17335          */
17336         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \
17337                 UINT32_C(0x10)
17338         /* The colors supported by LED #0. */
17339         uint16_t        led0_color_caps;
17340         /* reserved. */
17341         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD \
17342                 UINT32_C(0x1)
17343         /*
17344          * If set to 1, Amber color is supported on this LED.
17345          * If set to 0, Amber color is not supported on this LED.
17346          */
17347         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \
17348                 UINT32_C(0x2)
17349         /*
17350          * If set to 1, Green color is supported on this LED.
17351          * If set to 0, Green color is not supported on this LED.
17352          */
17353         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \
17354                 UINT32_C(0x4)
17355         /* An identifier for the LED #1. */
17356         uint8_t led1_id;
17357         /* The type of LED #1. */
17358         uint8_t led1_type;
17359         /* Speed LED */
17360         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
17361         /* Activity LED */
17362         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
17363         /* Invalid */
17364         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
17365         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST \
17366                 HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
17367         /*
17368          * An identifier for the group of LEDs that LED #1 belongs
17369          * to.
17370          * If set to 0, then the LED #0 cannot be grouped.
17371          * For all other non-zero values of this field, LED #0 is
17372          * grouped together with the LEDs with the same group ID
17373          * value.
17374          */
17375         uint8_t led1_group_id;
17376         uint8_t unused_1;
17377         /* The states supported by LED #1. */
17378         uint16_t        led1_state_caps;
17379         /*
17380          * If set to 1, this LED is enabled.
17381          * If set to 0, this LED is disabled.
17382          */
17383         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED \
17384                 UINT32_C(0x1)
17385         /*
17386          * If set to 1, off state is supported on this LED.
17387          * If set to 0, off state is not supported on this LED.
17388          */
17389         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \
17390                 UINT32_C(0x2)
17391         /*
17392          * If set to 1, on state is supported on this LED.
17393          * If set to 0, on state is not supported on this LED.
17394          */
17395         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \
17396                 UINT32_C(0x4)
17397         /*
17398          * If set to 1, blink state is supported on this LED.
17399          * If set to 0, blink state is not supported on this LED.
17400          */
17401         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \
17402                 UINT32_C(0x8)
17403         /*
17404          * If set to 1, blink_alt state is supported on this LED.
17405          * If set to 0, blink_alt state is not supported on this LED.
17406          */
17407         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \
17408                 UINT32_C(0x10)
17409         /* The colors supported by LED #1. */
17410         uint16_t        led1_color_caps;
17411         /* reserved. */
17412         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD \
17413                 UINT32_C(0x1)
17414         /*
17415          * If set to 1, Amber color is supported on this LED.
17416          * If set to 0, Amber color is not supported on this LED.
17417          */
17418         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \
17419                 UINT32_C(0x2)
17420         /*
17421          * If set to 1, Green color is supported on this LED.
17422          * If set to 0, Green color is not supported on this LED.
17423          */
17424         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \
17425                 UINT32_C(0x4)
17426         /* An identifier for the LED #2. */
17427         uint8_t led2_id;
17428         /* The type of LED #2. */
17429         uint8_t led2_type;
17430         /* Speed LED */
17431         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
17432         /* Activity LED */
17433         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
17434         /* Invalid */
17435         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
17436         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST \
17437                 HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
17438         /*
17439          * An identifier for the group of LEDs that LED #0 belongs
17440          * to.
17441          * If set to 0, then the LED #0 cannot be grouped.
17442          * For all other non-zero values of this field, LED #0 is
17443          * grouped together with the LEDs with the same group ID
17444          * value.
17445          */
17446         uint8_t led2_group_id;
17447         uint8_t unused_2;
17448         /* The states supported by LED #2. */
17449         uint16_t        led2_state_caps;
17450         /*
17451          * If set to 1, this LED is enabled.
17452          * If set to 0, this LED is disabled.
17453          */
17454         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED \
17455                 UINT32_C(0x1)
17456         /*
17457          * If set to 1, off state is supported on this LED.
17458          * If set to 0, off state is not supported on this LED.
17459          */
17460         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \
17461                 UINT32_C(0x2)
17462         /*
17463          * If set to 1, on state is supported on this LED.
17464          * If set to 0, on state is not supported on this LED.
17465          */
17466         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \
17467                 UINT32_C(0x4)
17468         /*
17469          * If set to 1, blink state is supported on this LED.
17470          * If set to 0, blink state is not supported on this LED.
17471          */
17472         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \
17473                 UINT32_C(0x8)
17474         /*
17475          * If set to 1, blink_alt state is supported on this LED.
17476          * If set to 0, blink_alt state is not supported on this LED.
17477          */
17478         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \
17479                 UINT32_C(0x10)
17480         /* The colors supported by LED #2. */
17481         uint16_t        led2_color_caps;
17482         /* reserved. */
17483         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD \
17484                 UINT32_C(0x1)
17485         /*
17486          * If set to 1, Amber color is supported on this LED.
17487          * If set to 0, Amber color is not supported on this LED.
17488          */
17489         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \
17490                 UINT32_C(0x2)
17491         /*
17492          * If set to 1, Green color is supported on this LED.
17493          * If set to 0, Green color is not supported on this LED.
17494          */
17495         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \
17496                 UINT32_C(0x4)
17497         /* An identifier for the LED #3. */
17498         uint8_t led3_id;
17499         /* The type of LED #3. */
17500         uint8_t led3_type;
17501         /* Speed LED */
17502         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
17503         /* Activity LED */
17504         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
17505         /* Invalid */
17506         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
17507         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST \
17508                 HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
17509         /*
17510          * An identifier for the group of LEDs that LED #3 belongs
17511          * to.
17512          * If set to 0, then the LED #0 cannot be grouped.
17513          * For all other non-zero values of this field, LED #0 is
17514          * grouped together with the LEDs with the same group ID
17515          * value.
17516          */
17517         uint8_t led3_group_id;
17518         uint8_t unused_3;
17519         /* The states supported by LED #3. */
17520         uint16_t        led3_state_caps;
17521         /*
17522          * If set to 1, this LED is enabled.
17523          * If set to 0, this LED is disabled.
17524          */
17525         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED \
17526                 UINT32_C(0x1)
17527         /*
17528          * If set to 1, off state is supported on this LED.
17529          * If set to 0, off state is not supported on this LED.
17530          */
17531         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \
17532                 UINT32_C(0x2)
17533         /*
17534          * If set to 1, on state is supported on this LED.
17535          * If set to 0, on state is not supported on this LED.
17536          */
17537         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \
17538                 UINT32_C(0x4)
17539         /*
17540          * If set to 1, blink state is supported on this LED.
17541          * If set to 0, blink state is not supported on this LED.
17542          */
17543         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \
17544                 UINT32_C(0x8)
17545         /*
17546          * If set to 1, blink_alt state is supported on this LED.
17547          * If set to 0, blink_alt state is not supported on this LED.
17548          */
17549         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \
17550                 UINT32_C(0x10)
17551         /* The colors supported by LED #3. */
17552         uint16_t        led3_color_caps;
17553         /* reserved. */
17554         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD \
17555                 UINT32_C(0x1)
17556         /*
17557          * If set to 1, Amber color is supported on this LED.
17558          * If set to 0, Amber color is not supported on this LED.
17559          */
17560         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \
17561                 UINT32_C(0x2)
17562         /*
17563          * If set to 1, Green color is supported on this LED.
17564          * If set to 0, Green color is not supported on this LED.
17565          */
17566         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \
17567                 UINT32_C(0x4)
17568         uint8_t unused_4[3];
17569         /*
17570          * This field is used in Output records to indicate that the output
17571          * is completely written to RAM.  This field should be read as '1'
17572          * to indicate that the output has been completely written.
17573          * When writing a command completion or response to an internal processor,
17574          * the order of writes has to be such that this field is written last.
17575          */
17576         uint8_t valid;
17577 } __attribute__((packed));
17578
17579 /***********************
17580  * hwrm_port_prbs_test *
17581  ***********************/
17582
17583
17584 /* hwrm_port_prbs_test_input (size:384b/48B) */
17585 struct hwrm_port_prbs_test_input {
17586         /* The HWRM command request type. */
17587         uint16_t        req_type;
17588         /*
17589          * The completion ring to send the completion event on. This should
17590          * be the NQ ID returned from the `nq_alloc` HWRM command.
17591          */
17592         uint16_t        cmpl_ring;
17593         /*
17594          * The sequence ID is used by the driver for tracking multiple
17595          * commands. This ID is treated as opaque data by the firmware and
17596          * the value is returned in the `hwrm_resp_hdr` upon completion.
17597          */
17598         uint16_t        seq_id;
17599         /*
17600          * The target ID of the command:
17601          * * 0x0-0xFFF8 - The function ID
17602          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17603          * * 0xFFFD - Reserved for user-space HWRM interface
17604          * * 0xFFFF - HWRM
17605          */
17606         uint16_t        target_id;
17607         /*
17608          * A physical address pointer pointing to a host buffer that the
17609          * command's response data will be written. This can be either a host
17610          * physical address (HPA) or a guest physical address (GPA) and must
17611          * point to a physically contiguous block of memory.
17612          */
17613         uint64_t        resp_addr;
17614         /* Host address data is to DMA'd to. */
17615         uint64_t        resp_data_addr;
17616         /*
17617          * Size of the buffer pointed to by resp_data_addr. The firmware may
17618          * use this entire buffer or less than the entire buffer, but never more.
17619          */
17620         uint16_t        data_len;
17621         uint16_t        unused_0;
17622         uint32_t        unused_1;
17623         /* Port ID of port where PRBS test to be run. */
17624         uint16_t        port_id;
17625         /* Polynomial selection for PRBS test. */
17626         uint16_t        poly;
17627         /* PRBS7 */
17628         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS7   UINT32_C(0x0)
17629         /* PRBS9 */
17630         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS9   UINT32_C(0x1)
17631         /* PRBS11 */
17632         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS11  UINT32_C(0x2)
17633         /* PRBS15 */
17634         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS15  UINT32_C(0x3)
17635         /* PRBS23 */
17636         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS23  UINT32_C(0x4)
17637         /* PRBS31 */
17638         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS31  UINT32_C(0x5)
17639         /* PRBS58 */
17640         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS58  UINT32_C(0x6)
17641         /* Invalid */
17642         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID UINT32_C(0xff)
17643         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_LAST \
17644                 HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID
17645         /*
17646          * Configuration bits for PRBS test.
17647          * Use enable bit to start/stop test.
17648          * Use tx/rx lane map bits to run test on specific lanes,
17649          * if set to 0 test will be run on all lanes.
17650          */
17651         uint16_t        prbs_config;
17652         /*
17653          * Set 0 to stop test currently in progress
17654          * Set 1 to start test with configuration provided.
17655          */
17656         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_START_STOP \
17657                 UINT32_C(0x1)
17658         /*
17659          * If set to 1, tx_lane_map bitmap should have lane bits set.
17660          * If set to 0, test will be run on all lanes for this port.
17661          */
17662         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_TX_LANE_MAP_VALID \
17663                 UINT32_C(0x2)
17664         /*
17665          * If set to 1, rx_lane_map bitmap should have lane bits set.
17666          * If set to 0, test will be run on all lanes for this port.
17667          */
17668         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_RX_LANE_MAP_VALID \
17669                 UINT32_C(0x4)
17670         /* Duration in seconds to run the PRBS test. */
17671         uint16_t        timeout;
17672         /*
17673          * If tx_lane_map_valid is set to 1, this field is a bitmap
17674          * of tx lanes to run PRBS test. bit0 = lane0,
17675          * bit1 = lane1 ..bit31 = lane31
17676          */
17677         uint32_t        tx_lane_map;
17678         /*
17679          * If rx_lane_map_valid is set to 1, this field is a bitmap
17680          * of rx lanes to run PRBS test. bit0 = lane0,
17681          * bit1 = lane1 ..bit31 = lane31
17682          */
17683         uint32_t        rx_lane_map;
17684 } __attribute__((packed));
17685
17686 /* hwrm_port_prbs_test_output (size:128b/16B) */
17687 struct hwrm_port_prbs_test_output {
17688         /* The specific error status for the command. */
17689         uint16_t        error_code;
17690         /* The HWRM command request type. */
17691         uint16_t        req_type;
17692         /* The sequence ID from the original command. */
17693         uint16_t        seq_id;
17694         /* The length of the response data in number of bytes. */
17695         uint16_t        resp_len;
17696         /* Total length of stored data. */
17697         uint16_t        total_data_len;
17698         uint16_t        unused_0;
17699         uint8_t unused_1[3];
17700         /*
17701          * This field is used in Output records to indicate that the output
17702          * is completely written to RAM.  This field should be read as '1'
17703          * to indicate that the output has been completely written.
17704          * When writing a command completion or response to an internal processor,
17705          * the order of writes has to be such that this field is written last.
17706          */
17707         uint8_t valid;
17708 } __attribute__((packed));
17709
17710 /***********************
17711  * hwrm_queue_qportcfg *
17712  ***********************/
17713
17714
17715 /* hwrm_queue_qportcfg_input (size:192b/24B) */
17716 struct hwrm_queue_qportcfg_input {
17717         /* The HWRM command request type. */
17718         uint16_t        req_type;
17719         /*
17720          * The completion ring to send the completion event on. This should
17721          * be the NQ ID returned from the `nq_alloc` HWRM command.
17722          */
17723         uint16_t        cmpl_ring;
17724         /*
17725          * The sequence ID is used by the driver for tracking multiple
17726          * commands. This ID is treated as opaque data by the firmware and
17727          * the value is returned in the `hwrm_resp_hdr` upon completion.
17728          */
17729         uint16_t        seq_id;
17730         /*
17731          * The target ID of the command:
17732          * * 0x0-0xFFF8 - The function ID
17733          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17734          * * 0xFFFD - Reserved for user-space HWRM interface
17735          * * 0xFFFF - HWRM
17736          */
17737         uint16_t        target_id;
17738         /*
17739          * A physical address pointer pointing to a host buffer that the
17740          * command's response data will be written. This can be either a host
17741          * physical address (HPA) or a guest physical address (GPA) and must
17742          * point to a physically contiguous block of memory.
17743          */
17744         uint64_t        resp_addr;
17745         uint32_t        flags;
17746         /*
17747          * Enumeration denoting the RX, TX type of the resource.
17748          * This enumeration is used for resources that are similar for both
17749          * TX and RX paths of the chip.
17750          */
17751         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
17752         /* tx path */
17753         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
17754         /* rx path */
17755         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
17756         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
17757                 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
17758         /*
17759          * Port ID of port for which the queue configuration is being
17760          * queried.  This field is only required when sent by IPC.
17761          */
17762         uint16_t        port_id;
17763         /*
17764          * Drivers will set this capability when it can use
17765          * queue_idx_service_profile to map the queues to application.
17766          */
17767         uint8_t drv_qmap_cap;
17768         /* disabled */
17769         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
17770         /* enabled */
17771         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
17772         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
17773                 HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
17774         uint8_t unused_0;
17775 } __attribute__((packed));
17776
17777 /* hwrm_queue_qportcfg_output (size:256b/32B) */
17778 struct hwrm_queue_qportcfg_output {
17779         /* The specific error status for the command. */
17780         uint16_t        error_code;
17781         /* The HWRM command request type. */
17782         uint16_t        req_type;
17783         /* The sequence ID from the original command. */
17784         uint16_t        seq_id;
17785         /* The length of the response data in number of bytes. */
17786         uint16_t        resp_len;
17787         /*
17788          * The maximum number of queues that can be configured on this
17789          * port.
17790          * Valid values range from 1 through 8.
17791          */
17792         uint8_t max_configurable_queues;
17793         /*
17794          * The maximum number of lossless queues that can be configured
17795          * on this port.
17796          * Valid values range from 0 through 8.
17797          */
17798         uint8_t max_configurable_lossless_queues;
17799         /*
17800          * Bitmask indicating which queues can be configured by the
17801          * hwrm_queue_cfg command.
17802          *
17803          * Each bit represents a specific queue where bit 0 represents
17804          * queue 0 and bit 7 represents queue 7.
17805          * # A value of 0 indicates that the queue is not configurable
17806          * by the hwrm_queue_cfg command.
17807          * # A value of 1 indicates that the queue is configurable.
17808          * # A hwrm_queue_cfg command shall return error when trying to
17809          * configure a queue not configurable.
17810          */
17811         uint8_t queue_cfg_allowed;
17812         /* Information about queue configuration. */
17813         uint8_t queue_cfg_info;
17814         /*
17815          * If this flag is set to '1', then the queues are
17816          * configured asymmetrically on TX and RX sides.
17817          * If this flag is set to '0', then the queues are
17818          * configured symmetrically on TX and RX sides. For
17819          * symmetric configuration, the queue configuration
17820          * including queue ids and service profiles on the
17821          * TX side is the same as the corresponding queue
17822          * configuration on the RX side.
17823          */
17824         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
17825                 UINT32_C(0x1)
17826         /*
17827          * Bitmask indicating which queues can be configured by the
17828          * hwrm_queue_pfcenable_cfg command.
17829          *
17830          * Each bit represents a specific priority where bit 0 represents
17831          * priority 0 and bit 7 represents priority 7.
17832          * # A value of 0 indicates that the priority is not configurable by
17833          * the hwrm_queue_pfcenable_cfg command.
17834          * # A value of 1 indicates that the priority is configurable.
17835          * # A hwrm_queue_pfcenable_cfg command shall return error when
17836          * trying to configure a priority that is not configurable.
17837          */
17838         uint8_t queue_pfcenable_cfg_allowed;
17839         /*
17840          * Bitmask indicating which queues can be configured by the
17841          * hwrm_queue_pri2cos_cfg command.
17842          *
17843          * Each bit represents a specific queue where bit 0 represents
17844          * queue 0 and bit 7 represents queue 7.
17845          * # A value of 0 indicates that the queue is not configurable
17846          * by the hwrm_queue_pri2cos_cfg command.
17847          * # A value of 1 indicates that the queue is configurable.
17848          * # A hwrm_queue_pri2cos_cfg command shall return error when
17849          * trying to configure a queue that is not configurable.
17850          */
17851         uint8_t queue_pri2cos_cfg_allowed;
17852         /*
17853          * Bitmask indicating which queues can be configured by the
17854          * hwrm_queue_pri2cos_cfg command.
17855          *
17856          * Each bit represents a specific queue where bit 0 represents
17857          * queue 0 and bit 7 represents queue 7.
17858          * # A value of 0 indicates that the queue is not configurable
17859          * by the hwrm_queue_pri2cos_cfg command.
17860          * # A value of 1 indicates that the queue is configurable.
17861          * # A hwrm_queue_pri2cos_cfg command shall return error when
17862          * trying to configure a queue not configurable.
17863          */
17864         uint8_t queue_cos2bw_cfg_allowed;
17865         /*
17866          * ID of CoS Queue 0.
17867          * FF - Invalid id
17868          *
17869          * # This ID can be used on any subsequent call to an hwrm command
17870          * that takes a queue id.
17871          * # IDs must always be queried by this command before any use
17872          * by the driver or software.
17873          * # Any driver or software should not make any assumptions about
17874          * queue IDs.
17875          * # A value of 0xff indicates that the queue is not available.
17876          * # Available queues may not be in sequential order.
17877          */
17878         uint8_t queue_id0;
17879         /* This value is applicable to CoS queues only. */
17880         uint8_t queue_id0_service_profile;
17881         /* Lossy (best-effort) */
17882         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
17883                 UINT32_C(0x0)
17884         /* Lossless (legacy) */
17885         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
17886                 UINT32_C(0x1)
17887         /* Lossless RoCE */
17888         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \
17889                 UINT32_C(0x1)
17890         /* Lossy RoCE CNP */
17891         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \
17892                 UINT32_C(0x2)
17893         /* Lossless NIC */
17894         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \
17895                 UINT32_C(0x3)
17896         /* Set to 0xFF... (All Fs) if there is no service profile specified */
17897         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
17898                 UINT32_C(0xff)
17899         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \
17900                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
17901         /*
17902          * ID of CoS Queue 1.
17903          * FF - Invalid id
17904          *
17905          * # This ID can be used on any subsequent call to an hwrm command
17906          * that takes a queue id.
17907          * # IDs must always be queried by this command before any use
17908          * by the driver or software.
17909          * # Any driver or software should not make any assumptions about
17910          * queue IDs.
17911          * # A value of 0xff indicates that the queue is not available.
17912          * # Available queues may not be in sequential order.
17913          */
17914         uint8_t queue_id1;
17915         /* This value is applicable to CoS queues only. */
17916         uint8_t queue_id1_service_profile;
17917         /* Lossy (best-effort) */
17918         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
17919                 UINT32_C(0x0)
17920         /* Lossless (legacy) */
17921         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
17922                 UINT32_C(0x1)
17923         /* Lossless RoCE */
17924         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \
17925                 UINT32_C(0x1)
17926         /* Lossy RoCE CNP */
17927         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \
17928                 UINT32_C(0x2)
17929         /* Lossless NIC */
17930         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \
17931                 UINT32_C(0x3)
17932         /* Set to 0xFF... (All Fs) if there is no service profile specified */
17933         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
17934                 UINT32_C(0xff)
17935         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \
17936                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
17937         /*
17938          * ID of CoS Queue 2.
17939          * FF - Invalid id
17940          *
17941          * # This ID can be used on any subsequent call to an hwrm command
17942          * that takes a queue id.
17943          * # IDs must always be queried by this command before any use
17944          * by the driver or software.
17945          * # Any driver or software should not make any assumptions about
17946          * queue IDs.
17947          * # A value of 0xff indicates that the queue is not available.
17948          * # Available queues may not be in sequential order.
17949          */
17950         uint8_t queue_id2;
17951         /* This value is applicable to CoS queues only. */
17952         uint8_t queue_id2_service_profile;
17953         /* Lossy (best-effort) */
17954         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
17955                 UINT32_C(0x0)
17956         /* Lossless (legacy) */
17957         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
17958                 UINT32_C(0x1)
17959         /* Lossless RoCE */
17960         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \
17961                 UINT32_C(0x1)
17962         /* Lossy RoCE CNP */
17963         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \
17964                 UINT32_C(0x2)
17965         /* Lossless NIC */
17966         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \
17967                 UINT32_C(0x3)
17968         /* Set to 0xFF... (All Fs) if there is no service profile specified */
17969         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
17970                 UINT32_C(0xff)
17971         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \
17972                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
17973         /*
17974          * ID of CoS Queue 3.
17975          * FF - Invalid id
17976          *
17977          * # This ID can be used on any subsequent call to an hwrm command
17978          * that takes a queue id.
17979          * # IDs must always be queried by this command before any use
17980          * by the driver or software.
17981          * # Any driver or software should not make any assumptions about
17982          * queue IDs.
17983          * # A value of 0xff indicates that the queue is not available.
17984          * # Available queues may not be in sequential order.
17985          */
17986         uint8_t queue_id3;
17987         /* This value is applicable to CoS queues only. */
17988         uint8_t queue_id3_service_profile;
17989         /* Lossy (best-effort) */
17990         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
17991                 UINT32_C(0x0)
17992         /* Lossless (legacy) */
17993         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
17994                 UINT32_C(0x1)
17995         /* Lossless RoCE */
17996         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \
17997                 UINT32_C(0x1)
17998         /* Lossy RoCE CNP */
17999         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18000                 UINT32_C(0x2)
18001         /* Lossless NIC */
18002         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \
18003                 UINT32_C(0x3)
18004         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18005         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
18006                 UINT32_C(0xff)
18007         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \
18008                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
18009         /*
18010          * ID of CoS Queue 4.
18011          * FF - Invalid id
18012          *
18013          * # This ID can be used on any subsequent call to an hwrm command
18014          * that takes a queue id.
18015          * # IDs must always be queried by this command before any use
18016          * by the driver or software.
18017          * # Any driver or software should not make any assumptions about
18018          * queue IDs.
18019          * # A value of 0xff indicates that the queue is not available.
18020          * # Available queues may not be in sequential order.
18021          */
18022         uint8_t queue_id4;
18023         /* This value is applicable to CoS queues only. */
18024         uint8_t queue_id4_service_profile;
18025         /* Lossy (best-effort) */
18026         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
18027                 UINT32_C(0x0)
18028         /* Lossless (legacy) */
18029         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
18030                 UINT32_C(0x1)
18031         /* Lossless RoCE */
18032         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \
18033                 UINT32_C(0x1)
18034         /* Lossy RoCE CNP */
18035         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18036                 UINT32_C(0x2)
18037         /* Lossless NIC */
18038         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \
18039                 UINT32_C(0x3)
18040         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18041         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
18042                 UINT32_C(0xff)
18043         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \
18044                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
18045         /*
18046          * ID of CoS Queue 5.
18047          * FF - Invalid id
18048          *
18049          * # This ID can be used on any subsequent call to an hwrm command
18050          * that takes a queue id.
18051          * # IDs must always be queried by this command before any use
18052          * by the driver or software.
18053          * # Any driver or software should not make any assumptions about
18054          * queue IDs.
18055          * # A value of 0xff indicates that the queue is not available.
18056          * # Available queues may not be in sequential order.
18057          */
18058         uint8_t queue_id5;
18059         /* This value is applicable to CoS queues only. */
18060         uint8_t queue_id5_service_profile;
18061         /* Lossy (best-effort) */
18062         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
18063                 UINT32_C(0x0)
18064         /* Lossless (legacy) */
18065         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
18066                 UINT32_C(0x1)
18067         /* Lossless RoCE */
18068         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \
18069                 UINT32_C(0x1)
18070         /* Lossy RoCE CNP */
18071         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18072                 UINT32_C(0x2)
18073         /* Lossless NIC */
18074         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \
18075                 UINT32_C(0x3)
18076         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18077         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
18078                 UINT32_C(0xff)
18079         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \
18080                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
18081         /*
18082          * ID of CoS Queue 6.
18083          * FF - Invalid id
18084          *
18085          * # This ID can be used on any subsequent call to an hwrm command
18086          * that takes a queue id.
18087          * # IDs must always be queried by this command before any use
18088          * by the driver or software.
18089          * # Any driver or software should not make any assumptions about
18090          * queue IDs.
18091          * # A value of 0xff indicates that the queue is not available.
18092          * # Available queues may not be in sequential order.
18093          */
18094         uint8_t queue_id6;
18095         /* This value is applicable to CoS queues only. */
18096         uint8_t queue_id6_service_profile;
18097         /* Lossy (best-effort) */
18098         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
18099                 UINT32_C(0x0)
18100         /* Lossless (legacy) */
18101         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
18102                 UINT32_C(0x1)
18103         /* Lossless RoCE */
18104         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \
18105                 UINT32_C(0x1)
18106         /* Lossy RoCE CNP */
18107         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18108                 UINT32_C(0x2)
18109         /* Lossless NIC */
18110         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \
18111                 UINT32_C(0x3)
18112         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18113         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
18114                 UINT32_C(0xff)
18115         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \
18116                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
18117         /*
18118          * ID of CoS Queue 7.
18119          * FF - Invalid id
18120          *
18121          * # This ID can be used on any subsequent call to an hwrm command
18122          * that takes a queue id.
18123          * # IDs must always be queried by this command before any use
18124          * by the driver or software.
18125          * # Any driver or software should not make any assumptions about
18126          * queue IDs.
18127          * # A value of 0xff indicates that the queue is not available.
18128          * # Available queues may not be in sequential order.
18129          */
18130         uint8_t queue_id7;
18131         /* This value is applicable to CoS queues only. */
18132         uint8_t queue_id7_service_profile;
18133         /* Lossy (best-effort) */
18134         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
18135                 UINT32_C(0x0)
18136         /* Lossless (legacy) */
18137         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
18138                 UINT32_C(0x1)
18139         /* Lossless RoCE */
18140         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \
18141                 UINT32_C(0x1)
18142         /* Lossy RoCE CNP */
18143         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18144                 UINT32_C(0x2)
18145         /* Lossless NIC */
18146         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \
18147                 UINT32_C(0x3)
18148         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18149         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
18150                 UINT32_C(0xff)
18151         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \
18152                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
18153         /*
18154          * This field is used in Output records to indicate that the output
18155          * is completely written to RAM.  This field should be read as '1'
18156          * to indicate that the output has been completely written.
18157          * When writing a command completion or response to an internal processor,
18158          * the order of writes has to be such that this field is written last.
18159          */
18160         uint8_t valid;
18161 } __attribute__((packed));
18162
18163 /*******************
18164  * hwrm_queue_qcfg *
18165  *******************/
18166
18167
18168 /* hwrm_queue_qcfg_input (size:192b/24B) */
18169 struct hwrm_queue_qcfg_input {
18170         /* The HWRM command request type. */
18171         uint16_t        req_type;
18172         /*
18173          * The completion ring to send the completion event on. This should
18174          * be the NQ ID returned from the `nq_alloc` HWRM command.
18175          */
18176         uint16_t        cmpl_ring;
18177         /*
18178          * The sequence ID is used by the driver for tracking multiple
18179          * commands. This ID is treated as opaque data by the firmware and
18180          * the value is returned in the `hwrm_resp_hdr` upon completion.
18181          */
18182         uint16_t        seq_id;
18183         /*
18184          * The target ID of the command:
18185          * * 0x0-0xFFF8 - The function ID
18186          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18187          * * 0xFFFD - Reserved for user-space HWRM interface
18188          * * 0xFFFF - HWRM
18189          */
18190         uint16_t        target_id;
18191         /*
18192          * A physical address pointer pointing to a host buffer that the
18193          * command's response data will be written. This can be either a host
18194          * physical address (HPA) or a guest physical address (GPA) and must
18195          * point to a physically contiguous block of memory.
18196          */
18197         uint64_t        resp_addr;
18198         uint32_t        flags;
18199         /*
18200          * Enumeration denoting the RX, TX type of the resource.
18201          * This enumeration is used for resources that are similar for both
18202          * TX and RX paths of the chip.
18203          */
18204         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
18205         /* tx path */
18206         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
18207         /* rx path */
18208         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
18209         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST \
18210                 HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
18211         /* Queue ID of the queue. */
18212         uint32_t        queue_id;
18213 } __attribute__((packed));
18214
18215 /* hwrm_queue_qcfg_output (size:128b/16B) */
18216 struct hwrm_queue_qcfg_output {
18217         /* The specific error status for the command. */
18218         uint16_t        error_code;
18219         /* The HWRM command request type. */
18220         uint16_t        req_type;
18221         /* The sequence ID from the original command. */
18222         uint16_t        seq_id;
18223         /* The length of the response data in number of bytes. */
18224         uint16_t        resp_len;
18225         /*
18226          * This value is a the estimate packet length used in the
18227          * TX arbiter.
18228          */
18229         uint32_t        queue_len;
18230         /* This value is applicable to CoS queues only. */
18231         uint8_t service_profile;
18232         /* Lossy (best-effort) */
18233         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
18234         /* Lossless */
18235         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
18236         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18237         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
18238         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST \
18239                 HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
18240         /* Information about queue configuration. */
18241         uint8_t queue_cfg_info;
18242         /*
18243          * If this flag is set to '1', then the queue is
18244          * configured asymmetrically on TX and RX sides.
18245          * If this flag is set to '0', then this queue is
18246          * configured symmetrically on TX and RX sides.
18247          */
18248         #define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
18249                 UINT32_C(0x1)
18250         uint8_t unused_0;
18251         /*
18252          * This field is used in Output records to indicate that the output
18253          * is completely written to RAM.  This field should be read as '1'
18254          * to indicate that the output has been completely written.
18255          * When writing a command completion or response to an internal processor,
18256          * the order of writes has to be such that this field is written last.
18257          */
18258         uint8_t valid;
18259 } __attribute__((packed));
18260
18261 /******************
18262  * hwrm_queue_cfg *
18263  ******************/
18264
18265
18266 /* hwrm_queue_cfg_input (size:320b/40B) */
18267 struct hwrm_queue_cfg_input {
18268         /* The HWRM command request type. */
18269         uint16_t        req_type;
18270         /*
18271          * The completion ring to send the completion event on. This should
18272          * be the NQ ID returned from the `nq_alloc` HWRM command.
18273          */
18274         uint16_t        cmpl_ring;
18275         /*
18276          * The sequence ID is used by the driver for tracking multiple
18277          * commands. This ID is treated as opaque data by the firmware and
18278          * the value is returned in the `hwrm_resp_hdr` upon completion.
18279          */
18280         uint16_t        seq_id;
18281         /*
18282          * The target ID of the command:
18283          * * 0x0-0xFFF8 - The function ID
18284          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18285          * * 0xFFFD - Reserved for user-space HWRM interface
18286          * * 0xFFFF - HWRM
18287          */
18288         uint16_t        target_id;
18289         /*
18290          * A physical address pointer pointing to a host buffer that the
18291          * command's response data will be written. This can be either a host
18292          * physical address (HPA) or a guest physical address (GPA) and must
18293          * point to a physically contiguous block of memory.
18294          */
18295         uint64_t        resp_addr;
18296         uint32_t        flags;
18297         /*
18298          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
18299          * This enumeration is used for resources that are similar for both
18300          * TX and RX paths of the chip.
18301          */
18302         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
18303         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT  0
18304         /* tx path */
18305         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
18306         /* rx path */
18307         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
18308         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
18309         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
18310         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST \
18311                 HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
18312         uint32_t        enables;
18313         /*
18314          * This bit must be '1' for the dflt_len field to be
18315          * configured.
18316          */
18317         #define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN            UINT32_C(0x1)
18318         /*
18319          * This bit must be '1' for the service_profile field to be
18320          * configured.
18321          */
18322         #define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE     UINT32_C(0x2)
18323         /* Queue ID of queue that is to be configured by this function. */
18324         uint32_t        queue_id;
18325         /*
18326          * This value is a the estimate packet length used in the
18327          * TX arbiter.
18328          * Set to 0xFF... (All Fs) to not adjust this value.
18329          */
18330         uint32_t        dflt_len;
18331         /* This value is applicable to CoS queues only. */
18332         uint8_t service_profile;
18333         /* Lossy (best-effort) */
18334         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
18335         /* Lossless */
18336         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
18337         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18338         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
18339         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST \
18340                 HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
18341         uint8_t unused_0[7];
18342 } __attribute__((packed));
18343
18344 /* hwrm_queue_cfg_output (size:128b/16B) */
18345 struct hwrm_queue_cfg_output {
18346         /* The specific error status for the command. */
18347         uint16_t        error_code;
18348         /* The HWRM command request type. */
18349         uint16_t        req_type;
18350         /* The sequence ID from the original command. */
18351         uint16_t        seq_id;
18352         /* The length of the response data in number of bytes. */
18353         uint16_t        resp_len;
18354         uint8_t unused_0[7];
18355         /*
18356          * This field is used in Output records to indicate that the output
18357          * is completely written to RAM.  This field should be read as '1'
18358          * to indicate that the output has been completely written.
18359          * When writing a command completion or response to an internal processor,
18360          * the order of writes has to be such that this field is written last.
18361          */
18362         uint8_t valid;
18363 } __attribute__((packed));
18364
18365 /*****************************
18366  * hwrm_queue_pfcenable_qcfg *
18367  *****************************/
18368
18369
18370 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
18371 struct hwrm_queue_pfcenable_qcfg_input {
18372         /* The HWRM command request type. */
18373         uint16_t        req_type;
18374         /*
18375          * The completion ring to send the completion event on. This should
18376          * be the NQ ID returned from the `nq_alloc` HWRM command.
18377          */
18378         uint16_t        cmpl_ring;
18379         /*
18380          * The sequence ID is used by the driver for tracking multiple
18381          * commands. This ID is treated as opaque data by the firmware and
18382          * the value is returned in the `hwrm_resp_hdr` upon completion.
18383          */
18384         uint16_t        seq_id;
18385         /*
18386          * The target ID of the command:
18387          * * 0x0-0xFFF8 - The function ID
18388          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18389          * * 0xFFFD - Reserved for user-space HWRM interface
18390          * * 0xFFFF - HWRM
18391          */
18392         uint16_t        target_id;
18393         /*
18394          * A physical address pointer pointing to a host buffer that the
18395          * command's response data will be written. This can be either a host
18396          * physical address (HPA) or a guest physical address (GPA) and must
18397          * point to a physically contiguous block of memory.
18398          */
18399         uint64_t        resp_addr;
18400         /*
18401          * Port ID of port for which the table is being configured.
18402          * The HWRM needs to check whether this function is allowed
18403          * to configure pri2cos mapping on this port.
18404          */
18405         uint16_t        port_id;
18406         uint8_t unused_0[6];
18407 } __attribute__((packed));
18408
18409 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
18410 struct hwrm_queue_pfcenable_qcfg_output {
18411         /* The specific error status for the command. */
18412         uint16_t        error_code;
18413         /* The HWRM command request type. */
18414         uint16_t        req_type;
18415         /* The sequence ID from the original command. */
18416         uint16_t        seq_id;
18417         /* The length of the response data in number of bytes. */
18418         uint16_t        resp_len;
18419         uint32_t        flags;
18420         /* If set to 1, then PFC is enabled on PRI 0. */
18421         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED \
18422                 UINT32_C(0x1)
18423         /* If set to 1, then PFC is enabled on PRI 1. */
18424         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED \
18425                 UINT32_C(0x2)
18426         /* If set to 1, then PFC is enabled on PRI 2. */
18427         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED \
18428                 UINT32_C(0x4)
18429         /* If set to 1, then PFC is enabled on PRI 3. */
18430         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED \
18431                 UINT32_C(0x8)
18432         /* If set to 1, then PFC is enabled on PRI 4. */
18433         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED \
18434                 UINT32_C(0x10)
18435         /* If set to 1, then PFC is enabled on PRI 5. */
18436         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED \
18437                 UINT32_C(0x20)
18438         /* If set to 1, then PFC is enabled on PRI 6. */
18439         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED \
18440                 UINT32_C(0x40)
18441         /* If set to 1, then PFC is enabled on PRI 7. */
18442         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED \
18443                 UINT32_C(0x80)
18444         uint8_t unused_0[3];
18445         /*
18446          * This field is used in Output records to indicate that the output
18447          * is completely written to RAM.  This field should be read as '1'
18448          * to indicate that the output has been completely written.
18449          * When writing a command completion or response to an internal processor,
18450          * the order of writes has to be such that this field is written last.
18451          */
18452         uint8_t valid;
18453 } __attribute__((packed));
18454
18455 /****************************
18456  * hwrm_queue_pfcenable_cfg *
18457  ****************************/
18458
18459
18460 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
18461 struct hwrm_queue_pfcenable_cfg_input {
18462         /* The HWRM command request type. */
18463         uint16_t        req_type;
18464         /*
18465          * The completion ring to send the completion event on. This should
18466          * be the NQ ID returned from the `nq_alloc` HWRM command.
18467          */
18468         uint16_t        cmpl_ring;
18469         /*
18470          * The sequence ID is used by the driver for tracking multiple
18471          * commands. This ID is treated as opaque data by the firmware and
18472          * the value is returned in the `hwrm_resp_hdr` upon completion.
18473          */
18474         uint16_t        seq_id;
18475         /*
18476          * The target ID of the command:
18477          * * 0x0-0xFFF8 - The function ID
18478          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18479          * * 0xFFFD - Reserved for user-space HWRM interface
18480          * * 0xFFFF - HWRM
18481          */
18482         uint16_t        target_id;
18483         /*
18484          * A physical address pointer pointing to a host buffer that the
18485          * command's response data will be written. This can be either a host
18486          * physical address (HPA) or a guest physical address (GPA) and must
18487          * point to a physically contiguous block of memory.
18488          */
18489         uint64_t        resp_addr;
18490         uint32_t        flags;
18491         /* If set to 1, then PFC is requested to be enabled on PRI 0. */
18492         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED \
18493                 UINT32_C(0x1)
18494         /* If set to 1, then PFC is requested to be enabled on PRI 1. */
18495         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED \
18496                 UINT32_C(0x2)
18497         /* If set to 1, then PFC is requested to  be enabled on PRI 2. */
18498         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED \
18499                 UINT32_C(0x4)
18500         /* If set to 1, then PFC is requested to  be enabled on PRI 3. */
18501         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED \
18502                 UINT32_C(0x8)
18503         /* If set to 1, then PFC is requested to  be enabled on PRI 4. */
18504         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED \
18505                 UINT32_C(0x10)
18506         /* If set to 1, then PFC is requested to  be enabled on PRI 5. */
18507         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED \
18508                 UINT32_C(0x20)
18509         /* If set to 1, then PFC is requested to  be enabled on PRI 6. */
18510         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED \
18511                 UINT32_C(0x40)
18512         /* If set to 1, then PFC is requested to  be enabled on PRI 7. */
18513         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED \
18514                 UINT32_C(0x80)
18515         /*
18516          * Port ID of port for which the table is being configured.
18517          * The HWRM needs to check whether this function is allowed
18518          * to configure pri2cos mapping on this port.
18519          */
18520         uint16_t        port_id;
18521         uint8_t unused_0[2];
18522 } __attribute__((packed));
18523
18524 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
18525 struct hwrm_queue_pfcenable_cfg_output {
18526         /* The specific error status for the command. */
18527         uint16_t        error_code;
18528         /* The HWRM command request type. */
18529         uint16_t        req_type;
18530         /* The sequence ID from the original command. */
18531         uint16_t        seq_id;
18532         /* The length of the response data in number of bytes. */
18533         uint16_t        resp_len;
18534         uint8_t unused_0[7];
18535         /*
18536          * This field is used in Output records to indicate that the output
18537          * is completely written to RAM.  This field should be read as '1'
18538          * to indicate that the output has been completely written.
18539          * When writing a command completion or response to an internal processor,
18540          * the order of writes has to be such that this field is written last.
18541          */
18542         uint8_t valid;
18543 } __attribute__((packed));
18544
18545 /***************************
18546  * hwrm_queue_pri2cos_qcfg *
18547  ***************************/
18548
18549
18550 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
18551 struct hwrm_queue_pri2cos_qcfg_input {
18552         /* The HWRM command request type. */
18553         uint16_t        req_type;
18554         /*
18555          * The completion ring to send the completion event on. This should
18556          * be the NQ ID returned from the `nq_alloc` HWRM command.
18557          */
18558         uint16_t        cmpl_ring;
18559         /*
18560          * The sequence ID is used by the driver for tracking multiple
18561          * commands. This ID is treated as opaque data by the firmware and
18562          * the value is returned in the `hwrm_resp_hdr` upon completion.
18563          */
18564         uint16_t        seq_id;
18565         /*
18566          * The target ID of the command:
18567          * * 0x0-0xFFF8 - The function ID
18568          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18569          * * 0xFFFD - Reserved for user-space HWRM interface
18570          * * 0xFFFF - HWRM
18571          */
18572         uint16_t        target_id;
18573         /*
18574          * A physical address pointer pointing to a host buffer that the
18575          * command's response data will be written. This can be either a host
18576          * physical address (HPA) or a guest physical address (GPA) and must
18577          * point to a physically contiguous block of memory.
18578          */
18579         uint64_t        resp_addr;
18580         uint32_t        flags;
18581         /*
18582          * Enumeration denoting the RX, TX type of the resource.
18583          * This enumeration is used for resources that are similar for both
18584          * TX and RX paths of the chip.
18585          */
18586         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH      UINT32_C(0x1)
18587         /* tx path */
18588         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
18589         /* rx path */
18590         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
18591         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST \
18592                 HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
18593         /*
18594          * When this bit is set to '0', the query is
18595          * for VLAN PRI field in tunnel headers.
18596          * When this bit is set to '1', the query is
18597          * for VLAN PRI field in inner packet headers.
18598          */
18599         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN     UINT32_C(0x2)
18600         /*
18601          * Port ID of port for which the table is being configured.
18602          * The HWRM needs to check whether this function is allowed
18603          * to configure pri2cos mapping on this port.
18604          */
18605         uint8_t port_id;
18606         uint8_t unused_0[3];
18607 } __attribute__((packed));
18608
18609 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
18610 struct hwrm_queue_pri2cos_qcfg_output {
18611         /* The specific error status for the command. */
18612         uint16_t        error_code;
18613         /* The HWRM command request type. */
18614         uint16_t        req_type;
18615         /* The sequence ID from the original command. */
18616         uint16_t        seq_id;
18617         /* The length of the response data in number of bytes. */
18618         uint16_t        resp_len;
18619         /*
18620          * CoS Queue assigned to priority 0.  This value can only
18621          * be changed before traffic has started.
18622          * A value of 0xff indicates that no CoS queue is assigned to the
18623          * specified priority.
18624          */
18625         uint8_t pri0_cos_queue_id;
18626         /*
18627          * CoS Queue assigned to priority 1.  This value can only
18628          * be changed before traffic has started.
18629          * A value of 0xff indicates that no CoS queue is assigned to the
18630          * specified priority.
18631          */
18632         uint8_t pri1_cos_queue_id;
18633         /*
18634          * CoS Queue assigned to priority 2  This value can only
18635          * be changed before traffic has started.
18636          * A value of 0xff indicates that no CoS queue is assigned to the
18637          * specified priority.
18638          */
18639         uint8_t pri2_cos_queue_id;
18640         /*
18641          * CoS Queue assigned to priority 3.  This value can only
18642          * be changed before traffic has started.
18643          * A value of 0xff indicates that no CoS queue is assigned to the
18644          * specified priority.
18645          */
18646         uint8_t pri3_cos_queue_id;
18647         /*
18648          * CoS Queue assigned to priority 4.  This value can only
18649          * be changed before traffic has started.
18650          * A value of 0xff indicates that no CoS queue is assigned to the
18651          * specified priority.
18652          */
18653         uint8_t pri4_cos_queue_id;
18654         /*
18655          * CoS Queue assigned to priority 5.  This value can only
18656          * be changed before traffic has started.
18657          * A value of 0xff indicates that no CoS queue is assigned to the
18658          * specified priority.
18659          */
18660         uint8_t pri5_cos_queue_id;
18661         /*
18662          * CoS Queue assigned to priority 6.  This value can only
18663          * be changed before traffic has started.
18664          * A value of 0xff indicates that no CoS queue is assigned to the
18665          * specified priority.
18666          */
18667         uint8_t pri6_cos_queue_id;
18668         /*
18669          * CoS Queue assigned to priority 7.  This value can only
18670          * be changed before traffic has started.
18671          * A value of 0xff indicates that no CoS queue is assigned to the
18672          * specified priority.
18673          */
18674         uint8_t pri7_cos_queue_id;
18675         /* Information about queue configuration. */
18676         uint8_t queue_cfg_info;
18677         /*
18678          * If this flag is set to '1', then the PRI to CoS
18679          * configuration is asymmetric on TX and RX sides.
18680          * If this flag is set to '0', then PRI to CoS configuration
18681          * is symmetric on TX and RX sides.
18682          */
18683         #define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
18684                 UINT32_C(0x1)
18685         uint8_t unused_0[6];
18686         /*
18687          * This field is used in Output records to indicate that the output
18688          * is completely written to RAM.  This field should be read as '1'
18689          * to indicate that the output has been completely written.
18690          * When writing a command completion or response to an internal processor,
18691          * the order of writes has to be such that this field is written last.
18692          */
18693         uint8_t valid;
18694 } __attribute__((packed));
18695
18696 /**************************
18697  * hwrm_queue_pri2cos_cfg *
18698  **************************/
18699
18700
18701 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
18702 struct hwrm_queue_pri2cos_cfg_input {
18703         /* The HWRM command request type. */
18704         uint16_t        req_type;
18705         /*
18706          * The completion ring to send the completion event on. This should
18707          * be the NQ ID returned from the `nq_alloc` HWRM command.
18708          */
18709         uint16_t        cmpl_ring;
18710         /*
18711          * The sequence ID is used by the driver for tracking multiple
18712          * commands. This ID is treated as opaque data by the firmware and
18713          * the value is returned in the `hwrm_resp_hdr` upon completion.
18714          */
18715         uint16_t        seq_id;
18716         /*
18717          * The target ID of the command:
18718          * * 0x0-0xFFF8 - The function ID
18719          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18720          * * 0xFFFD - Reserved for user-space HWRM interface
18721          * * 0xFFFF - HWRM
18722          */
18723         uint16_t        target_id;
18724         /*
18725          * A physical address pointer pointing to a host buffer that the
18726          * command's response data will be written. This can be either a host
18727          * physical address (HPA) or a guest physical address (GPA) and must
18728          * point to a physically contiguous block of memory.
18729          */
18730         uint64_t        resp_addr;
18731         uint32_t        flags;
18732         /*
18733          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
18734          * This enumeration is used for resources that are similar for both
18735          * TX and RX paths of the chip.
18736          */
18737         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
18738         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT  0
18739         /* tx path */
18740         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
18741         /* rx path */
18742         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
18743         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
18744         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
18745         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST \
18746                 HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
18747         /*
18748          * When this bit is set to '0', the mapping is requested
18749          * for VLAN PRI field in tunnel headers.
18750          * When this bit is set to '1', the mapping is requested
18751          * for VLAN PRI field in inner packet headers.
18752          */
18753         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN     UINT32_C(0x4)
18754         uint32_t        enables;
18755         /*
18756          * This bit must be '1' for the pri0_cos_queue_id field to be
18757          * configured.
18758          */
18759         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID \
18760                 UINT32_C(0x1)
18761         /*
18762          * This bit must be '1' for the pri1_cos_queue_id field to be
18763          * configured.
18764          */
18765         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID \
18766                 UINT32_C(0x2)
18767         /*
18768          * This bit must be '1' for the pri2_cos_queue_id field to be
18769          * configured.
18770          */
18771         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID \
18772                 UINT32_C(0x4)
18773         /*
18774          * This bit must be '1' for the pri3_cos_queue_id field to be
18775          * configured.
18776          */
18777         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID \
18778                 UINT32_C(0x8)
18779         /*
18780          * This bit must be '1' for the pri4_cos_queue_id field to be
18781          * configured.
18782          */
18783         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID \
18784                 UINT32_C(0x10)
18785         /*
18786          * This bit must be '1' for the pri5_cos_queue_id field to be
18787          * configured.
18788          */
18789         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID \
18790                 UINT32_C(0x20)
18791         /*
18792          * This bit must be '1' for the pri6_cos_queue_id field to be
18793          * configured.
18794          */
18795         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID \
18796                 UINT32_C(0x40)
18797         /*
18798          * This bit must be '1' for the pri7_cos_queue_id field to be
18799          * configured.
18800          */
18801         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID \
18802                 UINT32_C(0x80)
18803         /*
18804          * Port ID of port for which the table is being configured.
18805          * The HWRM needs to check whether this function is allowed
18806          * to configure pri2cos mapping on this port.
18807          */
18808         uint8_t port_id;
18809         /*
18810          * CoS Queue assigned to priority 0.  This value can only
18811          * be changed before traffic has started.
18812          */
18813         uint8_t pri0_cos_queue_id;
18814         /*
18815          * CoS Queue assigned to priority 1.  This value can only
18816          * be changed before traffic has started.
18817          */
18818         uint8_t pri1_cos_queue_id;
18819         /*
18820          * CoS Queue assigned to priority 2  This value can only
18821          * be changed before traffic has started.
18822          */
18823         uint8_t pri2_cos_queue_id;
18824         /*
18825          * CoS Queue assigned to priority 3.  This value can only
18826          * be changed before traffic has started.
18827          */
18828         uint8_t pri3_cos_queue_id;
18829         /*
18830          * CoS Queue assigned to priority 4.  This value can only
18831          * be changed before traffic has started.
18832          */
18833         uint8_t pri4_cos_queue_id;
18834         /*
18835          * CoS Queue assigned to priority 5.  This value can only
18836          * be changed before traffic has started.
18837          */
18838         uint8_t pri5_cos_queue_id;
18839         /*
18840          * CoS Queue assigned to priority 6.  This value can only
18841          * be changed before traffic has started.
18842          */
18843         uint8_t pri6_cos_queue_id;
18844         /*
18845          * CoS Queue assigned to priority 7.  This value can only
18846          * be changed before traffic has started.
18847          */
18848         uint8_t pri7_cos_queue_id;
18849         uint8_t unused_0[7];
18850 } __attribute__((packed));
18851
18852 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
18853 struct hwrm_queue_pri2cos_cfg_output {
18854         /* The specific error status for the command. */
18855         uint16_t        error_code;
18856         /* The HWRM command request type. */
18857         uint16_t        req_type;
18858         /* The sequence ID from the original command. */
18859         uint16_t        seq_id;
18860         /* The length of the response data in number of bytes. */
18861         uint16_t        resp_len;
18862         uint8_t unused_0[7];
18863         /*
18864          * This field is used in Output records to indicate that the output
18865          * is completely written to RAM.  This field should be read as '1'
18866          * to indicate that the output has been completely written.
18867          * When writing a command completion or response to an internal processor,
18868          * the order of writes has to be such that this field is written last.
18869          */
18870         uint8_t valid;
18871 } __attribute__((packed));
18872
18873 /**************************
18874  * hwrm_queue_cos2bw_qcfg *
18875  **************************/
18876
18877
18878 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
18879 struct hwrm_queue_cos2bw_qcfg_input {
18880         /* The HWRM command request type. */
18881         uint16_t        req_type;
18882         /*
18883          * The completion ring to send the completion event on. This should
18884          * be the NQ ID returned from the `nq_alloc` HWRM command.
18885          */
18886         uint16_t        cmpl_ring;
18887         /*
18888          * The sequence ID is used by the driver for tracking multiple
18889          * commands. This ID is treated as opaque data by the firmware and
18890          * the value is returned in the `hwrm_resp_hdr` upon completion.
18891          */
18892         uint16_t        seq_id;
18893         /*
18894          * The target ID of the command:
18895          * * 0x0-0xFFF8 - The function ID
18896          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18897          * * 0xFFFD - Reserved for user-space HWRM interface
18898          * * 0xFFFF - HWRM
18899          */
18900         uint16_t        target_id;
18901         /*
18902          * A physical address pointer pointing to a host buffer that the
18903          * command's response data will be written. This can be either a host
18904          * physical address (HPA) or a guest physical address (GPA) and must
18905          * point to a physically contiguous block of memory.
18906          */
18907         uint64_t        resp_addr;
18908         /*
18909          * Port ID of port for which the table is being configured.
18910          * The HWRM needs to check whether this function is allowed
18911          * to configure TC BW assignment on this port.
18912          */
18913         uint16_t        port_id;
18914         uint8_t unused_0[6];
18915 } __attribute__((packed));
18916
18917 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
18918 struct hwrm_queue_cos2bw_qcfg_output {
18919         /* The specific error status for the command. */
18920         uint16_t        error_code;
18921         /* The HWRM command request type. */
18922         uint16_t        req_type;
18923         /* The sequence ID from the original command. */
18924         uint16_t        seq_id;
18925         /* The length of the response data in number of bytes. */
18926         uint16_t        resp_len;
18927         /* ID of CoS Queue 0. */
18928         uint8_t queue_id0;
18929         uint8_t unused_0;
18930         uint16_t        unused_1;
18931         /*
18932          * Minimum BW allocated to CoS Queue.
18933          * The HWRM will translate this value into byte counter and
18934          * time interval used for this COS inside the device.
18935          */
18936         uint32_t        queue_id0_min_bw;
18937         /* The bandwidth value. */
18938         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
18939                 UINT32_C(0xfffffff)
18940         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
18941                 0
18942         /* The granularity of the value (bits or bytes). */
18943         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE \
18944                 UINT32_C(0x10000000)
18945         /* Value is in bits. */
18946         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
18947                 (UINT32_C(0x0) << 28)
18948         /* Value is in bytes. */
18949         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
18950                 (UINT32_C(0x1) << 28)
18951         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
18952                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
18953         /* bw_value_unit is 3 b */
18954         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
18955                 UINT32_C(0xe0000000)
18956         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
18957                 29
18958         /* Value is in Mb or MB (base 10). */
18959         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
18960                 (UINT32_C(0x0) << 29)
18961         /* Value is in Kb or KB (base 10). */
18962         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
18963                 (UINT32_C(0x2) << 29)
18964         /* Value is in bits or bytes. */
18965         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
18966                 (UINT32_C(0x4) << 29)
18967         /* Value is in Gb or GB (base 10). */
18968         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
18969                 (UINT32_C(0x6) << 29)
18970         /* Value is in 1/100th of a percentage of total bandwidth. */
18971         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
18972                 (UINT32_C(0x1) << 29)
18973         /* Invalid unit */
18974         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
18975                 (UINT32_C(0x7) << 29)
18976         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
18977                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
18978         /*
18979          * Maximum BW allocated to CoS Queue.
18980          * The HWRM will translate this value into byte counter and
18981          * time interval used for this COS inside the device.
18982          */
18983         uint32_t        queue_id0_max_bw;
18984         /* The bandwidth value. */
18985         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
18986                 UINT32_C(0xfffffff)
18987         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
18988                 0
18989         /* The granularity of the value (bits or bytes). */
18990         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE \
18991                 UINT32_C(0x10000000)
18992         /* Value is in bits. */
18993         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
18994                 (UINT32_C(0x0) << 28)
18995         /* Value is in bytes. */
18996         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
18997                 (UINT32_C(0x1) << 28)
18998         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
18999                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
19000         /* bw_value_unit is 3 b */
19001         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
19002                 UINT32_C(0xe0000000)
19003         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
19004                 29
19005         /* Value is in Mb or MB (base 10). */
19006         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
19007                 (UINT32_C(0x0) << 29)
19008         /* Value is in Kb or KB (base 10). */
19009         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
19010                 (UINT32_C(0x2) << 29)
19011         /* Value is in bits or bytes. */
19012         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
19013                 (UINT32_C(0x4) << 29)
19014         /* Value is in Gb or GB (base 10). */
19015         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
19016                 (UINT32_C(0x6) << 29)
19017         /* Value is in 1/100th of a percentage of total bandwidth. */
19018         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19019                 (UINT32_C(0x1) << 29)
19020         /* Invalid unit */
19021         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
19022                 (UINT32_C(0x7) << 29)
19023         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
19024                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
19025         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19026         uint8_t queue_id0_tsa_assign;
19027         /* Strict Priority */
19028         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP \
19029                 UINT32_C(0x0)
19030         /* Enhanced Transmission Selection */
19031         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
19032                 UINT32_C(0x1)
19033         /* reserved. */
19034         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
19035                 UINT32_C(0x2)
19036         /* reserved. */
19037         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
19038                 UINT32_C(0xff)
19039         /*
19040          * Priority level for strict priority. Valid only when the
19041          * tsa_assign is 0 - Strict Priority (SP)
19042          * 0..7 - Valid values.
19043          * 8..255 - Reserved.
19044          */
19045         uint8_t queue_id0_pri_lvl;
19046         /*
19047          * Weight used to allocate remaining BW for this COS after
19048          * servicing guaranteed bandwidths for all COS.
19049          */
19050         uint8_t queue_id0_bw_weight;
19051         /* ID of CoS Queue 1. */
19052         uint8_t queue_id1;
19053         /*
19054          * Minimum BW allocated to CoS Queue.
19055          * The HWRM will translate this value into byte counter and
19056          * time interval used for this COS inside the device.
19057          */
19058         uint32_t        queue_id1_min_bw;
19059         /* The bandwidth value. */
19060         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
19061                 UINT32_C(0xfffffff)
19062         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
19063                 0
19064         /* The granularity of the value (bits or bytes). */
19065         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE \
19066                 UINT32_C(0x10000000)
19067         /* Value is in bits. */
19068         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
19069                 (UINT32_C(0x0) << 28)
19070         /* Value is in bytes. */
19071         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
19072                 (UINT32_C(0x1) << 28)
19073         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
19074                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
19075         /* bw_value_unit is 3 b */
19076         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
19077                 UINT32_C(0xe0000000)
19078         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
19079                 29
19080         /* Value is in Mb or MB (base 10). */
19081         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
19082                 (UINT32_C(0x0) << 29)
19083         /* Value is in Kb or KB (base 10). */
19084         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
19085                 (UINT32_C(0x2) << 29)
19086         /* Value is in bits or bytes. */
19087         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
19088                 (UINT32_C(0x4) << 29)
19089         /* Value is in Gb or GB (base 10). */
19090         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
19091                 (UINT32_C(0x6) << 29)
19092         /* Value is in 1/100th of a percentage of total bandwidth. */
19093         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19094                 (UINT32_C(0x1) << 29)
19095         /* Invalid unit */
19096         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
19097                 (UINT32_C(0x7) << 29)
19098         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
19099                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
19100         /*
19101          * Maximum BW allocated to CoS queue.
19102          * The HWRM will translate this value into byte counter and
19103          * time interval used for this COS inside the device.
19104          */
19105         uint32_t        queue_id1_max_bw;
19106         /* The bandwidth value. */
19107         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
19108                 UINT32_C(0xfffffff)
19109         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
19110                 0
19111         /* The granularity of the value (bits or bytes). */
19112         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE \
19113                 UINT32_C(0x10000000)
19114         /* Value is in bits. */
19115         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
19116                 (UINT32_C(0x0) << 28)
19117         /* Value is in bytes. */
19118         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
19119                 (UINT32_C(0x1) << 28)
19120         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
19121                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
19122         /* bw_value_unit is 3 b */
19123         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
19124                 UINT32_C(0xe0000000)
19125         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
19126                 29
19127         /* Value is in Mb or MB (base 10). */
19128         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
19129                 (UINT32_C(0x0) << 29)
19130         /* Value is in Kb or KB (base 10). */
19131         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
19132                 (UINT32_C(0x2) << 29)
19133         /* Value is in bits or bytes. */
19134         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
19135                 (UINT32_C(0x4) << 29)
19136         /* Value is in Gb or GB (base 10). */
19137         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
19138                 (UINT32_C(0x6) << 29)
19139         /* Value is in 1/100th of a percentage of total bandwidth. */
19140         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19141                 (UINT32_C(0x1) << 29)
19142         /* Invalid unit */
19143         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
19144                 (UINT32_C(0x7) << 29)
19145         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
19146                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
19147         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19148         uint8_t queue_id1_tsa_assign;
19149         /* Strict Priority */
19150         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP \
19151                 UINT32_C(0x0)
19152         /* Enhanced Transmission Selection */
19153         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
19154                 UINT32_C(0x1)
19155         /* reserved. */
19156         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
19157                 UINT32_C(0x2)
19158         /* reserved. */
19159         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
19160                 UINT32_C(0xff)
19161         /*
19162          * Priority level for strict priority. Valid only when the
19163          * tsa_assign is 0 - Strict Priority (SP)
19164          * 0..7 - Valid values.
19165          * 8..255 - Reserved.
19166          */
19167         uint8_t queue_id1_pri_lvl;
19168         /*
19169          * Weight used to allocate remaining BW for this COS after
19170          * servicing guaranteed bandwidths for all COS.
19171          */
19172         uint8_t queue_id1_bw_weight;
19173         /* ID of CoS Queue 2. */
19174         uint8_t queue_id2;
19175         /*
19176          * Minimum BW allocated to CoS Queue.
19177          * The HWRM will translate this value into byte counter and
19178          * time interval used for this COS inside the device.
19179          */
19180         uint32_t        queue_id2_min_bw;
19181         /* The bandwidth value. */
19182         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
19183                 UINT32_C(0xfffffff)
19184         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
19185                 0
19186         /* The granularity of the value (bits or bytes). */
19187         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE \
19188                 UINT32_C(0x10000000)
19189         /* Value is in bits. */
19190         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
19191                 (UINT32_C(0x0) << 28)
19192         /* Value is in bytes. */
19193         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
19194                 (UINT32_C(0x1) << 28)
19195         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
19196                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
19197         /* bw_value_unit is 3 b */
19198         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
19199                 UINT32_C(0xe0000000)
19200         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
19201                 29
19202         /* Value is in Mb or MB (base 10). */
19203         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
19204                 (UINT32_C(0x0) << 29)
19205         /* Value is in Kb or KB (base 10). */
19206         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
19207                 (UINT32_C(0x2) << 29)
19208         /* Value is in bits or bytes. */
19209         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
19210                 (UINT32_C(0x4) << 29)
19211         /* Value is in Gb or GB (base 10). */
19212         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
19213                 (UINT32_C(0x6) << 29)
19214         /* Value is in 1/100th of a percentage of total bandwidth. */
19215         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19216                 (UINT32_C(0x1) << 29)
19217         /* Invalid unit */
19218         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
19219                 (UINT32_C(0x7) << 29)
19220         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
19221                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
19222         /*
19223          * Maximum BW allocated to CoS queue.
19224          * The HWRM will translate this value into byte counter and
19225          * time interval used for this COS inside the device.
19226          */
19227         uint32_t        queue_id2_max_bw;
19228         /* The bandwidth value. */
19229         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
19230                 UINT32_C(0xfffffff)
19231         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
19232                 0
19233         /* The granularity of the value (bits or bytes). */
19234         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE \
19235                 UINT32_C(0x10000000)
19236         /* Value is in bits. */
19237         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
19238                 (UINT32_C(0x0) << 28)
19239         /* Value is in bytes. */
19240         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
19241                 (UINT32_C(0x1) << 28)
19242         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
19243                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
19244         /* bw_value_unit is 3 b */
19245         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
19246                 UINT32_C(0xe0000000)
19247         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
19248                 29
19249         /* Value is in Mb or MB (base 10). */
19250         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
19251                 (UINT32_C(0x0) << 29)
19252         /* Value is in Kb or KB (base 10). */
19253         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
19254                 (UINT32_C(0x2) << 29)
19255         /* Value is in bits or bytes. */
19256         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
19257                 (UINT32_C(0x4) << 29)
19258         /* Value is in Gb or GB (base 10). */
19259         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
19260                 (UINT32_C(0x6) << 29)
19261         /* Value is in 1/100th of a percentage of total bandwidth. */
19262         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19263                 (UINT32_C(0x1) << 29)
19264         /* Invalid unit */
19265         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
19266                 (UINT32_C(0x7) << 29)
19267         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
19268                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
19269         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19270         uint8_t queue_id2_tsa_assign;
19271         /* Strict Priority */
19272         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP \
19273                 UINT32_C(0x0)
19274         /* Enhanced Transmission Selection */
19275         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
19276                 UINT32_C(0x1)
19277         /* reserved. */
19278         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
19279                 UINT32_C(0x2)
19280         /* reserved. */
19281         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
19282                 UINT32_C(0xff)
19283         /*
19284          * Priority level for strict priority. Valid only when the
19285          * tsa_assign is 0 - Strict Priority (SP)
19286          * 0..7 - Valid values.
19287          * 8..255 - Reserved.
19288          */
19289         uint8_t queue_id2_pri_lvl;
19290         /*
19291          * Weight used to allocate remaining BW for this COS after
19292          * servicing guaranteed bandwidths for all COS.
19293          */
19294         uint8_t queue_id2_bw_weight;
19295         /* ID of CoS Queue 3. */
19296         uint8_t queue_id3;
19297         /*
19298          * Minimum BW allocated to CoS Queue.
19299          * The HWRM will translate this value into byte counter and
19300          * time interval used for this COS inside the device.
19301          */
19302         uint32_t        queue_id3_min_bw;
19303         /* The bandwidth value. */
19304         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
19305                 UINT32_C(0xfffffff)
19306         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
19307                 0
19308         /* The granularity of the value (bits or bytes). */
19309         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE \
19310                 UINT32_C(0x10000000)
19311         /* Value is in bits. */
19312         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
19313                 (UINT32_C(0x0) << 28)
19314         /* Value is in bytes. */
19315         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
19316                 (UINT32_C(0x1) << 28)
19317         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
19318                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
19319         /* bw_value_unit is 3 b */
19320         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
19321                 UINT32_C(0xe0000000)
19322         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
19323                 29
19324         /* Value is in Mb or MB (base 10). */
19325         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
19326                 (UINT32_C(0x0) << 29)
19327         /* Value is in Kb or KB (base 10). */
19328         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
19329                 (UINT32_C(0x2) << 29)
19330         /* Value is in bits or bytes. */
19331         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
19332                 (UINT32_C(0x4) << 29)
19333         /* Value is in Gb or GB (base 10). */
19334         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
19335                 (UINT32_C(0x6) << 29)
19336         /* Value is in 1/100th of a percentage of total bandwidth. */
19337         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19338                 (UINT32_C(0x1) << 29)
19339         /* Invalid unit */
19340         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
19341                 (UINT32_C(0x7) << 29)
19342         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
19343                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
19344         /*
19345          * Maximum BW allocated to CoS queue.
19346          * The HWRM will translate this value into byte counter and
19347          * time interval used for this COS inside the device.
19348          */
19349         uint32_t        queue_id3_max_bw;
19350         /* The bandwidth value. */
19351         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
19352                 UINT32_C(0xfffffff)
19353         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
19354                 0
19355         /* The granularity of the value (bits or bytes). */
19356         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE \
19357                 UINT32_C(0x10000000)
19358         /* Value is in bits. */
19359         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
19360                 (UINT32_C(0x0) << 28)
19361         /* Value is in bytes. */
19362         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
19363                 (UINT32_C(0x1) << 28)
19364         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
19365                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
19366         /* bw_value_unit is 3 b */
19367         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
19368                 UINT32_C(0xe0000000)
19369         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
19370                 29
19371         /* Value is in Mb or MB (base 10). */
19372         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
19373                 (UINT32_C(0x0) << 29)
19374         /* Value is in Kb or KB (base 10). */
19375         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
19376                 (UINT32_C(0x2) << 29)
19377         /* Value is in bits or bytes. */
19378         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
19379                 (UINT32_C(0x4) << 29)
19380         /* Value is in Gb or GB (base 10). */
19381         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
19382                 (UINT32_C(0x6) << 29)
19383         /* Value is in 1/100th of a percentage of total bandwidth. */
19384         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19385                 (UINT32_C(0x1) << 29)
19386         /* Invalid unit */
19387         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
19388                 (UINT32_C(0x7) << 29)
19389         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
19390                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
19391         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19392         uint8_t queue_id3_tsa_assign;
19393         /* Strict Priority */
19394         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP \
19395                 UINT32_C(0x0)
19396         /* Enhanced Transmission Selection */
19397         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
19398                 UINT32_C(0x1)
19399         /* reserved. */
19400         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
19401                 UINT32_C(0x2)
19402         /* reserved. */
19403         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
19404                 UINT32_C(0xff)
19405         /*
19406          * Priority level for strict priority. Valid only when the
19407          * tsa_assign is 0 - Strict Priority (SP)
19408          * 0..7 - Valid values.
19409          * 8..255 - Reserved.
19410          */
19411         uint8_t queue_id3_pri_lvl;
19412         /*
19413          * Weight used to allocate remaining BW for this COS after
19414          * servicing guaranteed bandwidths for all COS.
19415          */
19416         uint8_t queue_id3_bw_weight;
19417         /* ID of CoS Queue 4. */
19418         uint8_t queue_id4;
19419         /*
19420          * Minimum BW allocated to CoS Queue.
19421          * The HWRM will translate this value into byte counter and
19422          * time interval used for this COS inside the device.
19423          */
19424         uint32_t        queue_id4_min_bw;
19425         /* The bandwidth value. */
19426         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
19427                 UINT32_C(0xfffffff)
19428         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
19429                 0
19430         /* The granularity of the value (bits or bytes). */
19431         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE \
19432                 UINT32_C(0x10000000)
19433         /* Value is in bits. */
19434         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
19435                 (UINT32_C(0x0) << 28)
19436         /* Value is in bytes. */
19437         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
19438                 (UINT32_C(0x1) << 28)
19439         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
19440                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
19441         /* bw_value_unit is 3 b */
19442         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
19443                 UINT32_C(0xe0000000)
19444         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
19445                 29
19446         /* Value is in Mb or MB (base 10). */
19447         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
19448                 (UINT32_C(0x0) << 29)
19449         /* Value is in Kb or KB (base 10). */
19450         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
19451                 (UINT32_C(0x2) << 29)
19452         /* Value is in bits or bytes. */
19453         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
19454                 (UINT32_C(0x4) << 29)
19455         /* Value is in Gb or GB (base 10). */
19456         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
19457                 (UINT32_C(0x6) << 29)
19458         /* Value is in 1/100th of a percentage of total bandwidth. */
19459         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19460                 (UINT32_C(0x1) << 29)
19461         /* Invalid unit */
19462         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
19463                 (UINT32_C(0x7) << 29)
19464         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
19465                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
19466         /*
19467          * Maximum BW allocated to CoS queue.
19468          * The HWRM will translate this value into byte counter and
19469          * time interval used for this COS inside the device.
19470          */
19471         uint32_t        queue_id4_max_bw;
19472         /* The bandwidth value. */
19473         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
19474                 UINT32_C(0xfffffff)
19475         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
19476                 0
19477         /* The granularity of the value (bits or bytes). */
19478         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE \
19479                 UINT32_C(0x10000000)
19480         /* Value is in bits. */
19481         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
19482                 (UINT32_C(0x0) << 28)
19483         /* Value is in bytes. */
19484         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
19485                 (UINT32_C(0x1) << 28)
19486         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
19487                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
19488         /* bw_value_unit is 3 b */
19489         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
19490                 UINT32_C(0xe0000000)
19491         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
19492                 29
19493         /* Value is in Mb or MB (base 10). */
19494         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
19495                 (UINT32_C(0x0) << 29)
19496         /* Value is in Kb or KB (base 10). */
19497         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
19498                 (UINT32_C(0x2) << 29)
19499         /* Value is in bits or bytes. */
19500         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
19501                 (UINT32_C(0x4) << 29)
19502         /* Value is in Gb or GB (base 10). */
19503         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
19504                 (UINT32_C(0x6) << 29)
19505         /* Value is in 1/100th of a percentage of total bandwidth. */
19506         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19507                 (UINT32_C(0x1) << 29)
19508         /* Invalid unit */
19509         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
19510                 (UINT32_C(0x7) << 29)
19511         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
19512                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
19513         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19514         uint8_t queue_id4_tsa_assign;
19515         /* Strict Priority */
19516         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP \
19517                 UINT32_C(0x0)
19518         /* Enhanced Transmission Selection */
19519         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
19520                 UINT32_C(0x1)
19521         /* reserved. */
19522         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
19523                 UINT32_C(0x2)
19524         /* reserved. */
19525         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
19526                 UINT32_C(0xff)
19527         /*
19528          * Priority level for strict priority. Valid only when the
19529          * tsa_assign is 0 - Strict Priority (SP)
19530          * 0..7 - Valid values.
19531          * 8..255 - Reserved.
19532          */
19533         uint8_t queue_id4_pri_lvl;
19534         /*
19535          * Weight used to allocate remaining BW for this COS after
19536          * servicing guaranteed bandwidths for all COS.
19537          */
19538         uint8_t queue_id4_bw_weight;
19539         /* ID of CoS Queue 5. */
19540         uint8_t queue_id5;
19541         /*
19542          * Minimum BW allocated to CoS Queue.
19543          * The HWRM will translate this value into byte counter and
19544          * time interval used for this COS inside the device.
19545          */
19546         uint32_t        queue_id5_min_bw;
19547         /* The bandwidth value. */
19548         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
19549                 UINT32_C(0xfffffff)
19550         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
19551                 0
19552         /* The granularity of the value (bits or bytes). */
19553         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE \
19554                 UINT32_C(0x10000000)
19555         /* Value is in bits. */
19556         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
19557                 (UINT32_C(0x0) << 28)
19558         /* Value is in bytes. */
19559         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
19560                 (UINT32_C(0x1) << 28)
19561         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
19562                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
19563         /* bw_value_unit is 3 b */
19564         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
19565                 UINT32_C(0xe0000000)
19566         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
19567                 29
19568         /* Value is in Mb or MB (base 10). */
19569         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
19570                 (UINT32_C(0x0) << 29)
19571         /* Value is in Kb or KB (base 10). */
19572         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
19573                 (UINT32_C(0x2) << 29)
19574         /* Value is in bits or bytes. */
19575         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
19576                 (UINT32_C(0x4) << 29)
19577         /* Value is in Gb or GB (base 10). */
19578         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
19579                 (UINT32_C(0x6) << 29)
19580         /* Value is in 1/100th of a percentage of total bandwidth. */
19581         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19582                 (UINT32_C(0x1) << 29)
19583         /* Invalid unit */
19584         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
19585                 (UINT32_C(0x7) << 29)
19586         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
19587                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
19588         /*
19589          * Maximum BW allocated to CoS queue.
19590          * The HWRM will translate this value into byte counter and
19591          * time interval used for this COS inside the device.
19592          */
19593         uint32_t        queue_id5_max_bw;
19594         /* The bandwidth value. */
19595         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
19596                 UINT32_C(0xfffffff)
19597         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
19598                 0
19599         /* The granularity of the value (bits or bytes). */
19600         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE \
19601                 UINT32_C(0x10000000)
19602         /* Value is in bits. */
19603         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
19604                 (UINT32_C(0x0) << 28)
19605         /* Value is in bytes. */
19606         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
19607                 (UINT32_C(0x1) << 28)
19608         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
19609                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
19610         /* bw_value_unit is 3 b */
19611         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
19612                 UINT32_C(0xe0000000)
19613         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
19614                 29
19615         /* Value is in Mb or MB (base 10). */
19616         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
19617                 (UINT32_C(0x0) << 29)
19618         /* Value is in Kb or KB (base 10). */
19619         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
19620                 (UINT32_C(0x2) << 29)
19621         /* Value is in bits or bytes. */
19622         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
19623                 (UINT32_C(0x4) << 29)
19624         /* Value is in Gb or GB (base 10). */
19625         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
19626                 (UINT32_C(0x6) << 29)
19627         /* Value is in 1/100th of a percentage of total bandwidth. */
19628         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19629                 (UINT32_C(0x1) << 29)
19630         /* Invalid unit */
19631         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
19632                 (UINT32_C(0x7) << 29)
19633         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
19634                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
19635         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19636         uint8_t queue_id5_tsa_assign;
19637         /* Strict Priority */
19638         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP \
19639                 UINT32_C(0x0)
19640         /* Enhanced Transmission Selection */
19641         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
19642                 UINT32_C(0x1)
19643         /* reserved. */
19644         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
19645                 UINT32_C(0x2)
19646         /* reserved. */
19647         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
19648                 UINT32_C(0xff)
19649         /*
19650          * Priority level for strict priority. Valid only when the
19651          * tsa_assign is 0 - Strict Priority (SP)
19652          * 0..7 - Valid values.
19653          * 8..255 - Reserved.
19654          */
19655         uint8_t queue_id5_pri_lvl;
19656         /*
19657          * Weight used to allocate remaining BW for this COS after
19658          * servicing guaranteed bandwidths for all COS.
19659          */
19660         uint8_t queue_id5_bw_weight;
19661         /* ID of CoS Queue 6. */
19662         uint8_t queue_id6;
19663         /*
19664          * Minimum BW allocated to CoS Queue.
19665          * The HWRM will translate this value into byte counter and
19666          * time interval used for this COS inside the device.
19667          */
19668         uint32_t        queue_id6_min_bw;
19669         /* The bandwidth value. */
19670         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
19671                 UINT32_C(0xfffffff)
19672         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
19673                 0
19674         /* The granularity of the value (bits or bytes). */
19675         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE \
19676                 UINT32_C(0x10000000)
19677         /* Value is in bits. */
19678         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
19679                 (UINT32_C(0x0) << 28)
19680         /* Value is in bytes. */
19681         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
19682                 (UINT32_C(0x1) << 28)
19683         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
19684                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
19685         /* bw_value_unit is 3 b */
19686         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
19687                 UINT32_C(0xe0000000)
19688         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
19689                 29
19690         /* Value is in Mb or MB (base 10). */
19691         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
19692                 (UINT32_C(0x0) << 29)
19693         /* Value is in Kb or KB (base 10). */
19694         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
19695                 (UINT32_C(0x2) << 29)
19696         /* Value is in bits or bytes. */
19697         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
19698                 (UINT32_C(0x4) << 29)
19699         /* Value is in Gb or GB (base 10). */
19700         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
19701                 (UINT32_C(0x6) << 29)
19702         /* Value is in 1/100th of a percentage of total bandwidth. */
19703         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19704                 (UINT32_C(0x1) << 29)
19705         /* Invalid unit */
19706         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
19707                 (UINT32_C(0x7) << 29)
19708         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
19709                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
19710         /*
19711          * Maximum BW allocated to CoS queue.
19712          * The HWRM will translate this value into byte counter and
19713          * time interval used for this COS inside the device.
19714          */
19715         uint32_t        queue_id6_max_bw;
19716         /* The bandwidth value. */
19717         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
19718                 UINT32_C(0xfffffff)
19719         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
19720                 0
19721         /* The granularity of the value (bits or bytes). */
19722         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE \
19723                 UINT32_C(0x10000000)
19724         /* Value is in bits. */
19725         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
19726                 (UINT32_C(0x0) << 28)
19727         /* Value is in bytes. */
19728         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
19729                 (UINT32_C(0x1) << 28)
19730         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
19731                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
19732         /* bw_value_unit is 3 b */
19733         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
19734                 UINT32_C(0xe0000000)
19735         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
19736                 29
19737         /* Value is in Mb or MB (base 10). */
19738         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
19739                 (UINT32_C(0x0) << 29)
19740         /* Value is in Kb or KB (base 10). */
19741         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
19742                 (UINT32_C(0x2) << 29)
19743         /* Value is in bits or bytes. */
19744         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
19745                 (UINT32_C(0x4) << 29)
19746         /* Value is in Gb or GB (base 10). */
19747         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
19748                 (UINT32_C(0x6) << 29)
19749         /* Value is in 1/100th of a percentage of total bandwidth. */
19750         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19751                 (UINT32_C(0x1) << 29)
19752         /* Invalid unit */
19753         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
19754                 (UINT32_C(0x7) << 29)
19755         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
19756                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
19757         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19758         uint8_t queue_id6_tsa_assign;
19759         /* Strict Priority */
19760         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP \
19761                 UINT32_C(0x0)
19762         /* Enhanced Transmission Selection */
19763         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
19764                 UINT32_C(0x1)
19765         /* reserved. */
19766         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
19767                 UINT32_C(0x2)
19768         /* reserved. */
19769         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
19770                 UINT32_C(0xff)
19771         /*
19772          * Priority level for strict priority. Valid only when the
19773          * tsa_assign is 0 - Strict Priority (SP)
19774          * 0..7 - Valid values.
19775          * 8..255 - Reserved.
19776          */
19777         uint8_t queue_id6_pri_lvl;
19778         /*
19779          * Weight used to allocate remaining BW for this COS after
19780          * servicing guaranteed bandwidths for all COS.
19781          */
19782         uint8_t queue_id6_bw_weight;
19783         /* ID of CoS Queue 7. */
19784         uint8_t queue_id7;
19785         /*
19786          * Minimum BW allocated to CoS Queue.
19787          * The HWRM will translate this value into byte counter and
19788          * time interval used for this COS inside the device.
19789          */
19790         uint32_t        queue_id7_min_bw;
19791         /* The bandwidth value. */
19792         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
19793                 UINT32_C(0xfffffff)
19794         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
19795                 0
19796         /* The granularity of the value (bits or bytes). */
19797         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE \
19798                 UINT32_C(0x10000000)
19799         /* Value is in bits. */
19800         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
19801                 (UINT32_C(0x0) << 28)
19802         /* Value is in bytes. */
19803         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
19804                 (UINT32_C(0x1) << 28)
19805         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
19806                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
19807         /* bw_value_unit is 3 b */
19808         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
19809                 UINT32_C(0xe0000000)
19810         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
19811                 29
19812         /* Value is in Mb or MB (base 10). */
19813         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
19814                 (UINT32_C(0x0) << 29)
19815         /* Value is in Kb or KB (base 10). */
19816         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
19817                 (UINT32_C(0x2) << 29)
19818         /* Value is in bits or bytes. */
19819         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
19820                 (UINT32_C(0x4) << 29)
19821         /* Value is in Gb or GB (base 10). */
19822         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
19823                 (UINT32_C(0x6) << 29)
19824         /* Value is in 1/100th of a percentage of total bandwidth. */
19825         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19826                 (UINT32_C(0x1) << 29)
19827         /* Invalid unit */
19828         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
19829                 (UINT32_C(0x7) << 29)
19830         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
19831                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
19832         /*
19833          * Maximum BW allocated to CoS queue.
19834          * The HWRM will translate this value into byte counter and
19835          * time interval used for this COS inside the device.
19836          */
19837         uint32_t        queue_id7_max_bw;
19838         /* The bandwidth value. */
19839         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
19840                 UINT32_C(0xfffffff)
19841         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
19842                 0
19843         /* The granularity of the value (bits or bytes). */
19844         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE \
19845                 UINT32_C(0x10000000)
19846         /* Value is in bits. */
19847         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
19848                 (UINT32_C(0x0) << 28)
19849         /* Value is in bytes. */
19850         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
19851                 (UINT32_C(0x1) << 28)
19852         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
19853                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
19854         /* bw_value_unit is 3 b */
19855         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
19856                 UINT32_C(0xe0000000)
19857         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
19858                 29
19859         /* Value is in Mb or MB (base 10). */
19860         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
19861                 (UINT32_C(0x0) << 29)
19862         /* Value is in Kb or KB (base 10). */
19863         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
19864                 (UINT32_C(0x2) << 29)
19865         /* Value is in bits or bytes. */
19866         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
19867                 (UINT32_C(0x4) << 29)
19868         /* Value is in Gb or GB (base 10). */
19869         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
19870                 (UINT32_C(0x6) << 29)
19871         /* Value is in 1/100th of a percentage of total bandwidth. */
19872         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19873                 (UINT32_C(0x1) << 29)
19874         /* Invalid unit */
19875         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
19876                 (UINT32_C(0x7) << 29)
19877         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
19878                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
19879         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19880         uint8_t queue_id7_tsa_assign;
19881         /* Strict Priority */
19882         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP \
19883                 UINT32_C(0x0)
19884         /* Enhanced Transmission Selection */
19885         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
19886                 UINT32_C(0x1)
19887         /* reserved. */
19888         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
19889                 UINT32_C(0x2)
19890         /* reserved. */
19891         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
19892                 UINT32_C(0xff)
19893         /*
19894          * Priority level for strict priority. Valid only when the
19895          * tsa_assign is 0 - Strict Priority (SP)
19896          * 0..7 - Valid values.
19897          * 8..255 - Reserved.
19898          */
19899         uint8_t queue_id7_pri_lvl;
19900         /*
19901          * Weight used to allocate remaining BW for this COS after
19902          * servicing guaranteed bandwidths for all COS.
19903          */
19904         uint8_t queue_id7_bw_weight;
19905         uint8_t unused_2[4];
19906         /*
19907          * This field is used in Output records to indicate that the output
19908          * is completely written to RAM.  This field should be read as '1'
19909          * to indicate that the output has been completely written.
19910          * When writing a command completion or response to an internal processor,
19911          * the order of writes has to be such that this field is written last.
19912          */
19913         uint8_t valid;
19914 } __attribute__((packed));
19915
19916 /*************************
19917  * hwrm_queue_cos2bw_cfg *
19918  *************************/
19919
19920
19921 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
19922 struct hwrm_queue_cos2bw_cfg_input {
19923         /* The HWRM command request type. */
19924         uint16_t        req_type;
19925         /*
19926          * The completion ring to send the completion event on. This should
19927          * be the NQ ID returned from the `nq_alloc` HWRM command.
19928          */
19929         uint16_t        cmpl_ring;
19930         /*
19931          * The sequence ID is used by the driver for tracking multiple
19932          * commands. This ID is treated as opaque data by the firmware and
19933          * the value is returned in the `hwrm_resp_hdr` upon completion.
19934          */
19935         uint16_t        seq_id;
19936         /*
19937          * The target ID of the command:
19938          * * 0x0-0xFFF8 - The function ID
19939          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19940          * * 0xFFFD - Reserved for user-space HWRM interface
19941          * * 0xFFFF - HWRM
19942          */
19943         uint16_t        target_id;
19944         /*
19945          * A physical address pointer pointing to a host buffer that the
19946          * command's response data will be written. This can be either a host
19947          * physical address (HPA) or a guest physical address (GPA) and must
19948          * point to a physically contiguous block of memory.
19949          */
19950         uint64_t        resp_addr;
19951         uint32_t        flags;
19952         uint32_t        enables;
19953         /*
19954          * If this bit is set to 1, then all queue_id0 related
19955          * parameters in this command are valid.
19956          */
19957         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID \
19958                 UINT32_C(0x1)
19959         /*
19960          * If this bit is set to 1, then all queue_id1 related
19961          * parameters in this command are valid.
19962          */
19963         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID \
19964                 UINT32_C(0x2)
19965         /*
19966          * If this bit is set to 1, then all queue_id2 related
19967          * parameters in this command are valid.
19968          */
19969         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID \
19970                 UINT32_C(0x4)
19971         /*
19972          * If this bit is set to 1, then all queue_id3 related
19973          * parameters in this command are valid.
19974          */
19975         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID \
19976                 UINT32_C(0x8)
19977         /*
19978          * If this bit is set to 1, then all queue_id4 related
19979          * parameters in this command are valid.
19980          */
19981         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID \
19982                 UINT32_C(0x10)
19983         /*
19984          * If this bit is set to 1, then all queue_id5 related
19985          * parameters in this command are valid.
19986          */
19987         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID \
19988                 UINT32_C(0x20)
19989         /*
19990          * If this bit is set to 1, then all queue_id6 related
19991          * parameters in this command are valid.
19992          */
19993         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID \
19994                 UINT32_C(0x40)
19995         /*
19996          * If this bit is set to 1, then all queue_id7 related
19997          * parameters in this command are valid.
19998          */
19999         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID \
20000                 UINT32_C(0x80)
20001         /*
20002          * Port ID of port for which the table is being configured.
20003          * The HWRM needs to check whether this function is allowed
20004          * to configure TC BW assignment on this port.
20005          */
20006         uint16_t        port_id;
20007         /* ID of CoS Queue 0. */
20008         uint8_t queue_id0;
20009         uint8_t unused_0;
20010         /*
20011          * Minimum BW allocated to CoS Queue.
20012          * The HWRM will translate this value into byte counter and
20013          * time interval used for this COS inside the device.
20014          */
20015         uint32_t        queue_id0_min_bw;
20016         /* The bandwidth value. */
20017         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
20018                 UINT32_C(0xfffffff)
20019         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
20020                 0
20021         /* The granularity of the value (bits or bytes). */
20022         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE \
20023                 UINT32_C(0x10000000)
20024         /* Value is in bits. */
20025         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
20026                 (UINT32_C(0x0) << 28)
20027         /* Value is in bytes. */
20028         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
20029                 (UINT32_C(0x1) << 28)
20030         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
20031                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
20032         /* bw_value_unit is 3 b */
20033         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
20034                 UINT32_C(0xe0000000)
20035         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
20036                 29
20037         /* Value is in Mb or MB (base 10). */
20038         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
20039                 (UINT32_C(0x0) << 29)
20040         /* Value is in Kb or KB (base 10). */
20041         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
20042                 (UINT32_C(0x2) << 29)
20043         /* Value is in bits or bytes. */
20044         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
20045                 (UINT32_C(0x4) << 29)
20046         /* Value is in Gb or GB (base 10). */
20047         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
20048                 (UINT32_C(0x6) << 29)
20049         /* Value is in 1/100th of a percentage of total bandwidth. */
20050         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20051                 (UINT32_C(0x1) << 29)
20052         /* Invalid unit */
20053         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
20054                 (UINT32_C(0x7) << 29)
20055         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
20056                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
20057         /*
20058          * Maximum BW allocated to CoS Queue.
20059          * The HWRM will translate this value into byte counter and
20060          * time interval used for this COS inside the device.
20061          */
20062         uint32_t        queue_id0_max_bw;
20063         /* The bandwidth value. */
20064         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
20065                 UINT32_C(0xfffffff)
20066         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
20067                 0
20068         /* The granularity of the value (bits or bytes). */
20069         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE \
20070                 UINT32_C(0x10000000)
20071         /* Value is in bits. */
20072         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
20073                 (UINT32_C(0x0) << 28)
20074         /* Value is in bytes. */
20075         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
20076                 (UINT32_C(0x1) << 28)
20077         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
20078                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
20079         /* bw_value_unit is 3 b */
20080         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
20081                 UINT32_C(0xe0000000)
20082         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
20083                 29
20084         /* Value is in Mb or MB (base 10). */
20085         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
20086                 (UINT32_C(0x0) << 29)
20087         /* Value is in Kb or KB (base 10). */
20088         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
20089                 (UINT32_C(0x2) << 29)
20090         /* Value is in bits or bytes. */
20091         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
20092                 (UINT32_C(0x4) << 29)
20093         /* Value is in Gb or GB (base 10). */
20094         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
20095                 (UINT32_C(0x6) << 29)
20096         /* Value is in 1/100th of a percentage of total bandwidth. */
20097         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20098                 (UINT32_C(0x1) << 29)
20099         /* Invalid unit */
20100         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
20101                 (UINT32_C(0x7) << 29)
20102         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
20103                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
20104         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20105         uint8_t queue_id0_tsa_assign;
20106         /* Strict Priority */
20107         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP \
20108                 UINT32_C(0x0)
20109         /* Enhanced Transmission Selection */
20110         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
20111                 UINT32_C(0x1)
20112         /* reserved. */
20113         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
20114                 UINT32_C(0x2)
20115         /* reserved. */
20116         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
20117                 UINT32_C(0xff)
20118         /*
20119          * Priority level for strict priority. Valid only when the
20120          * tsa_assign is 0 - Strict Priority (SP)
20121          * 0..7 - Valid values.
20122          * 8..255 - Reserved.
20123          */
20124         uint8_t queue_id0_pri_lvl;
20125         /*
20126          * Weight used to allocate remaining BW for this COS after
20127          * servicing guaranteed bandwidths for all COS.
20128          */
20129         uint8_t queue_id0_bw_weight;
20130         /* ID of CoS Queue 1. */
20131         uint8_t queue_id1;
20132         /*
20133          * Minimum BW allocated to CoS Queue.
20134          * The HWRM will translate this value into byte counter and
20135          * time interval used for this COS inside the device.
20136          */
20137         uint32_t        queue_id1_min_bw;
20138         /* The bandwidth value. */
20139         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
20140                 UINT32_C(0xfffffff)
20141         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
20142                 0
20143         /* The granularity of the value (bits or bytes). */
20144         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE \
20145                 UINT32_C(0x10000000)
20146         /* Value is in bits. */
20147         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
20148                 (UINT32_C(0x0) << 28)
20149         /* Value is in bytes. */
20150         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
20151                 (UINT32_C(0x1) << 28)
20152         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
20153                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
20154         /* bw_value_unit is 3 b */
20155         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
20156                 UINT32_C(0xe0000000)
20157         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
20158                 29
20159         /* Value is in Mb or MB (base 10). */
20160         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
20161                 (UINT32_C(0x0) << 29)
20162         /* Value is in Kb or KB (base 10). */
20163         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
20164                 (UINT32_C(0x2) << 29)
20165         /* Value is in bits or bytes. */
20166         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
20167                 (UINT32_C(0x4) << 29)
20168         /* Value is in Gb or GB (base 10). */
20169         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
20170                 (UINT32_C(0x6) << 29)
20171         /* Value is in 1/100th of a percentage of total bandwidth. */
20172         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20173                 (UINT32_C(0x1) << 29)
20174         /* Invalid unit */
20175         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
20176                 (UINT32_C(0x7) << 29)
20177         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
20178                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
20179         /*
20180          * Maximum BW allocated to CoS queue.
20181          * The HWRM will translate this value into byte counter and
20182          * time interval used for this COS inside the device.
20183          */
20184         uint32_t        queue_id1_max_bw;
20185         /* The bandwidth value. */
20186         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
20187                 UINT32_C(0xfffffff)
20188         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
20189                 0
20190         /* The granularity of the value (bits or bytes). */
20191         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE \
20192                 UINT32_C(0x10000000)
20193         /* Value is in bits. */
20194         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
20195                 (UINT32_C(0x0) << 28)
20196         /* Value is in bytes. */
20197         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
20198                 (UINT32_C(0x1) << 28)
20199         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
20200                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
20201         /* bw_value_unit is 3 b */
20202         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
20203                 UINT32_C(0xe0000000)
20204         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
20205                 29
20206         /* Value is in Mb or MB (base 10). */
20207         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
20208                 (UINT32_C(0x0) << 29)
20209         /* Value is in Kb or KB (base 10). */
20210         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
20211                 (UINT32_C(0x2) << 29)
20212         /* Value is in bits or bytes. */
20213         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
20214                 (UINT32_C(0x4) << 29)
20215         /* Value is in Gb or GB (base 10). */
20216         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
20217                 (UINT32_C(0x6) << 29)
20218         /* Value is in 1/100th of a percentage of total bandwidth. */
20219         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20220                 (UINT32_C(0x1) << 29)
20221         /* Invalid unit */
20222         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
20223                 (UINT32_C(0x7) << 29)
20224         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
20225                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
20226         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20227         uint8_t queue_id1_tsa_assign;
20228         /* Strict Priority */
20229         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP \
20230                 UINT32_C(0x0)
20231         /* Enhanced Transmission Selection */
20232         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
20233                 UINT32_C(0x1)
20234         /* reserved. */
20235         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
20236                 UINT32_C(0x2)
20237         /* reserved. */
20238         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
20239                 UINT32_C(0xff)
20240         /*
20241          * Priority level for strict priority. Valid only when the
20242          * tsa_assign is 0 - Strict Priority (SP)
20243          * 0..7 - Valid values.
20244          * 8..255 - Reserved.
20245          */
20246         uint8_t queue_id1_pri_lvl;
20247         /*
20248          * Weight used to allocate remaining BW for this COS after
20249          * servicing guaranteed bandwidths for all COS.
20250          */
20251         uint8_t queue_id1_bw_weight;
20252         /* ID of CoS Queue 2. */
20253         uint8_t queue_id2;
20254         /*
20255          * Minimum BW allocated to CoS Queue.
20256          * The HWRM will translate this value into byte counter and
20257          * time interval used for this COS inside the device.
20258          */
20259         uint32_t        queue_id2_min_bw;
20260         /* The bandwidth value. */
20261         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
20262                 UINT32_C(0xfffffff)
20263         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
20264                 0
20265         /* The granularity of the value (bits or bytes). */
20266         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE \
20267                 UINT32_C(0x10000000)
20268         /* Value is in bits. */
20269         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
20270                 (UINT32_C(0x0) << 28)
20271         /* Value is in bytes. */
20272         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
20273                 (UINT32_C(0x1) << 28)
20274         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
20275                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
20276         /* bw_value_unit is 3 b */
20277         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
20278                 UINT32_C(0xe0000000)
20279         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
20280                 29
20281         /* Value is in Mb or MB (base 10). */
20282         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
20283                 (UINT32_C(0x0) << 29)
20284         /* Value is in Kb or KB (base 10). */
20285         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
20286                 (UINT32_C(0x2) << 29)
20287         /* Value is in bits or bytes. */
20288         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
20289                 (UINT32_C(0x4) << 29)
20290         /* Value is in Gb or GB (base 10). */
20291         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
20292                 (UINT32_C(0x6) << 29)
20293         /* Value is in 1/100th of a percentage of total bandwidth. */
20294         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20295                 (UINT32_C(0x1) << 29)
20296         /* Invalid unit */
20297         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
20298                 (UINT32_C(0x7) << 29)
20299         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
20300                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
20301         /*
20302          * Maximum BW allocated to CoS queue.
20303          * The HWRM will translate this value into byte counter and
20304          * time interval used for this COS inside the device.
20305          */
20306         uint32_t        queue_id2_max_bw;
20307         /* The bandwidth value. */
20308         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
20309                 UINT32_C(0xfffffff)
20310         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
20311                 0
20312         /* The granularity of the value (bits or bytes). */
20313         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE \
20314                 UINT32_C(0x10000000)
20315         /* Value is in bits. */
20316         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
20317                 (UINT32_C(0x0) << 28)
20318         /* Value is in bytes. */
20319         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
20320                 (UINT32_C(0x1) << 28)
20321         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
20322                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
20323         /* bw_value_unit is 3 b */
20324         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
20325                 UINT32_C(0xe0000000)
20326         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
20327                 29
20328         /* Value is in Mb or MB (base 10). */
20329         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
20330                 (UINT32_C(0x0) << 29)
20331         /* Value is in Kb or KB (base 10). */
20332         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
20333                 (UINT32_C(0x2) << 29)
20334         /* Value is in bits or bytes. */
20335         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
20336                 (UINT32_C(0x4) << 29)
20337         /* Value is in Gb or GB (base 10). */
20338         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
20339                 (UINT32_C(0x6) << 29)
20340         /* Value is in 1/100th of a percentage of total bandwidth. */
20341         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20342                 (UINT32_C(0x1) << 29)
20343         /* Invalid unit */
20344         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
20345                 (UINT32_C(0x7) << 29)
20346         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
20347                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
20348         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20349         uint8_t queue_id2_tsa_assign;
20350         /* Strict Priority */
20351         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP \
20352                 UINT32_C(0x0)
20353         /* Enhanced Transmission Selection */
20354         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
20355                 UINT32_C(0x1)
20356         /* reserved. */
20357         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
20358                 UINT32_C(0x2)
20359         /* reserved. */
20360         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
20361                 UINT32_C(0xff)
20362         /*
20363          * Priority level for strict priority. Valid only when the
20364          * tsa_assign is 0 - Strict Priority (SP)
20365          * 0..7 - Valid values.
20366          * 8..255 - Reserved.
20367          */
20368         uint8_t queue_id2_pri_lvl;
20369         /*
20370          * Weight used to allocate remaining BW for this COS after
20371          * servicing guaranteed bandwidths for all COS.
20372          */
20373         uint8_t queue_id2_bw_weight;
20374         /* ID of CoS Queue 3. */
20375         uint8_t queue_id3;
20376         /*
20377          * Minimum BW allocated to CoS Queue.
20378          * The HWRM will translate this value into byte counter and
20379          * time interval used for this COS inside the device.
20380          */
20381         uint32_t        queue_id3_min_bw;
20382         /* The bandwidth value. */
20383         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
20384                 UINT32_C(0xfffffff)
20385         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
20386                 0
20387         /* The granularity of the value (bits or bytes). */
20388         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE \
20389                 UINT32_C(0x10000000)
20390         /* Value is in bits. */
20391         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
20392                 (UINT32_C(0x0) << 28)
20393         /* Value is in bytes. */
20394         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
20395                 (UINT32_C(0x1) << 28)
20396         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
20397                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
20398         /* bw_value_unit is 3 b */
20399         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
20400                 UINT32_C(0xe0000000)
20401         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
20402                 29
20403         /* Value is in Mb or MB (base 10). */
20404         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
20405                 (UINT32_C(0x0) << 29)
20406         /* Value is in Kb or KB (base 10). */
20407         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
20408                 (UINT32_C(0x2) << 29)
20409         /* Value is in bits or bytes. */
20410         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
20411                 (UINT32_C(0x4) << 29)
20412         /* Value is in Gb or GB (base 10). */
20413         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
20414                 (UINT32_C(0x6) << 29)
20415         /* Value is in 1/100th of a percentage of total bandwidth. */
20416         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20417                 (UINT32_C(0x1) << 29)
20418         /* Invalid unit */
20419         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
20420                 (UINT32_C(0x7) << 29)
20421         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
20422                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
20423         /*
20424          * Maximum BW allocated to CoS queue.
20425          * The HWRM will translate this value into byte counter and
20426          * time interval used for this COS inside the device.
20427          */
20428         uint32_t        queue_id3_max_bw;
20429         /* The bandwidth value. */
20430         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
20431                 UINT32_C(0xfffffff)
20432         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
20433                 0
20434         /* The granularity of the value (bits or bytes). */
20435         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE \
20436                 UINT32_C(0x10000000)
20437         /* Value is in bits. */
20438         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
20439                 (UINT32_C(0x0) << 28)
20440         /* Value is in bytes. */
20441         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
20442                 (UINT32_C(0x1) << 28)
20443         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
20444                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
20445         /* bw_value_unit is 3 b */
20446         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
20447                 UINT32_C(0xe0000000)
20448         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
20449                 29
20450         /* Value is in Mb or MB (base 10). */
20451         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
20452                 (UINT32_C(0x0) << 29)
20453         /* Value is in Kb or KB (base 10). */
20454         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
20455                 (UINT32_C(0x2) << 29)
20456         /* Value is in bits or bytes. */
20457         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
20458                 (UINT32_C(0x4) << 29)
20459         /* Value is in Gb or GB (base 10). */
20460         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
20461                 (UINT32_C(0x6) << 29)
20462         /* Value is in 1/100th of a percentage of total bandwidth. */
20463         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20464                 (UINT32_C(0x1) << 29)
20465         /* Invalid unit */
20466         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
20467                 (UINT32_C(0x7) << 29)
20468         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
20469                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
20470         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20471         uint8_t queue_id3_tsa_assign;
20472         /* Strict Priority */
20473         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP \
20474                 UINT32_C(0x0)
20475         /* Enhanced Transmission Selection */
20476         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
20477                 UINT32_C(0x1)
20478         /* reserved. */
20479         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
20480                 UINT32_C(0x2)
20481         /* reserved. */
20482         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
20483                 UINT32_C(0xff)
20484         /*
20485          * Priority level for strict priority. Valid only when the
20486          * tsa_assign is 0 - Strict Priority (SP)
20487          * 0..7 - Valid values.
20488          * 8..255 - Reserved.
20489          */
20490         uint8_t queue_id3_pri_lvl;
20491         /*
20492          * Weight used to allocate remaining BW for this COS after
20493          * servicing guaranteed bandwidths for all COS.
20494          */
20495         uint8_t queue_id3_bw_weight;
20496         /* ID of CoS Queue 4. */
20497         uint8_t queue_id4;
20498         /*
20499          * Minimum BW allocated to CoS Queue.
20500          * The HWRM will translate this value into byte counter and
20501          * time interval used for this COS inside the device.
20502          */
20503         uint32_t        queue_id4_min_bw;
20504         /* The bandwidth value. */
20505         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
20506                 UINT32_C(0xfffffff)
20507         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
20508                 0
20509         /* The granularity of the value (bits or bytes). */
20510         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE \
20511                 UINT32_C(0x10000000)
20512         /* Value is in bits. */
20513         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
20514                 (UINT32_C(0x0) << 28)
20515         /* Value is in bytes. */
20516         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
20517                 (UINT32_C(0x1) << 28)
20518         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
20519                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
20520         /* bw_value_unit is 3 b */
20521         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
20522                 UINT32_C(0xe0000000)
20523         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
20524                 29
20525         /* Value is in Mb or MB (base 10). */
20526         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
20527                 (UINT32_C(0x0) << 29)
20528         /* Value is in Kb or KB (base 10). */
20529         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
20530                 (UINT32_C(0x2) << 29)
20531         /* Value is in bits or bytes. */
20532         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
20533                 (UINT32_C(0x4) << 29)
20534         /* Value is in Gb or GB (base 10). */
20535         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
20536                 (UINT32_C(0x6) << 29)
20537         /* Value is in 1/100th of a percentage of total bandwidth. */
20538         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20539                 (UINT32_C(0x1) << 29)
20540         /* Invalid unit */
20541         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
20542                 (UINT32_C(0x7) << 29)
20543         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
20544                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
20545         /*
20546          * Maximum BW allocated to CoS queue.
20547          * The HWRM will translate this value into byte counter and
20548          * time interval used for this COS inside the device.
20549          */
20550         uint32_t        queue_id4_max_bw;
20551         /* The bandwidth value. */
20552         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
20553                 UINT32_C(0xfffffff)
20554         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
20555                 0
20556         /* The granularity of the value (bits or bytes). */
20557         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE \
20558                 UINT32_C(0x10000000)
20559         /* Value is in bits. */
20560         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
20561                 (UINT32_C(0x0) << 28)
20562         /* Value is in bytes. */
20563         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
20564                 (UINT32_C(0x1) << 28)
20565         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
20566                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
20567         /* bw_value_unit is 3 b */
20568         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
20569                 UINT32_C(0xe0000000)
20570         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
20571                 29
20572         /* Value is in Mb or MB (base 10). */
20573         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
20574                 (UINT32_C(0x0) << 29)
20575         /* Value is in Kb or KB (base 10). */
20576         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
20577                 (UINT32_C(0x2) << 29)
20578         /* Value is in bits or bytes. */
20579         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
20580                 (UINT32_C(0x4) << 29)
20581         /* Value is in Gb or GB (base 10). */
20582         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
20583                 (UINT32_C(0x6) << 29)
20584         /* Value is in 1/100th of a percentage of total bandwidth. */
20585         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20586                 (UINT32_C(0x1) << 29)
20587         /* Invalid unit */
20588         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
20589                 (UINT32_C(0x7) << 29)
20590         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
20591                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
20592         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20593         uint8_t queue_id4_tsa_assign;
20594         /* Strict Priority */
20595         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP \
20596                 UINT32_C(0x0)
20597         /* Enhanced Transmission Selection */
20598         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
20599                 UINT32_C(0x1)
20600         /* reserved. */
20601         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
20602                 UINT32_C(0x2)
20603         /* reserved. */
20604         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
20605                 UINT32_C(0xff)
20606         /*
20607          * Priority level for strict priority. Valid only when the
20608          * tsa_assign is 0 - Strict Priority (SP)
20609          * 0..7 - Valid values.
20610          * 8..255 - Reserved.
20611          */
20612         uint8_t queue_id4_pri_lvl;
20613         /*
20614          * Weight used to allocate remaining BW for this COS after
20615          * servicing guaranteed bandwidths for all COS.
20616          */
20617         uint8_t queue_id4_bw_weight;
20618         /* ID of CoS Queue 5. */
20619         uint8_t queue_id5;
20620         /*
20621          * Minimum BW allocated to CoS Queue.
20622          * The HWRM will translate this value into byte counter and
20623          * time interval used for this COS inside the device.
20624          */
20625         uint32_t        queue_id5_min_bw;
20626         /* The bandwidth value. */
20627         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
20628                 UINT32_C(0xfffffff)
20629         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
20630                 0
20631         /* The granularity of the value (bits or bytes). */
20632         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE \
20633                 UINT32_C(0x10000000)
20634         /* Value is in bits. */
20635         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
20636                 (UINT32_C(0x0) << 28)
20637         /* Value is in bytes. */
20638         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
20639                 (UINT32_C(0x1) << 28)
20640         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
20641                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
20642         /* bw_value_unit is 3 b */
20643         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
20644                 UINT32_C(0xe0000000)
20645         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
20646                 29
20647         /* Value is in Mb or MB (base 10). */
20648         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
20649                 (UINT32_C(0x0) << 29)
20650         /* Value is in Kb or KB (base 10). */
20651         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
20652                 (UINT32_C(0x2) << 29)
20653         /* Value is in bits or bytes. */
20654         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
20655                 (UINT32_C(0x4) << 29)
20656         /* Value is in Gb or GB (base 10). */
20657         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
20658                 (UINT32_C(0x6) << 29)
20659         /* Value is in 1/100th of a percentage of total bandwidth. */
20660         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20661                 (UINT32_C(0x1) << 29)
20662         /* Invalid unit */
20663         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
20664                 (UINT32_C(0x7) << 29)
20665         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
20666                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
20667         /*
20668          * Maximum BW allocated to CoS queue.
20669          * The HWRM will translate this value into byte counter and
20670          * time interval used for this COS inside the device.
20671          */
20672         uint32_t        queue_id5_max_bw;
20673         /* The bandwidth value. */
20674         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
20675                 UINT32_C(0xfffffff)
20676         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
20677                 0
20678         /* The granularity of the value (bits or bytes). */
20679         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE \
20680                 UINT32_C(0x10000000)
20681         /* Value is in bits. */
20682         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
20683                 (UINT32_C(0x0) << 28)
20684         /* Value is in bytes. */
20685         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
20686                 (UINT32_C(0x1) << 28)
20687         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
20688                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
20689         /* bw_value_unit is 3 b */
20690         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
20691                 UINT32_C(0xe0000000)
20692         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
20693                 29
20694         /* Value is in Mb or MB (base 10). */
20695         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
20696                 (UINT32_C(0x0) << 29)
20697         /* Value is in Kb or KB (base 10). */
20698         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
20699                 (UINT32_C(0x2) << 29)
20700         /* Value is in bits or bytes. */
20701         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
20702                 (UINT32_C(0x4) << 29)
20703         /* Value is in Gb or GB (base 10). */
20704         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
20705                 (UINT32_C(0x6) << 29)
20706         /* Value is in 1/100th of a percentage of total bandwidth. */
20707         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20708                 (UINT32_C(0x1) << 29)
20709         /* Invalid unit */
20710         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
20711                 (UINT32_C(0x7) << 29)
20712         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
20713                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
20714         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20715         uint8_t queue_id5_tsa_assign;
20716         /* Strict Priority */
20717         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP \
20718                 UINT32_C(0x0)
20719         /* Enhanced Transmission Selection */
20720         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
20721                 UINT32_C(0x1)
20722         /* reserved. */
20723         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
20724                 UINT32_C(0x2)
20725         /* reserved. */
20726         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
20727                 UINT32_C(0xff)
20728         /*
20729          * Priority level for strict priority. Valid only when the
20730          * tsa_assign is 0 - Strict Priority (SP)
20731          * 0..7 - Valid values.
20732          * 8..255 - Reserved.
20733          */
20734         uint8_t queue_id5_pri_lvl;
20735         /*
20736          * Weight used to allocate remaining BW for this COS after
20737          * servicing guaranteed bandwidths for all COS.
20738          */
20739         uint8_t queue_id5_bw_weight;
20740         /* ID of CoS Queue 6. */
20741         uint8_t queue_id6;
20742         /*
20743          * Minimum BW allocated to CoS Queue.
20744          * The HWRM will translate this value into byte counter and
20745          * time interval used for this COS inside the device.
20746          */
20747         uint32_t        queue_id6_min_bw;
20748         /* The bandwidth value. */
20749         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
20750                 UINT32_C(0xfffffff)
20751         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
20752                 0
20753         /* The granularity of the value (bits or bytes). */
20754         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE \
20755                 UINT32_C(0x10000000)
20756         /* Value is in bits. */
20757         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
20758                 (UINT32_C(0x0) << 28)
20759         /* Value is in bytes. */
20760         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
20761                 (UINT32_C(0x1) << 28)
20762         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
20763                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
20764         /* bw_value_unit is 3 b */
20765         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
20766                 UINT32_C(0xe0000000)
20767         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
20768                 29
20769         /* Value is in Mb or MB (base 10). */
20770         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
20771                 (UINT32_C(0x0) << 29)
20772         /* Value is in Kb or KB (base 10). */
20773         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
20774                 (UINT32_C(0x2) << 29)
20775         /* Value is in bits or bytes. */
20776         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
20777                 (UINT32_C(0x4) << 29)
20778         /* Value is in Gb or GB (base 10). */
20779         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
20780                 (UINT32_C(0x6) << 29)
20781         /* Value is in 1/100th of a percentage of total bandwidth. */
20782         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20783                 (UINT32_C(0x1) << 29)
20784         /* Invalid unit */
20785         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
20786                 (UINT32_C(0x7) << 29)
20787         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
20788                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
20789         /*
20790          * Maximum BW allocated to CoS queue.
20791          * The HWRM will translate this value into byte counter and
20792          * time interval used for this COS inside the device.
20793          */
20794         uint32_t        queue_id6_max_bw;
20795         /* The bandwidth value. */
20796         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
20797                 UINT32_C(0xfffffff)
20798         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
20799                 0
20800         /* The granularity of the value (bits or bytes). */
20801         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE \
20802                 UINT32_C(0x10000000)
20803         /* Value is in bits. */
20804         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
20805                 (UINT32_C(0x0) << 28)
20806         /* Value is in bytes. */
20807         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
20808                 (UINT32_C(0x1) << 28)
20809         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
20810                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
20811         /* bw_value_unit is 3 b */
20812         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
20813                 UINT32_C(0xe0000000)
20814         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
20815                 29
20816         /* Value is in Mb or MB (base 10). */
20817         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
20818                 (UINT32_C(0x0) << 29)
20819         /* Value is in Kb or KB (base 10). */
20820         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
20821                 (UINT32_C(0x2) << 29)
20822         /* Value is in bits or bytes. */
20823         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
20824                 (UINT32_C(0x4) << 29)
20825         /* Value is in Gb or GB (base 10). */
20826         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
20827                 (UINT32_C(0x6) << 29)
20828         /* Value is in 1/100th of a percentage of total bandwidth. */
20829         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20830                 (UINT32_C(0x1) << 29)
20831         /* Invalid unit */
20832         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
20833                 (UINT32_C(0x7) << 29)
20834         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
20835                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
20836         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20837         uint8_t queue_id6_tsa_assign;
20838         /* Strict Priority */
20839         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP \
20840                 UINT32_C(0x0)
20841         /* Enhanced Transmission Selection */
20842         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
20843                 UINT32_C(0x1)
20844         /* reserved. */
20845         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
20846                 UINT32_C(0x2)
20847         /* reserved. */
20848         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
20849                 UINT32_C(0xff)
20850         /*
20851          * Priority level for strict priority. Valid only when the
20852          * tsa_assign is 0 - Strict Priority (SP)
20853          * 0..7 - Valid values.
20854          * 8..255 - Reserved.
20855          */
20856         uint8_t queue_id6_pri_lvl;
20857         /*
20858          * Weight used to allocate remaining BW for this COS after
20859          * servicing guaranteed bandwidths for all COS.
20860          */
20861         uint8_t queue_id6_bw_weight;
20862         /* ID of CoS Queue 7. */
20863         uint8_t queue_id7;
20864         /*
20865          * Minimum BW allocated to CoS Queue.
20866          * The HWRM will translate this value into byte counter and
20867          * time interval used for this COS inside the device.
20868          */
20869         uint32_t        queue_id7_min_bw;
20870         /* The bandwidth value. */
20871         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
20872                 UINT32_C(0xfffffff)
20873         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
20874                 0
20875         /* The granularity of the value (bits or bytes). */
20876         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE \
20877                 UINT32_C(0x10000000)
20878         /* Value is in bits. */
20879         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
20880                 (UINT32_C(0x0) << 28)
20881         /* Value is in bytes. */
20882         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
20883                 (UINT32_C(0x1) << 28)
20884         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
20885                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
20886         /* bw_value_unit is 3 b */
20887         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
20888                 UINT32_C(0xe0000000)
20889         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
20890                 29
20891         /* Value is in Mb or MB (base 10). */
20892         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
20893                 (UINT32_C(0x0) << 29)
20894         /* Value is in Kb or KB (base 10). */
20895         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
20896                 (UINT32_C(0x2) << 29)
20897         /* Value is in bits or bytes. */
20898         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
20899                 (UINT32_C(0x4) << 29)
20900         /* Value is in Gb or GB (base 10). */
20901         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
20902                 (UINT32_C(0x6) << 29)
20903         /* Value is in 1/100th of a percentage of total bandwidth. */
20904         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20905                 (UINT32_C(0x1) << 29)
20906         /* Invalid unit */
20907         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
20908                 (UINT32_C(0x7) << 29)
20909         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
20910                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
20911         /*
20912          * Maximum BW allocated to CoS queue.
20913          * The HWRM will translate this value into byte counter and
20914          * time interval used for this COS inside the device.
20915          */
20916         uint32_t        queue_id7_max_bw;
20917         /* The bandwidth value. */
20918         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
20919                 UINT32_C(0xfffffff)
20920         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
20921                 0
20922         /* The granularity of the value (bits or bytes). */
20923         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE \
20924                 UINT32_C(0x10000000)
20925         /* Value is in bits. */
20926         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
20927                 (UINT32_C(0x0) << 28)
20928         /* Value is in bytes. */
20929         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
20930                 (UINT32_C(0x1) << 28)
20931         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
20932                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
20933         /* bw_value_unit is 3 b */
20934         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
20935                 UINT32_C(0xe0000000)
20936         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
20937                 29
20938         /* Value is in Mb or MB (base 10). */
20939         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
20940                 (UINT32_C(0x0) << 29)
20941         /* Value is in Kb or KB (base 10). */
20942         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
20943                 (UINT32_C(0x2) << 29)
20944         /* Value is in bits or bytes. */
20945         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
20946                 (UINT32_C(0x4) << 29)
20947         /* Value is in Gb or GB (base 10). */
20948         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
20949                 (UINT32_C(0x6) << 29)
20950         /* Value is in 1/100th of a percentage of total bandwidth. */
20951         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20952                 (UINT32_C(0x1) << 29)
20953         /* Invalid unit */
20954         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
20955                 (UINT32_C(0x7) << 29)
20956         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
20957                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
20958         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20959         uint8_t queue_id7_tsa_assign;
20960         /* Strict Priority */
20961         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP \
20962                 UINT32_C(0x0)
20963         /* Enhanced Transmission Selection */
20964         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
20965                 UINT32_C(0x1)
20966         /* reserved. */
20967         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
20968                 UINT32_C(0x2)
20969         /* reserved. */
20970         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
20971                 UINT32_C(0xff)
20972         /*
20973          * Priority level for strict priority. Valid only when the
20974          * tsa_assign is 0 - Strict Priority (SP)
20975          * 0..7 - Valid values.
20976          * 8..255 - Reserved.
20977          */
20978         uint8_t queue_id7_pri_lvl;
20979         /*
20980          * Weight used to allocate remaining BW for this COS after
20981          * servicing guaranteed bandwidths for all COS.
20982          */
20983         uint8_t queue_id7_bw_weight;
20984         uint8_t unused_1[5];
20985 } __attribute__((packed));
20986
20987 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
20988 struct hwrm_queue_cos2bw_cfg_output {
20989         /* The specific error status for the command. */
20990         uint16_t        error_code;
20991         /* The HWRM command request type. */
20992         uint16_t        req_type;
20993         /* The sequence ID from the original command. */
20994         uint16_t        seq_id;
20995         /* The length of the response data in number of bytes. */
20996         uint16_t        resp_len;
20997         uint8_t unused_0[7];
20998         /*
20999          * This field is used in Output records to indicate that the output
21000          * is completely written to RAM.  This field should be read as '1'
21001          * to indicate that the output has been completely written.
21002          * When writing a command completion or response to an internal processor,
21003          * the order of writes has to be such that this field is written last.
21004          */
21005         uint8_t valid;
21006 } __attribute__((packed));
21007
21008 /*******************
21009  * hwrm_vnic_alloc *
21010  *******************/
21011
21012
21013 /* hwrm_vnic_alloc_input (size:192b/24B) */
21014 struct hwrm_vnic_alloc_input {
21015         /* The HWRM command request type. */
21016         uint16_t        req_type;
21017         /*
21018          * The completion ring to send the completion event on. This should
21019          * be the NQ ID returned from the `nq_alloc` HWRM command.
21020          */
21021         uint16_t        cmpl_ring;
21022         /*
21023          * The sequence ID is used by the driver for tracking multiple
21024          * commands. This ID is treated as opaque data by the firmware and
21025          * the value is returned in the `hwrm_resp_hdr` upon completion.
21026          */
21027         uint16_t        seq_id;
21028         /*
21029          * The target ID of the command:
21030          * * 0x0-0xFFF8 - The function ID
21031          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21032          * * 0xFFFD - Reserved for user-space HWRM interface
21033          * * 0xFFFF - HWRM
21034          */
21035         uint16_t        target_id;
21036         /*
21037          * A physical address pointer pointing to a host buffer that the
21038          * command's response data will be written. This can be either a host
21039          * physical address (HPA) or a guest physical address (GPA) and must
21040          * point to a physically contiguous block of memory.
21041          */
21042         uint64_t        resp_addr;
21043         uint32_t        flags;
21044         /*
21045          * When this bit is '1', this VNIC is requested to
21046          * be the default VNIC for this function.
21047          */
21048         #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT     UINT32_C(0x1)
21049         uint8_t unused_0[4];
21050 } __attribute__((packed));
21051
21052 /* hwrm_vnic_alloc_output (size:128b/16B) */
21053 struct hwrm_vnic_alloc_output {
21054         /* The specific error status for the command. */
21055         uint16_t        error_code;
21056         /* The HWRM command request type. */
21057         uint16_t        req_type;
21058         /* The sequence ID from the original command. */
21059         uint16_t        seq_id;
21060         /* The length of the response data in number of bytes. */
21061         uint16_t        resp_len;
21062         /* Logical vnic ID */
21063         uint32_t        vnic_id;
21064         uint8_t unused_0[3];
21065         /*
21066          * This field is used in Output records to indicate that the output
21067          * is completely written to RAM.  This field should be read as '1'
21068          * to indicate that the output has been completely written.
21069          * When writing a command completion or response to an internal processor,
21070          * the order of writes has to be such that this field is written last.
21071          */
21072         uint8_t valid;
21073 } __attribute__((packed));
21074
21075 /******************
21076  * hwrm_vnic_free *
21077  ******************/
21078
21079
21080 /* hwrm_vnic_free_input (size:192b/24B) */
21081 struct hwrm_vnic_free_input {
21082         /* The HWRM command request type. */
21083         uint16_t        req_type;
21084         /*
21085          * The completion ring to send the completion event on. This should
21086          * be the NQ ID returned from the `nq_alloc` HWRM command.
21087          */
21088         uint16_t        cmpl_ring;
21089         /*
21090          * The sequence ID is used by the driver for tracking multiple
21091          * commands. This ID is treated as opaque data by the firmware and
21092          * the value is returned in the `hwrm_resp_hdr` upon completion.
21093          */
21094         uint16_t        seq_id;
21095         /*
21096          * The target ID of the command:
21097          * * 0x0-0xFFF8 - The function ID
21098          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21099          * * 0xFFFD - Reserved for user-space HWRM interface
21100          * * 0xFFFF - HWRM
21101          */
21102         uint16_t        target_id;
21103         /*
21104          * A physical address pointer pointing to a host buffer that the
21105          * command's response data will be written. This can be either a host
21106          * physical address (HPA) or a guest physical address (GPA) and must
21107          * point to a physically contiguous block of memory.
21108          */
21109         uint64_t        resp_addr;
21110         /* Logical vnic ID */
21111         uint32_t        vnic_id;
21112         uint8_t unused_0[4];
21113 } __attribute__((packed));
21114
21115 /* hwrm_vnic_free_output (size:128b/16B) */
21116 struct hwrm_vnic_free_output {
21117         /* The specific error status for the command. */
21118         uint16_t        error_code;
21119         /* The HWRM command request type. */
21120         uint16_t        req_type;
21121         /* The sequence ID from the original command. */
21122         uint16_t        seq_id;
21123         /* The length of the response data in number of bytes. */
21124         uint16_t        resp_len;
21125         uint8_t unused_0[7];
21126         /*
21127          * This field is used in Output records to indicate that the output
21128          * is completely written to RAM.  This field should be read as '1'
21129          * to indicate that the output has been completely written.
21130          * When writing a command completion or response to an internal processor,
21131          * the order of writes has to be such that this field is written last.
21132          */
21133         uint8_t valid;
21134 } __attribute__((packed));
21135
21136 /*****************
21137  * hwrm_vnic_cfg *
21138  *****************/
21139
21140
21141 /* hwrm_vnic_cfg_input (size:320b/40B) */
21142 struct hwrm_vnic_cfg_input {
21143         /* The HWRM command request type. */
21144         uint16_t        req_type;
21145         /*
21146          * The completion ring to send the completion event on. This should
21147          * be the NQ ID returned from the `nq_alloc` HWRM command.
21148          */
21149         uint16_t        cmpl_ring;
21150         /*
21151          * The sequence ID is used by the driver for tracking multiple
21152          * commands. This ID is treated as opaque data by the firmware and
21153          * the value is returned in the `hwrm_resp_hdr` upon completion.
21154          */
21155         uint16_t        seq_id;
21156         /*
21157          * The target ID of the command:
21158          * * 0x0-0xFFF8 - The function ID
21159          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21160          * * 0xFFFD - Reserved for user-space HWRM interface
21161          * * 0xFFFF - HWRM
21162          */
21163         uint16_t        target_id;
21164         /*
21165          * A physical address pointer pointing to a host buffer that the
21166          * command's response data will be written. This can be either a host
21167          * physical address (HPA) or a guest physical address (GPA) and must
21168          * point to a physically contiguous block of memory.
21169          */
21170         uint64_t        resp_addr;
21171         uint32_t        flags;
21172         /*
21173          * When this bit is '1', the VNIC is requested to
21174          * be the default VNIC for the function.
21175          */
21176         #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT \
21177                 UINT32_C(0x1)
21178         /*
21179          * When this bit is '1', the VNIC is being configured to
21180          * strip VLAN in the RX path.
21181          * If set to '0', then VLAN stripping is disabled on
21182          * this VNIC.
21183          */
21184         #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE \
21185                 UINT32_C(0x2)
21186         /*
21187          * When this bit is '1', the VNIC is being configured to
21188          * buffer receive packets in the hardware until the host
21189          * posts new receive buffers.
21190          * If set to '0', then bd_stall is being configured to be
21191          * disabled on this VNIC.
21192          */
21193         #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE \
21194                 UINT32_C(0x4)
21195         /*
21196          * When this bit is '1', the VNIC is being configured to
21197          * receive both RoCE and non-RoCE traffic.
21198          * If set to '0', then this VNIC is not configured to be
21199          * operating in dual VNIC mode.
21200          */
21201         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
21202                 UINT32_C(0x8)
21203         /*
21204          * When this flag is set to '1', the VNIC is requested to
21205          * be configured to receive only RoCE traffic.
21206          * If this flag is set to '0', then this flag shall be
21207          * ignored by the HWRM.
21208          * If roce_dual_vnic_mode flag is set to '1'
21209          * or roce_mirroring_capable_vnic_mode flag to 1,
21210          * then the HWRM client shall not set this flag to '1'.
21211          */
21212         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
21213                 UINT32_C(0x10)
21214         /*
21215          * When a VNIC uses one destination ring group for certain
21216          * application (e.g. Receive Flow Steering) where
21217          * exact match is used to direct packets to a VNIC with one
21218          * destination ring group only, there is no need to configure
21219          * RSS indirection table for that VNIC as only one destination
21220          * ring group is used.
21221          *
21222          * This flag is used to enable a mode where
21223          * RSS is enabled in the VNIC using a RSS context
21224          * for computing RSS hash but the RSS indirection table is
21225          * not configured using hwrm_vnic_rss_cfg.
21226          *
21227          * If this mode is enabled, then the driver should not program
21228          * RSS indirection table for the RSS context that is used for
21229          * computing RSS hash only.
21230          */
21231         #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE \
21232                 UINT32_C(0x20)
21233         /*
21234          * When this bit is '1', the VNIC is being configured to
21235          * receive both RoCE and non-RoCE traffic, but forward only the
21236          * RoCE traffic further. Also, RoCE traffic can be mirrored to
21237          * L2 driver.
21238          */
21239         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
21240                 UINT32_C(0x40)
21241         uint32_t        enables;
21242         /*
21243          * This bit must be '1' for the dflt_ring_grp field to be
21244          * configured.
21245          */
21246         #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP \
21247                 UINT32_C(0x1)
21248         /*
21249          * This bit must be '1' for the rss_rule field to be
21250          * configured.
21251          */
21252         #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE \
21253                 UINT32_C(0x2)
21254         /*
21255          * This bit must be '1' for the cos_rule field to be
21256          * configured.
21257          */
21258         #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE \
21259                 UINT32_C(0x4)
21260         /*
21261          * This bit must be '1' for the lb_rule field to be
21262          * configured.
21263          */
21264         #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE \
21265                 UINT32_C(0x8)
21266         /*
21267          * This bit must be '1' for the mru field to be
21268          * configured.
21269          */
21270         #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU \
21271                 UINT32_C(0x10)
21272         /*
21273          * This bit must be '1' for the default_rx_ring_id field to be
21274          * configured.
21275          */
21276         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID \
21277                 UINT32_C(0x20)
21278         /*
21279          * This bit must be '1' for the default_cmpl_ring_id field to be
21280          * configured.
21281          */
21282         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID \
21283                 UINT32_C(0x40)
21284         /* Logical vnic ID */
21285         uint16_t        vnic_id;
21286         /*
21287          * Default Completion ring for the VNIC.  This ring will
21288          * be chosen if packet does not match any RSS rules and if
21289          * there is no COS rule.
21290          */
21291         uint16_t        dflt_ring_grp;
21292         /*
21293          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
21294          * there is no RSS rule.
21295          */
21296         uint16_t        rss_rule;
21297         /*
21298          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
21299          * there is no COS rule.
21300          */
21301         uint16_t        cos_rule;
21302         /*
21303          * RSS ID for load balancing rule/table structure.
21304          * 0xFF... (All Fs) if there is no LB rule.
21305          */
21306         uint16_t        lb_rule;
21307         /*
21308          * The maximum receive unit of the vnic.
21309          * Each vnic is associated with a function.
21310          * The vnic mru value overwrites the mru setting of the
21311          * associated function.
21312          * The HWRM shall make sure that vnic mru does not exceed
21313          * the mru of the port the function is associated with.
21314          */
21315         uint16_t        mru;
21316         /*
21317          * Default Rx ring for the VNIC.  This ring will
21318          * be chosen if packet does not match any RSS rules.
21319          * The aggregation ring associated with the Rx ring is
21320          * implied based on the Rx ring specified when the
21321          * aggregation ring was allocated.
21322          */
21323         uint16_t        default_rx_ring_id;
21324         /*
21325          * Default completion ring for the VNIC.  This ring will
21326          * be chosen if packet does not match any RSS rules.
21327          */
21328         uint16_t        default_cmpl_ring_id;
21329 } __attribute__((packed));
21330
21331 /* hwrm_vnic_cfg_output (size:128b/16B) */
21332 struct hwrm_vnic_cfg_output {
21333         /* The specific error status for the command. */
21334         uint16_t        error_code;
21335         /* The HWRM command request type. */
21336         uint16_t        req_type;
21337         /* The sequence ID from the original command. */
21338         uint16_t        seq_id;
21339         /* The length of the response data in number of bytes. */
21340         uint16_t        resp_len;
21341         uint8_t unused_0[7];
21342         /*
21343          * This field is used in Output records to indicate that the output
21344          * is completely written to RAM.  This field should be read as '1'
21345          * to indicate that the output has been completely written.
21346          * When writing a command completion or response to an internal processor,
21347          * the order of writes has to be such that this field is written last.
21348          */
21349         uint8_t valid;
21350 } __attribute__((packed));
21351
21352 /******************
21353  * hwrm_vnic_qcfg *
21354  ******************/
21355
21356
21357 /* hwrm_vnic_qcfg_input (size:256b/32B) */
21358 struct hwrm_vnic_qcfg_input {
21359         /* The HWRM command request type. */
21360         uint16_t        req_type;
21361         /*
21362          * The completion ring to send the completion event on. This should
21363          * be the NQ ID returned from the `nq_alloc` HWRM command.
21364          */
21365         uint16_t        cmpl_ring;
21366         /*
21367          * The sequence ID is used by the driver for tracking multiple
21368          * commands. This ID is treated as opaque data by the firmware and
21369          * the value is returned in the `hwrm_resp_hdr` upon completion.
21370          */
21371         uint16_t        seq_id;
21372         /*
21373          * The target ID of the command:
21374          * * 0x0-0xFFF8 - The function ID
21375          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21376          * * 0xFFFD - Reserved for user-space HWRM interface
21377          * * 0xFFFF - HWRM
21378          */
21379         uint16_t        target_id;
21380         /*
21381          * A physical address pointer pointing to a host buffer that the
21382          * command's response data will be written. This can be either a host
21383          * physical address (HPA) or a guest physical address (GPA) and must
21384          * point to a physically contiguous block of memory.
21385          */
21386         uint64_t        resp_addr;
21387         uint32_t        enables;
21388         /*
21389          * This bit must be '1' for the vf_id_valid field to be
21390          * configured.
21391          */
21392         #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
21393         /* Logical vnic ID */
21394         uint32_t        vnic_id;
21395         /* ID of Virtual Function whose VNIC resource is being queried. */
21396         uint16_t        vf_id;
21397         uint8_t unused_0[6];
21398 } __attribute__((packed));
21399
21400 /* hwrm_vnic_qcfg_output (size:256b/32B) */
21401 struct hwrm_vnic_qcfg_output {
21402         /* The specific error status for the command. */
21403         uint16_t        error_code;
21404         /* The HWRM command request type. */
21405         uint16_t        req_type;
21406         /* The sequence ID from the original command. */
21407         uint16_t        seq_id;
21408         /* The length of the response data in number of bytes. */
21409         uint16_t        resp_len;
21410         /* Default Completion ring for the VNIC. */
21411         uint16_t        dflt_ring_grp;
21412         /*
21413          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
21414          * there is no RSS rule.
21415          */
21416         uint16_t        rss_rule;
21417         /*
21418          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
21419          * there is no COS rule.
21420          */
21421         uint16_t        cos_rule;
21422         /*
21423          * RSS ID for load balancing rule/table structure.
21424          * 0xFF... (All Fs) if there is no LB rule.
21425          */
21426         uint16_t        lb_rule;
21427         /* The maximum receive unit of the vnic. */
21428         uint16_t        mru;
21429         uint8_t unused_0[2];
21430         uint32_t        flags;
21431         /*
21432          * When this bit is '1', the VNIC is the default VNIC for
21433          * the function.
21434          */
21435         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT \
21436                 UINT32_C(0x1)
21437         /*
21438          * When this bit is '1', the VNIC is configured to
21439          * strip VLAN in the RX path.
21440          * If set to '0', then VLAN stripping is disabled on
21441          * this VNIC.
21442          */
21443         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE \
21444                 UINT32_C(0x2)
21445         /*
21446          * When this bit is '1', the VNIC is configured to
21447          * buffer receive packets in the hardware until the host
21448          * posts new receive buffers.
21449          * If set to '0', then bd_stall is disabled on
21450          * this VNIC.
21451          */
21452         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE \
21453                 UINT32_C(0x4)
21454         /*
21455          * When this bit is '1', the VNIC is configured to
21456          * receive both RoCE and non-RoCE traffic.
21457          * If set to '0', then this VNIC is not configured to
21458          * operate in dual VNIC mode.
21459          */
21460         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
21461                 UINT32_C(0x8)
21462         /*
21463          * When this flag is set to '1', the VNIC is configured to
21464          * receive only RoCE traffic.
21465          * When this flag is set to '0', the VNIC is not configured
21466          * to receive only RoCE traffic.
21467          * If roce_dual_vnic_mode flag and this flag both are set
21468          * to '1', then it is an invalid configuration of the
21469          * VNIC. The HWRM should not allow that type of
21470          * mis-configuration by HWRM clients.
21471          */
21472         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
21473                 UINT32_C(0x10)
21474         /*
21475          * When a VNIC uses one destination ring group for certain
21476          * application (e.g. Receive Flow Steering) where
21477          * exact match is used to direct packets to a VNIC with one
21478          * destination ring group only, there is no need to configure
21479          * RSS indirection table for that VNIC as only one destination
21480          * ring group is used.
21481          *
21482          * When this bit is set to '1', then the VNIC is enabled in a
21483          * mode where RSS is enabled in the VNIC using a RSS context
21484          * for computing RSS hash but the RSS indirection table is
21485          * not configured.
21486          */
21487         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE \
21488                 UINT32_C(0x20)
21489         /*
21490          * When this bit is '1', the VNIC is configured to
21491          * receive both RoCE and non-RoCE traffic, but forward only
21492          * RoCE traffic further. Also RoCE traffic can be mirrored to
21493          * L2 driver.
21494          */
21495         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
21496                 UINT32_C(0x40)
21497         uint8_t unused_1[7];
21498         /*
21499          * This field is used in Output records to indicate that the output
21500          * is completely written to RAM.  This field should be read as '1'
21501          * to indicate that the output has been completely written.
21502          * When writing a command completion or response to an internal processor,
21503          * the order of writes has to be such that this field is written last.
21504          */
21505         uint8_t valid;
21506 } __attribute__((packed));
21507
21508 /*******************
21509  * hwrm_vnic_qcaps *
21510  *******************/
21511
21512
21513 /* hwrm_vnic_qcaps_input (size:192b/24B) */
21514 struct hwrm_vnic_qcaps_input {
21515         /* The HWRM command request type. */
21516         uint16_t        req_type;
21517         /*
21518          * The completion ring to send the completion event on. This should
21519          * be the NQ ID returned from the `nq_alloc` HWRM command.
21520          */
21521         uint16_t        cmpl_ring;
21522         /*
21523          * The sequence ID is used by the driver for tracking multiple
21524          * commands. This ID is treated as opaque data by the firmware and
21525          * the value is returned in the `hwrm_resp_hdr` upon completion.
21526          */
21527         uint16_t        seq_id;
21528         /*
21529          * The target ID of the command:
21530          * * 0x0-0xFFF8 - The function ID
21531          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21532          * * 0xFFFD - Reserved for user-space HWRM interface
21533          * * 0xFFFF - HWRM
21534          */
21535         uint16_t        target_id;
21536         /*
21537          * A physical address pointer pointing to a host buffer that the
21538          * command's response data will be written. This can be either a host
21539          * physical address (HPA) or a guest physical address (GPA) and must
21540          * point to a physically contiguous block of memory.
21541          */
21542         uint64_t        resp_addr;
21543         uint32_t        enables;
21544         uint8_t unused_0[4];
21545 } __attribute__((packed));
21546
21547 /* hwrm_vnic_qcaps_output (size:192b/24B) */
21548 struct hwrm_vnic_qcaps_output {
21549         /* The specific error status for the command. */
21550         uint16_t        error_code;
21551         /* The HWRM command request type. */
21552         uint16_t        req_type;
21553         /* The sequence ID from the original command. */
21554         uint16_t        seq_id;
21555         /* The length of the response data in number of bytes. */
21556         uint16_t        resp_len;
21557         /* The maximum receive unit that is settable on a vnic. */
21558         uint16_t        mru;
21559         uint8_t unused_0[2];
21560         uint32_t        flags;
21561         /* Unused. */
21562         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED \
21563                 UINT32_C(0x1)
21564         /*
21565          * When this bit is '1', the capability of stripping VLAN in
21566          * the RX path is supported on VNIC(s).
21567          * If set to '0', then VLAN stripping capability is
21568          * not supported on VNIC(s).
21569          */
21570         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP \
21571                 UINT32_C(0x2)
21572         /*
21573          * When this bit is '1', the capability to buffer receive
21574          * packets in the hardware until the host posts new receive buffers
21575          * is supported on VNIC(s).
21576          * If set to '0', then bd_stall capability is not supported
21577          * on VNIC(s).
21578          */
21579         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP \
21580                 UINT32_C(0x4)
21581         /*
21582          * When this bit is '1', the capability to
21583          * receive both RoCE and non-RoCE traffic on VNIC(s) is
21584          * supported.
21585          * If set to '0', then the capability to receive
21586          * both RoCE and non-RoCE traffic on VNIC(s) is
21587          * not supported.
21588          */
21589         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP \
21590                 UINT32_C(0x8)
21591         /*
21592          * When this bit is set to '1', the capability to configure
21593          * a VNIC to receive only RoCE traffic is supported.
21594          * When this flag is set to '0', the VNIC capability to
21595          * configure to receive only RoCE traffic is not supported.
21596          */
21597         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP \
21598                 UINT32_C(0x10)
21599         /*
21600          * When this bit is set to '1', then the capability to enable
21601          * a VNIC in a mode where RSS context without configuring
21602          * RSS indirection table is supported (for RSS hash computation).
21603          * When this bit is set to '0', then a VNIC can not be configured
21604          * with a mode to enable RSS context without configuring RSS
21605          * indirection table.
21606          */
21607         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP \
21608                 UINT32_C(0x20)
21609         /*
21610          * When this bit is '1', the capability to
21611          * mirror the the RoCE traffic is supported.
21612          * If set to '0', then the capability to mirror the
21613          * RoCE traffic is not supported.
21614          */
21615         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP \
21616                 UINT32_C(0x40)
21617         /*
21618          * When this bit is '1', the outermost RSS hashing capability
21619          * is supported. If set to '0', then the outermost RSS hashing
21620          * capability is not supported.
21621          */
21622         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP \
21623                 UINT32_C(0x80)
21624         /*
21625          * This field advertises the maximum concurrent TPA aggregations
21626          * supported by the VNIC on new devices that support TPA v2.
21627          * '0' means that TPA v2 is not supported.
21628          */
21629         uint16_t        max_aggs_supported;
21630         uint8_t unused_1[5];
21631         /*
21632          * This field is used in Output records to indicate that the output
21633          * is completely written to RAM.  This field should be read as '1'
21634          * to indicate that the output has been completely written.
21635          * When writing a command completion or response to an internal processor,
21636          * the order of writes has to be such that this field is written last.
21637          */
21638         uint8_t valid;
21639 } __attribute__((packed));
21640
21641 /*********************
21642  * hwrm_vnic_tpa_cfg *
21643  *********************/
21644
21645
21646 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */
21647 struct hwrm_vnic_tpa_cfg_input {
21648         /* The HWRM command request type. */
21649         uint16_t        req_type;
21650         /*
21651          * The completion ring to send the completion event on. This should
21652          * be the NQ ID returned from the `nq_alloc` HWRM command.
21653          */
21654         uint16_t        cmpl_ring;
21655         /*
21656          * The sequence ID is used by the driver for tracking multiple
21657          * commands. This ID is treated as opaque data by the firmware and
21658          * the value is returned in the `hwrm_resp_hdr` upon completion.
21659          */
21660         uint16_t        seq_id;
21661         /*
21662          * The target ID of the command:
21663          * * 0x0-0xFFF8 - The function ID
21664          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21665          * * 0xFFFD - Reserved for user-space HWRM interface
21666          * * 0xFFFF - HWRM
21667          */
21668         uint16_t        target_id;
21669         /*
21670          * A physical address pointer pointing to a host buffer that the
21671          * command's response data will be written. This can be either a host
21672          * physical address (HPA) or a guest physical address (GPA) and must
21673          * point to a physically contiguous block of memory.
21674          */
21675         uint64_t        resp_addr;
21676         uint32_t        flags;
21677         /*
21678          * When this bit is '1', the VNIC shall be configured to
21679          * perform transparent packet aggregation (TPA) of
21680          * non-tunneled TCP packets.
21681          */
21682         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA \
21683                 UINT32_C(0x1)
21684         /*
21685          * When this bit is '1', the VNIC shall be configured to
21686          * perform transparent packet aggregation (TPA) of
21687          * tunneled TCP packets.
21688          */
21689         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA \
21690                 UINT32_C(0x2)
21691         /*
21692          * When this bit is '1', the VNIC shall be configured to
21693          * perform transparent packet aggregation (TPA) according
21694          * to Windows Receive Segment Coalescing (RSC) rules.
21695          */
21696         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE \
21697                 UINT32_C(0x4)
21698         /*
21699          * When this bit is '1', the VNIC shall be configured to
21700          * perform transparent packet aggregation (TPA) according
21701          * to Linux Generic Receive Offload (GRO) rules.
21702          */
21703         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO \
21704                 UINT32_C(0x8)
21705         /*
21706          * When this bit is '1', the VNIC shall be configured to
21707          * perform transparent packet aggregation (TPA) for TCP
21708          * packets with IP ECN set to non-zero.
21709          */
21710         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN \
21711                 UINT32_C(0x10)
21712         /*
21713          * When this bit is '1', the VNIC shall be configured to
21714          * perform transparent packet aggregation (TPA) for
21715          * GRE tunneled TCP packets only if all packets have the
21716          * same GRE sequence.
21717          */
21718         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
21719                 UINT32_C(0x20)
21720         /*
21721          * When this bit is '1' and the GRO mode is enabled,
21722          * the VNIC shall be configured to
21723          * perform transparent packet aggregation (TPA) for
21724          * TCP/IPv4 packets with consecutively increasing IPIDs.
21725          * In other words, the last packet that is being
21726          * aggregated to an already existing aggregation context
21727          * shall have IPID 1 more than the IPID of the last packet
21728          * that was aggregated in that aggregation context.
21729          */
21730         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK \
21731                 UINT32_C(0x40)
21732         /*
21733          * When this bit is '1' and the GRO mode is enabled,
21734          * the VNIC shall be configured to
21735          * perform transparent packet aggregation (TPA) for
21736          * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
21737          * value.
21738          */
21739         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK \
21740                 UINT32_C(0x80)
21741         /*
21742          * When this bit is '1' and the GRO mode is enabled,
21743          * the VNIC shall DMA payload data using GRO rules.
21744          * When this bit is '0', the VNIC shall DMA payload data
21745          * using the more efficient LRO rules of filling all
21746          * aggregation buffers.
21747          */
21748         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_PACK_AS_GRO \
21749                 UINT32_C(0x100)
21750         uint32_t        enables;
21751         /*
21752          * This bit must be '1' for the max_agg_segs field to be
21753          * configured.
21754          */
21755         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS      UINT32_C(0x1)
21756         /*
21757          * This bit must be '1' for the max_aggs field to be
21758          * configured.
21759          */
21760         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS          UINT32_C(0x2)
21761         /*
21762          * This bit must be '1' for the max_agg_timer field to be
21763          * configured.
21764          */
21765         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER     UINT32_C(0x4)
21766         /* deprecated bit.  Do not use!!! */
21767         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN       UINT32_C(0x8)
21768         /* Logical vnic ID */
21769         uint16_t        vnic_id;
21770         /*
21771          * This is the maximum number of TCP segments that can
21772          * be aggregated (unit is Log2). Max value is 31. On new
21773          * devices supporting TPA v2, the unit is multiples of 4 and
21774          * valid values are > 0 and <= 63.
21775          */
21776         uint16_t        max_agg_segs;
21777         /* 1 segment */
21778         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
21779         /* 2 segments */
21780         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
21781         /* 4 segments */
21782         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
21783         /* 8 segments */
21784         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
21785         /* Any segment size larger than this is not valid */
21786         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
21787         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST \
21788                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
21789         /*
21790          * This is the maximum number of aggregations this VNIC is
21791          * allowed (unit is Log2). Max value is 7. On new devices
21792          * supporting TPA v2, this is in unit of 1 and must be > 0
21793          * and <= max_aggs_supported in the hwrm_vnic_qcaps response
21794          * to enable TPA v2.
21795          */
21796         uint16_t        max_aggs;
21797         /* 1 aggregation */
21798         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1   UINT32_C(0x0)
21799         /* 2 aggregations */
21800         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2   UINT32_C(0x1)
21801         /* 4 aggregations */
21802         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4   UINT32_C(0x2)
21803         /* 8 aggregations */
21804         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8   UINT32_C(0x3)
21805         /* 16 aggregations */
21806         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16  UINT32_C(0x4)
21807         /* Any aggregation size larger than this is not valid */
21808         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
21809         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST \
21810                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
21811         uint8_t unused_0[2];
21812         /*
21813          * This is the maximum amount of time allowed for
21814          * an aggregation context to complete after it was initiated.
21815          */
21816         uint32_t        max_agg_timer;
21817         /*
21818          * This is the minimum amount of payload length required to
21819          * start an aggregation context. This field is deprecated and
21820          * should be set to 0.  The minimum length is set by firmware
21821          * and can be queried using hwrm_vnic_tpa_qcfg.
21822          */
21823         uint32_t        min_agg_len;
21824 } __attribute__((packed));
21825
21826 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
21827 struct hwrm_vnic_tpa_cfg_output {
21828         /* The specific error status for the command. */
21829         uint16_t        error_code;
21830         /* The HWRM command request type. */
21831         uint16_t        req_type;
21832         /* The sequence ID from the original command. */
21833         uint16_t        seq_id;
21834         /* The length of the response data in number of bytes. */
21835         uint16_t        resp_len;
21836         uint8_t unused_0[7];
21837         /*
21838          * This field is used in Output records to indicate that the output
21839          * is completely written to RAM.  This field should be read as '1'
21840          * to indicate that the output has been completely written.
21841          * When writing a command completion or response to an internal processor,
21842          * the order of writes has to be such that this field is written last.
21843          */
21844         uint8_t valid;
21845 } __attribute__((packed));
21846
21847 /*********************
21848  * hwrm_vnic_rss_cfg *
21849  *********************/
21850
21851
21852 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
21853 struct hwrm_vnic_rss_cfg_input {
21854         /* The HWRM command request type. */
21855         uint16_t        req_type;
21856         /*
21857          * The completion ring to send the completion event on. This should
21858          * be the NQ ID returned from the `nq_alloc` HWRM command.
21859          */
21860         uint16_t        cmpl_ring;
21861         /*
21862          * The sequence ID is used by the driver for tracking multiple
21863          * commands. This ID is treated as opaque data by the firmware and
21864          * the value is returned in the `hwrm_resp_hdr` upon completion.
21865          */
21866         uint16_t        seq_id;
21867         /*
21868          * The target ID of the command:
21869          * * 0x0-0xFFF8 - The function ID
21870          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21871          * * 0xFFFD - Reserved for user-space HWRM interface
21872          * * 0xFFFF - HWRM
21873          */
21874         uint16_t        target_id;
21875         /*
21876          * A physical address pointer pointing to a host buffer that the
21877          * command's response data will be written. This can be either a host
21878          * physical address (HPA) or a guest physical address (GPA) and must
21879          * point to a physically contiguous block of memory.
21880          */
21881         uint64_t        resp_addr;
21882         uint32_t        hash_type;
21883         /*
21884          * When this bit is '1', the RSS hash shall be computed
21885          * over source and destination IPv4 addresses of IPv4
21886          * packets.
21887          */
21888         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
21889         /*
21890          * When this bit is '1', the RSS hash shall be computed
21891          * over source/destination IPv4 addresses and
21892          * source/destination ports of TCP/IPv4 packets.
21893          */
21894         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
21895         /*
21896          * When this bit is '1', the RSS hash shall be computed
21897          * over source/destination IPv4 addresses and
21898          * source/destination ports of UDP/IPv4 packets.
21899          */
21900         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
21901         /*
21902          * When this bit is '1', the RSS hash shall be computed
21903          * over source and destination IPv4 addresses of IPv6
21904          * packets.
21905          */
21906         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
21907         /*
21908          * When this bit is '1', the RSS hash shall be computed
21909          * over source/destination IPv6 addresses and
21910          * source/destination ports of TCP/IPv6 packets.
21911          */
21912         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
21913         /*
21914          * When this bit is '1', the RSS hash shall be computed
21915          * over source/destination IPv6 addresses and
21916          * source/destination ports of UDP/IPv6 packets.
21917          */
21918         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
21919         /* VNIC ID of VNIC associated with RSS table being configured. */
21920         uint16_t        vnic_id;
21921         /*
21922          * Specifies which VNIC ring table pair to configure.
21923          * Valid values range from 0 to 7.
21924          */
21925         uint8_t ring_table_pair_index;
21926         /* Flags to specify different RSS hash modes. */
21927         uint8_t hash_mode_flags;
21928         /*
21929          * When this bit is '1', it indicates using current RSS
21930          * hash mode setting configured in the device.
21931          */
21932         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \
21933                 UINT32_C(0x1)
21934         /*
21935          * When this bit is '1', it indicates requesting support of
21936          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
21937          * l4.src, l4.dest} for tunnel packets. For none-tunnel
21938          * packets, the RSS hash is computed over the normal
21939          * src/dest l3 and src/dest l4 headers.
21940          */
21941         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \
21942                 UINT32_C(0x2)
21943         /*
21944          * When this bit is '1', it indicates requesting support of
21945          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
21946          * tunnel packets. For none-tunnel packets, the RSS hash is
21947          * computed over the normal src/dest l3 headers.
21948          */
21949         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \
21950                 UINT32_C(0x4)
21951         /*
21952          * When this bit is '1', it indicates requesting support of
21953          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
21954          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
21955          * packets, the RSS hash is computed over the normal
21956          * src/dest l3 and src/dest l4 headers.
21957          */
21958         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
21959                 UINT32_C(0x8)
21960         /*
21961          * When this bit is '1', it indicates requesting support of
21962          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
21963          * tunnel packets. For none-tunnel packets, the RSS hash is
21964          * computed over the normal src/dest l3 headers.
21965          */
21966         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
21967                 UINT32_C(0x10)
21968         /* This is the address for rss ring group table */
21969         uint64_t        ring_grp_tbl_addr;
21970         /* This is the address for rss hash key table */
21971         uint64_t        hash_key_tbl_addr;
21972         /* Index to the rss indirection table. */
21973         uint16_t        rss_ctx_idx;
21974         uint8_t unused_1[6];
21975 } __attribute__((packed));
21976
21977 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
21978 struct hwrm_vnic_rss_cfg_output {
21979         /* The specific error status for the command. */
21980         uint16_t        error_code;
21981         /* The HWRM command request type. */
21982         uint16_t        req_type;
21983         /* The sequence ID from the original command. */
21984         uint16_t        seq_id;
21985         /* The length of the response data in number of bytes. */
21986         uint16_t        resp_len;
21987         uint8_t unused_0[7];
21988         /*
21989          * This field is used in Output records to indicate that the output
21990          * is completely written to RAM.  This field should be read as '1'
21991          * to indicate that the output has been completely written.
21992          * When writing a command completion or response to an internal processor,
21993          * the order of writes has to be such that this field is written last.
21994          */
21995         uint8_t valid;
21996 } __attribute__((packed));
21997
21998 /**********************
21999  * hwrm_vnic_rss_qcfg *
22000  **********************/
22001
22002
22003 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
22004 struct hwrm_vnic_rss_qcfg_input {
22005         /* The HWRM command request type. */
22006         uint16_t        req_type;
22007         /*
22008          * The completion ring to send the completion event on. This should
22009          * be the NQ ID returned from the `nq_alloc` HWRM command.
22010          */
22011         uint16_t        cmpl_ring;
22012         /*
22013          * The sequence ID is used by the driver for tracking multiple
22014          * commands. This ID is treated as opaque data by the firmware and
22015          * the value is returned in the `hwrm_resp_hdr` upon completion.
22016          */
22017         uint16_t        seq_id;
22018         /*
22019          * The target ID of the command:
22020          * * 0x0-0xFFF8 - The function ID
22021          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22022          * * 0xFFFD - Reserved for user-space HWRM interface
22023          * * 0xFFFF - HWRM
22024          */
22025         uint16_t        target_id;
22026         /*
22027          * A physical address pointer pointing to a host buffer that the
22028          * command's response data will be written. This can be either a host
22029          * physical address (HPA) or a guest physical address (GPA) and must
22030          * point to a physically contiguous block of memory.
22031          */
22032         uint64_t        resp_addr;
22033         /* Index to the rss indirection table. */
22034         uint16_t        rss_ctx_idx;
22035         uint8_t unused_0[6];
22036 } __attribute__((packed));
22037
22038 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
22039 struct hwrm_vnic_rss_qcfg_output {
22040         /* The specific error status for the command. */
22041         uint16_t        error_code;
22042         /* The HWRM command request type. */
22043         uint16_t        req_type;
22044         /* The sequence ID from the original command. */
22045         uint16_t        seq_id;
22046         /* The length of the response data in number of bytes. */
22047         uint16_t        resp_len;
22048         uint32_t        hash_type;
22049         /*
22050          * When this bit is '1', the RSS hash shall be computed
22051          * over source and destination IPv4 addresses of IPv4
22052          * packets.
22053          */
22054         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
22055         /*
22056          * When this bit is '1', the RSS hash shall be computed
22057          * over source/destination IPv4 addresses and
22058          * source/destination ports of TCP/IPv4 packets.
22059          */
22060         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
22061         /*
22062          * When this bit is '1', the RSS hash shall be computed
22063          * over source/destination IPv4 addresses and
22064          * source/destination ports of UDP/IPv4 packets.
22065          */
22066         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
22067         /*
22068          * When this bit is '1', the RSS hash shall be computed
22069          * over source and destination IPv4 addresses of IPv6
22070          * packets.
22071          */
22072         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
22073         /*
22074          * When this bit is '1', the RSS hash shall be computed
22075          * over source/destination IPv6 addresses and
22076          * source/destination ports of TCP/IPv6 packets.
22077          */
22078         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
22079         /*
22080          * When this bit is '1', the RSS hash shall be computed
22081          * over source/destination IPv6 addresses and
22082          * source/destination ports of UDP/IPv6 packets.
22083          */
22084         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
22085         uint8_t unused_0[4];
22086         /* This is the value of rss hash key */
22087         uint32_t        hash_key[10];
22088         /* Flags to specify different RSS hash modes. */
22089         uint8_t hash_mode_flags;
22090         /*
22091          * When this bit is '1', it indicates using current RSS
22092          * hash mode setting configured in the device.
22093          */
22094         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \
22095                 UINT32_C(0x1)
22096         /*
22097          * When this bit is '1', it indicates requesting support of
22098          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
22099          * l4.src, l4.dest} for tunnel packets. For none-tunnel
22100          * packets, the RSS hash is computed over the normal
22101          * src/dest l3 and src/dest l4 headers.
22102          */
22103         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \
22104                 UINT32_C(0x2)
22105         /*
22106          * When this bit is '1', it indicates requesting support of
22107          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
22108          * tunnel packets. For none-tunnel packets, the RSS hash is
22109          * computed over the normal src/dest l3 headers.
22110          */
22111         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \
22112                 UINT32_C(0x4)
22113         /*
22114          * When this bit is '1', it indicates requesting support of
22115          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
22116          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
22117          * packets, the RSS hash is computed over the normal
22118          * src/dest l3 and src/dest l4 headers.
22119          */
22120         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
22121                 UINT32_C(0x8)
22122         /*
22123          * When this bit is '1', it indicates requesting support of
22124          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
22125          * tunnel packets. For none-tunnel packets, the RSS hash is
22126          * computed over the normal src/dest l3 headers.
22127          */
22128         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
22129                 UINT32_C(0x10)
22130         uint8_t unused_1[6];
22131         /*
22132          * This field is used in Output records to indicate that the output
22133          * is completely written to RAM.  This field should be read as '1'
22134          * to indicate that the output has been completely written.
22135          * When writing a command completion or response to an internal processor,
22136          * the order of writes has to be such that this field is written last.
22137          */
22138         uint8_t valid;
22139 } __attribute__((packed));
22140
22141 /**************************
22142  * hwrm_vnic_plcmodes_cfg *
22143  **************************/
22144
22145
22146 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
22147 struct hwrm_vnic_plcmodes_cfg_input {
22148         /* The HWRM command request type. */
22149         uint16_t        req_type;
22150         /*
22151          * The completion ring to send the completion event on. This should
22152          * be the NQ ID returned from the `nq_alloc` HWRM command.
22153          */
22154         uint16_t        cmpl_ring;
22155         /*
22156          * The sequence ID is used by the driver for tracking multiple
22157          * commands. This ID is treated as opaque data by the firmware and
22158          * the value is returned in the `hwrm_resp_hdr` upon completion.
22159          */
22160         uint16_t        seq_id;
22161         /*
22162          * The target ID of the command:
22163          * * 0x0-0xFFF8 - The function ID
22164          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22165          * * 0xFFFD - Reserved for user-space HWRM interface
22166          * * 0xFFFF - HWRM
22167          */
22168         uint16_t        target_id;
22169         /*
22170          * A physical address pointer pointing to a host buffer that the
22171          * command's response data will be written. This can be either a host
22172          * physical address (HPA) or a guest physical address (GPA) and must
22173          * point to a physically contiguous block of memory.
22174          */
22175         uint64_t        resp_addr;
22176         uint32_t        flags;
22177         /*
22178          * When this bit is '1', the VNIC shall be configured to
22179          * use regular placement algorithm.
22180          * By default, the regular placement algorithm shall be
22181          * enabled on the VNIC.
22182          */
22183         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
22184                 UINT32_C(0x1)
22185         /*
22186          * When this bit is '1', the VNIC shall be configured
22187          * use the jumbo placement algorithm.
22188          */
22189         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
22190                 UINT32_C(0x2)
22191         /*
22192          * When this bit is '1', the VNIC shall be configured
22193          * to enable Header-Data split for IPv4 packets according
22194          * to the following rules:
22195          * # If the packet is identified as TCP/IPv4, then the
22196          * packet is split at the beginning of the TCP payload.
22197          * # If the packet is identified as UDP/IPv4, then the
22198          * packet is split at the beginning of UDP payload.
22199          * # If the packet is identified as non-TCP and non-UDP
22200          * IPv4 packet, then the packet is split at the beginning
22201          * of the upper layer protocol header carried in the IPv4
22202          * packet.
22203          */
22204         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 \
22205                 UINT32_C(0x4)
22206         /*
22207          * When this bit is '1', the VNIC shall be configured
22208          * to enable Header-Data split for IPv6 packets according
22209          * to the following rules:
22210          * # If the packet is identified as TCP/IPv6, then the
22211          * packet is split at the beginning of the TCP payload.
22212          * # If the packet is identified as UDP/IPv6, then the
22213          * packet is split at the beginning of UDP payload.
22214          * # If the packet is identified as non-TCP and non-UDP
22215          * IPv6 packet, then the packet is split at the beginning
22216          * of the upper layer protocol header carried in the IPv6
22217          * packet.
22218          */
22219         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 \
22220                 UINT32_C(0x8)
22221         /*
22222          * When this bit is '1', the VNIC shall be configured
22223          * to enable Header-Data split for FCoE packets at the
22224          * beginning of FC payload.
22225          */
22226         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE \
22227                 UINT32_C(0x10)
22228         /*
22229          * When this bit is '1', the VNIC shall be configured
22230          * to enable Header-Data split for RoCE packets at the
22231          * beginning of RoCE payload (after BTH/GRH headers).
22232          */
22233         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE \
22234                 UINT32_C(0x20)
22235         uint32_t        enables;
22236         /*
22237          * This bit must be '1' for the jumbo_thresh_valid field to be
22238          * configured.
22239          */
22240         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
22241                 UINT32_C(0x1)
22242         /*
22243          * This bit must be '1' for the hds_offset_valid field to be
22244          * configured.
22245          */
22246         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
22247                 UINT32_C(0x2)
22248         /*
22249          * This bit must be '1' for the hds_threshold_valid field to be
22250          * configured.
22251          */
22252         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
22253                 UINT32_C(0x4)
22254         /* Logical vnic ID */
22255         uint32_t        vnic_id;
22256         /*
22257          * When jumbo placement algorithm is enabled, this value
22258          * is used to determine the threshold for jumbo placement.
22259          * Packets with length larger than this value will be
22260          * placed according to the jumbo placement algorithm.
22261          */
22262         uint16_t        jumbo_thresh;
22263         /*
22264          * This value is used to determine the offset into
22265          * packet buffer where the split data (payload) will be
22266          * placed according to one of of HDS placement algorithm.
22267          *
22268          * The lengths of packet buffers provided for split data
22269          * shall be larger than this value.
22270          */
22271         uint16_t        hds_offset;
22272         /*
22273          * When one of the HDS placement algorithm is enabled, this
22274          * value is used to determine the threshold for HDS
22275          * placement.
22276          * Packets with length larger than this value will be
22277          * placed according to the HDS placement algorithm.
22278          * This value shall be in multiple of 4 bytes.
22279          */
22280         uint16_t        hds_threshold;
22281         uint8_t unused_0[6];
22282 } __attribute__((packed));
22283
22284 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
22285 struct hwrm_vnic_plcmodes_cfg_output {
22286         /* The specific error status for the command. */
22287         uint16_t        error_code;
22288         /* The HWRM command request type. */
22289         uint16_t        req_type;
22290         /* The sequence ID from the original command. */
22291         uint16_t        seq_id;
22292         /* The length of the response data in number of bytes. */
22293         uint16_t        resp_len;
22294         uint8_t unused_0[7];
22295         /*
22296          * This field is used in Output records to indicate that the output
22297          * is completely written to RAM.  This field should be read as '1'
22298          * to indicate that the output has been completely written.
22299          * When writing a command completion or response to an internal processor,
22300          * the order of writes has to be such that this field is written last.
22301          */
22302         uint8_t valid;
22303 } __attribute__((packed));
22304
22305 /***************************
22306  * hwrm_vnic_plcmodes_qcfg *
22307  ***************************/
22308
22309
22310 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
22311 struct hwrm_vnic_plcmodes_qcfg_input {
22312         /* The HWRM command request type. */
22313         uint16_t        req_type;
22314         /*
22315          * The completion ring to send the completion event on. This should
22316          * be the NQ ID returned from the `nq_alloc` HWRM command.
22317          */
22318         uint16_t        cmpl_ring;
22319         /*
22320          * The sequence ID is used by the driver for tracking multiple
22321          * commands. This ID is treated as opaque data by the firmware and
22322          * the value is returned in the `hwrm_resp_hdr` upon completion.
22323          */
22324         uint16_t        seq_id;
22325         /*
22326          * The target ID of the command:
22327          * * 0x0-0xFFF8 - The function ID
22328          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22329          * * 0xFFFD - Reserved for user-space HWRM interface
22330          * * 0xFFFF - HWRM
22331          */
22332         uint16_t        target_id;
22333         /*
22334          * A physical address pointer pointing to a host buffer that the
22335          * command's response data will be written. This can be either a host
22336          * physical address (HPA) or a guest physical address (GPA) and must
22337          * point to a physically contiguous block of memory.
22338          */
22339         uint64_t        resp_addr;
22340         /* Logical vnic ID */
22341         uint32_t        vnic_id;
22342         uint8_t unused_0[4];
22343 } __attribute__((packed));
22344
22345 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
22346 struct hwrm_vnic_plcmodes_qcfg_output {
22347         /* The specific error status for the command. */
22348         uint16_t        error_code;
22349         /* The HWRM command request type. */
22350         uint16_t        req_type;
22351         /* The sequence ID from the original command. */
22352         uint16_t        seq_id;
22353         /* The length of the response data in number of bytes. */
22354         uint16_t        resp_len;
22355         uint32_t        flags;
22356         /*
22357          * When this bit is '1', the VNIC is configured to
22358          * use regular placement algorithm.
22359          */
22360         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
22361                 UINT32_C(0x1)
22362         /*
22363          * When this bit is '1', the VNIC is configured to
22364          * use the jumbo placement algorithm.
22365          */
22366         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
22367                 UINT32_C(0x2)
22368         /*
22369          * When this bit is '1', the VNIC is configured
22370          * to enable Header-Data split for IPv4 packets.
22371          */
22372         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 \
22373                 UINT32_C(0x4)
22374         /*
22375          * When this bit is '1', the VNIC is configured
22376          * to enable Header-Data split for IPv6 packets.
22377          */
22378         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 \
22379                 UINT32_C(0x8)
22380         /*
22381          * When this bit is '1', the VNIC is configured
22382          * to enable Header-Data split for FCoE packets.
22383          */
22384         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE \
22385                 UINT32_C(0x10)
22386         /*
22387          * When this bit is '1', the VNIC is configured
22388          * to enable Header-Data split for RoCE packets.
22389          */
22390         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE \
22391                 UINT32_C(0x20)
22392         /*
22393          * When this bit is '1', the VNIC is configured
22394          * to be the default VNIC of the requesting function.
22395          */
22396         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC \
22397                 UINT32_C(0x40)
22398         /*
22399          * When jumbo placement algorithm is enabled, this value
22400          * is used to determine the threshold for jumbo placement.
22401          * Packets with length larger than this value will be
22402          * placed according to the jumbo placement algorithm.
22403          */
22404         uint16_t        jumbo_thresh;
22405         /*
22406          * This value is used to determine the offset into
22407          * packet buffer where the split data (payload) will be
22408          * placed according to one of of HDS placement algorithm.
22409          *
22410          * The lengths of packet buffers provided for split data
22411          * shall be larger than this value.
22412          */
22413         uint16_t        hds_offset;
22414         /*
22415          * When one of the HDS placement algorithm is enabled, this
22416          * value is used to determine the threshold for HDS
22417          * placement.
22418          * Packets with length larger than this value will be
22419          * placed according to the HDS placement algorithm.
22420          * This value shall be in multiple of 4 bytes.
22421          */
22422         uint16_t        hds_threshold;
22423         uint8_t unused_0[5];
22424         /*
22425          * This field is used in Output records to indicate that the output
22426          * is completely written to RAM.  This field should be read as '1'
22427          * to indicate that the output has been completely written.
22428          * When writing a command completion or response to an internal processor,
22429          * the order of writes has to be such that this field is written last.
22430          */
22431         uint8_t valid;
22432 } __attribute__((packed));
22433
22434 /**********************************
22435  * hwrm_vnic_rss_cos_lb_ctx_alloc *
22436  **********************************/
22437
22438
22439 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
22440 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
22441         /* The HWRM command request type. */
22442         uint16_t        req_type;
22443         /*
22444          * The completion ring to send the completion event on. This should
22445          * be the NQ ID returned from the `nq_alloc` HWRM command.
22446          */
22447         uint16_t        cmpl_ring;
22448         /*
22449          * The sequence ID is used by the driver for tracking multiple
22450          * commands. This ID is treated as opaque data by the firmware and
22451          * the value is returned in the `hwrm_resp_hdr` upon completion.
22452          */
22453         uint16_t        seq_id;
22454         /*
22455          * The target ID of the command:
22456          * * 0x0-0xFFF8 - The function ID
22457          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22458          * * 0xFFFD - Reserved for user-space HWRM interface
22459          * * 0xFFFF - HWRM
22460          */
22461         uint16_t        target_id;
22462         /*
22463          * A physical address pointer pointing to a host buffer that the
22464          * command's response data will be written. This can be either a host
22465          * physical address (HPA) or a guest physical address (GPA) and must
22466          * point to a physically contiguous block of memory.
22467          */
22468         uint64_t        resp_addr;
22469 } __attribute__((packed));
22470
22471 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
22472 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
22473         /* The specific error status for the command. */
22474         uint16_t        error_code;
22475         /* The HWRM command request type. */
22476         uint16_t        req_type;
22477         /* The sequence ID from the original command. */
22478         uint16_t        seq_id;
22479         /* The length of the response data in number of bytes. */
22480         uint16_t        resp_len;
22481         /* rss_cos_lb_ctx_id is 16 b */
22482         uint16_t        rss_cos_lb_ctx_id;
22483         uint8_t unused_0[5];
22484         /*
22485          * This field is used in Output records to indicate that the output
22486          * is completely written to RAM.  This field should be read as '1'
22487          * to indicate that the output has been completely written.
22488          * When writing a command completion or response to an internal processor,
22489          * the order of writes has to be such that this field is written last.
22490          */
22491         uint8_t valid;
22492 } __attribute__((packed));
22493
22494 /*********************************
22495  * hwrm_vnic_rss_cos_lb_ctx_free *
22496  *********************************/
22497
22498
22499 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
22500 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
22501         /* The HWRM command request type. */
22502         uint16_t        req_type;
22503         /*
22504          * The completion ring to send the completion event on. This should
22505          * be the NQ ID returned from the `nq_alloc` HWRM command.
22506          */
22507         uint16_t        cmpl_ring;
22508         /*
22509          * The sequence ID is used by the driver for tracking multiple
22510          * commands. This ID is treated as opaque data by the firmware and
22511          * the value is returned in the `hwrm_resp_hdr` upon completion.
22512          */
22513         uint16_t        seq_id;
22514         /*
22515          * The target ID of the command:
22516          * * 0x0-0xFFF8 - The function ID
22517          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22518          * * 0xFFFD - Reserved for user-space HWRM interface
22519          * * 0xFFFF - HWRM
22520          */
22521         uint16_t        target_id;
22522         /*
22523          * A physical address pointer pointing to a host buffer that the
22524          * command's response data will be written. This can be either a host
22525          * physical address (HPA) or a guest physical address (GPA) and must
22526          * point to a physically contiguous block of memory.
22527          */
22528         uint64_t        resp_addr;
22529         /* rss_cos_lb_ctx_id is 16 b */
22530         uint16_t        rss_cos_lb_ctx_id;
22531         uint8_t unused_0[6];
22532 } __attribute__((packed));
22533
22534 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
22535 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
22536         /* The specific error status for the command. */
22537         uint16_t        error_code;
22538         /* The HWRM command request type. */
22539         uint16_t        req_type;
22540         /* The sequence ID from the original command. */
22541         uint16_t        seq_id;
22542         /* The length of the response data in number of bytes. */
22543         uint16_t        resp_len;
22544         uint8_t unused_0[7];
22545         /*
22546          * This field is used in Output records to indicate that the output
22547          * is completely written to RAM.  This field should be read as '1'
22548          * to indicate that the output has been completely written.
22549          * When writing a command completion or response to an internal processor,
22550          * the order of writes has to be such that this field is written last.
22551          */
22552         uint8_t valid;
22553 } __attribute__((packed));
22554
22555 /*******************
22556  * hwrm_ring_alloc *
22557  *******************/
22558
22559
22560 /* hwrm_ring_alloc_input (size:704b/88B) */
22561 struct hwrm_ring_alloc_input {
22562         /* The HWRM command request type. */
22563         uint16_t        req_type;
22564         /*
22565          * The completion ring to send the completion event on. This should
22566          * be the NQ ID returned from the `nq_alloc` HWRM command.
22567          */
22568         uint16_t        cmpl_ring;
22569         /*
22570          * The sequence ID is used by the driver for tracking multiple
22571          * commands. This ID is treated as opaque data by the firmware and
22572          * the value is returned in the `hwrm_resp_hdr` upon completion.
22573          */
22574         uint16_t        seq_id;
22575         /*
22576          * The target ID of the command:
22577          * * 0x0-0xFFF8 - The function ID
22578          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22579          * * 0xFFFD - Reserved for user-space HWRM interface
22580          * * 0xFFFF - HWRM
22581          */
22582         uint16_t        target_id;
22583         /*
22584          * A physical address pointer pointing to a host buffer that the
22585          * command's response data will be written. This can be either a host
22586          * physical address (HPA) or a guest physical address (GPA) and must
22587          * point to a physically contiguous block of memory.
22588          */
22589         uint64_t        resp_addr;
22590         uint32_t        enables;
22591         /*
22592          * This bit must be '1' for the ring_arb_cfg field to be
22593          * configured.
22594          */
22595         #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG \
22596                 UINT32_C(0x2)
22597         /*
22598          * This bit must be '1' for the stat_ctx_id_valid field to be
22599          * configured.
22600          */
22601         #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID \
22602                 UINT32_C(0x8)
22603         /*
22604          * This bit must be '1' for the max_bw_valid field to be
22605          * configured.
22606          */
22607         #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID \
22608                 UINT32_C(0x20)
22609         /*
22610          * This bit must be '1' for the rx_ring_id field to be
22611          * configured.
22612          */
22613         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID \
22614                 UINT32_C(0x40)
22615         /*
22616          * This bit must be '1' for the nq_ring_id field to be
22617          * configured.
22618          */
22619         #define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID \
22620                 UINT32_C(0x80)
22621         /*
22622          * This bit must be '1' for the rx_buf_size field to be
22623          * configured.
22624          */
22625         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID \
22626                 UINT32_C(0x100)
22627         /* Ring Type. */
22628         uint8_t ring_type;
22629         /* L2 Completion Ring (CR) */
22630         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
22631         /* TX Ring (TR) */
22632         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX        UINT32_C(0x1)
22633         /* RX Ring (RR) */
22634         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX        UINT32_C(0x2)
22635         /* RoCE Notification Completion Ring (ROCE_CR) */
22636         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
22637         /* RX Aggregation Ring */
22638         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
22639         /* Notification Queue */
22640         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
22641         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST \
22642                 HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
22643         uint8_t unused_0;
22644         /* Ring allocation flags. */
22645         uint16_t        flags;
22646         /*
22647          * For Rx rings, the incoming packet data can be placed at either
22648          * a 0B or 2B offset from the start of the Rx packet buffer. When
22649          * '1', the received packet will be padded with 2B of zeros at the
22650          * front of the packet. Note that this flag is only used for
22651          * Rx rings and is ignored for all other rings included Rx
22652          * Aggregation rings.
22653          */
22654         #define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD     UINT32_C(0x1)
22655         /*
22656          * This value is a pointer to the page table for the
22657          * Ring.
22658          */
22659         uint64_t        page_tbl_addr;
22660         /* First Byte Offset of the first entry in the first page. */
22661         uint32_t        fbo;
22662         /*
22663          * Actual page size in 2^page_size. The supported range is increments
22664          * in powers of 2 from 16 bytes to 1GB.
22665          * - 4 = 16 B
22666          *     Page size is 16 B.
22667          * - 12 = 4 KB
22668          *     Page size is 4 KB.
22669          * - 13 = 8 KB
22670          *     Page size is 8 KB.
22671          * - 16 = 64 KB
22672          *     Page size is 64 KB.
22673          * - 21 = 2 MB
22674          *     Page size is 2 MB.
22675          * - 22 = 4 MB
22676          *     Page size is 4 MB.
22677          * - 30 = 1 GB
22678          *     Page size is 1 GB.
22679          */
22680         uint8_t page_size;
22681         /*
22682          * This value indicates the depth of page table.
22683          * For this version of the specification, value other than 0 or
22684          * 1 shall be considered as an invalid value.
22685          * When the page_tbl_depth = 0, then it is treated as a
22686          * special case with the following.
22687          * 1. FBO and page size fields are not valid.
22688          * 2. page_tbl_addr is the physical address of the first
22689          *    element of the ring.
22690          */
22691         uint8_t page_tbl_depth;
22692         uint8_t unused_1[2];
22693         /*
22694          * Number of 16B units in the ring.  Minimum size for
22695          * a ring is 16 16B entries.
22696          */
22697         uint32_t        length;
22698         /*
22699          * Logical ring number for the ring to be allocated.
22700          * This value determines the position in the doorbell
22701          * area where the update to the ring will be made.
22702          *
22703          * For completion rings, this value is also the MSI-X
22704          * vector number for the function the completion ring is
22705          * associated with.
22706          */
22707         uint16_t        logical_id;
22708         /*
22709          * This field is used only when ring_type is a TX ring.
22710          * This value indicates what completion ring the TX ring
22711          * is associated with.
22712          */
22713         uint16_t        cmpl_ring_id;
22714         /*
22715          * This field is used only when ring_type is a TX ring.
22716          * This value indicates what CoS queue the TX ring
22717          * is associated with.
22718          */
22719         uint16_t        queue_id;
22720         /*
22721          * When allocating a Rx ring or Rx aggregation ring, this field
22722          * specifies the size of the buffer descriptors posted to the ring.
22723          */
22724         uint16_t        rx_buf_size;
22725         /*
22726          * When allocating an Rx aggregation ring, this field
22727          * specifies the associated Rx ring ID.
22728          */
22729         uint16_t        rx_ring_id;
22730         /*
22731          * When allocating a completion ring, this field
22732          * specifies the associated NQ ring ID.
22733          */
22734         uint16_t        nq_ring_id;
22735         /*
22736          * This field is used only when ring_type is a TX ring.
22737          * This field is used to configure arbitration related
22738          * parameters for a TX ring.
22739          */
22740         uint16_t        ring_arb_cfg;
22741         /* Arbitration policy used for the ring. */
22742         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK \
22743                 UINT32_C(0xf)
22744         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT       0
22745         /*
22746          * Use strict priority for the TX ring.
22747          * Priority value is specified in arb_policy_param
22748          */
22749         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
22750                 UINT32_C(0x1)
22751         /*
22752          * Use weighted fair queue arbitration for the TX ring.
22753          * Weight is specified in arb_policy_param
22754          */
22755         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
22756                 UINT32_C(0x2)
22757         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
22758                 HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
22759         /* Reserved field. */
22760         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK \
22761                 UINT32_C(0xf0)
22762         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT             4
22763         /*
22764          * Arbitration policy specific parameter.
22765          * # For strict priority arbitration policy, this field
22766          * represents a priority value. If set to 0, then the priority
22767          * is not specified and the HWRM is allowed to select
22768          * any priority for this TX ring.
22769          * # For weighted fair queue arbitration policy, this field
22770          * represents a weight value. If set to 0, then the weight
22771          * is not specified and the HWRM is allowed to select
22772          * any weight for this TX ring.
22773          */
22774         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
22775                 UINT32_C(0xff00)
22776         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
22777         uint16_t        unused_3;
22778         /*
22779          * This field is reserved for the future use.
22780          * It shall be set to 0.
22781          */
22782         uint32_t        reserved3;
22783         /*
22784          * This field is used only when ring_type is a TX ring.
22785          * This input indicates what statistics context this ring
22786          * should be associated with.
22787          */
22788         uint32_t        stat_ctx_id;
22789         /*
22790          * This field is reserved for the future use.
22791          * It shall be set to 0.
22792          */
22793         uint32_t        reserved4;
22794         /*
22795          * This field is used only when ring_type is a TX ring
22796          * to specify maximum BW allocated to the TX ring.
22797          * The HWRM will translate this value into byte counter and
22798          * time interval used for this ring inside the device.
22799          */
22800         uint32_t        max_bw;
22801         /* The bandwidth value. */
22802         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK \
22803                 UINT32_C(0xfffffff)
22804         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT              0
22805         /* The granularity of the value (bits or bytes). */
22806         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE \
22807                 UINT32_C(0x10000000)
22808         /* Value is in bits. */
22809         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS \
22810                 (UINT32_C(0x0) << 28)
22811         /* Value is in bytes. */
22812         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES \
22813                 (UINT32_C(0x1) << 28)
22814         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
22815                 HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
22816         /* bw_value_unit is 3 b */
22817         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
22818                 UINT32_C(0xe0000000)
22819         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
22820         /* Value is in Mb or MB (base 10). */
22821         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
22822                 (UINT32_C(0x0) << 29)
22823         /* Value is in Kb or KB (base 10). */
22824         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
22825                 (UINT32_C(0x2) << 29)
22826         /* Value is in bits or bytes. */
22827         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
22828                 (UINT32_C(0x4) << 29)
22829         /* Value is in Gb or GB (base 10). */
22830         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
22831                 (UINT32_C(0x6) << 29)
22832         /* Value is in 1/100th of a percentage of total bandwidth. */
22833         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
22834                 (UINT32_C(0x1) << 29)
22835         /* Invalid unit */
22836         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
22837                 (UINT32_C(0x7) << 29)
22838         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
22839                 HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
22840         /*
22841          * This field is used only when ring_type is a Completion ring.
22842          * This value indicates what interrupt mode should be used
22843          * on this completion ring.
22844          * Note: In the legacy interrupt mode, no more than 16
22845          * completion rings are allowed.
22846          */
22847         uint8_t int_mode;
22848         /* Legacy INTA */
22849         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
22850         /* Reserved */
22851         #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD   UINT32_C(0x1)
22852         /* MSI-X */
22853         #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX   UINT32_C(0x2)
22854         /* No Interrupt - Polled mode */
22855         #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL   UINT32_C(0x3)
22856         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST \
22857                 HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
22858         uint8_t unused_4[3];
22859         /*
22860          * The cq_handle is specified when allocating a completion ring. For
22861          * devices that support NQs, this cq_handle will be included in the
22862          * NQE to specify which CQ should be read to retrieve the completion
22863          * record.
22864          */
22865         uint64_t        cq_handle;
22866 } __attribute__((packed));
22867
22868 /* hwrm_ring_alloc_output (size:128b/16B) */
22869 struct hwrm_ring_alloc_output {
22870         /* The specific error status for the command. */
22871         uint16_t        error_code;
22872         /* The HWRM command request type. */
22873         uint16_t        req_type;
22874         /* The sequence ID from the original command. */
22875         uint16_t        seq_id;
22876         /* The length of the response data in number of bytes. */
22877         uint16_t        resp_len;
22878         /*
22879          * Physical number of ring allocated.
22880          * This value shall be unique for a ring type.
22881          */
22882         uint16_t        ring_id;
22883         /* Logical number of ring allocated. */
22884         uint16_t        logical_ring_id;
22885         uint8_t unused_0[3];
22886         /*
22887          * This field is used in Output records to indicate that the output
22888          * is completely written to RAM.  This field should be read as '1'
22889          * to indicate that the output has been completely written.
22890          * When writing a command completion or response to an internal processor,
22891          * the order of writes has to be such that this field is written last.
22892          */
22893         uint8_t valid;
22894 } __attribute__((packed));
22895
22896 /******************
22897  * hwrm_ring_free *
22898  ******************/
22899
22900
22901 /* hwrm_ring_free_input (size:192b/24B) */
22902 struct hwrm_ring_free_input {
22903         /* The HWRM command request type. */
22904         uint16_t        req_type;
22905         /*
22906          * The completion ring to send the completion event on. This should
22907          * be the NQ ID returned from the `nq_alloc` HWRM command.
22908          */
22909         uint16_t        cmpl_ring;
22910         /*
22911          * The sequence ID is used by the driver for tracking multiple
22912          * commands. This ID is treated as opaque data by the firmware and
22913          * the value is returned in the `hwrm_resp_hdr` upon completion.
22914          */
22915         uint16_t        seq_id;
22916         /*
22917          * The target ID of the command:
22918          * * 0x0-0xFFF8 - The function ID
22919          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22920          * * 0xFFFD - Reserved for user-space HWRM interface
22921          * * 0xFFFF - HWRM
22922          */
22923         uint16_t        target_id;
22924         /*
22925          * A physical address pointer pointing to a host buffer that the
22926          * command's response data will be written. This can be either a host
22927          * physical address (HPA) or a guest physical address (GPA) and must
22928          * point to a physically contiguous block of memory.
22929          */
22930         uint64_t        resp_addr;
22931         /* Ring Type. */
22932         uint8_t ring_type;
22933         /* L2 Completion Ring (CR) */
22934         #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
22935         /* TX Ring (TR) */
22936         #define HWRM_RING_FREE_INPUT_RING_TYPE_TX        UINT32_C(0x1)
22937         /* RX Ring (RR) */
22938         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX        UINT32_C(0x2)
22939         /* RoCE Notification Completion Ring (ROCE_CR) */
22940         #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
22941         /* RX Aggregation Ring */
22942         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
22943         /* Notification Queue */
22944         #define HWRM_RING_FREE_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
22945         #define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \
22946                 HWRM_RING_FREE_INPUT_RING_TYPE_NQ
22947         uint8_t unused_0;
22948         /* Physical number of ring allocated. */
22949         uint16_t        ring_id;
22950         uint8_t unused_1[4];
22951 } __attribute__((packed));
22952
22953 /* hwrm_ring_free_output (size:128b/16B) */
22954 struct hwrm_ring_free_output {
22955         /* The specific error status for the command. */
22956         uint16_t        error_code;
22957         /* The HWRM command request type. */
22958         uint16_t        req_type;
22959         /* The sequence ID from the original command. */
22960         uint16_t        seq_id;
22961         /* The length of the response data in number of bytes. */
22962         uint16_t        resp_len;
22963         uint8_t unused_0[7];
22964         /*
22965          * This field is used in Output records to indicate that the output
22966          * is completely written to RAM.  This field should be read as '1'
22967          * to indicate that the output has been completely written.
22968          * When writing a command completion or response to an internal processor,
22969          * the order of writes has to be such that this field is written last.
22970          */
22971         uint8_t valid;
22972 } __attribute__((packed));
22973
22974 /*******************
22975  * hwrm_ring_reset *
22976  *******************/
22977
22978
22979 /* hwrm_ring_reset_input (size:192b/24B) */
22980 struct hwrm_ring_reset_input {
22981         /* The HWRM command request type. */
22982         uint16_t        req_type;
22983         /*
22984          * The completion ring to send the completion event on. This should
22985          * be the NQ ID returned from the `nq_alloc` HWRM command.
22986          */
22987         uint16_t        cmpl_ring;
22988         /*
22989          * The sequence ID is used by the driver for tracking multiple
22990          * commands. This ID is treated as opaque data by the firmware and
22991          * the value is returned in the `hwrm_resp_hdr` upon completion.
22992          */
22993         uint16_t        seq_id;
22994         /*
22995          * The target ID of the command:
22996          * * 0x0-0xFFF8 - The function ID
22997          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22998          * * 0xFFFD - Reserved for user-space HWRM interface
22999          * * 0xFFFF - HWRM
23000          */
23001         uint16_t        target_id;
23002         /*
23003          * A physical address pointer pointing to a host buffer that the
23004          * command's response data will be written. This can be either a host
23005          * physical address (HPA) or a guest physical address (GPA) and must
23006          * point to a physically contiguous block of memory.
23007          */
23008         uint64_t        resp_addr;
23009         /* Ring Type. */
23010         uint8_t ring_type;
23011         /* L2 Completion Ring (CR) */
23012         #define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
23013         /* TX Ring (TR) */
23014         #define HWRM_RING_RESET_INPUT_RING_TYPE_TX        UINT32_C(0x1)
23015         /* RX Ring (RR) */
23016         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX        UINT32_C(0x2)
23017         /* RoCE Notification Completion Ring (ROCE_CR) */
23018         #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
23019         #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \
23020                 HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL
23021         uint8_t unused_0;
23022         /* Physical number of the ring. */
23023         uint16_t        ring_id;
23024         uint8_t unused_1[4];
23025 } __attribute__((packed));
23026
23027 /* hwrm_ring_reset_output (size:128b/16B) */
23028 struct hwrm_ring_reset_output {
23029         /* The specific error status for the command. */
23030         uint16_t        error_code;
23031         /* The HWRM command request type. */
23032         uint16_t        req_type;
23033         /* The sequence ID from the original command. */
23034         uint16_t        seq_id;
23035         /* The length of the response data in number of bytes. */
23036         uint16_t        resp_len;
23037         uint8_t unused_0[4];
23038         /* Position of consumer index after ring reset completes. */
23039         uint8_t consumer_idx[3];
23040         /*
23041          * This field is used in Output records to indicate that the output
23042          * is completely written to RAM.  This field should be read as '1'
23043          * to indicate that the output has been completely written.
23044          * When writing a command completion or response to an internal processor,
23045          * the order of writes has to be such that this field is written last.
23046          */
23047         uint8_t valid;
23048 } __attribute__((packed));
23049
23050 /**************************
23051  * hwrm_ring_aggint_qcaps *
23052  **************************/
23053
23054
23055 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */
23056 struct hwrm_ring_aggint_qcaps_input {
23057         /* The HWRM command request type. */
23058         uint16_t        req_type;
23059         /*
23060          * The completion ring to send the completion event on. This should
23061          * be the NQ ID returned from the `nq_alloc` HWRM command.
23062          */
23063         uint16_t        cmpl_ring;
23064         /*
23065          * The sequence ID is used by the driver for tracking multiple
23066          * commands. This ID is treated as opaque data by the firmware and
23067          * the value is returned in the `hwrm_resp_hdr` upon completion.
23068          */
23069         uint16_t        seq_id;
23070         /*
23071          * The target ID of the command:
23072          * * 0x0-0xFFF8 - The function ID
23073          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23074          * * 0xFFFD - Reserved for user-space HWRM interface
23075          * * 0xFFFF - HWRM
23076          */
23077         uint16_t        target_id;
23078         /*
23079          * A physical address pointer pointing to a host buffer that the
23080          * command's response data will be written. This can be either a host
23081          * physical address (HPA) or a guest physical address (GPA) and must
23082          * point to a physically contiguous block of memory.
23083          */
23084         uint64_t        resp_addr;
23085 } __attribute__((packed));
23086
23087 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
23088 struct hwrm_ring_aggint_qcaps_output {
23089         /* The specific error status for the command. */
23090         uint16_t        error_code;
23091         /* The HWRM command request type. */
23092         uint16_t        req_type;
23093         /* The sequence ID from the original command. */
23094         uint16_t        seq_id;
23095         /* The length of the response data in number of bytes. */
23096         uint16_t        resp_len;
23097         uint32_t        cmpl_params;
23098         /*
23099          * When this bit is set to '1', int_lat_tmr_min can be configured
23100          * on completion rings.
23101          */
23102         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN \
23103                 UINT32_C(0x1)
23104         /*
23105          * When this bit is set to '1', int_lat_tmr_max can be configured
23106          * on completion rings.
23107          */
23108         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX \
23109                 UINT32_C(0x2)
23110         /*
23111          * When this bit is set to '1', timer_reset can be enabled
23112          * on completion rings.
23113          */
23114         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET \
23115                 UINT32_C(0x4)
23116         /*
23117          * When this bit is set to '1', ring_idle can be enabled
23118          * on completion rings.
23119          */
23120         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE \
23121                 UINT32_C(0x8)
23122         /*
23123          * When this bit is set to '1', num_cmpl_dma_aggr can be configured
23124          * on completion rings.
23125          */
23126         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR \
23127                 UINT32_C(0x10)
23128         /*
23129          * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be configured
23130          * on completion rings.
23131          */
23132         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT \
23133                 UINT32_C(0x20)
23134         /*
23135          * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured
23136          * on completion rings.
23137          */
23138         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR \
23139                 UINT32_C(0x40)
23140         /*
23141          * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be configured
23142          * on completion rings.
23143          */
23144         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT \
23145                 UINT32_C(0x80)
23146         /*
23147          * When this bit is set to '1', num_cmpl_aggr_int can be configured
23148          * on completion rings.
23149          */
23150         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT \
23151                 UINT32_C(0x100)
23152         uint32_t        nq_params;
23153         /*
23154          * When this bit is set to '1', int_lat_tmr_min can be configured
23155          * on notification queues.
23156          */
23157         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN \
23158                 UINT32_C(0x1)
23159         /* Minimum value for num_cmpl_dma_aggr */
23160         uint16_t        num_cmpl_dma_aggr_min;
23161         /* Maximum value for num_cmpl_dma_aggr */
23162         uint16_t        num_cmpl_dma_aggr_max;
23163         /* Minimum value for num_cmpl_dma_aggr_during_int */
23164         uint16_t        num_cmpl_dma_aggr_during_int_min;
23165         /* Maximum value for num_cmpl_dma_aggr_during_int */
23166         uint16_t        num_cmpl_dma_aggr_during_int_max;
23167         /* Minimum value for cmpl_aggr_dma_tmr */
23168         uint16_t        cmpl_aggr_dma_tmr_min;
23169         /* Maximum value for cmpl_aggr_dma_tmr */
23170         uint16_t        cmpl_aggr_dma_tmr_max;
23171         /* Minimum value for cmpl_aggr_dma_tmr_during_int */
23172         uint16_t        cmpl_aggr_dma_tmr_during_int_min;
23173         /* Maximum value for cmpl_aggr_dma_tmr_during_int */
23174         uint16_t        cmpl_aggr_dma_tmr_during_int_max;
23175         /* Minimum value for int_lat_tmr_min */
23176         uint16_t        int_lat_tmr_min_min;
23177         /* Maximum value for int_lat_tmr_min */
23178         uint16_t        int_lat_tmr_min_max;
23179         /* Minimum value for int_lat_tmr_max */
23180         uint16_t        int_lat_tmr_max_min;
23181         /* Maximum value for int_lat_tmr_max */
23182         uint16_t        int_lat_tmr_max_max;
23183         /* Minimum value for num_cmpl_aggr_int */
23184         uint16_t        num_cmpl_aggr_int_min;
23185         /* Maximum value for num_cmpl_aggr_int */
23186         uint16_t        num_cmpl_aggr_int_max;
23187         /* The units for timer parameters, in nanoseconds. */
23188         uint16_t        timer_units;
23189         uint8_t unused_0[1];
23190         /*
23191          * This field is used in Output records to indicate that the output
23192          * is completely written to RAM.  This field should be read as '1'
23193          * to indicate that the output has been completely written.
23194          * When writing a command completion or response to an internal processor,
23195          * the order of writes has to be such that this field is written last.
23196          */
23197         uint8_t valid;
23198 } __attribute__((packed));
23199
23200 /**************************************
23201  * hwrm_ring_cmpl_ring_qaggint_params *
23202  **************************************/
23203
23204
23205 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
23206 struct hwrm_ring_cmpl_ring_qaggint_params_input {
23207         /* The HWRM command request type. */
23208         uint16_t        req_type;
23209         /*
23210          * The completion ring to send the completion event on. This should
23211          * be the NQ ID returned from the `nq_alloc` HWRM command.
23212          */
23213         uint16_t        cmpl_ring;
23214         /*
23215          * The sequence ID is used by the driver for tracking multiple
23216          * commands. This ID is treated as opaque data by the firmware and
23217          * the value is returned in the `hwrm_resp_hdr` upon completion.
23218          */
23219         uint16_t        seq_id;
23220         /*
23221          * The target ID of the command:
23222          * * 0x0-0xFFF8 - The function ID
23223          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23224          * * 0xFFFD - Reserved for user-space HWRM interface
23225          * * 0xFFFF - HWRM
23226          */
23227         uint16_t        target_id;
23228         /*
23229          * A physical address pointer pointing to a host buffer that the
23230          * command's response data will be written. This can be either a host
23231          * physical address (HPA) or a guest physical address (GPA) and must
23232          * point to a physically contiguous block of memory.
23233          */
23234         uint64_t        resp_addr;
23235         /* Physical number of completion ring. */
23236         uint16_t        ring_id;
23237         uint8_t unused_0[6];
23238 } __attribute__((packed));
23239
23240 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
23241 struct hwrm_ring_cmpl_ring_qaggint_params_output {
23242         /* The specific error status for the command. */
23243         uint16_t        error_code;
23244         /* The HWRM command request type. */
23245         uint16_t        req_type;
23246         /* The sequence ID from the original command. */
23247         uint16_t        seq_id;
23248         /* The length of the response data in number of bytes. */
23249         uint16_t        resp_len;
23250         uint16_t        flags;
23251         /*
23252          * When this bit is set to '1', interrupt max
23253          * timer is reset whenever a completion is received.
23254          */
23255         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET \
23256                 UINT32_C(0x1)
23257         /*
23258          * When this bit is set to '1', ring idle mode
23259          * aggregation will be enabled.
23260          */
23261         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE \
23262                 UINT32_C(0x2)
23263         /*
23264          * Number of completions to aggregate before DMA
23265          * during the normal mode.
23266          */
23267         uint16_t        num_cmpl_dma_aggr;
23268         /*
23269          * Number of completions to aggregate before DMA
23270          * during the interrupt mode.
23271          */
23272         uint16_t        num_cmpl_dma_aggr_during_int;
23273         /*
23274          * Timer in unit of 80-nsec used to aggregate completions before
23275          * DMA during the normal mode (not in interrupt mode).
23276          */
23277         uint16_t        cmpl_aggr_dma_tmr;
23278         /*
23279          * Timer in unit of 80-nsec used to aggregate completions before
23280          * DMA during the interrupt mode.
23281          */
23282         uint16_t        cmpl_aggr_dma_tmr_during_int;
23283         /* Minimum time (in unit of 80-nsec) between two interrupts. */
23284         uint16_t        int_lat_tmr_min;
23285         /*
23286          * Maximum wait time (in unit of 80-nsec) spent aggregating
23287          * completions before signaling the interrupt after the
23288          * interrupt is enabled.
23289          */
23290         uint16_t        int_lat_tmr_max;
23291         /*
23292          * Minimum number of completions aggregated before signaling
23293          * an interrupt.
23294          */
23295         uint16_t        num_cmpl_aggr_int;
23296         uint8_t unused_0[7];
23297         /*
23298          * This field is used in Output records to indicate that the output
23299          * is completely written to RAM.  This field should be read as '1'
23300          * to indicate that the output has been completely written.
23301          * When writing a command completion or response to an internal processor,
23302          * the order of writes has to be such that this field is written last.
23303          */
23304         uint8_t valid;
23305 } __attribute__((packed));
23306
23307 /*****************************************
23308  * hwrm_ring_cmpl_ring_cfg_aggint_params *
23309  *****************************************/
23310
23311
23312 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
23313 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
23314         /* The HWRM command request type. */
23315         uint16_t        req_type;
23316         /*
23317          * The completion ring to send the completion event on. This should
23318          * be the NQ ID returned from the `nq_alloc` HWRM command.
23319          */
23320         uint16_t        cmpl_ring;
23321         /*
23322          * The sequence ID is used by the driver for tracking multiple
23323          * commands. This ID is treated as opaque data by the firmware and
23324          * the value is returned in the `hwrm_resp_hdr` upon completion.
23325          */
23326         uint16_t        seq_id;
23327         /*
23328          * The target ID of the command:
23329          * * 0x0-0xFFF8 - The function ID
23330          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23331          * * 0xFFFD - Reserved for user-space HWRM interface
23332          * * 0xFFFF - HWRM
23333          */
23334         uint16_t        target_id;
23335         /*
23336          * A physical address pointer pointing to a host buffer that the
23337          * command's response data will be written. This can be either a host
23338          * physical address (HPA) or a guest physical address (GPA) and must
23339          * point to a physically contiguous block of memory.
23340          */
23341         uint64_t        resp_addr;
23342         /* Physical number of completion ring. */
23343         uint16_t        ring_id;
23344         uint16_t        flags;
23345         /*
23346          * When this bit is set to '1', interrupt latency max
23347          * timer is reset whenever a completion is received.
23348          */
23349         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET \
23350                 UINT32_C(0x1)
23351         /*
23352          * When this bit is set to '1', ring idle mode
23353          * aggregation will be enabled.
23354          */
23355         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE \
23356                 UINT32_C(0x2)
23357         /*
23358          * Set this flag to 1 when configuring parameters on a
23359          * notification queue. Set this flag to 0 when configuring
23360          * parameters on a completion queue.
23361          */
23362         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
23363                 UINT32_C(0x4)
23364         /*
23365          * Number of completions to aggregate before DMA
23366          * during the normal mode.
23367          */
23368         uint16_t        num_cmpl_dma_aggr;
23369         /*
23370          * Number of completions to aggregate before DMA
23371          * during the interrupt mode.
23372          */
23373         uint16_t        num_cmpl_dma_aggr_during_int;
23374         /*
23375          * Timer in unit of 80-nsec used to aggregate completions before
23376          * DMA during the normal mode (not in interrupt mode).
23377          */
23378         uint16_t        cmpl_aggr_dma_tmr;
23379         /*
23380          * Timer in unit of 80-nsec used to aggregate completions before
23381          * DMA during the interrupt mode.
23382          */
23383         uint16_t        cmpl_aggr_dma_tmr_during_int;
23384         /* Minimum time (in unit of 80-nsec) between two interrupts. */
23385         uint16_t        int_lat_tmr_min;
23386         /*
23387          * Maximum wait time (in unit of 80-nsec) spent aggregating
23388          * cmpls before signaling the interrupt after the
23389          * interrupt is enabled.
23390          */
23391         uint16_t        int_lat_tmr_max;
23392         /*
23393          * Minimum number of completions aggregated before signaling
23394          * an interrupt.
23395          */
23396         uint16_t        num_cmpl_aggr_int;
23397         /*
23398          * Bitfield that indicates which parameters are to be applied. Only
23399          * required when configuring devices with notification queues, and
23400          * used in that case to set certain parameters on completion queues
23401          * and others on notification queues.
23402          */
23403         uint16_t        enables;
23404         /*
23405          * This bit must be '1' for the num_cmpl_dma_aggr field to be
23406          * configured.
23407          */
23408         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR \
23409                 UINT32_C(0x1)
23410         /*
23411          * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be
23412          * configured.
23413          */
23414         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT \
23415                 UINT32_C(0x2)
23416         /*
23417          * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
23418          * configured.
23419          */
23420         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR \
23421                 UINT32_C(0x4)
23422         /*
23423          * This bit must be '1' for the int_lat_tmr_min field to be
23424          * configured.
23425          */
23426         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN \
23427                 UINT32_C(0x8)
23428         /*
23429          * This bit must be '1' for the int_lat_tmr_max field to be
23430          * configured.
23431          */
23432         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX \
23433                 UINT32_C(0x10)
23434         /*
23435          * This bit must be '1' for the num_cmpl_aggr_int field to be
23436          * configured.
23437          */
23438         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT \
23439                 UINT32_C(0x20)
23440         uint8_t unused_0[4];
23441 } __attribute__((packed));
23442
23443 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
23444 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
23445         /* The specific error status for the command. */
23446         uint16_t        error_code;
23447         /* The HWRM command request type. */
23448         uint16_t        req_type;
23449         /* The sequence ID from the original command. */
23450         uint16_t        seq_id;
23451         /* The length of the response data in number of bytes. */
23452         uint16_t        resp_len;
23453         uint8_t unused_0[7];
23454         /*
23455          * This field is used in Output records to indicate that the output
23456          * is completely written to RAM.  This field should be read as '1'
23457          * to indicate that the output has been completely written.
23458          * When writing a command completion or response to an internal processor,
23459          * the order of writes has to be such that this field is written last.
23460          */
23461         uint8_t valid;
23462 } __attribute__((packed));
23463
23464 /***********************
23465  * hwrm_ring_grp_alloc *
23466  ***********************/
23467
23468
23469 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
23470 struct hwrm_ring_grp_alloc_input {
23471         /* The HWRM command request type. */
23472         uint16_t        req_type;
23473         /*
23474          * The completion ring to send the completion event on. This should
23475          * be the NQ ID returned from the `nq_alloc` HWRM command.
23476          */
23477         uint16_t        cmpl_ring;
23478         /*
23479          * The sequence ID is used by the driver for tracking multiple
23480          * commands. This ID is treated as opaque data by the firmware and
23481          * the value is returned in the `hwrm_resp_hdr` upon completion.
23482          */
23483         uint16_t        seq_id;
23484         /*
23485          * The target ID of the command:
23486          * * 0x0-0xFFF8 - The function ID
23487          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23488          * * 0xFFFD - Reserved for user-space HWRM interface
23489          * * 0xFFFF - HWRM
23490          */
23491         uint16_t        target_id;
23492         /*
23493          * A physical address pointer pointing to a host buffer that the
23494          * command's response data will be written. This can be either a host
23495          * physical address (HPA) or a guest physical address (GPA) and must
23496          * point to a physically contiguous block of memory.
23497          */
23498         uint64_t        resp_addr;
23499         /*
23500          * This value identifies the CR associated with the ring
23501          * group.
23502          */
23503         uint16_t        cr;
23504         /*
23505          * This value identifies the main RR associated with the ring
23506          * group.
23507          */
23508         uint16_t        rr;
23509         /*
23510          * This value identifies the aggregation RR associated with
23511          * the ring group.  If this value is 0xFF... (All Fs), then no
23512          * Aggregation ring will be set.
23513          */
23514         uint16_t        ar;
23515         /*
23516          * This value identifies the statistics context associated
23517          * with the ring group.
23518          */
23519         uint16_t        sc;
23520 } __attribute__((packed));
23521
23522 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
23523 struct hwrm_ring_grp_alloc_output {
23524         /* The specific error status for the command. */
23525         uint16_t        error_code;
23526         /* The HWRM command request type. */
23527         uint16_t        req_type;
23528         /* The sequence ID from the original command. */
23529         uint16_t        seq_id;
23530         /* The length of the response data in number of bytes. */
23531         uint16_t        resp_len;
23532         /*
23533          * This is the ring group ID value.  Use this value to program
23534          * the default ring group for the VNIC or as table entries
23535          * in an RSS/COS context.
23536          */
23537         uint32_t        ring_group_id;
23538         uint8_t unused_0[3];
23539         /*
23540          * This field is used in Output records to indicate that the output
23541          * is completely written to RAM.  This field should be read as '1'
23542          * to indicate that the output has been completely written.
23543          * When writing a command completion or response to an internal processor,
23544          * the order of writes has to be such that this field is written last.
23545          */
23546         uint8_t valid;
23547 } __attribute__((packed));
23548
23549 /**********************
23550  * hwrm_ring_grp_free *
23551  **********************/
23552
23553
23554 /* hwrm_ring_grp_free_input (size:192b/24B) */
23555 struct hwrm_ring_grp_free_input {
23556         /* The HWRM command request type. */
23557         uint16_t        req_type;
23558         /*
23559          * The completion ring to send the completion event on. This should
23560          * be the NQ ID returned from the `nq_alloc` HWRM command.
23561          */
23562         uint16_t        cmpl_ring;
23563         /*
23564          * The sequence ID is used by the driver for tracking multiple
23565          * commands. This ID is treated as opaque data by the firmware and
23566          * the value is returned in the `hwrm_resp_hdr` upon completion.
23567          */
23568         uint16_t        seq_id;
23569         /*
23570          * The target ID of the command:
23571          * * 0x0-0xFFF8 - The function ID
23572          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23573          * * 0xFFFD - Reserved for user-space HWRM interface
23574          * * 0xFFFF - HWRM
23575          */
23576         uint16_t        target_id;
23577         /*
23578          * A physical address pointer pointing to a host buffer that the
23579          * command's response data will be written. This can be either a host
23580          * physical address (HPA) or a guest physical address (GPA) and must
23581          * point to a physically contiguous block of memory.
23582          */
23583         uint64_t        resp_addr;
23584         /* This is the ring group ID value. */
23585         uint32_t        ring_group_id;
23586         uint8_t unused_0[4];
23587 } __attribute__((packed));
23588
23589 /* hwrm_ring_grp_free_output (size:128b/16B) */
23590 struct hwrm_ring_grp_free_output {
23591         /* The specific error status for the command. */
23592         uint16_t        error_code;
23593         /* The HWRM command request type. */
23594         uint16_t        req_type;
23595         /* The sequence ID from the original command. */
23596         uint16_t        seq_id;
23597         /* The length of the response data in number of bytes. */
23598         uint16_t        resp_len;
23599         uint8_t unused_0[7];
23600         /*
23601          * This field is used in Output records to indicate that the output
23602          * is completely written to RAM.  This field should be read as '1'
23603          * to indicate that the output has been completely written.
23604          * When writing a command completion or response to an internal processor,
23605          * the order of writes has to be such that this field is written last.
23606          */
23607         uint8_t valid;
23608 } __attribute__((packed));
23609 /*
23610  * special reserved flow ID to identify per function default
23611  * flows for vSwitch offload
23612  */
23613 #define DEFAULT_FLOW_ID 0xFFFFFFFFUL
23614 /*
23615  * special reserved flow ID to identify per function RoCEv1
23616  * flows
23617  */
23618 #define ROCEV1_FLOW_ID 0xFFFFFFFEUL
23619 /*
23620  * special reserved flow ID to identify per function RoCEv2
23621  * flows
23622  */
23623 #define ROCEV2_FLOW_ID 0xFFFFFFFDUL
23624 /*
23625  * special reserved flow ID to identify per function RoCEv2
23626  * CNP flows
23627  */
23628 #define ROCEV2_CNP_FLOW_ID 0xFFFFFFFCUL
23629
23630 /****************************
23631  * hwrm_cfa_l2_filter_alloc *
23632  ****************************/
23633
23634
23635 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
23636 struct hwrm_cfa_l2_filter_alloc_input {
23637         /* The HWRM command request type. */
23638         uint16_t        req_type;
23639         /*
23640          * The completion ring to send the completion event on. This should
23641          * be the NQ ID returned from the `nq_alloc` HWRM command.
23642          */
23643         uint16_t        cmpl_ring;
23644         /*
23645          * The sequence ID is used by the driver for tracking multiple
23646          * commands. This ID is treated as opaque data by the firmware and
23647          * the value is returned in the `hwrm_resp_hdr` upon completion.
23648          */
23649         uint16_t        seq_id;
23650         /*
23651          * The target ID of the command:
23652          * * 0x0-0xFFF8 - The function ID
23653          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23654          * * 0xFFFD - Reserved for user-space HWRM interface
23655          * * 0xFFFF - HWRM
23656          */
23657         uint16_t        target_id;
23658         /*
23659          * A physical address pointer pointing to a host buffer that the
23660          * command's response data will be written. This can be either a host
23661          * physical address (HPA) or a guest physical address (GPA) and must
23662          * point to a physically contiguous block of memory.
23663          */
23664         uint64_t        resp_addr;
23665         uint32_t        flags;
23666         /*
23667          * Enumeration denoting the RX, TX type of the resource.
23668          * This enumeration is used for resources that are similar for both
23669          * TX and RX paths of the chip.
23670          */
23671         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
23672                 UINT32_C(0x1)
23673         /* tx path */
23674         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
23675                 UINT32_C(0x0)
23676         /* rx path */
23677         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
23678                 UINT32_C(0x1)
23679         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
23680                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
23681         /* Setting of this flag indicates the applicability to the loopback path. */
23682         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
23683                 UINT32_C(0x2)
23684         /*
23685          * Setting of this flag indicates drop action. If this flag is not set,
23686          * then it should be considered accept action.
23687          */
23688         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
23689                 UINT32_C(0x4)
23690         /*
23691          * If this flag is set, all t_l2_* fields are invalid
23692          * and they should not be specified.
23693          * If this flag is set, then l2_* fields refer to
23694          * fields of outermost L2 header.
23695          */
23696         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
23697                 UINT32_C(0x8)
23698         /*
23699          * Enumeration denoting NO_ROCE_L2 to support old drivers.
23700          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
23701          */
23702         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK \
23703                 UINT32_C(0x30)
23704         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT       4
23705         /* To support old drivers */
23706         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
23707                 (UINT32_C(0x0) << 4)
23708         /* Only L2 traffic */
23709         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2 \
23710                 (UINT32_C(0x1) << 4)
23711         /* Roce & L2 traffic */
23712         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE \
23713                 (UINT32_C(0x2) << 4)
23714         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST \
23715                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE
23716         /*
23717          * Setting of this flag indicates that no XDP filter is created with
23718          * L2 filter.
23719          * 0 - legacy behavior, XDP filter is created with L2 filter
23720          * 1 - XDP filter won't be created with L2 filter
23721          */
23722         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_XDP_DISABLE \
23723                 UINT32_C(0x40)
23724         /*
23725          * Setting this flag to 1 indicate the L2 fields in this command
23726          * pertain to source fields.  Setting this flag to 0 indicate the
23727          * L2 fields in this command pertain to the destination fields
23728          * and this is the default/legacy behavior.
23729          */
23730         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_SOURCE_VALID \
23731                 UINT32_C(0x80)
23732         uint32_t        enables;
23733         /*
23734          * This bit must be '1' for the l2_addr field to be
23735          * configured.
23736          */
23737         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
23738                 UINT32_C(0x1)
23739         /*
23740          * This bit must be '1' for the l2_addr_mask field to be
23741          * configured.
23742          */
23743         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
23744                 UINT32_C(0x2)
23745         /*
23746          * This bit must be '1' for the l2_ovlan field to be
23747          * configured.
23748          */
23749         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
23750                 UINT32_C(0x4)
23751         /*
23752          * This bit must be '1' for the l2_ovlan_mask field to be
23753          * configured.
23754          */
23755         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
23756                 UINT32_C(0x8)
23757         /*
23758          * This bit must be '1' for the l2_ivlan field to be
23759          * configured.
23760          */
23761         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
23762                 UINT32_C(0x10)
23763         /*
23764          * This bit must be '1' for the l2_ivlan_mask field to be
23765          * configured.
23766          */
23767         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
23768                 UINT32_C(0x20)
23769         /*
23770          * This bit must be '1' for the t_l2_addr field to be
23771          * configured.
23772          */
23773         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
23774                 UINT32_C(0x40)
23775         /*
23776          * This bit must be '1' for the t_l2_addr_mask field to be
23777          * configured.
23778          */
23779         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
23780                 UINT32_C(0x80)
23781         /*
23782          * This bit must be '1' for the t_l2_ovlan field to be
23783          * configured.
23784          */
23785         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
23786                 UINT32_C(0x100)
23787         /*
23788          * This bit must be '1' for the t_l2_ovlan_mask field to be
23789          * configured.
23790          */
23791         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
23792                 UINT32_C(0x200)
23793         /*
23794          * This bit must be '1' for the t_l2_ivlan field to be
23795          * configured.
23796          */
23797         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
23798                 UINT32_C(0x400)
23799         /*
23800          * This bit must be '1' for the t_l2_ivlan_mask field to be
23801          * configured.
23802          */
23803         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
23804                 UINT32_C(0x800)
23805         /*
23806          * This bit must be '1' for the src_type field to be
23807          * configured.
23808          */
23809         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
23810                 UINT32_C(0x1000)
23811         /*
23812          * This bit must be '1' for the src_id field to be
23813          * configured.
23814          */
23815         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
23816                 UINT32_C(0x2000)
23817         /*
23818          * This bit must be '1' for the tunnel_type field to be
23819          * configured.
23820          */
23821         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
23822                 UINT32_C(0x4000)
23823         /*
23824          * This bit must be '1' for the dst_id field to be
23825          * configured.
23826          */
23827         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
23828                 UINT32_C(0x8000)
23829         /*
23830          * This bit must be '1' for the mirror_vnic_id field to be
23831          * configured.
23832          */
23833         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
23834                 UINT32_C(0x10000)
23835         /*
23836          * This bit must be '1' for the num_vlans field to be
23837          * configured.
23838          */
23839         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_NUM_VLANS \
23840                 UINT32_C(0x20000)
23841         /*
23842          * This bit must be '1' for the t_num_vlans field to be
23843          * configured.
23844          */
23845         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_NUM_VLANS \
23846                 UINT32_C(0x40000)
23847         /*
23848          * This value sets the match value for the L2 MAC address.
23849          * Destination MAC address for RX path.
23850          * Source MAC address for TX path.
23851          */
23852         uint8_t l2_addr[6];
23853         /* This value sets the match value for the number of VLANs. */
23854         uint8_t num_vlans;
23855         /*
23856          * This value sets the match value for the number of VLANs
23857          * in the tunnel headers.
23858          */
23859         uint8_t t_num_vlans;
23860         /*
23861          * This value sets the mask value for the L2 address.
23862          * A value of 0 will mask the corresponding bit from
23863          * compare.
23864          */
23865         uint8_t l2_addr_mask[6];
23866         /* This value sets VLAN ID value for outer VLAN. */
23867         uint16_t        l2_ovlan;
23868         /*
23869          * This value sets the mask value for the ovlan id.
23870          * A value of 0 will mask the corresponding bit from
23871          * compare.
23872          */
23873         uint16_t        l2_ovlan_mask;
23874         /* This value sets VLAN ID value for inner VLAN. */
23875         uint16_t        l2_ivlan;
23876         /*
23877          * This value sets the mask value for the ivlan id.
23878          * A value of 0 will mask the corresponding bit from
23879          * compare.
23880          */
23881         uint16_t        l2_ivlan_mask;
23882         uint8_t unused_1[2];
23883         /*
23884          * This value sets the match value for the tunnel
23885          * L2 MAC address.
23886          * Destination MAC address for RX path.
23887          * Source MAC address for TX path.
23888          */
23889         uint8_t t_l2_addr[6];
23890         uint8_t unused_2[2];
23891         /*
23892          * This value sets the mask value for the tunnel L2
23893          * address.
23894          * A value of 0 will mask the corresponding bit from
23895          * compare.
23896          */
23897         uint8_t t_l2_addr_mask[6];
23898         /* This value sets VLAN ID value for tunnel outer VLAN. */
23899         uint16_t        t_l2_ovlan;
23900         /*
23901          * This value sets the mask value for the tunnel ovlan id.
23902          * A value of 0 will mask the corresponding bit from
23903          * compare.
23904          */
23905         uint16_t        t_l2_ovlan_mask;
23906         /* This value sets VLAN ID value for tunnel inner VLAN. */
23907         uint16_t        t_l2_ivlan;
23908         /*
23909          * This value sets the mask value for the tunnel ivlan id.
23910          * A value of 0 will mask the corresponding bit from
23911          * compare.
23912          */
23913         uint16_t        t_l2_ivlan_mask;
23914         /* This value identifies the type of source of the packet. */
23915         uint8_t src_type;
23916         /* Network port */
23917         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
23918         /* Physical function */
23919         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF    UINT32_C(0x1)
23920         /* Virtual function */
23921         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF    UINT32_C(0x2)
23922         /* Virtual NIC of a function */
23923         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC  UINT32_C(0x3)
23924         /* Embedded processor for CFA management */
23925         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG  UINT32_C(0x4)
23926         /* Embedded processor for OOB management */
23927         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE   UINT32_C(0x5)
23928         /* Embedded processor for RoCE */
23929         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO  UINT32_C(0x6)
23930         /* Embedded processor for network proxy functions */
23931         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG  UINT32_C(0x7)
23932         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST \
23933                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
23934         uint8_t unused_3;
23935         /*
23936          * This value is the id of the source.
23937          * For a network port, it represents port_id.
23938          * For a physical function, it represents fid.
23939          * For a virtual function, it represents vf_id.
23940          * For a vnic, it represents vnic_id.
23941          * For embedded processors, this id is not valid.
23942          *
23943          * Notes:
23944          * 1. The function ID is implied if it src_id is
23945          *    not provided for a src_type that is either
23946          */
23947         uint32_t        src_id;
23948         /* Tunnel Type. */
23949         uint8_t tunnel_type;
23950         /* Non-tunnel */
23951         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
23952                 UINT32_C(0x0)
23953         /* Virtual eXtensible Local Area Network (VXLAN) */
23954         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
23955                 UINT32_C(0x1)
23956         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
23957         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
23958                 UINT32_C(0x2)
23959         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
23960         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
23961                 UINT32_C(0x3)
23962         /* IP in IP */
23963         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
23964                 UINT32_C(0x4)
23965         /* Generic Network Virtualization Encapsulation (Geneve) */
23966         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
23967                 UINT32_C(0x5)
23968         /* Multi-Protocol Lable Switching (MPLS) */
23969         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
23970                 UINT32_C(0x6)
23971         /* Stateless Transport Tunnel (STT) */
23972         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
23973                 UINT32_C(0x7)
23974         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
23975         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
23976                 UINT32_C(0x8)
23977         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
23978         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
23979                 UINT32_C(0x9)
23980         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
23981         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
23982                 UINT32_C(0xa)
23983         /* Use fixed layer 2 ether type of 0xFFFF */
23984         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
23985                 UINT32_C(0xb)
23986         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
23987         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
23988                 UINT32_C(0xc)
23989         /* Any tunneled traffic */
23990         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
23991                 UINT32_C(0xff)
23992         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
23993                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
23994         uint8_t unused_4;
23995         /*
23996          * If set, this value shall represent the
23997          * Logical VNIC ID of the destination VNIC for the RX
23998          * path and network port id of the destination port for
23999          * the TX path.
24000          */
24001         uint16_t        dst_id;
24002         /*
24003          * Logical VNIC ID of the VNIC where traffic is
24004          * mirrored.
24005          */
24006         uint16_t        mirror_vnic_id;
24007         /*
24008          * This hint is provided to help in placing
24009          * the filter in the filter table.
24010          */
24011         uint8_t pri_hint;
24012         /* No preference */
24013         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
24014                 UINT32_C(0x0)
24015         /* Above the given filter */
24016         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
24017                 UINT32_C(0x1)
24018         /* Below the given filter */
24019         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
24020                 UINT32_C(0x2)
24021         /* As high as possible */
24022         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
24023                 UINT32_C(0x3)
24024         /* As low as possible */
24025         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
24026                 UINT32_C(0x4)
24027         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
24028                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
24029         uint8_t unused_5;
24030         uint32_t        unused_6;
24031         /*
24032          * This is the ID of the filter that goes along with
24033          * the pri_hint.
24034          *
24035          * This field is valid only for the following values.
24036          * 1 - Above the given filter
24037          * 2 - Below the given filter
24038          */
24039         uint64_t        l2_filter_id_hint;
24040 } __attribute__((packed));
24041
24042 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
24043 struct hwrm_cfa_l2_filter_alloc_output {
24044         /* The specific error status for the command. */
24045         uint16_t        error_code;
24046         /* The HWRM command request type. */
24047         uint16_t        req_type;
24048         /* The sequence ID from the original command. */
24049         uint16_t        seq_id;
24050         /* The length of the response data in number of bytes. */
24051         uint16_t        resp_len;
24052         /*
24053          * This value identifies a set of CFA data structures used for an L2
24054          * context.
24055          */
24056         uint64_t        l2_filter_id;
24057         /*
24058          * The flow id value in bit 0-29 is the actual ID of the flow
24059          * associated with this filter and it shall be used to match
24060          * and associate the flow identifier returned in completion
24061          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
24062          * shall indicate no valid flow id.
24063          */
24064         uint32_t        flow_id;
24065         /* Indicate the flow id value. */
24066         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
24067                 UINT32_C(0x3fffffff)
24068         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
24069         /* Indicate type of the flow. */
24070         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
24071                 UINT32_C(0x40000000)
24072         /*
24073          * If this bit set to 0, then it indicates that the flow is
24074          * internal flow.
24075          */
24076         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
24077                 (UINT32_C(0x0) << 30)
24078         /*
24079          * If this bit is set to 1, then it indicates that the flow is
24080          * external flow.
24081          */
24082         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
24083                 (UINT32_C(0x1) << 30)
24084         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
24085                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
24086         /* Indicate the flow direction. */
24087         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
24088                 UINT32_C(0x80000000)
24089         /* If this bit set to 0, then it indicates rx flow. */
24090         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
24091                 (UINT32_C(0x0) << 31)
24092         /* If this bit is set to 1, then it indicates that tx flow. */
24093         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
24094                 (UINT32_C(0x1) << 31)
24095         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
24096                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
24097         uint8_t unused_0[3];
24098         /*
24099          * This field is used in Output records to indicate that the output
24100          * is completely written to RAM.  This field should be read as '1'
24101          * to indicate that the output has been completely written.
24102          * When writing a command completion or response to an internal processor,
24103          * the order of writes has to be such that this field is written last.
24104          */
24105         uint8_t valid;
24106 } __attribute__((packed));
24107
24108 /***************************
24109  * hwrm_cfa_l2_filter_free *
24110  ***************************/
24111
24112
24113 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
24114 struct hwrm_cfa_l2_filter_free_input {
24115         /* The HWRM command request type. */
24116         uint16_t        req_type;
24117         /*
24118          * The completion ring to send the completion event on. This should
24119          * be the NQ ID returned from the `nq_alloc` HWRM command.
24120          */
24121         uint16_t        cmpl_ring;
24122         /*
24123          * The sequence ID is used by the driver for tracking multiple
24124          * commands. This ID is treated as opaque data by the firmware and
24125          * the value is returned in the `hwrm_resp_hdr` upon completion.
24126          */
24127         uint16_t        seq_id;
24128         /*
24129          * The target ID of the command:
24130          * * 0x0-0xFFF8 - The function ID
24131          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24132          * * 0xFFFD - Reserved for user-space HWRM interface
24133          * * 0xFFFF - HWRM
24134          */
24135         uint16_t        target_id;
24136         /*
24137          * A physical address pointer pointing to a host buffer that the
24138          * command's response data will be written. This can be either a host
24139          * physical address (HPA) or a guest physical address (GPA) and must
24140          * point to a physically contiguous block of memory.
24141          */
24142         uint64_t        resp_addr;
24143         /*
24144          * This value identifies a set of CFA data structures used for an L2
24145          * context.
24146          */
24147         uint64_t        l2_filter_id;
24148 } __attribute__((packed));
24149
24150 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
24151 struct hwrm_cfa_l2_filter_free_output {
24152         /* The specific error status for the command. */
24153         uint16_t        error_code;
24154         /* The HWRM command request type. */
24155         uint16_t        req_type;
24156         /* The sequence ID from the original command. */
24157         uint16_t        seq_id;
24158         /* The length of the response data in number of bytes. */
24159         uint16_t        resp_len;
24160         uint8_t unused_0[7];
24161         /*
24162          * This field is used in Output records to indicate that the output
24163          * is completely written to RAM.  This field should be read as '1'
24164          * to indicate that the output has been completely written.
24165          * When writing a command completion or response to an internal processor,
24166          * the order of writes has to be such that this field is written last.
24167          */
24168         uint8_t valid;
24169 } __attribute__((packed));
24170
24171 /**************************
24172  * hwrm_cfa_l2_filter_cfg *
24173  **************************/
24174
24175
24176 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
24177 struct hwrm_cfa_l2_filter_cfg_input {
24178         /* The HWRM command request type. */
24179         uint16_t        req_type;
24180         /*
24181          * The completion ring to send the completion event on. This should
24182          * be the NQ ID returned from the `nq_alloc` HWRM command.
24183          */
24184         uint16_t        cmpl_ring;
24185         /*
24186          * The sequence ID is used by the driver for tracking multiple
24187          * commands. This ID is treated as opaque data by the firmware and
24188          * the value is returned in the `hwrm_resp_hdr` upon completion.
24189          */
24190         uint16_t        seq_id;
24191         /*
24192          * The target ID of the command:
24193          * * 0x0-0xFFF8 - The function ID
24194          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24195          * * 0xFFFD - Reserved for user-space HWRM interface
24196          * * 0xFFFF - HWRM
24197          */
24198         uint16_t        target_id;
24199         /*
24200          * A physical address pointer pointing to a host buffer that the
24201          * command's response data will be written. This can be either a host
24202          * physical address (HPA) or a guest physical address (GPA) and must
24203          * point to a physically contiguous block of memory.
24204          */
24205         uint64_t        resp_addr;
24206         uint32_t        flags;
24207         /*
24208          * Enumeration denoting the RX, TX type of the resource.
24209          * This enumeration is used for resources that are similar for both
24210          * TX and RX paths of the chip.
24211          */
24212         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH \
24213                 UINT32_C(0x1)
24214         /* tx path */
24215         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \
24216                 UINT32_C(0x0)
24217         /* rx path */
24218         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \
24219                 UINT32_C(0x1)
24220         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
24221                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
24222         /*
24223          * Setting of this flag indicates drop action. If this flag is not set,
24224          * then it should be considered accept action.
24225          */
24226         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP \
24227                 UINT32_C(0x2)
24228         /*
24229          * Enumeration denoting NO_ROCE_L2 to support old drivers.
24230          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
24231          */
24232         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK \
24233                 UINT32_C(0xc)
24234         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT       2
24235         /* To support old drivers */
24236         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
24237                 (UINT32_C(0x0) << 2)
24238         /* Only L2 traffic */
24239         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2 \
24240                 (UINT32_C(0x1) << 2)
24241         /* Roce & L2 traffic */
24242         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE \
24243                 (UINT32_C(0x2) << 2)
24244         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST \
24245                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE
24246         uint32_t        enables;
24247         /*
24248          * This bit must be '1' for the dst_id field to be
24249          * configured.
24250          */
24251         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID \
24252                 UINT32_C(0x1)
24253         /*
24254          * This bit must be '1' for the new_mirror_vnic_id field to be
24255          * configured.
24256          */
24257         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
24258                 UINT32_C(0x2)
24259         /*
24260          * This value identifies a set of CFA data structures used for an L2
24261          * context.
24262          */
24263         uint64_t        l2_filter_id;
24264         /*
24265          * If set, this value shall represent the
24266          * Logical VNIC ID of the destination VNIC for the RX
24267          * path and network port id of the destination port for
24268          * the TX path.
24269          */
24270         uint32_t        dst_id;
24271         /*
24272          * New Logical VNIC ID of the VNIC where traffic is
24273          * mirrored.
24274          */
24275         uint32_t        new_mirror_vnic_id;
24276 } __attribute__((packed));
24277
24278 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
24279 struct hwrm_cfa_l2_filter_cfg_output {
24280         /* The specific error status for the command. */
24281         uint16_t        error_code;
24282         /* The HWRM command request type. */
24283         uint16_t        req_type;
24284         /* The sequence ID from the original command. */
24285         uint16_t        seq_id;
24286         /* The length of the response data in number of bytes. */
24287         uint16_t        resp_len;
24288         uint8_t unused_0[7];
24289         /*
24290          * This field is used in Output records to indicate that the output
24291          * is completely written to RAM.  This field should be read as '1'
24292          * to indicate that the output has been completely written.
24293          * When writing a command completion or response to an internal processor,
24294          * the order of writes has to be such that this field is written last.
24295          */
24296         uint8_t valid;
24297 } __attribute__((packed));
24298
24299 /***************************
24300  * hwrm_cfa_l2_set_rx_mask *
24301  ***************************/
24302
24303
24304 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
24305 struct hwrm_cfa_l2_set_rx_mask_input {
24306         /* The HWRM command request type. */
24307         uint16_t        req_type;
24308         /*
24309          * The completion ring to send the completion event on. This should
24310          * be the NQ ID returned from the `nq_alloc` HWRM command.
24311          */
24312         uint16_t        cmpl_ring;
24313         /*
24314          * The sequence ID is used by the driver for tracking multiple
24315          * commands. This ID is treated as opaque data by the firmware and
24316          * the value is returned in the `hwrm_resp_hdr` upon completion.
24317          */
24318         uint16_t        seq_id;
24319         /*
24320          * The target ID of the command:
24321          * * 0x0-0xFFF8 - The function ID
24322          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24323          * * 0xFFFD - Reserved for user-space HWRM interface
24324          * * 0xFFFF - HWRM
24325          */
24326         uint16_t        target_id;
24327         /*
24328          * A physical address pointer pointing to a host buffer that the
24329          * command's response data will be written. This can be either a host
24330          * physical address (HPA) or a guest physical address (GPA) and must
24331          * point to a physically contiguous block of memory.
24332          */
24333         uint64_t        resp_addr;
24334         /* VNIC ID */
24335         uint32_t        vnic_id;
24336         uint32_t        mask;
24337         /*
24338          * When this bit is '1', the function is requested to accept
24339          * multi-cast packets specified by the multicast addr table.
24340          */
24341         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST \
24342                 UINT32_C(0x2)
24343         /*
24344          * When this bit is '1', the function is requested to accept
24345          * all multi-cast packets.
24346          */
24347         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST \
24348                 UINT32_C(0x4)
24349         /*
24350          * When this bit is '1', the function is requested to accept
24351          * broadcast packets.
24352          */
24353         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST \
24354                 UINT32_C(0x8)
24355         /*
24356          * When this bit is '1', the function is requested to be
24357          * put in the promiscuous mode.
24358          *
24359          * The HWRM should accept any function to set up
24360          * promiscuous mode.
24361          *
24362          * The HWRM shall follow the semantics below for the
24363          * promiscuous mode support.
24364          * # When partitioning is not enabled on a port
24365          * (i.e. single PF on the port), then the PF shall
24366          * be allowed to be in the promiscuous mode. When the
24367          * PF is in the promiscuous mode, then it shall
24368          * receive all host bound traffic on that port.
24369          * # When partitioning is enabled on a port
24370          * (i.e. multiple PFs per port) and a PF on that
24371          * port is in the promiscuous mode, then the PF
24372          * receives all traffic within that partition as
24373          * identified by a unique identifier for the
24374          * PF (e.g. S-Tag). If a unique outer VLAN
24375          * for the PF is specified, then the setting of
24376          * promiscuous mode on that PF shall result in the
24377          * PF receiving all host bound traffic with matching
24378          * outer VLAN.
24379          * # A VF shall can be set in the promiscuous mode.
24380          * In the promiscuous mode, the VF does not receive any
24381          * traffic unless a unique outer VLAN for the
24382          * VF is specified. If a unique outer VLAN
24383          * for the VF is specified, then the setting of
24384          * promiscuous mode on that VF shall result in the
24385          * VF receiving all host bound traffic with the
24386          * matching outer VLAN.
24387          * # The HWRM shall allow the setting of promiscuous
24388          * mode on a function independently from the
24389          * promiscuous mode settings on other functions.
24390          */
24391         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS \
24392                 UINT32_C(0x10)
24393         /*
24394          * If this flag is set, the corresponding RX
24395          * filters shall be set up to cover multicast/broadcast
24396          * filters for the outermost Layer 2 destination MAC
24397          * address field.
24398          */
24399         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST \
24400                 UINT32_C(0x20)
24401         /*
24402          * If this flag is set, the corresponding RX
24403          * filters shall be set up to cover multicast/broadcast
24404          * filters for the VLAN-tagged packets that match the
24405          * TPID and VID fields of VLAN tags in the VLAN tag
24406          * table specified in this command.
24407          */
24408         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY \
24409                 UINT32_C(0x40)
24410         /*
24411          * If this flag is set, the corresponding RX
24412          * filters shall be set up to cover multicast/broadcast
24413          * filters for non-VLAN tagged packets and VLAN-tagged
24414          * packets that match the TPID and VID fields of VLAN
24415          * tags in the VLAN tag table specified in this command.
24416          */
24417         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN \
24418                 UINT32_C(0x80)
24419         /*
24420          * If this flag is set, the corresponding RX
24421          * filters shall be set up to cover multicast/broadcast
24422          * filters for non-VLAN tagged packets and VLAN-tagged
24423          * packets matching any VLAN tag.
24424          *
24425          * If this flag is set, then the HWRM shall ignore
24426          * VLAN tags specified in vlan_tag_tbl.
24427          *
24428          * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
24429          * flags is set, then the HWRM shall ignore
24430          * VLAN tags specified in vlan_tag_tbl.
24431          *
24432          * The HWRM client shall set at most one flag out of
24433          * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
24434          */
24435         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
24436                 UINT32_C(0x100)
24437         /* This is the address for mcast address tbl. */
24438         uint64_t        mc_tbl_addr;
24439         /*
24440          * This value indicates how many entries in mc_tbl are valid.
24441          * Each entry is 6 bytes.
24442          */
24443         uint32_t        num_mc_entries;
24444         uint8_t unused_0[4];
24445         /*
24446          * This is the address for VLAN tag table.
24447          * Each VLAN entry in the table is 4 bytes of a VLAN tag
24448          * including TPID, PCP, DEI, and VID fields in network byte
24449          * order.
24450          */
24451         uint64_t        vlan_tag_tbl_addr;
24452         /*
24453          * This value indicates how many entries in vlan_tag_tbl are
24454          * valid. Each entry is 4 bytes.
24455          */
24456         uint32_t        num_vlan_tags;
24457         uint8_t unused_1[4];
24458 } __attribute__((packed));
24459
24460 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
24461 struct hwrm_cfa_l2_set_rx_mask_output {
24462         /* The specific error status for the command. */
24463         uint16_t        error_code;
24464         /* The HWRM command request type. */
24465         uint16_t        req_type;
24466         /* The sequence ID from the original command. */
24467         uint16_t        seq_id;
24468         /* The length of the response data in number of bytes. */
24469         uint16_t        resp_len;
24470         uint8_t unused_0[7];
24471         /*
24472          * This field is used in Output records to indicate that the output
24473          * is completely written to RAM.  This field should be read as '1'
24474          * to indicate that the output has been completely written.
24475          * When writing a command completion or response to an internal processor,
24476          * the order of writes has to be such that this field is written last.
24477          */
24478         uint8_t valid;
24479 } __attribute__((packed));
24480
24481 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
24482 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
24483         /*
24484          * command specific error codes that goes to
24485          * the cmd_err field in Common HWRM Error Response.
24486          */
24487         uint8_t code;
24488         /* Unknown error */
24489         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN \
24490                 UINT32_C(0x0)
24491         /* Unable to complete operation due to conflict with Ntuple Filter */
24492         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR \
24493                 UINT32_C(0x1)
24494         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST \
24495                 HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
24496         uint8_t unused_0[7];
24497 } __attribute__((packed));
24498
24499 /*******************************
24500  * hwrm_cfa_vlan_antispoof_cfg *
24501  *******************************/
24502
24503
24504 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
24505 struct hwrm_cfa_vlan_antispoof_cfg_input {
24506         /* The HWRM command request type. */
24507         uint16_t        req_type;
24508         /*
24509          * The completion ring to send the completion event on. This should
24510          * be the NQ ID returned from the `nq_alloc` HWRM command.
24511          */
24512         uint16_t        cmpl_ring;
24513         /*
24514          * The sequence ID is used by the driver for tracking multiple
24515          * commands. This ID is treated as opaque data by the firmware and
24516          * the value is returned in the `hwrm_resp_hdr` upon completion.
24517          */
24518         uint16_t        seq_id;
24519         /*
24520          * The target ID of the command:
24521          * * 0x0-0xFFF8 - The function ID
24522          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24523          * * 0xFFFD - Reserved for user-space HWRM interface
24524          * * 0xFFFF - HWRM
24525          */
24526         uint16_t        target_id;
24527         /*
24528          * A physical address pointer pointing to a host buffer that the
24529          * command's response data will be written. This can be either a host
24530          * physical address (HPA) or a guest physical address (GPA) and must
24531          * point to a physically contiguous block of memory.
24532          */
24533         uint64_t        resp_addr;
24534         /*
24535          * Function ID of the function that is being configured.
24536          * Only valid for a VF FID configured by the PF.
24537          */
24538         uint16_t        fid;
24539         uint8_t unused_0[2];
24540         /* Number of VLAN entries in the vlan_tag_mask_tbl. */
24541         uint32_t        num_vlan_entries;
24542         /*
24543          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
24544          * antispoof table. Each table entry contains the 16-bit TPID
24545          * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
24546          * all in network order to match hwrm_cfa_l2_set_rx_mask.
24547          * For an individual VLAN entry, the mask value should be 0xfff
24548          * for the 12-bit VLAN ID.
24549          */
24550         uint64_t        vlan_tag_mask_tbl_addr;
24551 } __attribute__((packed));
24552
24553 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
24554 struct hwrm_cfa_vlan_antispoof_cfg_output {
24555         /* The specific error status for the command. */
24556         uint16_t        error_code;
24557         /* The HWRM command request type. */
24558         uint16_t        req_type;
24559         /* The sequence ID from the original command. */
24560         uint16_t        seq_id;
24561         /* The length of the response data in number of bytes. */
24562         uint16_t        resp_len;
24563         uint8_t unused_0[7];
24564         /*
24565          * This field is used in Output records to indicate that the output
24566          * is completely written to RAM.  This field should be read as '1'
24567          * to indicate that the output has been completely written.
24568          * When writing a command completion or response to an internal processor,
24569          * the order of writes has to be such that this field is written last.
24570          */
24571         uint8_t valid;
24572 } __attribute__((packed));
24573
24574 /********************************
24575  * hwrm_cfa_vlan_antispoof_qcfg *
24576  ********************************/
24577
24578
24579 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
24580 struct hwrm_cfa_vlan_antispoof_qcfg_input {
24581         /* The HWRM command request type. */
24582         uint16_t        req_type;
24583         /*
24584          * The completion ring to send the completion event on. This should
24585          * be the NQ ID returned from the `nq_alloc` HWRM command.
24586          */
24587         uint16_t        cmpl_ring;
24588         /*
24589          * The sequence ID is used by the driver for tracking multiple
24590          * commands. This ID is treated as opaque data by the firmware and
24591          * the value is returned in the `hwrm_resp_hdr` upon completion.
24592          */
24593         uint16_t        seq_id;
24594         /*
24595          * The target ID of the command:
24596          * * 0x0-0xFFF8 - The function ID
24597          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24598          * * 0xFFFD - Reserved for user-space HWRM interface
24599          * * 0xFFFF - HWRM
24600          */
24601         uint16_t        target_id;
24602         /*
24603          * A physical address pointer pointing to a host buffer that the
24604          * command's response data will be written. This can be either a host
24605          * physical address (HPA) or a guest physical address (GPA) and must
24606          * point to a physically contiguous block of memory.
24607          */
24608         uint64_t        resp_addr;
24609         /*
24610          * Function ID of the function that is being queried.
24611          * Only valid for a VF FID queried by the PF.
24612          */
24613         uint16_t        fid;
24614         uint8_t unused_0[2];
24615         /*
24616          * Maximum number of VLAN entries the firmware is allowed to DMA
24617          * to vlan_tag_mask_tbl.
24618          */
24619         uint32_t        max_vlan_entries;
24620         /*
24621          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
24622          * antispoof table to which firmware will DMA to. Each table
24623          * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
24624          * 16-bit VLAN ID, and a 16-bit mask, all in network order to
24625          * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
24626          * the mask value should be 0xfff for the 12-bit VLAN ID.
24627          */
24628         uint64_t        vlan_tag_mask_tbl_addr;
24629 } __attribute__((packed));
24630
24631 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
24632 struct hwrm_cfa_vlan_antispoof_qcfg_output {
24633         /* The specific error status for the command. */
24634         uint16_t        error_code;
24635         /* The HWRM command request type. */
24636         uint16_t        req_type;
24637         /* The sequence ID from the original command. */
24638         uint16_t        seq_id;
24639         /* The length of the response data in number of bytes. */
24640         uint16_t        resp_len;
24641         /* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
24642         uint32_t        num_vlan_entries;
24643         uint8_t unused_0[3];
24644         /*
24645          * This field is used in Output records to indicate that the output
24646          * is completely written to RAM.  This field should be read as '1'
24647          * to indicate that the output has been completely written.
24648          * When writing a command completion or response to an internal processor,
24649          * the order of writes has to be such that this field is written last.
24650          */
24651         uint8_t valid;
24652 } __attribute__((packed));
24653
24654 /********************************
24655  * hwrm_cfa_tunnel_filter_alloc *
24656  ********************************/
24657
24658
24659 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */
24660 struct hwrm_cfa_tunnel_filter_alloc_input {
24661         /* The HWRM command request type. */
24662         uint16_t        req_type;
24663         /*
24664          * The completion ring to send the completion event on. This should
24665          * be the NQ ID returned from the `nq_alloc` HWRM command.
24666          */
24667         uint16_t        cmpl_ring;
24668         /*
24669          * The sequence ID is used by the driver for tracking multiple
24670          * commands. This ID is treated as opaque data by the firmware and
24671          * the value is returned in the `hwrm_resp_hdr` upon completion.
24672          */
24673         uint16_t        seq_id;
24674         /*
24675          * The target ID of the command:
24676          * * 0x0-0xFFF8 - The function ID
24677          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24678          * * 0xFFFD - Reserved for user-space HWRM interface
24679          * * 0xFFFF - HWRM
24680          */
24681         uint16_t        target_id;
24682         /*
24683          * A physical address pointer pointing to a host buffer that the
24684          * command's response data will be written. This can be either a host
24685          * physical address (HPA) or a guest physical address (GPA) and must
24686          * point to a physically contiguous block of memory.
24687          */
24688         uint64_t        resp_addr;
24689         uint32_t        flags;
24690         /* Setting of this flag indicates the applicability to the loopback path. */
24691         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
24692                 UINT32_C(0x1)
24693         uint32_t        enables;
24694         /*
24695          * This bit must be '1' for the l2_filter_id field to be
24696          * configured.
24697          */
24698         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
24699                 UINT32_C(0x1)
24700         /*
24701          * This bit must be '1' for the l2_addr field to be
24702          * configured.
24703          */
24704         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
24705                 UINT32_C(0x2)
24706         /*
24707          * This bit must be '1' for the l2_ivlan field to be
24708          * configured.
24709          */
24710         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
24711                 UINT32_C(0x4)
24712         /*
24713          * This bit must be '1' for the l3_addr field to be
24714          * configured.
24715          */
24716         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR \
24717                 UINT32_C(0x8)
24718         /*
24719          * This bit must be '1' for the l3_addr_type field to be
24720          * configured.
24721          */
24722         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE \
24723                 UINT32_C(0x10)
24724         /*
24725          * This bit must be '1' for the t_l3_addr_type field to be
24726          * configured.
24727          */
24728         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE \
24729                 UINT32_C(0x20)
24730         /*
24731          * This bit must be '1' for the t_l3_addr field to be
24732          * configured.
24733          */
24734         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR \
24735                 UINT32_C(0x40)
24736         /*
24737          * This bit must be '1' for the tunnel_type field to be
24738          * configured.
24739          */
24740         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
24741                 UINT32_C(0x80)
24742         /*
24743          * This bit must be '1' for the vni field to be
24744          * configured.
24745          */
24746         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI \
24747                 UINT32_C(0x100)
24748         /*
24749          * This bit must be '1' for the dst_vnic_id field to be
24750          * configured.
24751          */
24752         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID \
24753                 UINT32_C(0x200)
24754         /*
24755          * This bit must be '1' for the mirror_vnic_id field to be
24756          * configured.
24757          */
24758         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
24759                 UINT32_C(0x400)
24760         /*
24761          * This value identifies a set of CFA data structures used for an L2
24762          * context.
24763          */
24764         uint64_t        l2_filter_id;
24765         /*
24766          * This value sets the match value for the inner L2
24767          * MAC address.
24768          * Destination MAC address for RX path.
24769          * Source MAC address for TX path.
24770          */
24771         uint8_t l2_addr[6];
24772         /*
24773          * This value sets VLAN ID value for inner VLAN.
24774          * Only 12-bits of VLAN ID are used in setting the filter.
24775          */
24776         uint16_t        l2_ivlan;
24777         /*
24778          * The value of inner destination IP address to be used in filtering.
24779          * For IPv4, first four bytes represent the IP address.
24780          */
24781         uint32_t        l3_addr[4];
24782         /*
24783          * The value of tunnel destination IP address to be used in filtering.
24784          * For IPv4, first four bytes represent the IP address.
24785          */
24786         uint32_t        t_l3_addr[4];
24787         /*
24788          * This value indicates the type of inner IP address.
24789          * 4 - IPv4
24790          * 6 - IPv6
24791          * All others are invalid.
24792          */
24793         uint8_t l3_addr_type;
24794         /*
24795          * This value indicates the type of tunnel IP address.
24796          * 4 - IPv4
24797          * 6 - IPv6
24798          * All others are invalid.
24799          */
24800         uint8_t t_l3_addr_type;
24801         /* Tunnel Type. */
24802         uint8_t tunnel_type;
24803         /* Non-tunnel */
24804         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
24805                 UINT32_C(0x0)
24806         /* Virtual eXtensible Local Area Network (VXLAN) */
24807         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
24808                 UINT32_C(0x1)
24809         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
24810         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
24811                 UINT32_C(0x2)
24812         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
24813         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
24814                 UINT32_C(0x3)
24815         /* IP in IP */
24816         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
24817                 UINT32_C(0x4)
24818         /* Generic Network Virtualization Encapsulation (Geneve) */
24819         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
24820                 UINT32_C(0x5)
24821         /* Multi-Protocol Lable Switching (MPLS) */
24822         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
24823                 UINT32_C(0x6)
24824         /* Stateless Transport Tunnel (STT) */
24825         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
24826                 UINT32_C(0x7)
24827         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
24828         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
24829                 UINT32_C(0x8)
24830         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
24831         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
24832                 UINT32_C(0x9)
24833         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
24834         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
24835                 UINT32_C(0xa)
24836         /* Use fixed layer 2 ether type of 0xFFFF */
24837         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
24838                 UINT32_C(0xb)
24839         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
24840         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
24841                 UINT32_C(0xc)
24842         /* Any tunneled traffic */
24843         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
24844                 UINT32_C(0xff)
24845         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
24846                 HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
24847         /*
24848          * tunnel_flags allows the user to indicate the tunnel tag detection
24849          * for the tunnel type specified in tunnel_type.
24850          */
24851         uint8_t tunnel_flags;
24852         /*
24853          * If the tunnel_type is geneve, then this bit indicates if we
24854          * need to match the geneve OAM packet.
24855          * If the tunnel_type is nvgre or gre, then this bit indicates if
24856          * we need to detect checksum present bit in geneve header.
24857          * If the tunnel_type is mpls, then this bit indicates if we need
24858          * to match mpls packet with explicit IPV4/IPV6 null header.
24859          */
24860         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR \
24861                 UINT32_C(0x1)
24862         /*
24863          * If the tunnel_type is geneve, then this bit indicates if we
24864          * need to detect the critical option bit set in the oam packet.
24865          * If the tunnel_type is nvgre or gre, then this bit indicates
24866          * if we need to match nvgre packets with key present bit set in
24867          * gre header.
24868          * If the tunnel_type is mpls, then this bit indicates if we
24869          * need to match mpls packet with S bit from inner/second label.
24870          */
24871         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1 \
24872                 UINT32_C(0x2)
24873         /*
24874          * If the tunnel_type is geneve, then this bit indicates if we
24875          * need to match geneve packet with extended header bit set in
24876          * geneve header.
24877          * If the tunnel_type is nvgre or gre, then this bit indicates
24878          * if we need to match nvgre packets with sequence number
24879          * present bit set in gre header.
24880          * If the tunnel_type is mpls, then this bit indicates if we
24881          * need to match mpls packet with S bit from out/first label.
24882          */
24883         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0 \
24884                 UINT32_C(0x4)
24885         /*
24886          * Virtual Network Identifier (VNI). Only valid with
24887          * tunnel_types VXLAN, NVGRE, and Geneve.
24888          * Only lower 24-bits of VNI field are used
24889          * in setting up the filter.
24890          */
24891         uint32_t        vni;
24892         /* Logical VNIC ID of the destination VNIC. */
24893         uint32_t        dst_vnic_id;
24894         /*
24895          * Logical VNIC ID of the VNIC where traffic is
24896          * mirrored.
24897          */
24898         uint32_t        mirror_vnic_id;
24899 } __attribute__((packed));
24900
24901 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
24902 struct hwrm_cfa_tunnel_filter_alloc_output {
24903         /* The specific error status for the command. */
24904         uint16_t        error_code;
24905         /* The HWRM command request type. */
24906         uint16_t        req_type;
24907         /* The sequence ID from the original command. */
24908         uint16_t        seq_id;
24909         /* The length of the response data in number of bytes. */
24910         uint16_t        resp_len;
24911         /* This value is an opaque id into CFA data structures. */
24912         uint64_t        tunnel_filter_id;
24913         /*
24914          * The flow id value in bit 0-29 is the actual ID of the flow
24915          * associated with this filter and it shall be used to match
24916          * and associate the flow identifier returned in completion
24917          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
24918          * shall indicate no valid flow id.
24919          */
24920         uint32_t        flow_id;
24921         /* Indicate the flow id value. */
24922         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
24923                 UINT32_C(0x3fffffff)
24924         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
24925         /* Indicate type of the flow. */
24926         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
24927                 UINT32_C(0x40000000)
24928         /*
24929          * If this bit set to 0, then it indicates that the flow is
24930          * internal flow.
24931          */
24932         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
24933                 (UINT32_C(0x0) << 30)
24934         /*
24935          * If this bit is set to 1, then it indicates that the flow is
24936          * external flow.
24937          */
24938         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
24939                 (UINT32_C(0x1) << 30)
24940         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
24941                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
24942         /* Indicate the flow direction. */
24943         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
24944                 UINT32_C(0x80000000)
24945         /* If this bit set to 0, then it indicates rx flow. */
24946         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
24947                 (UINT32_C(0x0) << 31)
24948         /* If this bit is set to 1, then it indicates that tx flow. */
24949         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
24950                 (UINT32_C(0x1) << 31)
24951         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
24952                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
24953         uint8_t unused_0[3];
24954         /*
24955          * This field is used in Output records to indicate that the output
24956          * is completely written to RAM.  This field should be read as '1'
24957          * to indicate that the output has been completely written.
24958          * When writing a command completion or response to an internal processor,
24959          * the order of writes has to be such that this field is written last.
24960          */
24961         uint8_t valid;
24962 } __attribute__((packed));
24963
24964 /*******************************
24965  * hwrm_cfa_tunnel_filter_free *
24966  *******************************/
24967
24968
24969 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */
24970 struct hwrm_cfa_tunnel_filter_free_input {
24971         /* The HWRM command request type. */
24972         uint16_t        req_type;
24973         /*
24974          * The completion ring to send the completion event on. This should
24975          * be the NQ ID returned from the `nq_alloc` HWRM command.
24976          */
24977         uint16_t        cmpl_ring;
24978         /*
24979          * The sequence ID is used by the driver for tracking multiple
24980          * commands. This ID is treated as opaque data by the firmware and
24981          * the value is returned in the `hwrm_resp_hdr` upon completion.
24982          */
24983         uint16_t        seq_id;
24984         /*
24985          * The target ID of the command:
24986          * * 0x0-0xFFF8 - The function ID
24987          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24988          * * 0xFFFD - Reserved for user-space HWRM interface
24989          * * 0xFFFF - HWRM
24990          */
24991         uint16_t        target_id;
24992         /*
24993          * A physical address pointer pointing to a host buffer that the
24994          * command's response data will be written. This can be either a host
24995          * physical address (HPA) or a guest physical address (GPA) and must
24996          * point to a physically contiguous block of memory.
24997          */
24998         uint64_t        resp_addr;
24999         /* This value is an opaque id into CFA data structures. */
25000         uint64_t        tunnel_filter_id;
25001 } __attribute__((packed));
25002
25003 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
25004 struct hwrm_cfa_tunnel_filter_free_output {
25005         /* The specific error status for the command. */
25006         uint16_t        error_code;
25007         /* The HWRM command request type. */
25008         uint16_t        req_type;
25009         /* The sequence ID from the original command. */
25010         uint16_t        seq_id;
25011         /* The length of the response data in number of bytes. */
25012         uint16_t        resp_len;
25013         uint8_t unused_0[7];
25014         /*
25015          * This field is used in Output records to indicate that the output
25016          * is completely written to RAM.  This field should be read as '1'
25017          * to indicate that the output has been completely written.
25018          * When writing a command completion or response to an internal processor,
25019          * the order of writes has to be such that this field is written last.
25020          */
25021         uint8_t valid;
25022 } __attribute__((packed));
25023
25024 /***************************************
25025  * hwrm_cfa_redirect_tunnel_type_alloc *
25026  ***************************************/
25027
25028
25029 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */
25030 struct hwrm_cfa_redirect_tunnel_type_alloc_input {
25031         /* The HWRM command request type. */
25032         uint16_t        req_type;
25033         /*
25034          * The completion ring to send the completion event on. This should
25035          * be the NQ ID returned from the `nq_alloc` HWRM command.
25036          */
25037         uint16_t        cmpl_ring;
25038         /*
25039          * The sequence ID is used by the driver for tracking multiple
25040          * commands. This ID is treated as opaque data by the firmware and
25041          * the value is returned in the `hwrm_resp_hdr` upon completion.
25042          */
25043         uint16_t        seq_id;
25044         /*
25045          * The target ID of the command:
25046          * * 0x0-0xFFF8 - The function ID
25047          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25048          * * 0xFFFD - Reserved for user-space HWRM interface
25049          * * 0xFFFF - HWRM
25050          */
25051         uint16_t        target_id;
25052         /*
25053          * A physical address pointer pointing to a host buffer that the
25054          * command's response data will be written. This can be either a host
25055          * physical address (HPA) or a guest physical address (GPA) and must
25056          * point to a physically contiguous block of memory.
25057          */
25058         uint64_t        resp_addr;
25059         /* The destination function id, to whom the traffic is redirected. */
25060         uint16_t        dest_fid;
25061         /* Tunnel Type. */
25062         uint8_t tunnel_type;
25063         /* Non-tunnel */
25064         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
25065                 UINT32_C(0x0)
25066         /* Virtual eXtensible Local Area Network (VXLAN) */
25067         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
25068                 UINT32_C(0x1)
25069         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25070         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
25071                 UINT32_C(0x2)
25072         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25073         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
25074                 UINT32_C(0x3)
25075         /* IP in IP */
25076         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
25077                 UINT32_C(0x4)
25078         /* Generic Network Virtualization Encapsulation (Geneve) */
25079         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
25080                 UINT32_C(0x5)
25081         /* Multi-Protocol Lable Switching (MPLS) */
25082         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
25083                 UINT32_C(0x6)
25084         /* Stateless Transport Tunnel (STT) */
25085         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT \
25086                 UINT32_C(0x7)
25087         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25088         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
25089                 UINT32_C(0x8)
25090         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25091         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25092                 UINT32_C(0x9)
25093         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25094         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25095                 UINT32_C(0xa)
25096         /* Use fixed layer 2 ether type of 0xFFFF */
25097         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
25098                 UINT32_C(0xb)
25099         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25100         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25101                 UINT32_C(0xc)
25102         /* Any tunneled traffic */
25103         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25104                 UINT32_C(0xff)
25105         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST \
25106                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
25107         /* Tunnel alloc flags. */
25108         uint8_t flags;
25109         /* Setting of this flag indicates modify existing redirect tunnel to new destination function ID. */
25110         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST \
25111                 UINT32_C(0x1)
25112         uint8_t unused_0[4];
25113 } __attribute__((packed));
25114
25115 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
25116 struct hwrm_cfa_redirect_tunnel_type_alloc_output {
25117         /* The specific error status for the command. */
25118         uint16_t        error_code;
25119         /* The HWRM command request type. */
25120         uint16_t        req_type;
25121         /* The sequence ID from the original command. */
25122         uint16_t        seq_id;
25123         /* The length of the response data in number of bytes. */
25124         uint16_t        resp_len;
25125         uint8_t unused_0[7];
25126         /*
25127          * This field is used in Output records to indicate that the output
25128          * is completely written to RAM.  This field should be read as '1'
25129          * to indicate that the output has been completely written.
25130          * When writing a command completion or response to an internal processor,
25131          * the order of writes has to be such that this field is written last.
25132          */
25133         uint8_t valid;
25134 } __attribute__((packed));
25135
25136 /**************************************
25137  * hwrm_cfa_redirect_tunnel_type_free *
25138  **************************************/
25139
25140
25141 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */
25142 struct hwrm_cfa_redirect_tunnel_type_free_input {
25143         /* The HWRM command request type. */
25144         uint16_t        req_type;
25145         /*
25146          * The completion ring to send the completion event on. This should
25147          * be the NQ ID returned from the `nq_alloc` HWRM command.
25148          */
25149         uint16_t        cmpl_ring;
25150         /*
25151          * The sequence ID is used by the driver for tracking multiple
25152          * commands. This ID is treated as opaque data by the firmware and
25153          * the value is returned in the `hwrm_resp_hdr` upon completion.
25154          */
25155         uint16_t        seq_id;
25156         /*
25157          * The target ID of the command:
25158          * * 0x0-0xFFF8 - The function ID
25159          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25160          * * 0xFFFD - Reserved for user-space HWRM interface
25161          * * 0xFFFF - HWRM
25162          */
25163         uint16_t        target_id;
25164         /*
25165          * A physical address pointer pointing to a host buffer that the
25166          * command's response data will be written. This can be either a host
25167          * physical address (HPA) or a guest physical address (GPA) and must
25168          * point to a physically contiguous block of memory.
25169          */
25170         uint64_t        resp_addr;
25171         /* The destination function id, to whom the traffic is redirected. */
25172         uint16_t        dest_fid;
25173         /* Tunnel Type. */
25174         uint8_t tunnel_type;
25175         /* Non-tunnel */
25176         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL \
25177                 UINT32_C(0x0)
25178         /* Virtual eXtensible Local Area Network (VXLAN) */
25179         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN \
25180                 UINT32_C(0x1)
25181         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25182         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE \
25183                 UINT32_C(0x2)
25184         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25185         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE \
25186                 UINT32_C(0x3)
25187         /* IP in IP */
25188         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP \
25189                 UINT32_C(0x4)
25190         /* Generic Network Virtualization Encapsulation (Geneve) */
25191         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE \
25192                 UINT32_C(0x5)
25193         /* Multi-Protocol Lable Switching (MPLS) */
25194         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS \
25195                 UINT32_C(0x6)
25196         /* Stateless Transport Tunnel (STT) */
25197         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT \
25198                 UINT32_C(0x7)
25199         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25200         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE \
25201                 UINT32_C(0x8)
25202         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25203         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25204                 UINT32_C(0x9)
25205         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25206         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25207                 UINT32_C(0xa)
25208         /* Use fixed layer 2 ether type of 0xFFFF */
25209         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
25210                 UINT32_C(0xb)
25211         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25212         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25213                 UINT32_C(0xc)
25214         /* Any tunneled traffic */
25215         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25216                 UINT32_C(0xff)
25217         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST \
25218                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
25219         uint8_t unused_0[5];
25220 } __attribute__((packed));
25221
25222 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
25223 struct hwrm_cfa_redirect_tunnel_type_free_output {
25224         /* The specific error status for the command. */
25225         uint16_t        error_code;
25226         /* The HWRM command request type. */
25227         uint16_t        req_type;
25228         /* The sequence ID from the original command. */
25229         uint16_t        seq_id;
25230         /* The length of the response data in number of bytes. */
25231         uint16_t        resp_len;
25232         uint8_t unused_0[7];
25233         /*
25234          * This field is used in Output records to indicate that the output
25235          * is completely written to RAM.  This field should be read as '1'
25236          * to indicate that the output has been completely written.
25237          * When writing a command completion or response to an internal processor,
25238          * the order of writes has to be such that this field is written last.
25239          */
25240         uint8_t valid;
25241 } __attribute__((packed));
25242
25243 /**************************************
25244  * hwrm_cfa_redirect_tunnel_type_info *
25245  **************************************/
25246
25247
25248 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */
25249 struct hwrm_cfa_redirect_tunnel_type_info_input {
25250         /* The HWRM command request type. */
25251         uint16_t        req_type;
25252         /*
25253          * The completion ring to send the completion event on. This should
25254          * be the NQ ID returned from the `nq_alloc` HWRM command.
25255          */
25256         uint16_t        cmpl_ring;
25257         /*
25258          * The sequence ID is used by the driver for tracking multiple
25259          * commands. This ID is treated as opaque data by the firmware and
25260          * the value is returned in the `hwrm_resp_hdr` upon completion.
25261          */
25262         uint16_t        seq_id;
25263         /*
25264          * The target ID of the command:
25265          * * 0x0-0xFFF8 - The function ID
25266          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25267          * * 0xFFFD - Reserved for user-space HWRM interface
25268          * * 0xFFFF - HWRM
25269          */
25270         uint16_t        target_id;
25271         /*
25272          * A physical address pointer pointing to a host buffer that the
25273          * command's response data will be written. This can be either a host
25274          * physical address (HPA) or a guest physical address (GPA) and must
25275          * point to a physically contiguous block of memory.
25276          */
25277         uint64_t        resp_addr;
25278         /* The source function id. */
25279         uint16_t        src_fid;
25280         /* Tunnel Type. */
25281         uint8_t tunnel_type;
25282         /* Non-tunnel */
25283         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL \
25284                 UINT32_C(0x0)
25285         /* Virtual eXtensible Local Area Network (VXLAN) */
25286         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN \
25287                 UINT32_C(0x1)
25288         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25289         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE \
25290                 UINT32_C(0x2)
25291         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25292         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE \
25293                 UINT32_C(0x3)
25294         /* IP in IP */
25295         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP \
25296                 UINT32_C(0x4)
25297         /* Generic Network Virtualization Encapsulation (Geneve) */
25298         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE \
25299                 UINT32_C(0x5)
25300         /* Multi-Protocol Lable Switching (MPLS) */
25301         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS \
25302                 UINT32_C(0x6)
25303         /* Stateless Transport Tunnel (STT) */
25304         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT \
25305                 UINT32_C(0x7)
25306         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25307         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE \
25308                 UINT32_C(0x8)
25309         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25310         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25311                 UINT32_C(0x9)
25312         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25313         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25314                 UINT32_C(0xa)
25315         /* Use fixed layer 2 ether type of 0xFFFF */
25316         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2_ETYPE \
25317                 UINT32_C(0xb)
25318         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25319         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25320                 UINT32_C(0xc)
25321         /* Any tunneled traffic */
25322         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25323                 UINT32_C(0xff)
25324         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST \
25325                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
25326         uint8_t unused_0[5];
25327 } __attribute__((packed));
25328
25329 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
25330 struct hwrm_cfa_redirect_tunnel_type_info_output {
25331         /* The specific error status for the command. */
25332         uint16_t        error_code;
25333         /* The HWRM command request type. */
25334         uint16_t        req_type;
25335         /* The sequence ID from the original command. */
25336         uint16_t        seq_id;
25337         /* The length of the response data in number of bytes. */
25338         uint16_t        resp_len;
25339         /* The destination function id, to whom the traffic is redirected. */
25340         uint16_t        dest_fid;
25341         uint8_t unused_0[5];
25342         /*
25343          * This field is used in Output records to indicate that the output
25344          * is completely written to RAM.  This field should be read as '1'
25345          * to indicate that the output has been completely written.
25346          * When writing a command completion or response to an internal processor,
25347          * the order of writes has to be such that this field is written last.
25348          */
25349         uint8_t valid;
25350 } __attribute__((packed));
25351
25352 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
25353 struct hwrm_vxlan_ipv4_hdr {
25354         /* IPv4 version and header length. */
25355         uint8_t ver_hlen;
25356         /* IPv4 header length */
25357         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf)
25358         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0
25359         /* Version */
25360         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK      UINT32_C(0xf0)
25361         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT       4
25362         /* IPv4 type of service. */
25363         uint8_t tos;
25364         /* IPv4 identification. */
25365         uint16_t        ip_id;
25366         /* IPv4 flags and offset. */
25367         uint16_t        flags_frag_offset;
25368         /* IPv4 TTL. */
25369         uint8_t ttl;
25370         /* IPv4 protocol. */
25371         uint8_t protocol;
25372         /* IPv4 source address. */
25373         uint32_t        src_ip_addr;
25374         /* IPv4 destination address. */
25375         uint32_t        dest_ip_addr;
25376 } __attribute__((packed));
25377
25378 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
25379 struct hwrm_vxlan_ipv6_hdr {
25380         /* IPv6 version, traffic class and flow label. */
25381         uint32_t        ver_tc_flow_label;
25382         /* IPv6 version shift */
25383         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT \
25384                 UINT32_C(0x1c)
25385         /* IPv6 version mask */
25386         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK \
25387                 UINT32_C(0xf0000000)
25388         /* IPv6 TC shift */
25389         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT \
25390                 UINT32_C(0x14)
25391         /* IPv6 TC mask */
25392         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK \
25393                 UINT32_C(0xff00000)
25394         /* IPv6 flow label shift */
25395         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT \
25396                 UINT32_C(0x0)
25397         /* IPv6 flow label mask */
25398         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK \
25399                 UINT32_C(0xfffff)
25400         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST \
25401                 HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK
25402         /* IPv6 payload length. */
25403         uint16_t        payload_len;
25404         /* IPv6 next header. */
25405         uint8_t next_hdr;
25406         /* IPv6 TTL. */
25407         uint8_t ttl;
25408         /* IPv6 source address. */
25409         uint32_t        src_ip_addr[4];
25410         /* IPv6 destination address. */
25411         uint32_t        dest_ip_addr[4];
25412 } __attribute__((packed));
25413
25414 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
25415 struct hwrm_cfa_encap_data_vxlan {
25416         /* Source MAC address. */
25417         uint8_t src_mac_addr[6];
25418         /* reserved. */
25419         uint16_t        unused_0;
25420         /* Destination MAC address. */
25421         uint8_t dst_mac_addr[6];
25422         /* Number of VLAN tags. */
25423         uint8_t num_vlan_tags;
25424         /* reserved. */
25425         uint8_t unused_1;
25426         /* Outer VLAN TPID. */
25427         uint16_t        ovlan_tpid;
25428         /* Outer VLAN TCI. */
25429         uint16_t        ovlan_tci;
25430         /* Inner VLAN TPID. */
25431         uint16_t        ivlan_tpid;
25432         /* Inner VLAN TCI. */
25433         uint16_t        ivlan_tci;
25434         /* L3 header fields. */
25435         uint32_t        l3[10];
25436         /* IP version mask. */
25437         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf)
25438         /* IP version 4. */
25439         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4)
25440         /* IP version 6. */
25441         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6)
25442         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST \
25443                 HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6
25444         /* UDP source port. */
25445         uint16_t        src_port;
25446         /* UDP destination port. */
25447         uint16_t        dst_port;
25448         /* VXLAN Network Identifier. */
25449         uint32_t        vni;
25450         /* 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN header. */
25451         uint8_t hdr_rsvd0[3];
25452         /* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */
25453         uint8_t hdr_rsvd1;
25454         /* VXLAN header flags field. */
25455         uint8_t hdr_flags;
25456         uint8_t unused[3];
25457 } __attribute__((packed));
25458
25459 /*******************************
25460  * hwrm_cfa_encap_record_alloc *
25461  *******************************/
25462
25463
25464 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */
25465 struct hwrm_cfa_encap_record_alloc_input {
25466         /* The HWRM command request type. */
25467         uint16_t        req_type;
25468         /*
25469          * The completion ring to send the completion event on. This should
25470          * be the NQ ID returned from the `nq_alloc` HWRM command.
25471          */
25472         uint16_t        cmpl_ring;
25473         /*
25474          * The sequence ID is used by the driver for tracking multiple
25475          * commands. This ID is treated as opaque data by the firmware and
25476          * the value is returned in the `hwrm_resp_hdr` upon completion.
25477          */
25478         uint16_t        seq_id;
25479         /*
25480          * The target ID of the command:
25481          * * 0x0-0xFFF8 - The function ID
25482          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25483          * * 0xFFFD - Reserved for user-space HWRM interface
25484          * * 0xFFFF - HWRM
25485          */
25486         uint16_t        target_id;
25487         /*
25488          * A physical address pointer pointing to a host buffer that the
25489          * command's response data will be written. This can be either a host
25490          * physical address (HPA) or a guest physical address (GPA) and must
25491          * point to a physically contiguous block of memory.
25492          */
25493         uint64_t        resp_addr;
25494         uint32_t        flags;
25495         /* Setting of this flag indicates the applicability to the loopback path. */
25496         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK \
25497                 UINT32_C(0x1)
25498         /*
25499          * Setting of this flag indicates this encap record is external encap record.
25500          * Resetting of this flag indicates this flag is internal encap record and
25501          * this is the default setting.
25502          */
25503         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_EXTERNAL \
25504                 UINT32_C(0x2)
25505         /* Encapsulation Type. */
25506         uint8_t encap_type;
25507         /* Virtual eXtensible Local Area Network (VXLAN) */
25508         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN \
25509                 UINT32_C(0x1)
25510         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25511         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE \
25512                 UINT32_C(0x2)
25513         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
25514         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE \
25515                 UINT32_C(0x3)
25516         /* IP in IP */
25517         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP \
25518                 UINT32_C(0x4)
25519         /* Generic Network Virtualization Encapsulation (Geneve) */
25520         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE \
25521                 UINT32_C(0x5)
25522         /* Multi-Protocol Lable Switching (MPLS) */
25523         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS \
25524                 UINT32_C(0x6)
25525         /* VLAN */
25526         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN \
25527                 UINT32_C(0x7)
25528         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25529         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE \
25530                 UINT32_C(0x8)
25531         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25532         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4 \
25533                 UINT32_C(0x9)
25534         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25535         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE_V1 \
25536                 UINT32_C(0xa)
25537         /* Use fixed layer 2 ether type of 0xFFFF */
25538         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE \
25539                 UINT32_C(0xb)
25540         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25541         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6 \
25542                 UINT32_C(0xc)
25543         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST \
25544                 HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6
25545         uint8_t unused_0[3];
25546         /* This value is encap data used for the given encap type. */
25547         uint32_t        encap_data[20];
25548 } __attribute__((packed));
25549
25550 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
25551 struct hwrm_cfa_encap_record_alloc_output {
25552         /* The specific error status for the command. */
25553         uint16_t        error_code;
25554         /* The HWRM command request type. */
25555         uint16_t        req_type;
25556         /* The sequence ID from the original command. */
25557         uint16_t        seq_id;
25558         /* The length of the response data in number of bytes. */
25559         uint16_t        resp_len;
25560         /* This value is an opaque id into CFA data structures. */
25561         uint32_t        encap_record_id;
25562         uint8_t unused_0[3];
25563         /*
25564          * This field is used in Output records to indicate that the output
25565          * is completely written to RAM.  This field should be read as '1'
25566          * to indicate that the output has been completely written.
25567          * When writing a command completion or response to an internal processor,
25568          * the order of writes has to be such that this field is written last.
25569          */
25570         uint8_t valid;
25571 } __attribute__((packed));
25572
25573 /******************************
25574  * hwrm_cfa_encap_record_free *
25575  ******************************/
25576
25577
25578 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */
25579 struct hwrm_cfa_encap_record_free_input {
25580         /* The HWRM command request type. */
25581         uint16_t        req_type;
25582         /*
25583          * The completion ring to send the completion event on. This should
25584          * be the NQ ID returned from the `nq_alloc` HWRM command.
25585          */
25586         uint16_t        cmpl_ring;
25587         /*
25588          * The sequence ID is used by the driver for tracking multiple
25589          * commands. This ID is treated as opaque data by the firmware and
25590          * the value is returned in the `hwrm_resp_hdr` upon completion.
25591          */
25592         uint16_t        seq_id;
25593         /*
25594          * The target ID of the command:
25595          * * 0x0-0xFFF8 - The function ID
25596          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25597          * * 0xFFFD - Reserved for user-space HWRM interface
25598          * * 0xFFFF - HWRM
25599          */
25600         uint16_t        target_id;
25601         /*
25602          * A physical address pointer pointing to a host buffer that the
25603          * command's response data will be written. This can be either a host
25604          * physical address (HPA) or a guest physical address (GPA) and must
25605          * point to a physically contiguous block of memory.
25606          */
25607         uint64_t        resp_addr;
25608         /* This value is an opaque id into CFA data structures. */
25609         uint32_t        encap_record_id;
25610         uint8_t unused_0[4];
25611 } __attribute__((packed));
25612
25613 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
25614 struct hwrm_cfa_encap_record_free_output {
25615         /* The specific error status for the command. */
25616         uint16_t        error_code;
25617         /* The HWRM command request type. */
25618         uint16_t        req_type;
25619         /* The sequence ID from the original command. */
25620         uint16_t        seq_id;
25621         /* The length of the response data in number of bytes. */
25622         uint16_t        resp_len;
25623         uint8_t unused_0[7];
25624         /*
25625          * This field is used in Output records to indicate that the output
25626          * is completely written to RAM.  This field should be read as '1'
25627          * to indicate that the output has been completely written.
25628          * When writing a command completion or response to an internal processor,
25629          * the order of writes has to be such that this field is written last.
25630          */
25631         uint8_t valid;
25632 } __attribute__((packed));
25633
25634 /********************************
25635  * hwrm_cfa_ntuple_filter_alloc *
25636  ********************************/
25637
25638
25639 /* hwrm_cfa_ntuple_filter_alloc_input (size:1088b/136B) */
25640 struct hwrm_cfa_ntuple_filter_alloc_input {
25641         /* The HWRM command request type. */
25642         uint16_t        req_type;
25643         /*
25644          * The completion ring to send the completion event on. This should
25645          * be the NQ ID returned from the `nq_alloc` HWRM command.
25646          */
25647         uint16_t        cmpl_ring;
25648         /*
25649          * The sequence ID is used by the driver for tracking multiple
25650          * commands. This ID is treated as opaque data by the firmware and
25651          * the value is returned in the `hwrm_resp_hdr` upon completion.
25652          */
25653         uint16_t        seq_id;
25654         /*
25655          * The target ID of the command:
25656          * * 0x0-0xFFF8 - The function ID
25657          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25658          * * 0xFFFD - Reserved for user-space HWRM interface
25659          * * 0xFFFF - HWRM
25660          */
25661         uint16_t        target_id;
25662         /*
25663          * A physical address pointer pointing to a host buffer that the
25664          * command's response data will be written. This can be either a host
25665          * physical address (HPA) or a guest physical address (GPA) and must
25666          * point to a physically contiguous block of memory.
25667          */
25668         uint64_t        resp_addr;
25669         uint32_t        flags;
25670         /* Setting of this flag indicates the applicability to the loopback path. */
25671         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
25672                 UINT32_C(0x1)
25673         /*
25674          * Setting of this flag indicates drop action. If this flag is not set,
25675          * then it should be considered accept action.
25676          */
25677         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP \
25678                 UINT32_C(0x2)
25679         /*
25680          * Setting of this flag indicates that a meter is expected to be attached
25681          * to this flow. This hint can be used when choosing the action record
25682          * format required for the flow.
25683          */
25684         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER \
25685                 UINT32_C(0x4)
25686         /*
25687          * Setting of this flag indicates that the dest_id field contains function ID.
25688          * If this is not set it indicates dest_id is VNIC or VPORT.
25689          */
25690         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_FID \
25691                 UINT32_C(0x8)
25692         uint32_t        enables;
25693         /*
25694          * This bit must be '1' for the l2_filter_id field to be
25695          * configured.
25696          */
25697         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
25698                 UINT32_C(0x1)
25699         /*
25700          * This bit must be '1' for the ethertype field to be
25701          * configured.
25702          */
25703         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
25704                 UINT32_C(0x2)
25705         /*
25706          * This bit must be '1' for the tunnel_type field to be
25707          * configured.
25708          */
25709         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
25710                 UINT32_C(0x4)
25711         /*
25712          * This bit must be '1' for the src_macaddr field to be
25713          * configured.
25714          */
25715         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
25716                 UINT32_C(0x8)
25717         /*
25718          * This bit must be '1' for the ipaddr_type field to be
25719          * configured.
25720          */
25721         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
25722                 UINT32_C(0x10)
25723         /*
25724          * This bit must be '1' for the src_ipaddr field to be
25725          * configured.
25726          */
25727         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
25728                 UINT32_C(0x20)
25729         /*
25730          * This bit must be '1' for the src_ipaddr_mask field to be
25731          * configured.
25732          */
25733         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK \
25734                 UINT32_C(0x40)
25735         /*
25736          * This bit must be '1' for the dst_ipaddr field to be
25737          * configured.
25738          */
25739         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
25740                 UINT32_C(0x80)
25741         /*
25742          * This bit must be '1' for the dst_ipaddr_mask field to be
25743          * configured.
25744          */
25745         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK \
25746                 UINT32_C(0x100)
25747         /*
25748          * This bit must be '1' for the ip_protocol field to be
25749          * configured.
25750          */
25751         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
25752                 UINT32_C(0x200)
25753         /*
25754          * This bit must be '1' for the src_port field to be
25755          * configured.
25756          */
25757         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
25758                 UINT32_C(0x400)
25759         /*
25760          * This bit must be '1' for the src_port_mask field to be
25761          * configured.
25762          */
25763         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK \
25764                 UINT32_C(0x800)
25765         /*
25766          * This bit must be '1' for the dst_port field to be
25767          * configured.
25768          */
25769         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
25770                 UINT32_C(0x1000)
25771         /*
25772          * This bit must be '1' for the dst_port_mask field to be
25773          * configured.
25774          */
25775         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK \
25776                 UINT32_C(0x2000)
25777         /*
25778          * This bit must be '1' for the pri_hint field to be
25779          * configured.
25780          */
25781         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT \
25782                 UINT32_C(0x4000)
25783         /*
25784          * This bit must be '1' for the ntuple_filter_id field to be
25785          * configured.
25786          */
25787         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID \
25788                 UINT32_C(0x8000)
25789         /*
25790          * This bit must be '1' for the dst_id field to be
25791          * configured.
25792          */
25793         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
25794                 UINT32_C(0x10000)
25795         /*
25796          * This bit must be '1' for the mirror_vnic_id field to be
25797          * configured.
25798          */
25799         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
25800                 UINT32_C(0x20000)
25801         /*
25802          * This bit must be '1' for the dst_macaddr field to be
25803          * configured.
25804          */
25805         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
25806                 UINT32_C(0x40000)
25807         /*
25808          * This bit must be '1' for the rfs_ring_tbl_idx field to be
25809          * configured.
25810          */
25811         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_RFS_RING_TBL_IDX \
25812                 UINT32_C(0x80000)
25813         /*
25814          * This value identifies a set of CFA data structures used for an L2
25815          * context.
25816          */
25817         uint64_t        l2_filter_id;
25818         /*
25819          * This value indicates the source MAC address in
25820          * the Ethernet header.
25821          */
25822         uint8_t src_macaddr[6];
25823         /* This value indicates the ethertype in the Ethernet header. */
25824         uint16_t        ethertype;
25825         /*
25826          * This value indicates the type of IP address.
25827          * 4 - IPv4
25828          * 6 - IPv6
25829          * All others are invalid.
25830          */
25831         uint8_t ip_addr_type;
25832         /* invalid */
25833         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
25834                 UINT32_C(0x0)
25835         /* IPv4 */
25836         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
25837                 UINT32_C(0x4)
25838         /* IPv6 */
25839         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
25840                 UINT32_C(0x6)
25841         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
25842                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
25843         /*
25844          * The value of protocol filed in IP header.
25845          * Applies to UDP and TCP traffic.
25846          * 6 - TCP
25847          * 17 - UDP
25848          */
25849         uint8_t ip_protocol;
25850         /* invalid */
25851         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
25852                 UINT32_C(0x0)
25853         /* TCP */
25854         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
25855                 UINT32_C(0x6)
25856         /* UDP */
25857         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
25858                 UINT32_C(0x11)
25859         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
25860                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
25861         /*
25862          * If set, this value shall represent the
25863          * Logical VNIC ID of the destination VNIC for the RX
25864          * path and network port id of the destination port for
25865          * the TX path.
25866          */
25867         uint16_t        dst_id;
25868         /*
25869          * Logical VNIC ID of the VNIC where traffic is
25870          * mirrored.
25871          */
25872         uint16_t        mirror_vnic_id;
25873         /*
25874          * This value indicates the tunnel type for this filter.
25875          * If this field is not specified, then the filter shall
25876          * apply to both non-tunneled and tunneled packets.
25877          * If this field conflicts with the tunnel_type specified
25878          * in the l2_filter_id, then the HWRM shall return an
25879          * error for this command.
25880          */
25881         uint8_t tunnel_type;
25882         /* Non-tunnel */
25883         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
25884                 UINT32_C(0x0)
25885         /* Virtual eXtensible Local Area Network (VXLAN) */
25886         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
25887                 UINT32_C(0x1)
25888         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25889         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
25890                 UINT32_C(0x2)
25891         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25892         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
25893                 UINT32_C(0x3)
25894         /* IP in IP */
25895         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
25896                 UINT32_C(0x4)
25897         /* Generic Network Virtualization Encapsulation (Geneve) */
25898         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
25899                 UINT32_C(0x5)
25900         /* Multi-Protocol Lable Switching (MPLS) */
25901         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
25902                 UINT32_C(0x6)
25903         /* Stateless Transport Tunnel (STT) */
25904         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
25905                 UINT32_C(0x7)
25906         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25907         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
25908                 UINT32_C(0x8)
25909         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25910         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25911                 UINT32_C(0x9)
25912         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25913         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25914                 UINT32_C(0xa)
25915         /* Use fixed layer 2 ether type of 0xFFFF */
25916         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
25917                 UINT32_C(0xb)
25918         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25919         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25920                 UINT32_C(0xc)
25921         /* Any tunneled traffic */
25922         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25923                 UINT32_C(0xff)
25924         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
25925                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
25926         /*
25927          * This hint is provided to help in placing
25928          * the filter in the filter table.
25929          */
25930         uint8_t pri_hint;
25931         /* No preference */
25932         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
25933                 UINT32_C(0x0)
25934         /* Above the given filter */
25935         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE \
25936                 UINT32_C(0x1)
25937         /* Below the given filter */
25938         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW \
25939                 UINT32_C(0x2)
25940         /* As high as possible */
25941         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST \
25942                 UINT32_C(0x3)
25943         /* As low as possible */
25944         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST \
25945                 UINT32_C(0x4)
25946         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
25947                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
25948         /*
25949          * The value of source IP address to be used in filtering.
25950          * For IPv4, first four bytes represent the IP address.
25951          */
25952         uint32_t        src_ipaddr[4];
25953         /*
25954          * The value of source IP address mask to be used in
25955          * filtering.
25956          * For IPv4, first four bytes represent the IP address mask.
25957          */
25958         uint32_t        src_ipaddr_mask[4];
25959         /*
25960          * The value of destination IP address to be used in filtering.
25961          * For IPv4, first four bytes represent the IP address.
25962          */
25963         uint32_t        dst_ipaddr[4];
25964         /*
25965          * The value of destination IP address mask to be used in
25966          * filtering.
25967          * For IPv4, first four bytes represent the IP address mask.
25968          */
25969         uint32_t        dst_ipaddr_mask[4];
25970         /*
25971          * The value of source port to be used in filtering.
25972          * Applies to UDP and TCP traffic.
25973          */
25974         uint16_t        src_port;
25975         /*
25976          * The value of source port mask to be used in filtering.
25977          * Applies to UDP and TCP traffic.
25978          */
25979         uint16_t        src_port_mask;
25980         /*
25981          * The value of destination port to be used in filtering.
25982          * Applies to UDP and TCP traffic.
25983          */
25984         uint16_t        dst_port;
25985         /*
25986          * The value of destination port mask to be used in
25987          * filtering.
25988          * Applies to UDP and TCP traffic.
25989          */
25990         uint16_t        dst_port_mask;
25991         /*
25992          * This is the ID of the filter that goes along with
25993          * the pri_hint.
25994          */
25995         uint64_t        ntuple_filter_id_hint;
25996         /*
25997          * The value of rfs_ring_tbl_idx to be used for RFS for this filter.
25998          * This index is used in lieu of the RSS hash when selecting the
25999          * index into the RSS table to determine the rx ring.
26000          */
26001         uint16_t        rfs_ring_tbl_idx;
26002         uint8_t unused_0[6];
26003 } __attribute__((packed));
26004
26005 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
26006 struct hwrm_cfa_ntuple_filter_alloc_output {
26007         /* The specific error status for the command. */
26008         uint16_t        error_code;
26009         /* The HWRM command request type. */
26010         uint16_t        req_type;
26011         /* The sequence ID from the original command. */
26012         uint16_t        seq_id;
26013         /* The length of the response data in number of bytes. */
26014         uint16_t        resp_len;
26015         /* This value is an opaque id into CFA data structures. */
26016         uint64_t        ntuple_filter_id;
26017         /*
26018          * The flow id value in bit 0-29 is the actual ID of the flow
26019          * associated with this filter and it shall be used to match
26020          * and associate the flow identifier returned in completion
26021          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
26022          * shall indicate no valid flow id.
26023          */
26024         uint32_t        flow_id;
26025         /* Indicate the flow id value. */
26026         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
26027                 UINT32_C(0x3fffffff)
26028         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
26029         /* Indicate type of the flow. */
26030         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
26031                 UINT32_C(0x40000000)
26032         /*
26033          * If this bit set to 0, then it indicates that the flow is
26034          * internal flow.
26035          */
26036         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
26037                 (UINT32_C(0x0) << 30)
26038         /*
26039          * If this bit is set to 1, then it indicates that the flow is
26040          * external flow.
26041          */
26042         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
26043                 (UINT32_C(0x1) << 30)
26044         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
26045                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
26046         /* Indicate the flow direction. */
26047         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
26048                 UINT32_C(0x80000000)
26049         /* If this bit set to 0, then it indicates rx flow. */
26050         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
26051                 (UINT32_C(0x0) << 31)
26052         /* If this bit is set to 1, then it indicates that tx flow. */
26053         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
26054                 (UINT32_C(0x1) << 31)
26055         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
26056                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
26057         uint8_t unused_0[3];
26058         /*
26059          * This field is used in Output records to indicate that the output
26060          * is completely written to RAM.  This field should be read as '1'
26061          * to indicate that the output has been completely written.
26062          * When writing a command completion or response to an internal processor,
26063          * the order of writes has to be such that this field is written last.
26064          */
26065         uint8_t valid;
26066 } __attribute__((packed));
26067
26068 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
26069 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
26070         /*
26071          * command specific error codes that goes to
26072          * the cmd_err field in Common HWRM Error Response.
26073          */
26074         uint8_t code;
26075         /* Unknown error */
26076         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN \
26077                 UINT32_C(0x0)
26078         /* Unable to complete operation due to conflict with Rx Mask VLAN */
26079         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR \
26080                 UINT32_C(0x1)
26081         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST \
26082                 HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
26083         uint8_t unused_0[7];
26084 } __attribute__((packed));
26085
26086 /*******************************
26087  * hwrm_cfa_ntuple_filter_free *
26088  *******************************/
26089
26090
26091 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
26092 struct hwrm_cfa_ntuple_filter_free_input {
26093         /* The HWRM command request type. */
26094         uint16_t        req_type;
26095         /*
26096          * The completion ring to send the completion event on. This should
26097          * be the NQ ID returned from the `nq_alloc` HWRM command.
26098          */
26099         uint16_t        cmpl_ring;
26100         /*
26101          * The sequence ID is used by the driver for tracking multiple
26102          * commands. This ID is treated as opaque data by the firmware and
26103          * the value is returned in the `hwrm_resp_hdr` upon completion.
26104          */
26105         uint16_t        seq_id;
26106         /*
26107          * The target ID of the command:
26108          * * 0x0-0xFFF8 - The function ID
26109          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26110          * * 0xFFFD - Reserved for user-space HWRM interface
26111          * * 0xFFFF - HWRM
26112          */
26113         uint16_t        target_id;
26114         /*
26115          * A physical address pointer pointing to a host buffer that the
26116          * command's response data will be written. This can be either a host
26117          * physical address (HPA) or a guest physical address (GPA) and must
26118          * point to a physically contiguous block of memory.
26119          */
26120         uint64_t        resp_addr;
26121         /* This value is an opaque id into CFA data structures. */
26122         uint64_t        ntuple_filter_id;
26123 } __attribute__((packed));
26124
26125 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
26126 struct hwrm_cfa_ntuple_filter_free_output {
26127         /* The specific error status for the command. */
26128         uint16_t        error_code;
26129         /* The HWRM command request type. */
26130         uint16_t        req_type;
26131         /* The sequence ID from the original command. */
26132         uint16_t        seq_id;
26133         /* The length of the response data in number of bytes. */
26134         uint16_t        resp_len;
26135         uint8_t unused_0[7];
26136         /*
26137          * This field is used in Output records to indicate that the output
26138          * is completely written to RAM.  This field should be read as '1'
26139          * to indicate that the output has been completely written.
26140          * When writing a command completion or response to an internal processor,
26141          * the order of writes has to be such that this field is written last.
26142          */
26143         uint8_t valid;
26144 } __attribute__((packed));
26145
26146 /******************************
26147  * hwrm_cfa_ntuple_filter_cfg *
26148  ******************************/
26149
26150
26151 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
26152 struct hwrm_cfa_ntuple_filter_cfg_input {
26153         /* The HWRM command request type. */
26154         uint16_t        req_type;
26155         /*
26156          * The completion ring to send the completion event on. This should
26157          * be the NQ ID returned from the `nq_alloc` HWRM command.
26158          */
26159         uint16_t        cmpl_ring;
26160         /*
26161          * The sequence ID is used by the driver for tracking multiple
26162          * commands. This ID is treated as opaque data by the firmware and
26163          * the value is returned in the `hwrm_resp_hdr` upon completion.
26164          */
26165         uint16_t        seq_id;
26166         /*
26167          * The target ID of the command:
26168          * * 0x0-0xFFF8 - The function ID
26169          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26170          * * 0xFFFD - Reserved for user-space HWRM interface
26171          * * 0xFFFF - HWRM
26172          */
26173         uint16_t        target_id;
26174         /*
26175          * A physical address pointer pointing to a host buffer that the
26176          * command's response data will be written. This can be either a host
26177          * physical address (HPA) or a guest physical address (GPA) and must
26178          * point to a physically contiguous block of memory.
26179          */
26180         uint64_t        resp_addr;
26181         uint32_t        enables;
26182         /*
26183          * This bit must be '1' for the new_dst_id field to be
26184          * configured.
26185          */
26186         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID \
26187                 UINT32_C(0x1)
26188         /*
26189          * This bit must be '1' for the new_mirror_vnic_id field to be
26190          * configured.
26191          */
26192         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
26193                 UINT32_C(0x2)
26194         /*
26195          * This bit must be '1' for the new_meter_instance_id field to be
26196          * configured.
26197          */
26198         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
26199                 UINT32_C(0x4)
26200         uint32_t        flags;
26201         /*
26202          * Setting this bit to 1 indicates that dest_id field contains FID.
26203          * Setting this to 0 indicates that dest_id field contains VNIC or VPORT.
26204          */
26205         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_FID \
26206                 UINT32_C(0x1)
26207         /* This value is an opaque id into CFA data structures. */
26208         uint64_t        ntuple_filter_id;
26209         /*
26210          * If set, this value shall represent the new
26211          * Logical VNIC ID of the destination VNIC for the RX
26212          * path and new network port id of the destination port for
26213          * the TX path.
26214          */
26215         uint32_t        new_dst_id;
26216         /*
26217          * New Logical VNIC ID of the VNIC where traffic is
26218          * mirrored.
26219          */
26220         uint32_t        new_mirror_vnic_id;
26221         /*
26222          * New meter to attach to the flow. Specifying the
26223          * invalid instance ID is used to remove any existing
26224          * meter from the flow.
26225          */
26226         uint16_t        new_meter_instance_id;
26227         /*
26228          * A value of 0xfff is considered invalid and implies the
26229          * instance is not configured.
26230          */
26231         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
26232                 UINT32_C(0xffff)
26233         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \
26234                 HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
26235         uint8_t unused_1[6];
26236 } __attribute__((packed));
26237
26238 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
26239 struct hwrm_cfa_ntuple_filter_cfg_output {
26240         /* The specific error status for the command. */
26241         uint16_t        error_code;
26242         /* The HWRM command request type. */
26243         uint16_t        req_type;
26244         /* The sequence ID from the original command. */
26245         uint16_t        seq_id;
26246         /* The length of the response data in number of bytes. */
26247         uint16_t        resp_len;
26248         uint8_t unused_0[7];
26249         /*
26250          * This field is used in Output records to indicate that the output
26251          * is completely written to RAM.  This field should be read as '1'
26252          * to indicate that the output has been completely written.
26253          * When writing a command completion or response to an internal processor,
26254          * the order of writes has to be such that this field is written last.
26255          */
26256         uint8_t valid;
26257 } __attribute__((packed));
26258
26259 /**************************
26260  * hwrm_cfa_em_flow_alloc *
26261  **************************/
26262
26263
26264 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
26265 struct hwrm_cfa_em_flow_alloc_input {
26266         /* The HWRM command request type. */
26267         uint16_t        req_type;
26268         /*
26269          * The completion ring to send the completion event on. This should
26270          * be the NQ ID returned from the `nq_alloc` HWRM command.
26271          */
26272         uint16_t        cmpl_ring;
26273         /*
26274          * The sequence ID is used by the driver for tracking multiple
26275          * commands. This ID is treated as opaque data by the firmware and
26276          * the value is returned in the `hwrm_resp_hdr` upon completion.
26277          */
26278         uint16_t        seq_id;
26279         /*
26280          * The target ID of the command:
26281          * * 0x0-0xFFF8 - The function ID
26282          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26283          * * 0xFFFD - Reserved for user-space HWRM interface
26284          * * 0xFFFF - HWRM
26285          */
26286         uint16_t        target_id;
26287         /*
26288          * A physical address pointer pointing to a host buffer that the
26289          * command's response data will be written. This can be either a host
26290          * physical address (HPA) or a guest physical address (GPA) and must
26291          * point to a physically contiguous block of memory.
26292          */
26293         uint64_t        resp_addr;
26294         uint32_t        flags;
26295         /*
26296          * Enumeration denoting the RX, TX type of the resource.
26297          * This enumeration is used for resources that are similar for both
26298          * TX and RX paths of the chip.
26299          */
26300         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH         UINT32_C(0x1)
26301         /* tx path */
26302         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX        UINT32_C(0x0)
26303         /* rx path */
26304         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX        UINT32_C(0x1)
26305         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST \
26306                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
26307         /*
26308          * Setting of this flag indicates enabling of a byte counter for a given
26309          * flow.
26310          */
26311         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR     UINT32_C(0x2)
26312         /*
26313          * Setting of this flag indicates enabling of a packet counter for a given
26314          * flow.
26315          */
26316         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR      UINT32_C(0x4)
26317         /* Setting of this flag indicates de-capsulation action for the given flow. */
26318         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP        UINT32_C(0x8)
26319         /* Setting of this flag indicates encapsulation action for the given flow. */
26320         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP        UINT32_C(0x10)
26321         /*
26322          * Setting of this flag indicates drop action. If this flag is not set,
26323          * then it should be considered accept action.
26324          */
26325         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP         UINT32_C(0x20)
26326         /*
26327          * Setting of this flag indicates that a meter is expected to be attached
26328          * to this flow. This hint can be used when choosing the action record
26329          * format required for the flow.
26330          */
26331         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER        UINT32_C(0x40)
26332         uint32_t        enables;
26333         /*
26334          * This bit must be '1' for the l2_filter_id field to be
26335          * configured.
26336          */
26337         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
26338                 UINT32_C(0x1)
26339         /*
26340          * This bit must be '1' for the tunnel_type field to be
26341          * configured.
26342          */
26343         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
26344                 UINT32_C(0x2)
26345         /*
26346          * This bit must be '1' for the tunnel_id field to be
26347          * configured.
26348          */
26349         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID \
26350                 UINT32_C(0x4)
26351         /*
26352          * This bit must be '1' for the src_macaddr field to be
26353          * configured.
26354          */
26355         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR \
26356                 UINT32_C(0x8)
26357         /*
26358          * This bit must be '1' for the dst_macaddr field to be
26359          * configured.
26360          */
26361         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR \
26362                 UINT32_C(0x10)
26363         /*
26364          * This bit must be '1' for the ovlan_vid field to be
26365          * configured.
26366          */
26367         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID \
26368                 UINT32_C(0x20)
26369         /*
26370          * This bit must be '1' for the ivlan_vid field to be
26371          * configured.
26372          */
26373         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID \
26374                 UINT32_C(0x40)
26375         /*
26376          * This bit must be '1' for the ethertype field to be
26377          * configured.
26378          */
26379         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE \
26380                 UINT32_C(0x80)
26381         /*
26382          * This bit must be '1' for the src_ipaddr field to be
26383          * configured.
26384          */
26385         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR \
26386                 UINT32_C(0x100)
26387         /*
26388          * This bit must be '1' for the dst_ipaddr field to be
26389          * configured.
26390          */
26391         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR \
26392                 UINT32_C(0x200)
26393         /*
26394          * This bit must be '1' for the ipaddr_type field to be
26395          * configured.
26396          */
26397         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
26398                 UINT32_C(0x400)
26399         /*
26400          * This bit must be '1' for the ip_protocol field to be
26401          * configured.
26402          */
26403         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
26404                 UINT32_C(0x800)
26405         /*
26406          * This bit must be '1' for the src_port field to be
26407          * configured.
26408          */
26409         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT \
26410                 UINT32_C(0x1000)
26411         /*
26412          * This bit must be '1' for the dst_port field to be
26413          * configured.
26414          */
26415         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT \
26416                 UINT32_C(0x2000)
26417         /*
26418          * This bit must be '1' for the dst_id field to be
26419          * configured.
26420          */
26421         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID \
26422                 UINT32_C(0x4000)
26423         /*
26424          * This bit must be '1' for the mirror_vnic_id field to be
26425          * configured.
26426          */
26427         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
26428                 UINT32_C(0x8000)
26429         /*
26430          * This bit must be '1' for the encap_record_id field to be
26431          * configured.
26432          */
26433         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID \
26434                 UINT32_C(0x10000)
26435         /*
26436          * This bit must be '1' for the meter_instance_id field to be
26437          * configured.
26438          */
26439         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID \
26440                 UINT32_C(0x20000)
26441         /*
26442          * This value identifies a set of CFA data structures used for an L2
26443          * context.
26444          */
26445         uint64_t        l2_filter_id;
26446         /* Tunnel Type. */
26447         uint8_t tunnel_type;
26448         /* Non-tunnel */
26449         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
26450                 UINT32_C(0x0)
26451         /* Virtual eXtensible Local Area Network (VXLAN) */
26452         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
26453                 UINT32_C(0x1)
26454         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
26455         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
26456                 UINT32_C(0x2)
26457         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
26458         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
26459                 UINT32_C(0x3)
26460         /* IP in IP */
26461         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
26462                 UINT32_C(0x4)
26463         /* Generic Network Virtualization Encapsulation (Geneve) */
26464         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
26465                 UINT32_C(0x5)
26466         /* Multi-Protocol Lable Switching (MPLS) */
26467         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
26468                 UINT32_C(0x6)
26469         /* Stateless Transport Tunnel (STT) */
26470         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
26471                 UINT32_C(0x7)
26472         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
26473         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
26474                 UINT32_C(0x8)
26475         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
26476         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
26477                 UINT32_C(0x9)
26478         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
26479         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
26480                 UINT32_C(0xa)
26481         /* Use fixed layer 2 ether type of 0xFFFF */
26482         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
26483                 UINT32_C(0xb)
26484         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
26485         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
26486                 UINT32_C(0xc)
26487         /* Any tunneled traffic */
26488         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
26489                 UINT32_C(0xff)
26490         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
26491                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
26492         uint8_t unused_0[3];
26493         /*
26494          * Tunnel identifier.
26495          * Virtual Network Identifier (VNI). Only valid with
26496          * tunnel_types VXLAN, NVGRE, and Geneve.
26497          * Only lower 24-bits of VNI field are used
26498          * in setting up the filter.
26499          */
26500         uint32_t        tunnel_id;
26501         /*
26502          * This value indicates the source MAC address in
26503          * the Ethernet header.
26504          */
26505         uint8_t src_macaddr[6];
26506         /* The meter instance to attach to the flow. */
26507         uint16_t        meter_instance_id;
26508         /*
26509          * A value of 0xfff is considered invalid and implies the
26510          * instance is not configured.
26511          */
26512         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID \
26513                 UINT32_C(0xffff)
26514         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST \
26515                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
26516         /*
26517          * This value indicates the destination MAC address in
26518          * the Ethernet header.
26519          */
26520         uint8_t dst_macaddr[6];
26521         /*
26522          * This value indicates the VLAN ID of the outer VLAN tag
26523          * in the Ethernet header.
26524          */
26525         uint16_t        ovlan_vid;
26526         /*
26527          * This value indicates the VLAN ID of the inner VLAN tag
26528          * in the Ethernet header.
26529          */
26530         uint16_t        ivlan_vid;
26531         /* This value indicates the ethertype in the Ethernet header. */
26532         uint16_t        ethertype;
26533         /*
26534          * This value indicates the type of IP address.
26535          * 4 - IPv4
26536          * 6 - IPv6
26537          * All others are invalid.
26538          */
26539         uint8_t ip_addr_type;
26540         /* invalid */
26541         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
26542         /* IPv4 */
26543         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4    UINT32_C(0x4)
26544         /* IPv6 */
26545         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6    UINT32_C(0x6)
26546         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
26547                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
26548         /*
26549          * The value of protocol filed in IP header.
26550          * Applies to UDP and TCP traffic.
26551          * 6 - TCP
26552          * 17 - UDP
26553          */
26554         uint8_t ip_protocol;
26555         /* invalid */
26556         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
26557         /* TCP */
26558         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP     UINT32_C(0x6)
26559         /* UDP */
26560         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP     UINT32_C(0x11)
26561         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST \
26562                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
26563         uint8_t unused_1[2];
26564         /*
26565          * The value of source IP address to be used in filtering.
26566          * For IPv4, first four bytes represent the IP address.
26567          */
26568         uint32_t        src_ipaddr[4];
26569         /*
26570          * big_endian = True
26571          *     The value of destination IP address to be used in filtering.
26572          *     For IPv4, first four bytes represent the IP address.
26573          */
26574         uint32_t        dst_ipaddr[4];
26575         /*
26576          * The value of source port to be used in filtering.
26577          * Applies to UDP and TCP traffic.
26578          */
26579         uint16_t        src_port;
26580         /*
26581          * The value of destination port to be used in filtering.
26582          * Applies to UDP and TCP traffic.
26583          */
26584         uint16_t        dst_port;
26585         /*
26586          * If set, this value shall represent the
26587          * Logical VNIC ID of the destination VNIC for the RX
26588          * path and network port id of the destination port for
26589          * the TX path.
26590          */
26591         uint16_t        dst_id;
26592         /*
26593          * Logical VNIC ID of the VNIC where traffic is
26594          * mirrored.
26595          */
26596         uint16_t        mirror_vnic_id;
26597         /* Logical ID of the encapsulation record. */
26598         uint32_t        encap_record_id;
26599         uint8_t unused_2[4];
26600 } __attribute__((packed));
26601
26602 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
26603 struct hwrm_cfa_em_flow_alloc_output {
26604         /* The specific error status for the command. */
26605         uint16_t        error_code;
26606         /* The HWRM command request type. */
26607         uint16_t        req_type;
26608         /* The sequence ID from the original command. */
26609         uint16_t        seq_id;
26610         /* The length of the response data in number of bytes. */
26611         uint16_t        resp_len;
26612         /* This value is an opaque id into CFA data structures. */
26613         uint64_t        em_filter_id;
26614         /*
26615          * The flow id value in bit 0-29 is the actual ID of the flow
26616          * associated with this filter and it shall be used to match
26617          * and associate the flow identifier returned in completion
26618          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
26619          * shall indicate no valid flow id.
26620          */
26621         uint32_t        flow_id;
26622         /* Indicate the flow id value. */
26623         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
26624                 UINT32_C(0x3fffffff)
26625         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
26626         /* Indicate type of the flow. */
26627         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
26628                 UINT32_C(0x40000000)
26629         /*
26630          * If this bit set to 0, then it indicates that the flow is
26631          * internal flow.
26632          */
26633         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
26634                 (UINT32_C(0x0) << 30)
26635         /*
26636          * If this bit is set to 1, then it indicates that the flow is
26637          * external flow.
26638          */
26639         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
26640                 (UINT32_C(0x1) << 30)
26641         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
26642                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
26643         /* Indicate the flow direction. */
26644         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
26645                 UINT32_C(0x80000000)
26646         /* If this bit set to 0, then it indicates rx flow. */
26647         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
26648                 (UINT32_C(0x0) << 31)
26649         /* If this bit is set to 1, then it indicates that tx flow. */
26650         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
26651                 (UINT32_C(0x1) << 31)
26652         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
26653                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
26654         uint8_t unused_0[3];
26655         /*
26656          * This field is used in Output records to indicate that the output
26657          * is completely written to RAM.  This field should be read as '1'
26658          * to indicate that the output has been completely written.
26659          * When writing a command completion or response to an internal processor,
26660          * the order of writes has to be such that this field is written last.
26661          */
26662         uint8_t valid;
26663 } __attribute__((packed));
26664
26665 /*************************
26666  * hwrm_cfa_em_flow_free *
26667  *************************/
26668
26669
26670 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
26671 struct hwrm_cfa_em_flow_free_input {
26672         /* The HWRM command request type. */
26673         uint16_t        req_type;
26674         /*
26675          * The completion ring to send the completion event on. This should
26676          * be the NQ ID returned from the `nq_alloc` HWRM command.
26677          */
26678         uint16_t        cmpl_ring;
26679         /*
26680          * The sequence ID is used by the driver for tracking multiple
26681          * commands. This ID is treated as opaque data by the firmware and
26682          * the value is returned in the `hwrm_resp_hdr` upon completion.
26683          */
26684         uint16_t        seq_id;
26685         /*
26686          * The target ID of the command:
26687          * * 0x0-0xFFF8 - The function ID
26688          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26689          * * 0xFFFD - Reserved for user-space HWRM interface
26690          * * 0xFFFF - HWRM
26691          */
26692         uint16_t        target_id;
26693         /*
26694          * A physical address pointer pointing to a host buffer that the
26695          * command's response data will be written. This can be either a host
26696          * physical address (HPA) or a guest physical address (GPA) and must
26697          * point to a physically contiguous block of memory.
26698          */
26699         uint64_t        resp_addr;
26700         /* This value is an opaque id into CFA data structures. */
26701         uint64_t        em_filter_id;
26702 } __attribute__((packed));
26703
26704 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
26705 struct hwrm_cfa_em_flow_free_output {
26706         /* The specific error status for the command. */
26707         uint16_t        error_code;
26708         /* The HWRM command request type. */
26709         uint16_t        req_type;
26710         /* The sequence ID from the original command. */
26711         uint16_t        seq_id;
26712         /* The length of the response data in number of bytes. */
26713         uint16_t        resp_len;
26714         uint8_t unused_0[7];
26715         /*
26716          * This field is used in Output records to indicate that the output
26717          * is completely written to RAM.  This field should be read as '1'
26718          * to indicate that the output has been completely written.
26719          * When writing a command completion or response to an internal processor,
26720          * the order of writes has to be such that this field is written last.
26721          */
26722         uint8_t valid;
26723 } __attribute__((packed));
26724
26725 /************************
26726  * hwrm_cfa_meter_qcaps *
26727  ************************/
26728
26729
26730 /* hwrm_cfa_meter_qcaps_input (size:128b/16B) */
26731 struct hwrm_cfa_meter_qcaps_input {
26732         /* The HWRM command request type. */
26733         uint16_t        req_type;
26734         /*
26735          * The completion ring to send the completion event on. This should
26736          * be the NQ ID returned from the `nq_alloc` HWRM command.
26737          */
26738         uint16_t        cmpl_ring;
26739         /*
26740          * The sequence ID is used by the driver for tracking multiple
26741          * commands. This ID is treated as opaque data by the firmware and
26742          * the value is returned in the `hwrm_resp_hdr` upon completion.
26743          */
26744         uint16_t        seq_id;
26745         /*
26746          * The target ID of the command:
26747          * * 0x0-0xFFF8 - The function ID
26748          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26749          * * 0xFFFD - Reserved for user-space HWRM interface
26750          * * 0xFFFF - HWRM
26751          */
26752         uint16_t        target_id;
26753         /*
26754          * A physical address pointer pointing to a host buffer that the
26755          * command's response data will be written. This can be either a host
26756          * physical address (HPA) or a guest physical address (GPA) and must
26757          * point to a physically contiguous block of memory.
26758          */
26759         uint64_t        resp_addr;
26760 } __attribute__((packed));
26761
26762 /* hwrm_cfa_meter_qcaps_output (size:320b/40B) */
26763 struct hwrm_cfa_meter_qcaps_output {
26764         /* The specific error status for the command. */
26765         uint16_t        error_code;
26766         /* The HWRM command request type. */
26767         uint16_t        req_type;
26768         /* The sequence ID from the original command. */
26769         uint16_t        seq_id;
26770         /* The length of the response data in number of bytes. */
26771         uint16_t        resp_len;
26772         uint32_t        flags;
26773         /*
26774          * Enumeration denoting the clock at which the Meter is running with.
26775          * This enumeration is used for resources that are similar for both
26776          * TX and RX paths of the chip.
26777          */
26778         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_MASK  UINT32_C(0xf)
26779         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_SFT   0
26780         /* 375 MHz */
26781         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_375MHZ  UINT32_C(0x0)
26782         /* 625 MHz */
26783         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ  UINT32_C(0x1)
26784         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_LAST \
26785                 HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ
26786         uint8_t unused_0[4];
26787         /*
26788          * The minimum guaranteed number of tx meter profiles supported
26789          * for this function.
26790          */
26791         uint16_t        min_tx_profile;
26792         /*
26793          * The maximum non-guaranteed number of tx meter profiles supported
26794          * for this function.
26795          */
26796         uint16_t        max_tx_profile;
26797         /*
26798          * The minimum guaranteed number of rx meter profiles supported
26799          * for this function.
26800          */
26801         uint16_t        min_rx_profile;
26802         /*
26803          * The maximum non-guaranteed number of rx meter profiles supported
26804          * for this function.
26805          */
26806         uint16_t        max_rx_profile;
26807         /*
26808          * The minimum guaranteed number of tx meter instances supported
26809          * for this function.
26810          */
26811         uint16_t        min_tx_instance;
26812         /*
26813          * The maximum non-guaranteed number of tx meter instances supported
26814          * for this function.
26815          */
26816         uint16_t        max_tx_instance;
26817         /*
26818          * The minimum guaranteed number of rx meter instances supported
26819          * for this function.
26820          */
26821         uint16_t        min_rx_instance;
26822         /*
26823          * The maximum non-guaranteed number of rx meter instances supported
26824          * for this function.
26825          */
26826         uint16_t        max_rx_instance;
26827         uint8_t unused_1[7];
26828         /*
26829          * This field is used in Output records to indicate that the output
26830          * is completely written to RAM.  This field should be read as '1'
26831          * to indicate that the output has been completely written.
26832          * When writing a command completion or response to an internal processor,
26833          * the order of writes has to be such that this field is written last.
26834          */
26835         uint8_t valid;
26836 } __attribute__((packed));
26837
26838 /********************************
26839  * hwrm_cfa_meter_profile_alloc *
26840  ********************************/
26841
26842
26843 /* hwrm_cfa_meter_profile_alloc_input (size:320b/40B) */
26844 struct hwrm_cfa_meter_profile_alloc_input {
26845         /* The HWRM command request type. */
26846         uint16_t        req_type;
26847         /*
26848          * The completion ring to send the completion event on. This should
26849          * be the NQ ID returned from the `nq_alloc` HWRM command.
26850          */
26851         uint16_t        cmpl_ring;
26852         /*
26853          * The sequence ID is used by the driver for tracking multiple
26854          * commands. This ID is treated as opaque data by the firmware and
26855          * the value is returned in the `hwrm_resp_hdr` upon completion.
26856          */
26857         uint16_t        seq_id;
26858         /*
26859          * The target ID of the command:
26860          * * 0x0-0xFFF8 - The function ID
26861          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26862          * * 0xFFFD - Reserved for user-space HWRM interface
26863          * * 0xFFFF - HWRM
26864          */
26865         uint16_t        target_id;
26866         /*
26867          * A physical address pointer pointing to a host buffer that the
26868          * command's response data will be written. This can be either a host
26869          * physical address (HPA) or a guest physical address (GPA) and must
26870          * point to a physically contiguous block of memory.
26871          */
26872         uint64_t        resp_addr;
26873         uint8_t flags;
26874         /*
26875          * Enumeration denoting the RX, TX type of the resource.
26876          * This enumeration is used for resources that are similar for both
26877          * TX and RX paths of the chip.
26878          */
26879         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH     UINT32_C(0x1)
26880         /* tx path */
26881         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX \
26882                 UINT32_C(0x0)
26883         /* rx path */
26884         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX \
26885                 UINT32_C(0x1)
26886         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST \
26887                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
26888         /* The meter algorithm type. */
26889         uint8_t meter_type;
26890         /* RFC 2697 (srTCM) */
26891         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 \
26892                 UINT32_C(0x0)
26893         /* RFC 2698 (trTCM) */
26894         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 \
26895                 UINT32_C(0x1)
26896         /* RFC 4115 (trTCM) */
26897         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 \
26898                 UINT32_C(0x2)
26899         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_LAST \
26900                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115
26901         /*
26902          * This field is reserved for the future use.
26903          * It shall be set to 0.
26904          */
26905         uint16_t        reserved1;
26906         /*
26907          * This field is reserved for the future use.
26908          * It shall be set to 0.
26909          */
26910         uint32_t        reserved2;
26911         /* A meter rate specified in bytes-per-second. */
26912         uint32_t        commit_rate;
26913         /* The bandwidth value. */
26914         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK \
26915                 UINT32_C(0xfffffff)
26916         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT \
26917                 0
26918         /* The granularity of the value (bits or bytes). */
26919         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE \
26920                 UINT32_C(0x10000000)
26921         /* Value is in bits. */
26922         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS \
26923                 (UINT32_C(0x0) << 28)
26924         /* Value is in bytes. */
26925         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES \
26926                 (UINT32_C(0x1) << 28)
26927         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST \
26928                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
26929         /* bw_value_unit is 3 b */
26930         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
26931                 UINT32_C(0xe0000000)
26932         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
26933                 29
26934         /* Value is in Mb or MB (base 10). */
26935         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
26936                 (UINT32_C(0x0) << 29)
26937         /* Value is in Kb or KB (base 10). */
26938         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
26939                 (UINT32_C(0x2) << 29)
26940         /* Value is in bits or bytes. */
26941         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
26942                 (UINT32_C(0x4) << 29)
26943         /* Value is in Gb or GB (base 10). */
26944         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
26945                 (UINT32_C(0x6) << 29)
26946         /* Value is in 1/100th of a percentage of total bandwidth. */
26947         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
26948                 (UINT32_C(0x1) << 29)
26949         /* Raw value */
26950         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
26951                 (UINT32_C(0x7) << 29)
26952         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
26953                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
26954         /* A meter burst size specified in bytes. */
26955         uint32_t        commit_burst;
26956         /* The bandwidth value. */
26957         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK \
26958                 UINT32_C(0xfffffff)
26959         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT \
26960                 0
26961         /* The granularity of the value (bits or bytes). */
26962         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE \
26963                 UINT32_C(0x10000000)
26964         /* Value is in bits. */
26965         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS \
26966                 (UINT32_C(0x0) << 28)
26967         /* Value is in bytes. */
26968         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES \
26969                 (UINT32_C(0x1) << 28)
26970         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST \
26971                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
26972         /* bw_value_unit is 3 b */
26973         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
26974                 UINT32_C(0xe0000000)
26975         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
26976                 29
26977         /* Value is in Mb or MB (base 10). */
26978         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
26979                 (UINT32_C(0x0) << 29)
26980         /* Value is in Kb or KB (base 10). */
26981         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
26982                 (UINT32_C(0x2) << 29)
26983         /* Value is in bits or bytes. */
26984         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
26985                 (UINT32_C(0x4) << 29)
26986         /* Value is in Gb or GB (base 10). */
26987         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
26988                 (UINT32_C(0x6) << 29)
26989         /* Value is in 1/100th of a percentage of total bandwidth. */
26990         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
26991                 (UINT32_C(0x1) << 29)
26992         /* Invalid value */
26993         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
26994                 (UINT32_C(0x7) << 29)
26995         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
26996                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
26997         /* A meter rate specified in bytes-per-second. */
26998         uint32_t        excess_peak_rate;
26999         /* The bandwidth value. */
27000         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
27001                 UINT32_C(0xfffffff)
27002         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
27003                 0
27004         /* The granularity of the value (bits or bytes). */
27005         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE \
27006                 UINT32_C(0x10000000)
27007         /* Value is in bits. */
27008         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
27009                 (UINT32_C(0x0) << 28)
27010         /* Value is in bytes. */
27011         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
27012                 (UINT32_C(0x1) << 28)
27013         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
27014                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
27015         /* bw_value_unit is 3 b */
27016         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
27017                 UINT32_C(0xe0000000)
27018         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
27019                 29
27020         /* Value is in Mb or MB (base 10). */
27021         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
27022                 (UINT32_C(0x0) << 29)
27023         /* Value is in Kb or KB (base 10). */
27024         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
27025                 (UINT32_C(0x2) << 29)
27026         /* Value is in bits or bytes. */
27027         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
27028                 (UINT32_C(0x4) << 29)
27029         /* Value is in Gb or GB (base 10). */
27030         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
27031                 (UINT32_C(0x6) << 29)
27032         /* Value is in 1/100th of a percentage of total bandwidth. */
27033         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
27034                 (UINT32_C(0x1) << 29)
27035         /* Raw unit */
27036         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
27037                 (UINT32_C(0x7) << 29)
27038         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
27039                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
27040         /* A meter burst size specified in bytes. */
27041         uint32_t        excess_peak_burst;
27042         /* The bandwidth value. */
27043         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
27044                 UINT32_C(0xfffffff)
27045         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
27046                 0
27047         /* The granularity of the value (bits or bytes). */
27048         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE \
27049                 UINT32_C(0x10000000)
27050         /* Value is in bits. */
27051         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
27052                 (UINT32_C(0x0) << 28)
27053         /* Value is in bytes. */
27054         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
27055                 (UINT32_C(0x1) << 28)
27056         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
27057                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
27058         /* bw_value_unit is 3 b */
27059         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
27060                 UINT32_C(0xe0000000)
27061         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
27062                 29
27063         /* Value is in Mb or MB (base 10). */
27064         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
27065                 (UINT32_C(0x0) << 29)
27066         /* Value is in Kb or KB (base 10). */
27067         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
27068                 (UINT32_C(0x2) << 29)
27069         /* Value is in bits or bytes. */
27070         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
27071                 (UINT32_C(0x4) << 29)
27072         /* Value is in Gb or GB (base 10). */
27073         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
27074                 (UINT32_C(0x6) << 29)
27075         /* Value is in 1/100th of a percentage of total bandwidth. */
27076         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27077                 (UINT32_C(0x1) << 29)
27078         /* Invalid unit */
27079         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
27080                 (UINT32_C(0x7) << 29)
27081         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
27082                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
27083 } __attribute__((packed));
27084
27085 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
27086 struct hwrm_cfa_meter_profile_alloc_output {
27087         /* The specific error status for the command. */
27088         uint16_t        error_code;
27089         /* The HWRM command request type. */
27090         uint16_t        req_type;
27091         /* The sequence ID from the original command. */
27092         uint16_t        seq_id;
27093         /* The length of the response data in number of bytes. */
27094         uint16_t        resp_len;
27095         /* This value identifies a meter profile in CFA. */
27096         uint16_t        meter_profile_id;
27097         /*
27098          * A value of 0xfff is considered invalid and implies the
27099          * profile is not configured.
27100          */
27101         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID \
27102                 UINT32_C(0xffff)
27103         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_LAST \
27104                 HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID
27105         uint8_t unused_0[5];
27106         /*
27107          * This field is used in Output records to indicate that the output
27108          * is completely written to RAM.  This field should be read as '1'
27109          * to indicate that the output has been completely written.
27110          * When writing a command completion or response to an internal processor,
27111          * the order of writes has to be such that this field is written last.
27112          */
27113         uint8_t valid;
27114 } __attribute__((packed));
27115
27116 /*******************************
27117  * hwrm_cfa_meter_profile_free *
27118  *******************************/
27119
27120
27121 /* hwrm_cfa_meter_profile_free_input (size:192b/24B) */
27122 struct hwrm_cfa_meter_profile_free_input {
27123         /* The HWRM command request type. */
27124         uint16_t        req_type;
27125         /*
27126          * The completion ring to send the completion event on. This should
27127          * be the NQ ID returned from the `nq_alloc` HWRM command.
27128          */
27129         uint16_t        cmpl_ring;
27130         /*
27131          * The sequence ID is used by the driver for tracking multiple
27132          * commands. This ID is treated as opaque data by the firmware and
27133          * the value is returned in the `hwrm_resp_hdr` upon completion.
27134          */
27135         uint16_t        seq_id;
27136         /*
27137          * The target ID of the command:
27138          * * 0x0-0xFFF8 - The function ID
27139          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27140          * * 0xFFFD - Reserved for user-space HWRM interface
27141          * * 0xFFFF - HWRM
27142          */
27143         uint16_t        target_id;
27144         /*
27145          * A physical address pointer pointing to a host buffer that the
27146          * command's response data will be written. This can be either a host
27147          * physical address (HPA) or a guest physical address (GPA) and must
27148          * point to a physically contiguous block of memory.
27149          */
27150         uint64_t        resp_addr;
27151         uint8_t flags;
27152         /*
27153          * Enumeration denoting the RX, TX type of the resource.
27154          * This enumeration is used for resources that are similar for both
27155          * TX and RX paths of the chip.
27156          */
27157         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
27158         /* tx path */
27159         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX \
27160                 UINT32_C(0x0)
27161         /* rx path */
27162         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX \
27163                 UINT32_C(0x1)
27164         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST \
27165                 HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
27166         uint8_t unused_0;
27167         /* This value identifies a meter profile in CFA. */
27168         uint16_t        meter_profile_id;
27169         /*
27170          * A value of 0xfff is considered invalid and implies the
27171          * profile is not configured.
27172          */
27173         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID \
27174                 UINT32_C(0xffff)
27175         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST \
27176                 HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
27177         uint8_t unused_1[4];
27178 } __attribute__((packed));
27179
27180 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
27181 struct hwrm_cfa_meter_profile_free_output {
27182         /* The specific error status for the command. */
27183         uint16_t        error_code;
27184         /* The HWRM command request type. */
27185         uint16_t        req_type;
27186         /* The sequence ID from the original command. */
27187         uint16_t        seq_id;
27188         /* The length of the response data in number of bytes. */
27189         uint16_t        resp_len;
27190         uint8_t unused_0[7];
27191         /*
27192          * This field is used in Output records to indicate that the output
27193          * is completely written to RAM.  This field should be read as '1'
27194          * to indicate that the output has been completely written.
27195          * When writing a command completion or response to an internal processor,
27196          * the order of writes has to be such that this field is written last.
27197          */
27198         uint8_t valid;
27199 } __attribute__((packed));
27200
27201 /******************************
27202  * hwrm_cfa_meter_profile_cfg *
27203  ******************************/
27204
27205
27206 /* hwrm_cfa_meter_profile_cfg_input (size:320b/40B) */
27207 struct hwrm_cfa_meter_profile_cfg_input {
27208         /* The HWRM command request type. */
27209         uint16_t        req_type;
27210         /*
27211          * The completion ring to send the completion event on. This should
27212          * be the NQ ID returned from the `nq_alloc` HWRM command.
27213          */
27214         uint16_t        cmpl_ring;
27215         /*
27216          * The sequence ID is used by the driver for tracking multiple
27217          * commands. This ID is treated as opaque data by the firmware and
27218          * the value is returned in the `hwrm_resp_hdr` upon completion.
27219          */
27220         uint16_t        seq_id;
27221         /*
27222          * The target ID of the command:
27223          * * 0x0-0xFFF8 - The function ID
27224          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27225          * * 0xFFFD - Reserved for user-space HWRM interface
27226          * * 0xFFFF - HWRM
27227          */
27228         uint16_t        target_id;
27229         /*
27230          * A physical address pointer pointing to a host buffer that the
27231          * command's response data will be written. This can be either a host
27232          * physical address (HPA) or a guest physical address (GPA) and must
27233          * point to a physically contiguous block of memory.
27234          */
27235         uint64_t        resp_addr;
27236         uint8_t flags;
27237         /*
27238          * Enumeration denoting the RX, TX type of the resource.
27239          * This enumeration is used for resources that are similar for both
27240          * TX and RX paths of the chip.
27241          */
27242         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
27243         /* tx path */
27244         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
27245         /* rx path */
27246         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
27247         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST \
27248                 HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
27249         /* The meter algorithm type. */
27250         uint8_t meter_type;
27251         /* RFC 2697 (srTCM) */
27252         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 \
27253                 UINT32_C(0x0)
27254         /* RFC 2698 (trTCM) */
27255         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 \
27256                 UINT32_C(0x1)
27257         /* RFC 4115 (trTCM) */
27258         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 \
27259                 UINT32_C(0x2)
27260         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_LAST \
27261                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115
27262         /* This value identifies a meter profile in CFA. */
27263         uint16_t        meter_profile_id;
27264         /*
27265          * A value of 0xfff is considered invalid and implies the
27266          * profile is not configured.
27267          */
27268         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID \
27269                 UINT32_C(0xffff)
27270         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_LAST \
27271                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID
27272         /*
27273          * This field is reserved for the future use.
27274          * It shall be set to 0.
27275          */
27276         uint32_t        reserved;
27277         /* A meter rate specified in bytes-per-second. */
27278         uint32_t        commit_rate;
27279         /* The bandwidth value. */
27280         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK \
27281                 UINT32_C(0xfffffff)
27282         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT \
27283                 0
27284         /* The granularity of the value (bits or bytes). */
27285         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE \
27286                 UINT32_C(0x10000000)
27287         /* Value is in bits. */
27288         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS \
27289                 (UINT32_C(0x0) << 28)
27290         /* Value is in bytes. */
27291         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES \
27292                 (UINT32_C(0x1) << 28)
27293         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST \
27294                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
27295         /* bw_value_unit is 3 b */
27296         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
27297                 UINT32_C(0xe0000000)
27298         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
27299                 29
27300         /* Value is in Mb or MB (base 10). */
27301         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
27302                 (UINT32_C(0x0) << 29)
27303         /* Value is in Kb or KB (base 10). */
27304         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
27305                 (UINT32_C(0x2) << 29)
27306         /* Value is in bits or bytes. */
27307         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
27308                 (UINT32_C(0x4) << 29)
27309         /* Value is in Gb or GB (base 10). */
27310         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
27311                 (UINT32_C(0x6) << 29)
27312         /* Value is in 1/100th of a percentage of total bandwidth. */
27313         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
27314                 (UINT32_C(0x1) << 29)
27315         /* Raw value */
27316         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
27317                 (UINT32_C(0x7) << 29)
27318         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
27319                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
27320         /* A meter burst size specified in bytes. */
27321         uint32_t        commit_burst;
27322         /* The bandwidth value. */
27323         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK \
27324                 UINT32_C(0xfffffff)
27325         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT \
27326                 0
27327         /* The granularity of the value (bits or bytes). */
27328         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE \
27329                 UINT32_C(0x10000000)
27330         /* Value is in bits. */
27331         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS \
27332                 (UINT32_C(0x0) << 28)
27333         /* Value is in bytes. */
27334         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES \
27335                 (UINT32_C(0x1) << 28)
27336         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST \
27337                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
27338         /* bw_value_unit is 3 b */
27339         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
27340                 UINT32_C(0xe0000000)
27341         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
27342                 29
27343         /* Value is in Mb or MB (base 10). */
27344         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
27345                 (UINT32_C(0x0) << 29)
27346         /* Value is in Kb or KB (base 10). */
27347         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
27348                 (UINT32_C(0x2) << 29)
27349         /* Value is in bits or bytes. */
27350         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
27351                 (UINT32_C(0x4) << 29)
27352         /* Value is in Gb or GB (base 10). */
27353         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
27354                 (UINT32_C(0x6) << 29)
27355         /* Value is in 1/100th of a percentage of total bandwidth. */
27356         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27357                 (UINT32_C(0x1) << 29)
27358         /* Invalid value */
27359         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
27360                 (UINT32_C(0x7) << 29)
27361         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
27362                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
27363         /* A meter rate specified in bytes-per-second. */
27364         uint32_t        excess_peak_rate;
27365         /* The bandwidth value. */
27366         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
27367                 UINT32_C(0xfffffff)
27368         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
27369                 0
27370         /* The granularity of the value (bits or bytes). */
27371         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE \
27372                 UINT32_C(0x10000000)
27373         /* Value is in bits. */
27374         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
27375                 (UINT32_C(0x0) << 28)
27376         /* Value is in bytes. */
27377         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
27378                 (UINT32_C(0x1) << 28)
27379         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
27380                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
27381         /* bw_value_unit is 3 b */
27382         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
27383                 UINT32_C(0xe0000000)
27384         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
27385                 29
27386         /* Value is in Mb or MB (base 10). */
27387         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
27388                 (UINT32_C(0x0) << 29)
27389         /* Value is in Kb or KB (base 10). */
27390         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
27391                 (UINT32_C(0x2) << 29)
27392         /* Value is in bits or bytes. */
27393         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
27394                 (UINT32_C(0x4) << 29)
27395         /* Value is in Gb or GB (base 10). */
27396         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
27397                 (UINT32_C(0x6) << 29)
27398         /* Value is in 1/100th of a percentage of total bandwidth. */
27399         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
27400                 (UINT32_C(0x1) << 29)
27401         /* Raw unit */
27402         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
27403                 (UINT32_C(0x7) << 29)
27404         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
27405                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
27406         /* A meter burst size specified in bytes. */
27407         uint32_t        excess_peak_burst;
27408         /* The bandwidth value. */
27409         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
27410                 UINT32_C(0xfffffff)
27411         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
27412                 0
27413         /* The granularity of the value (bits or bytes). */
27414         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE \
27415                 UINT32_C(0x10000000)
27416         /* Value is in bits. */
27417         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
27418                 (UINT32_C(0x0) << 28)
27419         /* Value is in bytes. */
27420         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
27421                 (UINT32_C(0x1) << 28)
27422         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
27423                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
27424         /* bw_value_unit is 3 b */
27425         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
27426                 UINT32_C(0xe0000000)
27427         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
27428                 29
27429         /* Value is in Mb or MB (base 10). */
27430         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
27431                 (UINT32_C(0x0) << 29)
27432         /* Value is in Kb or KB (base 10). */
27433         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
27434                 (UINT32_C(0x2) << 29)
27435         /* Value is in bits or bytes. */
27436         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
27437                 (UINT32_C(0x4) << 29)
27438         /* Value is in Gb or GB (base 10). */
27439         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
27440                 (UINT32_C(0x6) << 29)
27441         /* Value is in 1/100th of a percentage of total bandwidth. */
27442         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27443                 (UINT32_C(0x1) << 29)
27444         /* Invalid unit */
27445         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
27446                 (UINT32_C(0x7) << 29)
27447         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
27448                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
27449 } __attribute__((packed));
27450
27451 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
27452 struct hwrm_cfa_meter_profile_cfg_output {
27453         /* The specific error status for the command. */
27454         uint16_t        error_code;
27455         /* The HWRM command request type. */
27456         uint16_t        req_type;
27457         /* The sequence ID from the original command. */
27458         uint16_t        seq_id;
27459         /* The length of the response data in number of bytes. */
27460         uint16_t        resp_len;
27461         uint8_t unused_0[7];
27462         /*
27463          * This field is used in Output records to indicate that the output
27464          * is completely written to RAM.  This field should be read as '1'
27465          * to indicate that the output has been completely written.
27466          * When writing a command completion or response to an internal processor,
27467          * the order of writes has to be such that this field is written last.
27468          */
27469         uint8_t valid;
27470 } __attribute__((packed));
27471
27472 /*********************************
27473  * hwrm_cfa_meter_instance_alloc *
27474  *********************************/
27475
27476
27477 /* hwrm_cfa_meter_instance_alloc_input (size:192b/24B) */
27478 struct hwrm_cfa_meter_instance_alloc_input {
27479         /* The HWRM command request type. */
27480         uint16_t        req_type;
27481         /*
27482          * The completion ring to send the completion event on. This should
27483          * be the NQ ID returned from the `nq_alloc` HWRM command.
27484          */
27485         uint16_t        cmpl_ring;
27486         /*
27487          * The sequence ID is used by the driver for tracking multiple
27488          * commands. This ID is treated as opaque data by the firmware and
27489          * the value is returned in the `hwrm_resp_hdr` upon completion.
27490          */
27491         uint16_t        seq_id;
27492         /*
27493          * The target ID of the command:
27494          * * 0x0-0xFFF8 - The function ID
27495          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27496          * * 0xFFFD - Reserved for user-space HWRM interface
27497          * * 0xFFFF - HWRM
27498          */
27499         uint16_t        target_id;
27500         /*
27501          * A physical address pointer pointing to a host buffer that the
27502          * command's response data will be written. This can be either a host
27503          * physical address (HPA) or a guest physical address (GPA) and must
27504          * point to a physically contiguous block of memory.
27505          */
27506         uint64_t        resp_addr;
27507         uint8_t flags;
27508         /*
27509          * Enumeration denoting the RX, TX type of the resource.
27510          * This enumeration is used for resources that are similar for both
27511          * TX and RX paths of the chip.
27512          */
27513         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH \
27514                 UINT32_C(0x1)
27515         /* tx path */
27516         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX \
27517                 UINT32_C(0x0)
27518         /* rx path */
27519         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX \
27520                 UINT32_C(0x1)
27521         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST \
27522                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
27523         uint8_t unused_0;
27524         /* This value identifies a meter profile in CFA. */
27525         uint16_t        meter_profile_id;
27526         /*
27527          * A value of 0xffff is considered invalid and implies the
27528          * profile is not configured.
27529          */
27530         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID \
27531                 UINT32_C(0xffff)
27532         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST \
27533                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
27534         uint8_t unused_1[4];
27535 } __attribute__((packed));
27536
27537 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
27538 struct hwrm_cfa_meter_instance_alloc_output {
27539         /* The specific error status for the command. */
27540         uint16_t        error_code;
27541         /* The HWRM command request type. */
27542         uint16_t        req_type;
27543         /* The sequence ID from the original command. */
27544         uint16_t        seq_id;
27545         /* The length of the response data in number of bytes. */
27546         uint16_t        resp_len;
27547         /* This value identifies a meter instance in CFA. */
27548         uint16_t        meter_instance_id;
27549         /*
27550          * A value of 0xffff is considered invalid and implies the
27551          * instance is not configured.
27552          */
27553         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID \
27554                 UINT32_C(0xffff)
27555         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_LAST \
27556                 HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID
27557         uint8_t unused_0[5];
27558         /*
27559          * This field is used in Output records to indicate that the output
27560          * is completely written to RAM.  This field should be read as '1'
27561          * to indicate that the output has been completely written.
27562          * When writing a command completion or response to an internal processor,
27563          * the order of writes has to be such that this field is written last.
27564          */
27565         uint8_t valid;
27566 } __attribute__((packed));
27567
27568 /*******************************
27569  * hwrm_cfa_meter_instance_cfg *
27570  *******************************/
27571
27572
27573 /* hwrm_cfa_meter_instance_cfg_input (size:192b/24B) */
27574 struct hwrm_cfa_meter_instance_cfg_input {
27575         /* The HWRM command request type. */
27576         uint16_t        req_type;
27577         /*
27578          * The completion ring to send the completion event on. This should
27579          * be the NQ ID returned from the `nq_alloc` HWRM command.
27580          */
27581         uint16_t        cmpl_ring;
27582         /*
27583          * The sequence ID is used by the driver for tracking multiple
27584          * commands. This ID is treated as opaque data by the firmware and
27585          * the value is returned in the `hwrm_resp_hdr` upon completion.
27586          */
27587         uint16_t        seq_id;
27588         /*
27589          * The target ID of the command:
27590          * * 0x0-0xFFF8 - The function ID
27591          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27592          * * 0xFFFD - Reserved for user-space HWRM interface
27593          * * 0xFFFF - HWRM
27594          */
27595         uint16_t        target_id;
27596         /*
27597          * A physical address pointer pointing to a host buffer that the
27598          * command's response data will be written. This can be either a host
27599          * physical address (HPA) or a guest physical address (GPA) and must
27600          * point to a physically contiguous block of memory.
27601          */
27602         uint64_t        resp_addr;
27603         uint8_t flags;
27604         /*
27605          * Enumeration denoting the RX, TX type of the resource.
27606          * This enumeration is used for resources that are similar for both
27607          * TX and RX paths of the chip.
27608          */
27609         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
27610         /* tx path */
27611         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_TX \
27612                 UINT32_C(0x0)
27613         /* rx path */
27614         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX \
27615                 UINT32_C(0x1)
27616         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_LAST \
27617                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX
27618         uint8_t unused_0;
27619         /*
27620          * This value identifies a new meter profile to be associated with
27621          * the meter instance specified in this command.
27622          */
27623         uint16_t        meter_profile_id;
27624         /*
27625          * A value of 0xffff is considered invalid and implies the
27626          * profile is not configured.
27627          */
27628         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID \
27629                 UINT32_C(0xffff)
27630         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_LAST \
27631                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID
27632         /*
27633          * This value identifies the ID of a meter instance that needs to be updated with
27634          * a new meter profile specified in this command.
27635          */
27636         uint16_t        meter_instance_id;
27637         uint8_t unused_1[2];
27638 } __attribute__((packed));
27639
27640 /* hwrm_cfa_meter_instance_cfg_output (size:128b/16B) */
27641 struct hwrm_cfa_meter_instance_cfg_output {
27642         /* The specific error status for the command. */
27643         uint16_t        error_code;
27644         /* The HWRM command request type. */
27645         uint16_t        req_type;
27646         /* The sequence ID from the original command. */
27647         uint16_t        seq_id;
27648         /* The length of the response data in number of bytes. */
27649         uint16_t        resp_len;
27650         uint8_t unused_0[7];
27651         /*
27652          * This field is used in Output records to indicate that the output
27653          * is completely written to RAM.  This field should be read as '1'
27654          * to indicate that the output has been completely written.
27655          * When writing a command completion or response to an internal processor,
27656          * the order of writes has to be such that this field is written last.
27657          */
27658         uint8_t valid;
27659 } __attribute__((packed));
27660
27661 /********************************
27662  * hwrm_cfa_meter_instance_free *
27663  ********************************/
27664
27665
27666 /* hwrm_cfa_meter_instance_free_input (size:192b/24B) */
27667 struct hwrm_cfa_meter_instance_free_input {
27668         /* The HWRM command request type. */
27669         uint16_t        req_type;
27670         /*
27671          * The completion ring to send the completion event on. This should
27672          * be the NQ ID returned from the `nq_alloc` HWRM command.
27673          */
27674         uint16_t        cmpl_ring;
27675         /*
27676          * The sequence ID is used by the driver for tracking multiple
27677          * commands. This ID is treated as opaque data by the firmware and
27678          * the value is returned in the `hwrm_resp_hdr` upon completion.
27679          */
27680         uint16_t        seq_id;
27681         /*
27682          * The target ID of the command:
27683          * * 0x0-0xFFF8 - The function ID
27684          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27685          * * 0xFFFD - Reserved for user-space HWRM interface
27686          * * 0xFFFF - HWRM
27687          */
27688         uint16_t        target_id;
27689         /*
27690          * A physical address pointer pointing to a host buffer that the
27691          * command's response data will be written. This can be either a host
27692          * physical address (HPA) or a guest physical address (GPA) and must
27693          * point to a physically contiguous block of memory.
27694          */
27695         uint64_t        resp_addr;
27696         uint8_t flags;
27697         /*
27698          * Enumeration denoting the RX, TX type of the resource.
27699          * This enumeration is used for resources that are similar for both
27700          * TX and RX paths of the chip.
27701          */
27702         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
27703         /* tx path */
27704         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX \
27705                 UINT32_C(0x0)
27706         /* rx path */
27707         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX \
27708                 UINT32_C(0x1)
27709         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST \
27710                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
27711         uint8_t unused_0;
27712         /* This value identifies a meter instance in CFA. */
27713         uint16_t        meter_instance_id;
27714         /*
27715          * A value of 0xfff is considered invalid and implies the
27716          * instance is not configured.
27717          */
27718         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID \
27719                 UINT32_C(0xffff)
27720         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST \
27721                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
27722         uint8_t unused_1[4];
27723 } __attribute__((packed));
27724
27725 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
27726 struct hwrm_cfa_meter_instance_free_output {
27727         /* The specific error status for the command. */
27728         uint16_t        error_code;
27729         /* The HWRM command request type. */
27730         uint16_t        req_type;
27731         /* The sequence ID from the original command. */
27732         uint16_t        seq_id;
27733         /* The length of the response data in number of bytes. */
27734         uint16_t        resp_len;
27735         uint8_t unused_0[7];
27736         /*
27737          * This field is used in Output records to indicate that the output
27738          * is completely written to RAM.  This field should be read as '1'
27739          * to indicate that the output has been completely written.
27740          * When writing a command completion or response to an internal processor,
27741          * the order of writes has to be such that this field is written last.
27742          */
27743         uint8_t valid;
27744 } __attribute__((packed));
27745
27746 /*******************************
27747  * hwrm_cfa_decap_filter_alloc *
27748  *******************************/
27749
27750
27751 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */
27752 struct hwrm_cfa_decap_filter_alloc_input {
27753         /* The HWRM command request type. */
27754         uint16_t        req_type;
27755         /*
27756          * The completion ring to send the completion event on. This should
27757          * be the NQ ID returned from the `nq_alloc` HWRM command.
27758          */
27759         uint16_t        cmpl_ring;
27760         /*
27761          * The sequence ID is used by the driver for tracking multiple
27762          * commands. This ID is treated as opaque data by the firmware and
27763          * the value is returned in the `hwrm_resp_hdr` upon completion.
27764          */
27765         uint16_t        seq_id;
27766         /*
27767          * The target ID of the command:
27768          * * 0x0-0xFFF8 - The function ID
27769          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27770          * * 0xFFFD - Reserved for user-space HWRM interface
27771          * * 0xFFFF - HWRM
27772          */
27773         uint16_t        target_id;
27774         /*
27775          * A physical address pointer pointing to a host buffer that the
27776          * command's response data will be written. This can be either a host
27777          * physical address (HPA) or a guest physical address (GPA) and must
27778          * point to a physically contiguous block of memory.
27779          */
27780         uint64_t        resp_addr;
27781         uint32_t        flags;
27782         /* ovs_tunnel is 1 b */
27783         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL \
27784                 UINT32_C(0x1)
27785         uint32_t        enables;
27786         /*
27787          * This bit must be '1' for the tunnel_type field to be
27788          * configured.
27789          */
27790         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
27791                 UINT32_C(0x1)
27792         /*
27793          * This bit must be '1' for the tunnel_id field to be
27794          * configured.
27795          */
27796         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID \
27797                 UINT32_C(0x2)
27798         /*
27799          * This bit must be '1' for the src_macaddr field to be
27800          * configured.
27801          */
27802         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
27803                 UINT32_C(0x4)
27804         /*
27805          * This bit must be '1' for the dst_macaddr field to be
27806          * configured.
27807          */
27808         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
27809                 UINT32_C(0x8)
27810         /*
27811          * This bit must be '1' for the ovlan_vid field to be
27812          * configured.
27813          */
27814         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID \
27815                 UINT32_C(0x10)
27816         /*
27817          * This bit must be '1' for the ivlan_vid field to be
27818          * configured.
27819          */
27820         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID \
27821                 UINT32_C(0x20)
27822         /*
27823          * This bit must be '1' for the t_ovlan_vid field to be
27824          * configured.
27825          */
27826         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID \
27827                 UINT32_C(0x40)
27828         /*
27829          * This bit must be '1' for the t_ivlan_vid field to be
27830          * configured.
27831          */
27832         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID \
27833                 UINT32_C(0x80)
27834         /*
27835          * This bit must be '1' for the ethertype field to be
27836          * configured.
27837          */
27838         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
27839                 UINT32_C(0x100)
27840         /*
27841          * This bit must be '1' for the src_ipaddr field to be
27842          * configured.
27843          */
27844         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
27845                 UINT32_C(0x200)
27846         /*
27847          * This bit must be '1' for the dst_ipaddr field to be
27848          * configured.
27849          */
27850         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
27851                 UINT32_C(0x400)
27852         /*
27853          * This bit must be '1' for the ipaddr_type field to be
27854          * configured.
27855          */
27856         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
27857                 UINT32_C(0x800)
27858         /*
27859          * This bit must be '1' for the ip_protocol field to be
27860          * configured.
27861          */
27862         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
27863                 UINT32_C(0x1000)
27864         /*
27865          * This bit must be '1' for the src_port field to be
27866          * configured.
27867          */
27868         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
27869                 UINT32_C(0x2000)
27870         /*
27871          * This bit must be '1' for the dst_port field to be
27872          * configured.
27873          */
27874         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
27875                 UINT32_C(0x4000)
27876         /*
27877          * This bit must be '1' for the dst_id field to be
27878          * configured.
27879          */
27880         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
27881                 UINT32_C(0x8000)
27882         /*
27883          * This bit must be '1' for the mirror_vnic_id field to be
27884          * configured.
27885          */
27886         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
27887                 UINT32_C(0x10000)
27888         /*
27889          * Tunnel identifier.
27890          * Virtual Network Identifier (VNI). Only valid with
27891          * tunnel_types VXLAN, NVGRE, and Geneve.
27892          * Only lower 24-bits of VNI field are used
27893          * in setting up the filter.
27894          */
27895         uint32_t        tunnel_id;
27896         /* Tunnel Type. */
27897         uint8_t tunnel_type;
27898         /* Non-tunnel */
27899         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
27900                 UINT32_C(0x0)
27901         /* Virtual eXtensible Local Area Network (VXLAN) */
27902         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
27903                 UINT32_C(0x1)
27904         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
27905         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
27906                 UINT32_C(0x2)
27907         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
27908         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
27909                 UINT32_C(0x3)
27910         /* IP in IP */
27911         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
27912                 UINT32_C(0x4)
27913         /* Generic Network Virtualization Encapsulation (Geneve) */
27914         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
27915                 UINT32_C(0x5)
27916         /* Multi-Protocol Lable Switching (MPLS) */
27917         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
27918                 UINT32_C(0x6)
27919         /* Stateless Transport Tunnel (STT) */
27920         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
27921                 UINT32_C(0x7)
27922         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
27923         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
27924                 UINT32_C(0x8)
27925         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
27926         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
27927                 UINT32_C(0x9)
27928         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
27929         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
27930                 UINT32_C(0xa)
27931         /* Use fixed layer 2 ether type of 0xFFFF */
27932         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
27933                 UINT32_C(0xb)
27934         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
27935         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
27936                 UINT32_C(0xc)
27937         /* Any tunneled traffic */
27938         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
27939                 UINT32_C(0xff)
27940         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
27941                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
27942         uint8_t unused_0;
27943         uint16_t        unused_1;
27944         /*
27945          * This value indicates the source MAC address in
27946          * the Ethernet header.
27947          */
27948         uint8_t src_macaddr[6];
27949         uint8_t unused_2[2];
27950         /*
27951          * This value indicates the destination MAC address in
27952          * the Ethernet header.
27953          */
27954         uint8_t dst_macaddr[6];
27955         /*
27956          * This value indicates the VLAN ID of the outer VLAN tag
27957          * in the Ethernet header.
27958          */
27959         uint16_t        ovlan_vid;
27960         /*
27961          * This value indicates the VLAN ID of the inner VLAN tag
27962          * in the Ethernet header.
27963          */
27964         uint16_t        ivlan_vid;
27965         /*
27966          * This value indicates the VLAN ID of the outer VLAN tag
27967          * in the tunnel Ethernet header.
27968          */
27969         uint16_t        t_ovlan_vid;
27970         /*
27971          * This value indicates the VLAN ID of the inner VLAN tag
27972          * in the tunnel Ethernet header.
27973          */
27974         uint16_t        t_ivlan_vid;
27975         /* This value indicates the ethertype in the Ethernet header. */
27976         uint16_t        ethertype;
27977         /*
27978          * This value indicates the type of IP address.
27979          * 4 - IPv4
27980          * 6 - IPv6
27981          * All others are invalid.
27982          */
27983         uint8_t ip_addr_type;
27984         /* invalid */
27985         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
27986                 UINT32_C(0x0)
27987         /* IPv4 */
27988         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
27989                 UINT32_C(0x4)
27990         /* IPv6 */
27991         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
27992                 UINT32_C(0x6)
27993         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
27994                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
27995         /*
27996          * The value of protocol filed in IP header.
27997          * Applies to UDP and TCP traffic.
27998          * 6 - TCP
27999          * 17 - UDP
28000          */
28001         uint8_t ip_protocol;
28002         /* invalid */
28003         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
28004                 UINT32_C(0x0)
28005         /* TCP */
28006         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
28007                 UINT32_C(0x6)
28008         /* UDP */
28009         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
28010                 UINT32_C(0x11)
28011         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
28012                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
28013         uint16_t        unused_3;
28014         uint32_t        unused_4;
28015         /*
28016          * The value of source IP address to be used in filtering.
28017          * For IPv4, first four bytes represent the IP address.
28018          */
28019         uint32_t        src_ipaddr[4];
28020         /*
28021          * The value of destination IP address to be used in filtering.
28022          * For IPv4, first four bytes represent the IP address.
28023          */
28024         uint32_t        dst_ipaddr[4];
28025         /*
28026          * The value of source port to be used in filtering.
28027          * Applies to UDP and TCP traffic.
28028          */
28029         uint16_t        src_port;
28030         /*
28031          * The value of destination port to be used in filtering.
28032          * Applies to UDP and TCP traffic.
28033          */
28034         uint16_t        dst_port;
28035         /*
28036          * If set, this value shall represent the
28037          * Logical VNIC ID of the destination VNIC for the RX
28038          * path.
28039          */
28040         uint16_t        dst_id;
28041         /*
28042          * If set, this value shall represent the L2 context that matches the L2
28043          * information of the decap filter.
28044          */
28045         uint16_t        l2_ctxt_ref_id;
28046 } __attribute__((packed));
28047
28048 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
28049 struct hwrm_cfa_decap_filter_alloc_output {
28050         /* The specific error status for the command. */
28051         uint16_t        error_code;
28052         /* The HWRM command request type. */
28053         uint16_t        req_type;
28054         /* The sequence ID from the original command. */
28055         uint16_t        seq_id;
28056         /* The length of the response data in number of bytes. */
28057         uint16_t        resp_len;
28058         /* This value is an opaque id into CFA data structures. */
28059         uint32_t        decap_filter_id;
28060         uint8_t unused_0[3];
28061         /*
28062          * This field is used in Output records to indicate that the output
28063          * is completely written to RAM.  This field should be read as '1'
28064          * to indicate that the output has been completely written.
28065          * When writing a command completion or response to an internal processor,
28066          * the order of writes has to be such that this field is written last.
28067          */
28068         uint8_t valid;
28069 } __attribute__((packed));
28070
28071 /******************************
28072  * hwrm_cfa_decap_filter_free *
28073  ******************************/
28074
28075
28076 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */
28077 struct hwrm_cfa_decap_filter_free_input {
28078         /* The HWRM command request type. */
28079         uint16_t        req_type;
28080         /*
28081          * The completion ring to send the completion event on. This should
28082          * be the NQ ID returned from the `nq_alloc` HWRM command.
28083          */
28084         uint16_t        cmpl_ring;
28085         /*
28086          * The sequence ID is used by the driver for tracking multiple
28087          * commands. This ID is treated as opaque data by the firmware and
28088          * the value is returned in the `hwrm_resp_hdr` upon completion.
28089          */
28090         uint16_t        seq_id;
28091         /*
28092          * The target ID of the command:
28093          * * 0x0-0xFFF8 - The function ID
28094          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28095          * * 0xFFFD - Reserved for user-space HWRM interface
28096          * * 0xFFFF - HWRM
28097          */
28098         uint16_t        target_id;
28099         /*
28100          * A physical address pointer pointing to a host buffer that the
28101          * command's response data will be written. This can be either a host
28102          * physical address (HPA) or a guest physical address (GPA) and must
28103          * point to a physically contiguous block of memory.
28104          */
28105         uint64_t        resp_addr;
28106         /* This value is an opaque id into CFA data structures. */
28107         uint32_t        decap_filter_id;
28108         uint8_t unused_0[4];
28109 } __attribute__((packed));
28110
28111 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
28112 struct hwrm_cfa_decap_filter_free_output {
28113         /* The specific error status for the command. */
28114         uint16_t        error_code;
28115         /* The HWRM command request type. */
28116         uint16_t        req_type;
28117         /* The sequence ID from the original command. */
28118         uint16_t        seq_id;
28119         /* The length of the response data in number of bytes. */
28120         uint16_t        resp_len;
28121         uint8_t unused_0[7];
28122         /*
28123          * This field is used in Output records to indicate that the output
28124          * is completely written to RAM.  This field should be read as '1'
28125          * to indicate that the output has been completely written.
28126          * When writing a command completion or response to an internal processor,
28127          * the order of writes has to be such that this field is written last.
28128          */
28129         uint8_t valid;
28130 } __attribute__((packed));
28131
28132 /***********************
28133  * hwrm_cfa_flow_alloc *
28134  ***********************/
28135
28136
28137 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */
28138 struct hwrm_cfa_flow_alloc_input {
28139         /* The HWRM command request type. */
28140         uint16_t        req_type;
28141         /*
28142          * The completion ring to send the completion event on. This should
28143          * be the NQ ID returned from the `nq_alloc` HWRM command.
28144          */
28145         uint16_t        cmpl_ring;
28146         /*
28147          * The sequence ID is used by the driver for tracking multiple
28148          * commands. This ID is treated as opaque data by the firmware and
28149          * the value is returned in the `hwrm_resp_hdr` upon completion.
28150          */
28151         uint16_t        seq_id;
28152         /*
28153          * The target ID of the command:
28154          * * 0x0-0xFFF8 - The function ID
28155          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28156          * * 0xFFFD - Reserved for user-space HWRM interface
28157          * * 0xFFFF - HWRM
28158          */
28159         uint16_t        target_id;
28160         /*
28161          * A physical address pointer pointing to a host buffer that the
28162          * command's response data will be written. This can be either a host
28163          * physical address (HPA) or a guest physical address (GPA) and must
28164          * point to a physically contiguous block of memory.
28165          */
28166         uint64_t        resp_addr;
28167         uint16_t        flags;
28168         /* tunnel is 1 b */
28169         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL \
28170                 UINT32_C(0x1)
28171         /* num_vlan is 2 b */
28172         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK \
28173                 UINT32_C(0x6)
28174         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT           1
28175         /* no tags */
28176         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE \
28177                 (UINT32_C(0x0) << 1)
28178         /* 1 tag */
28179         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE \
28180                 (UINT32_C(0x1) << 1)
28181         /* 2 tags */
28182         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO \
28183                 (UINT32_C(0x2) << 1)
28184         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST \
28185                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
28186         /* Enumeration denoting the Flow Type. */
28187         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK \
28188                 UINT32_C(0x38)
28189         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT           3
28190         /* L2 flow */
28191         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2 \
28192                 (UINT32_C(0x0) << 3)
28193         /* IPV4 flow */
28194         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4 \
28195                 (UINT32_C(0x1) << 3)
28196         /* IPV6 flow */
28197         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6 \
28198                 (UINT32_C(0x2) << 3)
28199         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST \
28200                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
28201         /*
28202          * when set to 1, indicates TX flow offload for function specified in src_fid and
28203          * the dst_fid should be set to invalid value. To indicate a VM to VM flow, both
28204          * of the path_tx and path_rx flags need to be set. For virtio vSwitch offload
28205          * case, the src_fid and dst_fid is set to the same fid value. For the SRIOV
28206          * vSwitch offload case, the src_fid and dst_fid must be set to the same VF FID
28207          * belong to the children VFs of the same PF to indicate VM to VM flow.
28208          */
28209         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX \
28210                 UINT32_C(0x40)
28211         /*
28212          * when set to 1, indicates RX flow offload for function specified in dst_fid and
28213          * the src_fid should be set to invalid value.
28214          */
28215         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX \
28216                 UINT32_C(0x80)
28217         /*
28218          * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan header is
28219          * required and the VXLAN VNI value is stored in the first 24 bits of the dmac field.
28220          * This flag is only valid when the flow direction is RX.
28221          */
28222         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI \
28223                 UINT32_C(0x100)
28224         /* Set to 1 to indicate vhost_id is specified in the outer_vlan_tci field. */
28225         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_VHOST_ID_USE_VLAN \
28226                 UINT32_C(0x200)
28227         /*
28228          * Tx Flow: vf fid.
28229          * Rx Flow: pf fid.
28230          */
28231         uint16_t        src_fid;
28232         /* Tunnel handle valid when tunnel flag is set. */
28233         uint32_t        tunnel_handle;
28234         uint16_t        action_flags;
28235         /*
28236          * Setting of this flag indicates drop action. If this flag is not set,
28237          * then it should be considered accept action.
28238          */
28239         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD \
28240                 UINT32_C(0x1)
28241         /* recycle is 1 b */
28242         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE \
28243                 UINT32_C(0x2)
28244         /*
28245          * Setting of this flag indicates drop action. If this flag is not set,
28246          * then it should be considered accept action.
28247          */
28248         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP \
28249                 UINT32_C(0x4)
28250         /* meter is 1 b */
28251         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER \
28252                 UINT32_C(0x8)
28253         /* tunnel is 1 b */
28254         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL \
28255                 UINT32_C(0x10)
28256         /* nat_src is 1 b */
28257         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC \
28258                 UINT32_C(0x20)
28259         /* nat_dest is 1 b */
28260         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST \
28261                 UINT32_C(0x40)
28262         /* nat_ipv4_address is 1 b */
28263         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS \
28264                 UINT32_C(0x80)
28265         /* l2_header_rewrite is 1 b */
28266         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE \
28267                 UINT32_C(0x100)
28268         /* ttl_decrement is 1 b */
28269         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT \
28270                 UINT32_C(0x200)
28271         /*
28272          * If set to 1 and flow direction is TX, it indicates decap of L2 header
28273          * and encap of tunnel header. If set to 1 and flow direction is RX, it
28274          * indicates decap of tunnel header and encap L2 header. The type of tunnel
28275          * is specified in the tunnel_type field.
28276          */
28277         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP \
28278                 UINT32_C(0x400)
28279         /* If set to 1, flow aging is enabled for this flow. */
28280         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FLOW_AGING_ENABLED \
28281                 UINT32_C(0x800)
28282         /*
28283          * If set to 1 an attempt will be made to try to offload this flow to the
28284          * most optimal flow table resource.  If set to 0, the flow will be
28285          * placed to the default flow table resource.
28286          */
28287         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_PRI_HINT \
28288                 UINT32_C(0x1000)
28289         /*
28290          * If set to 1 there will be no attempt to allocate an on-chip try to
28291          * offload this flow. If set to 0, which will keep compatibility with the
28292          * older drivers, will cause the FW to attempt to allocate an on-chip flow
28293          * counter for the newly created flow.  This will keep the existing behavior
28294          * with EM flows which always had an associated flow counter.
28295          */
28296         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NO_FLOW_COUNTER_ALLOC \
28297                 UINT32_C(0x2000)
28298         /*
28299          * Tx Flow: pf or vf fid.
28300          * Rx Flow: vf fid.
28301          */
28302         uint16_t        dst_fid;
28303         /* VLAN tpid, valid when push_vlan flag is set. */
28304         uint16_t        l2_rewrite_vlan_tpid;
28305         /* VLAN tci, valid when push_vlan flag is set. */
28306         uint16_t        l2_rewrite_vlan_tci;
28307         /* Meter id, valid when meter flag is set. */
28308         uint16_t        act_meter_id;
28309         /* Flow with the same l2 context tcam key. */
28310         uint16_t        ref_flow_handle;
28311         /* This value sets the match value for the ethertype. */
28312         uint16_t        ethertype;
28313         /* valid when num tags is 1 or 2. */
28314         uint16_t        outer_vlan_tci;
28315         /* This value sets the match value for the Destination MAC address. */
28316         uint16_t        dmac[3];
28317         /* valid when num tags is 2. */
28318         uint16_t        inner_vlan_tci;
28319         /* This value sets the match value for the Source MAC address. */
28320         uint16_t        smac[3];
28321         /* The bit length of destination IP address mask. */
28322         uint8_t ip_dst_mask_len;
28323         /* The bit length of source IP address mask. */
28324         uint8_t ip_src_mask_len;
28325         /* The value of destination IPv4/IPv6 address. */
28326         uint32_t        ip_dst[4];
28327         /* The source IPv4/IPv6 address. */
28328         uint32_t        ip_src[4];
28329         /*
28330          * The value of source port.
28331          * Applies to UDP and TCP traffic.
28332          */
28333         uint16_t        l4_src_port;
28334         /*
28335          * The value of source port mask.
28336          * Applies to UDP and TCP traffic.
28337          */
28338         uint16_t        l4_src_port_mask;
28339         /*
28340          * The value of destination port.
28341          * Applies to UDP and TCP traffic.
28342          */
28343         uint16_t        l4_dst_port;
28344         /*
28345          * The value of destination port mask.
28346          * Applies to UDP and TCP traffic.
28347          */
28348         uint16_t        l4_dst_port_mask;
28349         /*
28350          * NAT IPv4/6 address based on address type flag.
28351          * 0 values are ignored.
28352          */
28353         uint32_t        nat_ip_address[4];
28354         /* L2 header re-write Destination MAC address. */
28355         uint16_t        l2_rewrite_dmac[3];
28356         /*
28357          * The NAT source/destination port based on direction flag.
28358          * Applies to UDP and TCP traffic.
28359          * 0 values are ignored.
28360          */
28361         uint16_t        nat_port;
28362         /* L2 header re-write Source MAC address. */
28363         uint16_t        l2_rewrite_smac[3];
28364         /* The value of ip protocol. */
28365         uint8_t ip_proto;
28366         /* Tunnel Type. */
28367         uint8_t tunnel_type;
28368         /* Non-tunnel */
28369         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
28370                 UINT32_C(0x0)
28371         /* Virtual eXtensible Local Area Network (VXLAN) */
28372         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
28373                 UINT32_C(0x1)
28374         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
28375         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
28376                 UINT32_C(0x2)
28377         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
28378         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
28379                 UINT32_C(0x3)
28380         /* IP in IP */
28381         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
28382                 UINT32_C(0x4)
28383         /* Generic Network Virtualization Encapsulation (Geneve) */
28384         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
28385                 UINT32_C(0x5)
28386         /* Multi-Protocol Lable Switching (MPLS) */
28387         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
28388                 UINT32_C(0x6)
28389         /* Stateless Transport Tunnel (STT) */
28390         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
28391                 UINT32_C(0x7)
28392         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
28393         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
28394                 UINT32_C(0x8)
28395         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
28396         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
28397                 UINT32_C(0x9)
28398         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
28399         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
28400                 UINT32_C(0xa)
28401         /* Use fixed layer 2 ether type of 0xFFFF */
28402         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
28403                 UINT32_C(0xb)
28404         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
28405         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
28406                 UINT32_C(0xc)
28407         /* Any tunneled traffic */
28408         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
28409                 UINT32_C(0xff)
28410         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
28411                 HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
28412 } __attribute__((packed));
28413
28414 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
28415 struct hwrm_cfa_flow_alloc_output {
28416         /* The specific error status for the command. */
28417         uint16_t        error_code;
28418         /* The HWRM command request type. */
28419         uint16_t        req_type;
28420         /* The sequence ID from the original command. */
28421         uint16_t        seq_id;
28422         /* The length of the response data in number of bytes. */
28423         uint16_t        resp_len;
28424         /* Flow record index. */
28425         uint16_t        flow_handle;
28426         uint8_t unused_0[2];
28427         /*
28428          * The flow id value in bit 0-29 is the actual ID of the flow
28429          * associated with this filter and it shall be used to match
28430          * and associate the flow identifier returned in completion
28431          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
28432          * shall indicate no valid flow id.
28433          */
28434         uint32_t        flow_id;
28435         /* Indicate the flow id value. */
28436         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
28437                 UINT32_C(0x3fffffff)
28438         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
28439         /* Indicate type of the flow. */
28440         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
28441                 UINT32_C(0x40000000)
28442         /*
28443          * If this bit set to 0, then it indicates that the flow is
28444          * internal flow.
28445          */
28446         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
28447                 (UINT32_C(0x0) << 30)
28448         /*
28449          * If this bit is set to 1, then it indicates that the flow is
28450          * external flow.
28451          */
28452         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
28453                 (UINT32_C(0x1) << 30)
28454         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
28455                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
28456         /* Indicate the flow direction. */
28457         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
28458                 UINT32_C(0x80000000)
28459         /* If this bit set to 0, then it indicates rx flow. */
28460         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
28461                 (UINT32_C(0x0) << 31)
28462         /* If this bit is set to 1, then it indicates that tx flow. */
28463         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
28464                 (UINT32_C(0x1) << 31)
28465         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
28466                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
28467         /* This value identifies a set of CFA data structures used for a flow. */
28468         uint64_t        ext_flow_handle;
28469         uint32_t        flow_counter_id;
28470         uint8_t unused_1[3];
28471         /*
28472          * This field is used in Output records to indicate that the output
28473          * is completely written to RAM.  This field should be read as '1'
28474          * to indicate that the output has been completely written.
28475          * When writing a command completion or response to an internal processor,
28476          * the order of writes has to be such that this field is written last.
28477          */
28478         uint8_t valid;
28479 } __attribute__((packed));
28480
28481 /* hwrm_cfa_flow_alloc_cmd_err (size:64b/8B) */
28482 struct hwrm_cfa_flow_alloc_cmd_err {
28483         /*
28484          * command specific error codes that goes to
28485          * the cmd_err field in Common HWRM Error Response.
28486          */
28487         uint8_t code;
28488         /* Unknown error */
28489         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_UNKNOWN         UINT32_C(0x0)
28490         /* No more L2 Context TCAM */
28491         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_L2_CONTEXT_TCAM UINT32_C(0x1)
28492         /* No more action records */
28493         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_ACTION_RECORD   UINT32_C(0x2)
28494         /* No more flow counters */
28495         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_COUNTER    UINT32_C(0x3)
28496         /* No more wild-card TCAM */
28497         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_WILD_CARD_TCAM  UINT32_C(0x4)
28498         /* Hash collsion in exact match tables */
28499         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_HASH_COLLISION  UINT32_C(0x5)
28500         /* Key is already installed */
28501         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_KEY_EXISTS      UINT32_C(0x6)
28502         /* Flow Context DB is out of resource */
28503         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB    UINT32_C(0x7)
28504         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_LAST \
28505                 HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB
28506         uint8_t unused_0[7];
28507 } __attribute__((packed));
28508
28509 /**********************
28510  * hwrm_cfa_flow_free *
28511  **********************/
28512
28513
28514 /* hwrm_cfa_flow_free_input (size:256b/32B) */
28515 struct hwrm_cfa_flow_free_input {
28516         /* The HWRM command request type. */
28517         uint16_t        req_type;
28518         /*
28519          * The completion ring to send the completion event on. This should
28520          * be the NQ ID returned from the `nq_alloc` HWRM command.
28521          */
28522         uint16_t        cmpl_ring;
28523         /*
28524          * The sequence ID is used by the driver for tracking multiple
28525          * commands. This ID is treated as opaque data by the firmware and
28526          * the value is returned in the `hwrm_resp_hdr` upon completion.
28527          */
28528         uint16_t        seq_id;
28529         /*
28530          * The target ID of the command:
28531          * * 0x0-0xFFF8 - The function ID
28532          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28533          * * 0xFFFD - Reserved for user-space HWRM interface
28534          * * 0xFFFF - HWRM
28535          */
28536         uint16_t        target_id;
28537         /*
28538          * A physical address pointer pointing to a host buffer that the
28539          * command's response data will be written. This can be either a host
28540          * physical address (HPA) or a guest physical address (GPA) and must
28541          * point to a physically contiguous block of memory.
28542          */
28543         uint64_t        resp_addr;
28544         /* Flow record index. */
28545         uint16_t        flow_handle;
28546         uint16_t        unused_0;
28547         /* Flow counter id to be freed. */
28548         uint32_t        flow_counter_id;
28549         /* This value identifies a set of CFA data structures used for a flow. */
28550         uint64_t        ext_flow_handle;
28551 } __attribute__((packed));
28552
28553 /* hwrm_cfa_flow_free_output (size:256b/32B) */
28554 struct hwrm_cfa_flow_free_output {
28555         /* The specific error status for the command. */
28556         uint16_t        error_code;
28557         /* The HWRM command request type. */
28558         uint16_t        req_type;
28559         /* The sequence ID from the original command. */
28560         uint16_t        seq_id;
28561         /* The length of the response data in number of bytes. */
28562         uint16_t        resp_len;
28563         /* packet is 64 b */
28564         uint64_t        packet;
28565         /* byte is 64 b */
28566         uint64_t        byte;
28567         uint8_t unused_0[7];
28568         /*
28569          * This field is used in Output records to indicate that the output
28570          * is completely written to RAM.  This field should be read as '1'
28571          * to indicate that the output has been completely written.
28572          * When writing a command completion or response to an internal processor,
28573          * the order of writes has to be such that this field is written last.
28574          */
28575         uint8_t valid;
28576 } __attribute__((packed));
28577
28578 /* hwrm_cfa_flow_action_data (size:960b/120B) */
28579 struct hwrm_cfa_flow_action_data {
28580         uint16_t        action_flags;
28581         /* Setting of this flag indicates accept action. */
28582         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FWD \
28583                 UINT32_C(0x1)
28584         /* Setting of this flag indicates recycle action. */
28585         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_RECYCLE \
28586                 UINT32_C(0x2)
28587         /* Setting of this flag indicates drop action. */
28588         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DROP \
28589                 UINT32_C(0x4)
28590         /* Setting of this flag indicates meter action. */
28591         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_METER \
28592                 UINT32_C(0x8)
28593         /* Setting of this flag indicates tunnel action. */
28594         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL \
28595                 UINT32_C(0x10)
28596         /*
28597          * If set to 1 and flow direction is TX, it indicates decap of L2 header
28598          * and encap of tunnel header. If set to 1 and flow direction is RX, it
28599          * indicates decap of tunnel header and encap L2 header.
28600          */
28601         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL_IP \
28602                 UINT32_C(0x20)
28603         /* Setting of this flag indicates ttl decrement action. */
28604         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TTL_DECREMENT \
28605                 UINT32_C(0x40)
28606         /* If set to 1, flow aging is enabled for this flow. */
28607         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FLOW_AGING_ENABLED \
28608                 UINT32_C(0x80)
28609         /* Setting of this flag indicates encap action.. */
28610         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_ENCAP \
28611                 UINT32_C(0x100)
28612         /* Setting of this flag indicates decap action.. */
28613         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DECAP \
28614                 UINT32_C(0x200)
28615         /* Meter id. */
28616         uint16_t        act_meter_id;
28617         /* VNIC id. */
28618         uint16_t        vnic_id;
28619         /* vport number. */
28620         uint16_t        vport_id;
28621         /* The NAT source/destination. */
28622         uint16_t        nat_port;
28623         uint16_t        unused_0[3];
28624         /* NAT IPv4/IPv6 address. */
28625         uint32_t        nat_ip_address[4];
28626         /* Encapsulation Type. */
28627         uint8_t encap_type;
28628         /* Virtual eXtensible Local Area Network (VXLAN) */
28629         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN        UINT32_C(0x1)
28630         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
28631         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_NVGRE        UINT32_C(0x2)
28632         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
28633         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2GRE        UINT32_C(0x3)
28634         /* IP in IP */
28635         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPIP         UINT32_C(0x4)
28636         /* Generic Network Virtualization Encapsulation (Geneve) */
28637         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_GENEVE       UINT32_C(0x5)
28638         /* Multi-Protocol Lable Switching (MPLS) */
28639         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_MPLS         UINT32_C(0x6)
28640         /* VLAN */
28641         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VLAN         UINT32_C(0x7)
28642         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
28643         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE        UINT32_C(0x8)
28644         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
28645         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_V4     UINT32_C(0x9)
28646         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
28647         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE_V1     UINT32_C(0xa)
28648         /* Use fixed layer 2 ether type of 0xFFFF */
28649         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2_ETYPE     UINT32_C(0xb)
28650         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
28651         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
28652         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_LAST \
28653                 HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6
28654         uint8_t unused[7];
28655         /* This value is encap data for the associated encap type. */
28656         uint32_t        encap_data[20];
28657 } __attribute__((packed));
28658
28659 /* hwrm_cfa_flow_tunnel_hdr_data (size:64b/8B) */
28660 struct hwrm_cfa_flow_tunnel_hdr_data {
28661         /* Tunnel Type. */
28662         uint8_t tunnel_type;
28663         /* Non-tunnel */
28664         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NONTUNNEL \
28665                 UINT32_C(0x0)
28666         /* Virtual eXtensible Local Area Network (VXLAN) */
28667         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN \
28668                 UINT32_C(0x1)
28669         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
28670         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NVGRE \
28671                 UINT32_C(0x2)
28672         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
28673         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2GRE \
28674                 UINT32_C(0x3)
28675         /* IP in IP */
28676         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPIP \
28677                 UINT32_C(0x4)
28678         /* Generic Network Virtualization Encapsulation (Geneve) */
28679         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_GENEVE \
28680                 UINT32_C(0x5)
28681         /* Multi-Protocol Lable Switching (MPLS) */
28682         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_MPLS \
28683                 UINT32_C(0x6)
28684         /* Stateless Transport Tunnel (STT) */
28685         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_STT \
28686                 UINT32_C(0x7)
28687         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
28688         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE \
28689                 UINT32_C(0x8)
28690         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
28691         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_V4 \
28692                 UINT32_C(0x9)
28693         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
28694         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE_V1 \
28695                 UINT32_C(0xa)
28696         /* Use fixed layer 2 ether type of 0xFFFF */
28697         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2_ETYPE \
28698                 UINT32_C(0xb)
28699         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
28700         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE_V6 \
28701                 UINT32_C(0xc)
28702         /* Any tunneled traffic */
28703         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL \
28704                 UINT32_C(0xff)
28705         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_LAST \
28706                 HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL
28707         uint8_t unused[3];
28708         /*
28709          * Tunnel identifier.
28710          * Virtual Network Identifier (VNI).
28711          */
28712         uint32_t        tunnel_id;
28713 } __attribute__((packed));
28714
28715 /* hwrm_cfa_flow_l4_key_data (size:64b/8B) */
28716 struct hwrm_cfa_flow_l4_key_data {
28717         /* The value of source port. */
28718         uint16_t        l4_src_port;
28719         /* The value of destination port. */
28720         uint16_t        l4_dst_port;
28721         uint32_t        unused;
28722 } __attribute__((packed));
28723
28724 /* hwrm_cfa_flow_l3_key_data (size:512b/64B) */
28725 struct hwrm_cfa_flow_l3_key_data {
28726         /* The value of ip protocol. */
28727         uint8_t ip_protocol;
28728         uint8_t unused_0[7];
28729         /* The value of destination IPv4/IPv6 address. */
28730         uint32_t        ip_dst[4];
28731         /* The source IPv4/IPv6 address. */
28732         uint32_t        ip_src[4];
28733         /* NAT IPv4/IPv6 address. */
28734         uint32_t        nat_ip_address[4];
28735         uint32_t        unused[2];
28736 } __attribute__((packed));
28737
28738 /* hwrm_cfa_flow_l2_key_data (size:448b/56B) */
28739 struct hwrm_cfa_flow_l2_key_data {
28740         /* Destination MAC address. */
28741         uint16_t        dmac[3];
28742         uint16_t        unused_0;
28743         /* Source MAC address. */
28744         uint16_t        smac[3];
28745         uint16_t        unused_1;
28746         /* L2 header re-write Destination MAC address. */
28747         uint16_t        l2_rewrite_dmac[3];
28748         uint16_t        unused_2;
28749         /* L2 header re-write Source MAC address. */
28750         uint16_t        l2_rewrite_smac[3];
28751         /* Ethertype. */
28752         uint16_t        ethertype;
28753         /* Number of VLAN tags. */
28754         uint16_t        num_vlan_tags;
28755         /* VLAN tpid. */
28756         uint16_t        l2_rewrite_vlan_tpid;
28757         /* VLAN tci. */
28758         uint16_t        l2_rewrite_vlan_tci;
28759         uint8_t unused_3[2];
28760         /* Outer VLAN TPID. */
28761         uint16_t        ovlan_tpid;
28762         /* Outer VLAN TCI. */
28763         uint16_t        ovlan_tci;
28764         /* Inner VLAN TPID. */
28765         uint16_t        ivlan_tpid;
28766         /* Inner VLAN TCI. */
28767         uint16_t        ivlan_tci;
28768         uint8_t unused[8];
28769 } __attribute__((packed));
28770
28771 /* hwrm_cfa_flow_key_data (size:4160b/520B) */
28772 struct hwrm_cfa_flow_key_data {
28773         /* Flow associated tunnel L2 header key info. */
28774         uint32_t        t_l2_key_data[14];
28775         /* Flow associated tunnel L2 header mask info. */
28776         uint32_t        t_l2_key_mask[14];
28777         /* Flow associated tunnel L3 header key info. */
28778         uint32_t        t_l3_key_data[16];
28779         /* Flow associated tunnel L3 header mask info. */
28780         uint32_t        t_l3_key_mask[16];
28781         /* Flow associated tunnel L4 header key info. */
28782         uint32_t        t_l4_key_data[2];
28783         /* Flow associated tunnel L4 header mask info. */
28784         uint32_t        t_l4_key_mask[2];
28785         /* Flow associated tunnel header info. */
28786         uint32_t        tunnel_hdr[2];
28787         /* Flow associated L2 header key info. */
28788         uint32_t        l2_key_data[14];
28789         /* Flow associated L2 header mask info. */
28790         uint32_t        l2_key_mask[14];
28791         /* Flow associated L3 header key info. */
28792         uint32_t        l3_key_data[16];
28793         /* Flow associated L3 header mask info. */
28794         uint32_t        l3_key_mask[16];
28795         /* Flow associated L4 header key info. */
28796         uint32_t        l4_key_data[2];
28797         /* Flow associated L4 header mask info. */
28798         uint32_t        l4_key_mask[2];
28799 } __attribute__((packed));
28800
28801 /**********************
28802  * hwrm_cfa_flow_info *
28803  **********************/
28804
28805
28806 /* hwrm_cfa_flow_info_input (size:256b/32B) */
28807 struct hwrm_cfa_flow_info_input {
28808         /* The HWRM command request type. */
28809         uint16_t        req_type;
28810         /*
28811          * The completion ring to send the completion event on. This should
28812          * be the NQ ID returned from the `nq_alloc` HWRM command.
28813          */
28814         uint16_t        cmpl_ring;
28815         /*
28816          * The sequence ID is used by the driver for tracking multiple
28817          * commands. This ID is treated as opaque data by the firmware and
28818          * the value is returned in the `hwrm_resp_hdr` upon completion.
28819          */
28820         uint16_t        seq_id;
28821         /*
28822          * The target ID of the command:
28823          * * 0x0-0xFFF8 - The function ID
28824          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28825          * * 0xFFFD - Reserved for user-space HWRM interface
28826          * * 0xFFFF - HWRM
28827          */
28828         uint16_t        target_id;
28829         /*
28830          * A physical address pointer pointing to a host buffer that the
28831          * command's response data will be written. This can be either a host
28832          * physical address (HPA) or a guest physical address (GPA) and must
28833          * point to a physically contiguous block of memory.
28834          */
28835         uint64_t        resp_addr;
28836         /* Flow record index. */
28837         uint16_t        flow_handle;
28838         /* Max flow handle */
28839         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK \
28840                 UINT32_C(0xfff)
28841         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_SFT        0
28842         /* CNP flow handle */
28843         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT \
28844                 UINT32_C(0x1000)
28845         /* RoCEv1 flow handle */
28846         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT \
28847                 UINT32_C(0x2000)
28848         /* RoCEv2 flow handle */
28849         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT \
28850                 UINT32_C(0x4000)
28851         /* Direction rx = 1 */
28852         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX \
28853                 UINT32_C(0x8000)
28854         uint8_t unused_0[6];
28855         /* This value identifies a set of CFA data structures used for a flow. */
28856         uint64_t        ext_flow_handle;
28857 } __attribute__((packed));
28858
28859 /* hwrm_cfa_flow_info_output (size:5632b/704B) */
28860 struct hwrm_cfa_flow_info_output {
28861         /* The specific error status for the command. */
28862         uint16_t        error_code;
28863         /* The HWRM command request type. */
28864         uint16_t        req_type;
28865         /* The sequence ID from the original command. */
28866         uint16_t        seq_id;
28867         /* The length of the response data in number of bytes. */
28868         uint16_t        resp_len;
28869         uint8_t flags;
28870         /* When set to 1, indicates the configuration is the TX flow. */
28871         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_TX     UINT32_C(0x1)
28872         /* When set to 1, indicates the configuration is the RX flow. */
28873         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_RX     UINT32_C(0x2)
28874         /* profile is 8 b */
28875         uint8_t profile;
28876         /* src_fid is 16 b */
28877         uint16_t        src_fid;
28878         /* dst_fid is 16 b */
28879         uint16_t        dst_fid;
28880         /* l2_ctxt_id is 16 b */
28881         uint16_t        l2_ctxt_id;
28882         /* em_info is 64 b */
28883         uint64_t        em_info;
28884         /* tcam_info is 64 b */
28885         uint64_t        tcam_info;
28886         /* vfp_tcam_info is 64 b */
28887         uint64_t        vfp_tcam_info;
28888         /* ar_id is 16 b */
28889         uint16_t        ar_id;
28890         /* flow_handle is 16 b */
28891         uint16_t        flow_handle;
28892         /* tunnel_handle is 32 b */
28893         uint32_t        tunnel_handle;
28894         /* The flow aging timer for the flow, the unit is 100 milliseconds */
28895         uint16_t        flow_timer;
28896         uint8_t unused_0[6];
28897         /* Flow associated L2, L3 and L4 headers info. */
28898         uint32_t        flow_key_data[130];
28899         /* Flow associated action record info. */
28900         uint32_t        flow_action_info[30];
28901         uint8_t unused_1[7];
28902         /*
28903          * This field is used in Output records to indicate that the output
28904          * is completely written to RAM.  This field should be read as '1'
28905          * to indicate that the output has been completely written.
28906          * When writing a command completion or response to an internal processor,
28907          * the order of writes has to be such that this field is written last.
28908          */
28909         uint8_t valid;
28910 } __attribute__((packed));
28911
28912 /***********************
28913  * hwrm_cfa_flow_flush *
28914  ***********************/
28915
28916
28917 /* hwrm_cfa_flow_flush_input (size:256b/32B) */
28918 struct hwrm_cfa_flow_flush_input {
28919         /* The HWRM command request type. */
28920         uint16_t        req_type;
28921         /*
28922          * The completion ring to send the completion event on. This should
28923          * be the NQ ID returned from the `nq_alloc` HWRM command.
28924          */
28925         uint16_t        cmpl_ring;
28926         /*
28927          * The sequence ID is used by the driver for tracking multiple
28928          * commands. This ID is treated as opaque data by the firmware and
28929          * the value is returned in the `hwrm_resp_hdr` upon completion.
28930          */
28931         uint16_t        seq_id;
28932         /*
28933          * The target ID of the command:
28934          * * 0x0-0xFFF8 - The function ID
28935          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28936          * * 0xFFFD - Reserved for user-space HWRM interface
28937          * * 0xFFFF - HWRM
28938          */
28939         uint16_t        target_id;
28940         /*
28941          * A physical address pointer pointing to a host buffer that the
28942          * command's response data will be written. This can be either a host
28943          * physical address (HPA) or a guest physical address (GPA) and must
28944          * point to a physically contiguous block of memory.
28945          */
28946         uint64_t        resp_addr;
28947         /* flags is 32 b */
28948         uint32_t        flags;
28949         /*
28950          * Set to 1 to indicate the page size, page layers, and flow_handle_table_dma_addr
28951          * fields are valid. The flow flush operation should only flush the flows from the
28952          * flow table specified. This flag is set to 0 by older driver. For older firmware,
28953          * setting this flag has no effect.
28954          */
28955         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_TABLE_VALID \
28956                 UINT32_C(0x1)
28957         /*
28958          * Set to 1 to indicate flow flush operation to cleanup all the flows, meters, CFA
28959          * context memory tables..etc.  This flag is set to 0 by older driver. For older firmware,
28960          * setting this flag has no effect.
28961          */
28962         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_ALL \
28963                 UINT32_C(0x2)
28964         /*
28965          * Set to 1 to indicate flow flush operation to cleanup all the flows by the caller.
28966          * This flag is set to 0 by older driver. For older firmware, setting this flag has no effect.
28967          */
28968         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_PORT \
28969                 UINT32_C(0x4)
28970         /* Set to 1 to indicate the flow counter IDs are included in the flow table. */
28971         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_INCL_FC \
28972                 UINT32_C(0x8000000)
28973         /*
28974          * This specifies the size of flow handle entries provided by the driver
28975          * in the flow table specified below. Only two flow handle size enums are defined.
28976          */
28977         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_MASK \
28978                 UINT32_C(0xc0000000)
28979         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_SFT \
28980                 30
28981         /* The flow handle is 16bit */
28982         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_16BIT \
28983                 (UINT32_C(0x0) << 30)
28984         /* The flow handle is 64bit */
28985         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT \
28986                 (UINT32_C(0x1) << 30)
28987         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_LAST \
28988                 HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT
28989         /* Specify page size of the flow table memory. */
28990         uint8_t page_size;
28991         /* The page size is 4K */
28992         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
28993         /* The page size is 8K */
28994         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
28995         /* The page size is 64K */
28996         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
28997         /* The page size is 256K */
28998         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
28999         /* The page size is 1M */
29000         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
29001         /* The page size is 2M */
29002         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
29003         /* The page size is 4M */
29004         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
29005         /* The page size is 1G */
29006         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
29007         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_LAST \
29008                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G
29009         /* FLow table memory indirect levels. */
29010         uint8_t page_level;
29011         /* PBL pointer is physical start address. */
29012         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
29013         /* PBL pointer points to PTE table. */
29014         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
29015         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
29016         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
29017         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LAST \
29018                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2
29019         /* number of flows in the flow table */
29020         uint16_t        num_flows;
29021         /* Pointer to the PBL, or PDL depending on number of levels */
29022         uint64_t        page_dir;
29023 } __attribute__((packed));
29024
29025 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
29026 struct hwrm_cfa_flow_flush_output {
29027         /* The specific error status for the command. */
29028         uint16_t        error_code;
29029         /* The HWRM command request type. */
29030         uint16_t        req_type;
29031         /* The sequence ID from the original command. */
29032         uint16_t        seq_id;
29033         /* The length of the response data in number of bytes. */
29034         uint16_t        resp_len;
29035         uint8_t unused_0[7];
29036         /*
29037          * This field is used in Output records to indicate that the output
29038          * is completely written to RAM.  This field should be read as '1'
29039          * to indicate that the output has been completely written.
29040          * When writing a command completion or response to an internal processor,
29041          * the order of writes has to be such that this field is written last.
29042          */
29043         uint8_t valid;
29044 } __attribute__((packed));
29045
29046 /***********************
29047  * hwrm_cfa_flow_stats *
29048  ***********************/
29049
29050
29051 /* hwrm_cfa_flow_stats_input (size:640b/80B) */
29052 struct hwrm_cfa_flow_stats_input {
29053         /* The HWRM command request type. */
29054         uint16_t        req_type;
29055         /*
29056          * The completion ring to send the completion event on. This should
29057          * be the NQ ID returned from the `nq_alloc` HWRM command.
29058          */
29059         uint16_t        cmpl_ring;
29060         /*
29061          * The sequence ID is used by the driver for tracking multiple
29062          * commands. This ID is treated as opaque data by the firmware and
29063          * the value is returned in the `hwrm_resp_hdr` upon completion.
29064          */
29065         uint16_t        seq_id;
29066         /*
29067          * The target ID of the command:
29068          * * 0x0-0xFFF8 - The function ID
29069          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29070          * * 0xFFFD - Reserved for user-space HWRM interface
29071          * * 0xFFFF - HWRM
29072          */
29073         uint16_t        target_id;
29074         /*
29075          * A physical address pointer pointing to a host buffer that the
29076          * command's response data will be written. This can be either a host
29077          * physical address (HPA) or a guest physical address (GPA) and must
29078          * point to a physically contiguous block of memory.
29079          */
29080         uint64_t        resp_addr;
29081         /* Flow handle. */
29082         uint16_t        num_flows;
29083         /* Flow handle. */
29084         uint16_t        flow_handle_0;
29085         /* Flow handle. */
29086         uint16_t        flow_handle_1;
29087         /* Flow handle. */
29088         uint16_t        flow_handle_2;
29089         /* Flow handle. */
29090         uint16_t        flow_handle_3;
29091         /* Flow handle. */
29092         uint16_t        flow_handle_4;
29093         /* Flow handle. */
29094         uint16_t        flow_handle_5;
29095         /* Flow handle. */
29096         uint16_t        flow_handle_6;
29097         /* Flow handle. */
29098         uint16_t        flow_handle_7;
29099         /* Flow handle. */
29100         uint16_t        flow_handle_8;
29101         /* Flow handle. */
29102         uint16_t        flow_handle_9;
29103         uint8_t unused_0[2];
29104         /* Flow ID of a flow. */
29105         uint32_t        flow_id_0;
29106         /* Flow ID of a flow. */
29107         uint32_t        flow_id_1;
29108         /* Flow ID of a flow. */
29109         uint32_t        flow_id_2;
29110         /* Flow ID of a flow. */
29111         uint32_t        flow_id_3;
29112         /* Flow ID of a flow. */
29113         uint32_t        flow_id_4;
29114         /* Flow ID of a flow. */
29115         uint32_t        flow_id_5;
29116         /* Flow ID of a flow. */
29117         uint32_t        flow_id_6;
29118         /* Flow ID of a flow. */
29119         uint32_t        flow_id_7;
29120         /* Flow ID of a flow. */
29121         uint32_t        flow_id_8;
29122         /* Flow ID of a flow. */
29123         uint32_t        flow_id_9;
29124 } __attribute__((packed));
29125
29126 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
29127 struct hwrm_cfa_flow_stats_output {
29128         /* The specific error status for the command. */
29129         uint16_t        error_code;
29130         /* The HWRM command request type. */
29131         uint16_t        req_type;
29132         /* The sequence ID from the original command. */
29133         uint16_t        seq_id;
29134         /* The length of the response data in number of bytes. */
29135         uint16_t        resp_len;
29136         /* packet_0 is 64 b */
29137         uint64_t        packet_0;
29138         /* packet_1 is 64 b */
29139         uint64_t        packet_1;
29140         /* packet_2 is 64 b */
29141         uint64_t        packet_2;
29142         /* packet_3 is 64 b */
29143         uint64_t        packet_3;
29144         /* packet_4 is 64 b */
29145         uint64_t        packet_4;
29146         /* packet_5 is 64 b */
29147         uint64_t        packet_5;
29148         /* packet_6 is 64 b */
29149         uint64_t        packet_6;
29150         /* packet_7 is 64 b */
29151         uint64_t        packet_7;
29152         /* packet_8 is 64 b */
29153         uint64_t        packet_8;
29154         /* packet_9 is 64 b */
29155         uint64_t        packet_9;
29156         /* byte_0 is 64 b */
29157         uint64_t        byte_0;
29158         /* byte_1 is 64 b */
29159         uint64_t        byte_1;
29160         /* byte_2 is 64 b */
29161         uint64_t        byte_2;
29162         /* byte_3 is 64 b */
29163         uint64_t        byte_3;
29164         /* byte_4 is 64 b */
29165         uint64_t        byte_4;
29166         /* byte_5 is 64 b */
29167         uint64_t        byte_5;
29168         /* byte_6 is 64 b */
29169         uint64_t        byte_6;
29170         /* byte_7 is 64 b */
29171         uint64_t        byte_7;
29172         /* byte_8 is 64 b */
29173         uint64_t        byte_8;
29174         /* byte_9 is 64 b */
29175         uint64_t        byte_9;
29176         uint8_t unused_0[7];
29177         /*
29178          * This field is used in Output records to indicate that the output
29179          * is completely written to RAM.  This field should be read as '1'
29180          * to indicate that the output has been completely written.
29181          * When writing a command completion or response to an internal processor,
29182          * the order of writes has to be such that this field is written last.
29183          */
29184         uint8_t valid;
29185 } __attribute__((packed));
29186
29187 /***********************************
29188  * hwrm_cfa_flow_aging_timer_reset *
29189  ***********************************/
29190
29191
29192 /* hwrm_cfa_flow_aging_timer_reset_input (size:256b/32B) */
29193 struct hwrm_cfa_flow_aging_timer_reset_input {
29194         /* The HWRM command request type. */
29195         uint16_t        req_type;
29196         /*
29197          * The completion ring to send the completion event on. This should
29198          * be the NQ ID returned from the `nq_alloc` HWRM command.
29199          */
29200         uint16_t        cmpl_ring;
29201         /*
29202          * The sequence ID is used by the driver for tracking multiple
29203          * commands. This ID is treated as opaque data by the firmware and
29204          * the value is returned in the `hwrm_resp_hdr` upon completion.
29205          */
29206         uint16_t        seq_id;
29207         /*
29208          * The target ID of the command:
29209          * * 0x0-0xFFF8 - The function ID
29210          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29211          * * 0xFFFD - Reserved for user-space HWRM interface
29212          * * 0xFFFF - HWRM
29213          */
29214         uint16_t        target_id;
29215         /*
29216          * A physical address pointer pointing to a host buffer that the
29217          * command's response data will be written. This can be either a host
29218          * physical address (HPA) or a guest physical address (GPA) and must
29219          * point to a physically contiguous block of memory.
29220          */
29221         uint64_t        resp_addr;
29222         /* Flow record index. */
29223         uint16_t        flow_handle;
29224         uint8_t unused_0[2];
29225         /*
29226          * New flow timer value for the flow specified in the ext_flow_handle.
29227          * The flow timer unit is 100ms.
29228          */
29229         uint32_t        flow_timer;
29230         /* This value identifies a set of CFA data structures used for a flow. */
29231         uint64_t        ext_flow_handle;
29232 } __attribute__((packed));
29233
29234 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
29235 struct hwrm_cfa_flow_aging_timer_reset_output {
29236         /* The specific error status for the command. */
29237         uint16_t        error_code;
29238         /* The HWRM command request type. */
29239         uint16_t        req_type;
29240         /* The sequence ID from the original command. */
29241         uint16_t        seq_id;
29242         /* The length of the response data in number of bytes. */
29243         uint16_t        resp_len;
29244         uint8_t unused_0[7];
29245         /*
29246          * This field is used in Output records to indicate that the output
29247          * is completely written to RAM.  This field should be read as '1'
29248          * to indicate that the output has been completely written.
29249          * When writing a command completion or response to an internal processor,
29250          * the order of writes has to be such that this field is written last.
29251          */
29252         uint8_t valid;
29253 } __attribute__((packed));
29254
29255 /***************************
29256  * hwrm_cfa_flow_aging_cfg *
29257  ***************************/
29258
29259
29260 /* hwrm_cfa_flow_aging_cfg_input (size:384b/48B) */
29261 struct hwrm_cfa_flow_aging_cfg_input {
29262         /* The HWRM command request type. */
29263         uint16_t        req_type;
29264         /*
29265          * The completion ring to send the completion event on. This should
29266          * be the NQ ID returned from the `nq_alloc` HWRM command.
29267          */
29268         uint16_t        cmpl_ring;
29269         /*
29270          * The sequence ID is used by the driver for tracking multiple
29271          * commands. This ID is treated as opaque data by the firmware and
29272          * the value is returned in the `hwrm_resp_hdr` upon completion.
29273          */
29274         uint16_t        seq_id;
29275         /*
29276          * The target ID of the command:
29277          * * 0x0-0xFFF8 - The function ID
29278          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29279          * * 0xFFFD - Reserved for user-space HWRM interface
29280          * * 0xFFFF - HWRM
29281          */
29282         uint16_t        target_id;
29283         /*
29284          * A physical address pointer pointing to a host buffer that the
29285          * command's response data will be written. This can be either a host
29286          * physical address (HPA) or a guest physical address (GPA) and must
29287          * point to a physically contiguous block of memory.
29288          */
29289         uint64_t        resp_addr;
29290         /* The bit field to enable per flow aging configuration. */
29291         uint16_t        enables;
29292         /* This bit must be '1' for the tcp flow timer field to be configured */
29293         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FLOW_TIMER \
29294                 UINT32_C(0x1)
29295         /* This bit must be '1' for the tcp finish timer field to be configured */
29296         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FIN_TIMER \
29297                 UINT32_C(0x2)
29298         /* This bit must be '1' for the udp flow timer field to be configured */
29299         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_UDP_FLOW_TIMER \
29300                 UINT32_C(0x4)
29301         /* This bit must be '1' for the eem dma interval field to be configured */
29302         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_DMA_INTERVAL \
29303                 UINT32_C(0x8)
29304         /* This bit must be '1' for the eem notice interval field to be configured */
29305         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_NOTICE_INTERVAL \
29306                 UINT32_C(0x10)
29307         /* This bit must be '1' for the eem context memory maximum entries field to be configured */
29308         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MAX_ENTRIES \
29309                 UINT32_C(0x20)
29310         /* This bit must be '1' for the eem context memory ID field to be configured */
29311         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_ID \
29312                 UINT32_C(0x40)
29313         /* This bit must be '1' for the eem context memory type field to be configured */
29314         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MEM_TYPE \
29315                 UINT32_C(0x80)
29316         uint8_t flags;
29317         /* Enumeration denoting the RX, TX type of the resource. */
29318         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH       UINT32_C(0x1)
29319         /* tx path */
29320         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_TX      UINT32_C(0x0)
29321         /* rx path */
29322         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX      UINT32_C(0x1)
29323         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_LAST \
29324                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX
29325         /* Enumeration denoting the enable, disable eem flow aging configuration. */
29326         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM        UINT32_C(0x2)
29327         /* tx path */
29328         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_DISABLE \
29329                 (UINT32_C(0x0) << 1)
29330         /* rx path */
29331         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE \
29332                 (UINT32_C(0x1) << 1)
29333         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_LAST \
29334                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE
29335         uint8_t unused_0;
29336         /* The flow aging timer for all TCP flows, the unit is 100 milliseconds. */
29337         uint32_t        tcp_flow_timer;
29338         /* The TCP finished timer for all TCP flows, the unit is 100 milliseconds. */
29339         uint32_t        tcp_fin_timer;
29340         /* The flow aging timer for all UDP flows, the unit is 100 milliseconds. */
29341         uint32_t        udp_flow_timer;
29342         /* The interval to dma eem ejection data to host memory, the unit is milliseconds. */
29343         uint16_t        eem_dma_interval;
29344         /* The interval to notify driver to read the eem ejection data, the unit is milliseconds. */
29345         uint16_t        eem_notice_interval;
29346         /* The maximum entries number in the eem context memory. */
29347         uint32_t        eem_ctx_max_entries;
29348         /* The context memory ID for eem flow aging. */
29349         uint16_t        eem_ctx_id;
29350         uint16_t        eem_ctx_mem_type;
29351         /* The content of context memory is eem ejection data, the size of each entry is 4 bytes. */
29352         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA \
29353                 UINT32_C(0x0)
29354         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_LAST \
29355                 HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA
29356         uint8_t unused_1[4];
29357 } __attribute__((packed));
29358
29359 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
29360 struct hwrm_cfa_flow_aging_cfg_output {
29361         /* The specific error status for the command. */
29362         uint16_t        error_code;
29363         /* The HWRM command request type. */
29364         uint16_t        req_type;
29365         /* The sequence ID from the original command. */
29366         uint16_t        seq_id;
29367         /* The length of the response data in number of bytes. */
29368         uint16_t        resp_len;
29369         uint8_t unused_0[7];
29370         /*
29371          * This field is used in Output records to indicate that the output
29372          * is completely written to RAM.  This field should be read as '1'
29373          * to indicate that the output has been completely written.
29374          * When writing a command completion or response to an internal processor,
29375          * the order of writes has to be such that this field is written last.
29376          */
29377         uint8_t valid;
29378 } __attribute__((packed));
29379
29380 /****************************
29381  * hwrm_cfa_flow_aging_qcfg *
29382  ****************************/
29383
29384
29385 /* hwrm_cfa_flow_aging_qcfg_input (size:192b/24B) */
29386 struct hwrm_cfa_flow_aging_qcfg_input {
29387         /* The HWRM command request type. */
29388         uint16_t        req_type;
29389         /*
29390          * The completion ring to send the completion event on. This should
29391          * be the NQ ID returned from the `nq_alloc` HWRM command.
29392          */
29393         uint16_t        cmpl_ring;
29394         /*
29395          * The sequence ID is used by the driver for tracking multiple
29396          * commands. This ID is treated as opaque data by the firmware and
29397          * the value is returned in the `hwrm_resp_hdr` upon completion.
29398          */
29399         uint16_t        seq_id;
29400         /*
29401          * The target ID of the command:
29402          * * 0x0-0xFFF8 - The function ID
29403          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29404          * * 0xFFFD - Reserved for user-space HWRM interface
29405          * * 0xFFFF - HWRM
29406          */
29407         uint16_t        target_id;
29408         /*
29409          * A physical address pointer pointing to a host buffer that the
29410          * command's response data will be written. This can be either a host
29411          * physical address (HPA) or a guest physical address (GPA) and must
29412          * point to a physically contiguous block of memory.
29413          */
29414         uint64_t        resp_addr;
29415         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
29416         uint8_t flags;
29417         /* Enumeration denoting the RX, TX type of the resource. */
29418         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
29419         /* tx path */
29420         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
29421         /* rx path */
29422         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
29423         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST \
29424                 HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
29425         uint8_t unused_0[7];
29426 } __attribute__((packed));
29427
29428 /* hwrm_cfa_flow_aging_qcfg_output (size:320b/40B) */
29429 struct hwrm_cfa_flow_aging_qcfg_output {
29430         /* The specific error status for the command. */
29431         uint16_t        error_code;
29432         /* The HWRM command request type. */
29433         uint16_t        req_type;
29434         /* The sequence ID from the original command. */
29435         uint16_t        seq_id;
29436         /* The length of the response data in number of bytes. */
29437         uint16_t        resp_len;
29438         /* The current flow aging timer for all TCP flows, the unit is 100 millisecond. */
29439         uint32_t        tcp_flow_timer;
29440         /* The current TCP finished timer for all TCP flows, the unit is 100 millisecond. */
29441         uint32_t        tcp_fin_timer;
29442         /* The current flow aging timer for all UDP flows, the unit is 100 millisecond. */
29443         uint32_t        udp_flow_timer;
29444         /* The interval to dma eem ejection data to host memory, the unit is milliseconds. */
29445         uint16_t        eem_dma_interval;
29446         /* The interval to notify driver to read the eem ejection data, the unit is milliseconds. */
29447         uint16_t        eem_notice_interval;
29448         /* The maximum entries number in the eem context memory. */
29449         uint32_t        eem_ctx_max_entries;
29450         /* The context memory ID for eem flow aging. */
29451         uint16_t        eem_ctx_id;
29452         /* The context memory type for eem flow aging. */
29453         uint16_t        eem_ctx_mem_type;
29454         uint8_t unused_0[7];
29455         /*
29456          * This field is used in Output records to indicate that the output
29457          * is completely written to RAM.  This field should be read as '1'
29458          * to indicate that the output has been completely written.
29459          * When writing a command completion or response to an internal processor,
29460          * the order of writes has to be such that this field is written last.
29461          */
29462         uint8_t valid;
29463 } __attribute__((packed));
29464
29465 /*****************************
29466  * hwrm_cfa_flow_aging_qcaps *
29467  *****************************/
29468
29469
29470 /* hwrm_cfa_flow_aging_qcaps_input (size:192b/24B) */
29471 struct hwrm_cfa_flow_aging_qcaps_input {
29472         /* The HWRM command request type. */
29473         uint16_t        req_type;
29474         /*
29475          * The completion ring to send the completion event on. This should
29476          * be the NQ ID returned from the `nq_alloc` HWRM command.
29477          */
29478         uint16_t        cmpl_ring;
29479         /*
29480          * The sequence ID is used by the driver for tracking multiple
29481          * commands. This ID is treated as opaque data by the firmware and
29482          * the value is returned in the `hwrm_resp_hdr` upon completion.
29483          */
29484         uint16_t        seq_id;
29485         /*
29486          * The target ID of the command:
29487          * * 0x0-0xFFF8 - The function ID
29488          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29489          * * 0xFFFD - Reserved for user-space HWRM interface
29490          * * 0xFFFF - HWRM
29491          */
29492         uint16_t        target_id;
29493         /*
29494          * A physical address pointer pointing to a host buffer that the
29495          * command's response data will be written. This can be either a host
29496          * physical address (HPA) or a guest physical address (GPA) and must
29497          * point to a physically contiguous block of memory.
29498          */
29499         uint64_t        resp_addr;
29500         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
29501         uint8_t flags;
29502         /* Enumeration denoting the RX, TX type of the resource. */
29503         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH     UINT32_C(0x1)
29504         /* tx path */
29505         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
29506         /* rx path */
29507         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
29508         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST \
29509                 HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
29510         uint8_t unused_0[7];
29511 } __attribute__((packed));
29512
29513 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
29514 struct hwrm_cfa_flow_aging_qcaps_output {
29515         /* The specific error status for the command. */
29516         uint16_t        error_code;
29517         /* The HWRM command request type. */
29518         uint16_t        req_type;
29519         /* The sequence ID from the original command. */
29520         uint16_t        seq_id;
29521         /* The length of the response data in number of bytes. */
29522         uint16_t        resp_len;
29523         /* The maximum flow aging timer for all TCP flows, the unit is 100 millisecond. */
29524         uint32_t        max_tcp_flow_timer;
29525         /* The maximum TCP finished timer for all TCP flows, the unit is 100 millisecond. */
29526         uint32_t        max_tcp_fin_timer;
29527         /* The maximum flow aging timer for all UDP flows, the unit is 100 millisecond. */
29528         uint32_t        max_udp_flow_timer;
29529         /* The maximum aging flows that HW can support. */
29530         uint32_t        max_aging_flows;
29531         uint8_t unused_0[7];
29532         /*
29533          * This field is used in Output records to indicate that the output
29534          * is completely written to RAM.  This field should be read as '1'
29535          * to indicate that the output has been completely written.
29536          * When writing a command completion or response to an internal processor,
29537          * the order of writes has to be such that this field is written last.
29538          */
29539         uint8_t valid;
29540 } __attribute__((packed));
29541
29542 /**********************************
29543  * hwrm_cfa_tcp_flag_process_qcfg *
29544  **********************************/
29545
29546
29547 /* hwrm_cfa_tcp_flag_process_qcfg_input (size:128b/16B) */
29548 struct hwrm_cfa_tcp_flag_process_qcfg_input {
29549         /* The HWRM command request type. */
29550         uint16_t        req_type;
29551         /*
29552          * The completion ring to send the completion event on. This should
29553          * be the NQ ID returned from the `nq_alloc` HWRM command.
29554          */
29555         uint16_t        cmpl_ring;
29556         /*
29557          * The sequence ID is used by the driver for tracking multiple
29558          * commands. This ID is treated as opaque data by the firmware and
29559          * the value is returned in the `hwrm_resp_hdr` upon completion.
29560          */
29561         uint16_t        seq_id;
29562         /*
29563          * The target ID of the command:
29564          * * 0x0-0xFFF8 - The function ID
29565          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29566          * * 0xFFFD - Reserved for user-space HWRM interface
29567          * * 0xFFFF - HWRM
29568          */
29569         uint16_t        target_id;
29570         /*
29571          * A physical address pointer pointing to a host buffer that the
29572          * command's response data will be written. This can be either a host
29573          * physical address (HPA) or a guest physical address (GPA) and must
29574          * point to a physically contiguous block of memory.
29575          */
29576         uint64_t        resp_addr;
29577 } __attribute__((packed));
29578
29579 /* hwrm_cfa_tcp_flag_process_qcfg_output (size:192b/24B) */
29580 struct hwrm_cfa_tcp_flag_process_qcfg_output {
29581         /* The specific error status for the command. */
29582         uint16_t        error_code;
29583         /* The HWRM command request type. */
29584         uint16_t        req_type;
29585         /* The sequence ID from the original command. */
29586         uint16_t        seq_id;
29587         /* The length of the response data in number of bytes. */
29588         uint16_t        resp_len;
29589         /* The port 0 RX mirror action record ID. */
29590         uint16_t        rx_ar_id_port0;
29591         /* The port 1 RX mirror action record ID. */
29592         uint16_t        rx_ar_id_port1;
29593         /* The port 0 RX action record ID for TX TCP flag packets from loopback path. */
29594         uint16_t        tx_ar_id_port0;
29595         /* The port 1 RX action record ID for TX TCP flag packets from loopback path. */
29596         uint16_t        tx_ar_id_port1;
29597         uint8_t unused_0[7];
29598         /*
29599          * This field is used in Output records to indicate that the output
29600          * is completely written to RAM.  This field should be read as '1'
29601          * to indicate that the output has been completely written.
29602          * When writing a command completion or response to an internal processor,
29603          * the order of writes has to be such that this field is written last.
29604          */
29605         uint8_t valid;
29606 } __attribute__((packed));
29607
29608 /**********************
29609  * hwrm_cfa_pair_info *
29610  **********************/
29611
29612
29613 /* hwrm_cfa_pair_info_input (size:448b/56B) */
29614 struct hwrm_cfa_pair_info_input {
29615         /* The HWRM command request type. */
29616         uint16_t        req_type;
29617         /*
29618          * The completion ring to send the completion event on. This should
29619          * be the NQ ID returned from the `nq_alloc` HWRM command.
29620          */
29621         uint16_t        cmpl_ring;
29622         /*
29623          * The sequence ID is used by the driver for tracking multiple
29624          * commands. This ID is treated as opaque data by the firmware and
29625          * the value is returned in the `hwrm_resp_hdr` upon completion.
29626          */
29627         uint16_t        seq_id;
29628         /*
29629          * The target ID of the command:
29630          * * 0x0-0xFFF8 - The function ID
29631          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29632          * * 0xFFFD - Reserved for user-space HWRM interface
29633          * * 0xFFFF - HWRM
29634          */
29635         uint16_t        target_id;
29636         /*
29637          * A physical address pointer pointing to a host buffer that the
29638          * command's response data will be written. This can be either a host
29639          * physical address (HPA) or a guest physical address (GPA) and must
29640          * point to a physically contiguous block of memory.
29641          */
29642         uint64_t        resp_addr;
29643         uint32_t        flags;
29644         /* If this flag is set, lookup by name else lookup by index. */
29645         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE      UINT32_C(0x1)
29646         /* If this flag is set, lookup by PF id and VF id. */
29647         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE     UINT32_C(0x2)
29648         /* Pair table index. */
29649         uint16_t        pair_index;
29650         /* Pair pf index. */
29651         uint8_t pair_pfid;
29652         /* Pair vf index. */
29653         uint8_t pair_vfid;
29654         /* Pair name (32 byte string). */
29655         char    pair_name[32];
29656 } __attribute__((packed));
29657
29658 /* hwrm_cfa_pair_info_output (size:576b/72B) */
29659 struct hwrm_cfa_pair_info_output {
29660         /* The specific error status for the command. */
29661         uint16_t        error_code;
29662         /* The HWRM command request type. */
29663         uint16_t        req_type;
29664         /* The sequence ID from the original command. */
29665         uint16_t        seq_id;
29666         /* The length of the response data in number of bytes. */
29667         uint16_t        resp_len;
29668         /* Pair table index. */
29669         uint16_t        next_pair_index;
29670         /* Pair member a's fid. */
29671         uint16_t        a_fid;
29672         /* Logical host number. */
29673         uint8_t host_a_index;
29674         /* Logical PF number. */
29675         uint8_t pf_a_index;
29676         /* Pair member a's Linux logical VF number. */
29677         uint16_t        vf_a_index;
29678         /* Rx CFA code. */
29679         uint16_t        rx_cfa_code_a;
29680         /* Tx CFA action. */
29681         uint16_t        tx_cfa_action_a;
29682         /* Pair member b's fid. */
29683         uint16_t        b_fid;
29684         /* Logical host number. */
29685         uint8_t host_b_index;
29686         /* Logical PF number. */
29687         uint8_t pf_b_index;
29688         /* Pair member a's Linux logical VF number. */
29689         uint16_t        vf_b_index;
29690         /* Rx CFA code. */
29691         uint16_t        rx_cfa_code_b;
29692         /* Tx CFA action. */
29693         uint16_t        tx_cfa_action_b;
29694         /* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */
29695         uint8_t pair_mode;
29696         /* Pair between VF on local host with PF or VF on specified host. */
29697         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN   UINT32_C(0x0)
29698         /* Pair between REP on local host with PF or VF on specified host. */
29699         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN  UINT32_C(0x1)
29700         /* Pair between REP on local host with REP on specified host. */
29701         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
29702         /* Pair for the proxy interface. */
29703         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY   UINT32_C(0x3)
29704         /* Pair for the PF interface. */
29705         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR  UINT32_C(0x4)
29706         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST \
29707                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR
29708         /* Pair state. */
29709         uint8_t pair_state;
29710         /* Pair has been allocated */
29711         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
29712         /* Both pair members are active */
29713         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE    UINT32_C(0x2)
29714         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST \
29715                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
29716         /* Pair name (32 byte string). */
29717         char    pair_name[32];
29718         uint8_t unused_0[7];
29719         /*
29720          * This field is used in Output records to indicate that the output
29721          * is completely written to RAM.  This field should be read as '1'
29722          * to indicate that the output has been completely written.
29723          * When writing a command completion or response to an internal processor,
29724          * the order of writes has to be such that this field is written last.
29725          */
29726         uint8_t valid;
29727 } __attribute__((packed));
29728
29729 /***************************************
29730  * hwrm_cfa_redirect_query_tunnel_type *
29731  ***************************************/
29732
29733
29734 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */
29735 struct hwrm_cfa_redirect_query_tunnel_type_input {
29736         /* The HWRM command request type. */
29737         uint16_t        req_type;
29738         /*
29739          * The completion ring to send the completion event on. This should
29740          * be the NQ ID returned from the `nq_alloc` HWRM command.
29741          */
29742         uint16_t        cmpl_ring;
29743         /*
29744          * The sequence ID is used by the driver for tracking multiple
29745          * commands. This ID is treated as opaque data by the firmware and
29746          * the value is returned in the `hwrm_resp_hdr` upon completion.
29747          */
29748         uint16_t        seq_id;
29749         /*
29750          * The target ID of the command:
29751          * * 0x0-0xFFF8 - The function ID
29752          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29753          * * 0xFFFD - Reserved for user-space HWRM interface
29754          * * 0xFFFF - HWRM
29755          */
29756         uint16_t        target_id;
29757         /*
29758          * A physical address pointer pointing to a host buffer that the
29759          * command's response data will be written. This can be either a host
29760          * physical address (HPA) or a guest physical address (GPA) and must
29761          * point to a physically contiguous block of memory.
29762          */
29763         uint64_t        resp_addr;
29764         /* The source function id. */
29765         uint16_t        src_fid;
29766         uint8_t unused_0[6];
29767 } __attribute__((packed));
29768
29769 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
29770 struct hwrm_cfa_redirect_query_tunnel_type_output {
29771         /* The specific error status for the command. */
29772         uint16_t        error_code;
29773         /* The HWRM command request type. */
29774         uint16_t        req_type;
29775         /* The sequence ID from the original command. */
29776         uint16_t        seq_id;
29777         /* The length of the response data in number of bytes. */
29778         uint16_t        resp_len;
29779         /* Tunnel Mask. */
29780         uint32_t        tunnel_mask;
29781         /* Non-tunnel */
29782         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL \
29783                 UINT32_C(0x1)
29784         /* Virtual eXtensible Local Area Network (VXLAN) */
29785         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN \
29786                 UINT32_C(0x2)
29787         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
29788         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE \
29789                 UINT32_C(0x4)
29790         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
29791         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE \
29792                 UINT32_C(0x8)
29793         /* IP in IP */
29794         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP \
29795                 UINT32_C(0x10)
29796         /* Generic Network Virtualization Encapsulation (Geneve) */
29797         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE \
29798                 UINT32_C(0x20)
29799         /* Multi-Protocol Lable Switching (MPLS) */
29800         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS \
29801                 UINT32_C(0x40)
29802         /* Stateless Transport Tunnel (STT) */
29803         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT \
29804                 UINT32_C(0x80)
29805         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
29806         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE \
29807                 UINT32_C(0x100)
29808         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
29809         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4 \
29810                 UINT32_C(0x200)
29811         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
29812         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1 \
29813                 UINT32_C(0x400)
29814         /* Any tunneled traffic */
29815         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL \
29816                 UINT32_C(0x800)
29817         /* Use fixed layer 2 ether type of 0xFFFF */
29818         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2_ETYPE \
29819                 UINT32_C(0x1000)
29820         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
29821         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE_V6 \
29822                 UINT32_C(0x2000)
29823         uint8_t unused_0[3];
29824         /*
29825          * This field is used in Output records to indicate that the output
29826          * is completely written to RAM.  This field should be read as '1'
29827          * to indicate that the output has been completely written.
29828          * When writing a command completion or response to an internal processor,
29829          * the order of writes has to be such that this field is written last.
29830          */
29831         uint8_t valid;
29832 } __attribute__((packed));
29833
29834 /*************************
29835  * hwrm_cfa_ctx_mem_rgtr *
29836  *************************/
29837
29838
29839 /* hwrm_cfa_ctx_mem_rgtr_input (size:256b/32B) */
29840 struct hwrm_cfa_ctx_mem_rgtr_input {
29841         /* The HWRM command request type. */
29842         uint16_t        req_type;
29843         /*
29844          * The completion ring to send the completion event on. This should
29845          * be the NQ ID returned from the `nq_alloc` HWRM command.
29846          */
29847         uint16_t        cmpl_ring;
29848         /*
29849          * The sequence ID is used by the driver for tracking multiple
29850          * commands. This ID is treated as opaque data by the firmware and
29851          * the value is returned in the `hwrm_resp_hdr` upon completion.
29852          */
29853         uint16_t        seq_id;
29854         /*
29855          * The target ID of the command:
29856          * * 0x0-0xFFF8 - The function ID
29857          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29858          * * 0xFFFD - Reserved for user-space HWRM interface
29859          * * 0xFFFF - HWRM
29860          */
29861         uint16_t        target_id;
29862         /*
29863          * A physical address pointer pointing to a host buffer that the
29864          * command's response data will be written. This can be either a host
29865          * physical address (HPA) or a guest physical address (GPA) and must
29866          * point to a physically contiguous block of memory.
29867          */
29868         uint64_t        resp_addr;
29869         uint16_t        flags;
29870         /* Counter PBL indirect levels. */
29871         uint8_t page_level;
29872         /* PBL pointer is physical start address. */
29873         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
29874         /* PBL pointer points to PTE table. */
29875         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
29876         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
29877         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
29878         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LAST \
29879                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
29880         /* Page size. */
29881         uint8_t page_size;
29882         /* 4KB page size. */
29883         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
29884         /* 8KB page size. */
29885         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
29886         /* 64KB page size. */
29887         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
29888         /* 256KB page size. */
29889         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
29890         /* 1MB page size. */
29891         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
29892         /* 2MB page size. */
29893         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
29894         /* 4MB page size. */
29895         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
29896         /* 1GB page size. */
29897         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
29898         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_LAST \
29899                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G
29900         uint32_t        unused_0;
29901         /* Pointer to the PBL, or PDL depending on number of levels */
29902         uint64_t        page_dir;
29903 } __attribute__((packed));
29904
29905 /* hwrm_cfa_ctx_mem_rgtr_output (size:128b/16B) */
29906 struct hwrm_cfa_ctx_mem_rgtr_output {
29907         /* The specific error status for the command. */
29908         uint16_t        error_code;
29909         /* The HWRM command request type. */
29910         uint16_t        req_type;
29911         /* The sequence ID from the original command. */
29912         uint16_t        seq_id;
29913         /* The length of the response data in number of bytes. */
29914         uint16_t        resp_len;
29915         /*
29916          * Id/Handle to the recently register context memory.  This handle is passed
29917          * to the CFA feature.
29918          */
29919         uint16_t        ctx_id;
29920         uint8_t unused_0[5];
29921         /*
29922          * This field is used in Output records to indicate that the output
29923          * is completely written to RAM.  This field should be read as '1'
29924          * to indicate that the output has been completely written.
29925          * When writing a command completion or response to an internal processor,
29926          * the order of writes has to be such that this field is written last.
29927          */
29928         uint8_t valid;
29929 } __attribute__((packed));
29930
29931 /***************************
29932  * hwrm_cfa_ctx_mem_unrgtr *
29933  ***************************/
29934
29935
29936 /* hwrm_cfa_ctx_mem_unrgtr_input (size:192b/24B) */
29937 struct hwrm_cfa_ctx_mem_unrgtr_input {
29938         /* The HWRM command request type. */
29939         uint16_t        req_type;
29940         /*
29941          * The completion ring to send the completion event on. This should
29942          * be the NQ ID returned from the `nq_alloc` HWRM command.
29943          */
29944         uint16_t        cmpl_ring;
29945         /*
29946          * The sequence ID is used by the driver for tracking multiple
29947          * commands. This ID is treated as opaque data by the firmware and
29948          * the value is returned in the `hwrm_resp_hdr` upon completion.
29949          */
29950         uint16_t        seq_id;
29951         /*
29952          * The target ID of the command:
29953          * * 0x0-0xFFF8 - The function ID
29954          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29955          * * 0xFFFD - Reserved for user-space HWRM interface
29956          * * 0xFFFF - HWRM
29957          */
29958         uint16_t        target_id;
29959         /*
29960          * A physical address pointer pointing to a host buffer that the
29961          * command's response data will be written. This can be either a host
29962          * physical address (HPA) or a guest physical address (GPA) and must
29963          * point to a physically contiguous block of memory.
29964          */
29965         uint64_t        resp_addr;
29966         /*
29967          * Id/Handle to the recently register context memory.  This handle is passed
29968          * to the CFA feature.
29969          */
29970         uint16_t        ctx_id;
29971         uint8_t unused_0[6];
29972 } __attribute__((packed));
29973
29974 /* hwrm_cfa_ctx_mem_unrgtr_output (size:128b/16B) */
29975 struct hwrm_cfa_ctx_mem_unrgtr_output {
29976         /* The specific error status for the command. */
29977         uint16_t        error_code;
29978         /* The HWRM command request type. */
29979         uint16_t        req_type;
29980         /* The sequence ID from the original command. */
29981         uint16_t        seq_id;
29982         /* The length of the response data in number of bytes. */
29983         uint16_t        resp_len;
29984         uint8_t unused_0[7];
29985         /*
29986          * This field is used in Output records to indicate that the output
29987          * is completely written to RAM.  This field should be read as '1'
29988          * to indicate that the output has been completely written.
29989          * When writing a command completion or response to an internal processor,
29990          * the order of writes has to be such that this field is written last.
29991          */
29992         uint8_t valid;
29993 } __attribute__((packed));
29994
29995 /*************************
29996  * hwrm_cfa_ctx_mem_qctx *
29997  *************************/
29998
29999
30000 /* hwrm_cfa_ctx_mem_qctx_input (size:192b/24B) */
30001 struct hwrm_cfa_ctx_mem_qctx_input {
30002         /* The HWRM command request type. */
30003         uint16_t        req_type;
30004         /*
30005          * The completion ring to send the completion event on. This should
30006          * be the NQ ID returned from the `nq_alloc` HWRM command.
30007          */
30008         uint16_t        cmpl_ring;
30009         /*
30010          * The sequence ID is used by the driver for tracking multiple
30011          * commands. This ID is treated as opaque data by the firmware and
30012          * the value is returned in the `hwrm_resp_hdr` upon completion.
30013          */
30014         uint16_t        seq_id;
30015         /*
30016          * The target ID of the command:
30017          * * 0x0-0xFFF8 - The function ID
30018          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30019          * * 0xFFFD - Reserved for user-space HWRM interface
30020          * * 0xFFFF - HWRM
30021          */
30022         uint16_t        target_id;
30023         /*
30024          * A physical address pointer pointing to a host buffer that the
30025          * command's response data will be written. This can be either a host
30026          * physical address (HPA) or a guest physical address (GPA) and must
30027          * point to a physically contiguous block of memory.
30028          */
30029         uint64_t        resp_addr;
30030         /*
30031          * Id/Handle to the recently register context memory.  This handle is passed
30032          * to the CFA feature.
30033          */
30034         uint16_t        ctx_id;
30035         uint8_t unused_0[6];
30036 } __attribute__((packed));
30037
30038 /* hwrm_cfa_ctx_mem_qctx_output (size:256b/32B) */
30039 struct hwrm_cfa_ctx_mem_qctx_output {
30040         /* The specific error status for the command. */
30041         uint16_t        error_code;
30042         /* The HWRM command request type. */
30043         uint16_t        req_type;
30044         /* The sequence ID from the original command. */
30045         uint16_t        seq_id;
30046         /* The length of the response data in number of bytes. */
30047         uint16_t        resp_len;
30048         uint16_t        flags;
30049         /* Counter PBL indirect levels. */
30050         uint8_t page_level;
30051         /* PBL pointer is physical start address. */
30052         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
30053         /* PBL pointer points to PTE table. */
30054         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
30055         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
30056         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
30057         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LAST \
30058                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2
30059         /* Page size. */
30060         uint8_t page_size;
30061         /* 4KB page size. */
30062         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
30063         /* 8KB page size. */
30064         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
30065         /* 64KB page size. */
30066         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
30067         /* 256KB page size. */
30068         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
30069         /* 1MB page size. */
30070         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
30071         /* 2MB page size. */
30072         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
30073         /* 4MB page size. */
30074         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
30075         /* 1GB page size. */
30076         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
30077         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_LAST \
30078                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G
30079         uint8_t unused_0[4];
30080         /* Pointer to the PBL, or PDL depending on number of levels */
30081         uint64_t        page_dir;
30082         uint8_t unused_1[7];
30083         /*
30084          * This field is used in Output records to indicate that the output
30085          * is completely written to RAM.  This field should be read as '1'
30086          * to indicate that the output has been completely written.
30087          * When writing a command completion or response to an internal processor,
30088          * the order of writes has to be such that this field is written last.
30089          */
30090         uint8_t valid;
30091 } __attribute__((packed));
30092
30093 /**************************
30094  * hwrm_cfa_ctx_mem_qcaps *
30095  **************************/
30096
30097
30098 /* hwrm_cfa_ctx_mem_qcaps_input (size:128b/16B) */
30099 struct hwrm_cfa_ctx_mem_qcaps_input {
30100         /* The HWRM command request type. */
30101         uint16_t        req_type;
30102         /*
30103          * The completion ring to send the completion event on. This should
30104          * be the NQ ID returned from the `nq_alloc` HWRM command.
30105          */
30106         uint16_t        cmpl_ring;
30107         /*
30108          * The sequence ID is used by the driver for tracking multiple
30109          * commands. This ID is treated as opaque data by the firmware and
30110          * the value is returned in the `hwrm_resp_hdr` upon completion.
30111          */
30112         uint16_t        seq_id;
30113         /*
30114          * The target ID of the command:
30115          * * 0x0-0xFFF8 - The function ID
30116          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30117          * * 0xFFFD - Reserved for user-space HWRM interface
30118          * * 0xFFFF - HWRM
30119          */
30120         uint16_t        target_id;
30121         /*
30122          * A physical address pointer pointing to a host buffer that the
30123          * command's response data will be written. This can be either a host
30124          * physical address (HPA) or a guest physical address (GPA) and must
30125          * point to a physically contiguous block of memory.
30126          */
30127         uint64_t        resp_addr;
30128 } __attribute__((packed));
30129
30130 /* hwrm_cfa_ctx_mem_qcaps_output (size:128b/16B) */
30131 struct hwrm_cfa_ctx_mem_qcaps_output {
30132         /* The specific error status for the command. */
30133         uint16_t        error_code;
30134         /* The HWRM command request type. */
30135         uint16_t        req_type;
30136         /* The sequence ID from the original command. */
30137         uint16_t        seq_id;
30138         /* The length of the response data in number of bytes. */
30139         uint16_t        resp_len;
30140         /* Indicates the maximum number of context memory which can be registered. */
30141         uint16_t        max_entries;
30142         uint8_t unused_0[5];
30143         /*
30144          * This field is used in Output records to indicate that the output
30145          * is completely written to RAM.  This field should be read as '1'
30146          * to indicate that the output has been completely written.
30147          * When writing a command completion or response to an internal processor,
30148          * the order of writes has to be such that this field is written last.
30149          */
30150         uint8_t valid;
30151 } __attribute__((packed));
30152
30153 /**********************
30154  * hwrm_cfa_eem_qcaps *
30155  **********************/
30156
30157
30158 /* hwrm_cfa_eem_qcaps_input (size:192b/24B) */
30159 struct hwrm_cfa_eem_qcaps_input {
30160         /* The HWRM command request type. */
30161         uint16_t        req_type;
30162         /*
30163          * The completion ring to send the completion event on. This should
30164          * be the NQ ID returned from the `nq_alloc` HWRM command.
30165          */
30166         uint16_t        cmpl_ring;
30167         /*
30168          * The sequence ID is used by the driver for tracking multiple
30169          * commands. This ID is treated as opaque data by the firmware and
30170          * the value is returned in the `hwrm_resp_hdr` upon completion.
30171          */
30172         uint16_t        seq_id;
30173         /*
30174          * The target ID of the command:
30175          * * 0x0-0xFFF8 - The function ID
30176          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30177          * * 0xFFFD - Reserved for user-space HWRM interface
30178          * * 0xFFFF - HWRM
30179          */
30180         uint16_t        target_id;
30181         /*
30182          * A physical address pointer pointing to a host buffer that the
30183          * command's response data will be written. This can be either a host
30184          * physical address (HPA) or a guest physical address (GPA) and must
30185          * point to a physically contiguous block of memory.
30186          */
30187         uint64_t        resp_addr;
30188         uint32_t        flags;
30189         /*
30190          * When set to 1, indicates the configuration will apply to TX flows
30191          * which are to be offloaded.
30192          * Note if this bit is set then the path_rx bit can't be set.
30193          */
30194         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_TX \
30195                 UINT32_C(0x1)
30196         /*
30197          * When set to 1, indicates the configuration will apply to RX flows
30198          * which are to be offloaded.
30199          * Note if this bit is set then the path_tx bit can't be set.
30200          */
30201         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_RX \
30202                 UINT32_C(0x2)
30203         /* When set to 1, all offloaded flows will be sent to EEM. */
30204         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD \
30205                 UINT32_C(0x4)
30206         uint32_t        unused_0;
30207 } __attribute__((packed));
30208
30209 /* hwrm_cfa_eem_qcaps_output (size:320b/40B) */
30210 struct hwrm_cfa_eem_qcaps_output {
30211         /* The specific error status for the command. */
30212         uint16_t        error_code;
30213         /* The HWRM command request type. */
30214         uint16_t        req_type;
30215         /* The sequence ID from the original command. */
30216         uint16_t        seq_id;
30217         /* The length of the response data in number of bytes. */
30218         uint16_t        resp_len;
30219         uint32_t        flags;
30220         /*
30221          * When set to 1, indicates the configuration will apply to TX flows
30222          * which are to be offloaded.
30223          * Note if this bit is set then the path_rx bit can't be set.
30224          */
30225         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_TX \
30226                 UINT32_C(0x1)
30227         /*
30228          * When set to 1, indicates the configuration will apply to RX flows
30229          * which are to be offloaded.
30230          * Note if this bit is set then the path_tx bit can't be set.
30231          */
30232         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_RX \
30233                 UINT32_C(0x2)
30234         /*
30235          * When set to 1, indicates the the FW supports the Centralized
30236          * Memory Model.  The concept designates one entity for the
30237          * memory allocation while all others â€˜subscribe’ to it.
30238          */
30239         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
30240                 UINT32_C(0x4)
30241         /*
30242          * When set to 1, indicates the the FW supports the Detached
30243          * Centralized Memory Model.  The memory is allocated and managed
30244          * as a separate entity.  All PFs and VFs will be granted direct
30245          * or semi-direct access to the allocated memory while none of
30246          * which can interfere with the management of the memory.
30247          */
30248         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
30249                 UINT32_C(0x8)
30250         uint32_t        unused_0;
30251         uint32_t        supported;
30252         /*
30253          * If set to 1, then EEM KEY0 table is supported using crc32 hash.
30254          * If set to 0, EEM KEY0 table is not supported.
30255          */
30256         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE \
30257                 UINT32_C(0x1)
30258         /*
30259          * If set to 1, then EEM KEY1 table is supported using lookup3 hash.
30260          * If set to 0, EEM KEY1 table is not supported.
30261          */
30262         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE \
30263                 UINT32_C(0x2)
30264         /*
30265          * If set to 1, then EEM External Record table is supported.
30266          * If set to 0, EEM External Record table is not supported.
30267          * (This table includes action record, EFC pointers, encap pointers)
30268          */
30269         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE \
30270                 UINT32_C(0x4)
30271         /*
30272          * If set to 1, then EEM External Flow Counters table is supported.
30273          * If set to 0, EEM External Flow Counters table is not supported.
30274          */
30275         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE \
30276                 UINT32_C(0x8)
30277         /*
30278          * If set to 1, then FID table used for implicit flow flush is supported.
30279          * If set to 0, then FID table used for implicit flow flush is not supported.
30280          */
30281         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE \
30282                 UINT32_C(0x10)
30283         /*
30284          * The maximum number of entries supported by EEM.   When configuring the host memory
30285          * the number of numbers of entries that can supported are -
30286          *      32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M, 128M entries.
30287          * Any value that are not these values, the FW will round down to the closest support
30288          * number of entries.
30289          */
30290         uint32_t        max_entries_supported;
30291         /* The entry size in bytes of each entry in the EEM KEY0/KEY1 tables. */
30292         uint16_t        key_entry_size;
30293         /* The entry size in bytes of each entry in the EEM RECORD tables. */
30294         uint16_t        record_entry_size;
30295         /* The entry size in bytes of each entry in the EEM EFC tables. */
30296         uint16_t        efc_entry_size;
30297         /* The FID size in bytes of each entry in the EEM FID tables. */
30298         uint16_t        fid_entry_size;
30299         uint8_t unused_1[7];
30300         /*
30301          * This field is used in Output records to indicate that the output
30302          * is completely written to RAM.  This field should be read as '1'
30303          * to indicate that the output has been completely written.
30304          * When writing a command completion or response to an internal processor,
30305          * the order of writes has to be such that this field is written last.
30306          */
30307         uint8_t valid;
30308 } __attribute__((packed));
30309
30310 /********************
30311  * hwrm_cfa_eem_cfg *
30312  ********************/
30313
30314
30315 /* hwrm_cfa_eem_cfg_input (size:384b/48B) */
30316 struct hwrm_cfa_eem_cfg_input {
30317         /* The HWRM command request type. */
30318         uint16_t        req_type;
30319         /*
30320          * The completion ring to send the completion event on. This should
30321          * be the NQ ID returned from the `nq_alloc` HWRM command.
30322          */
30323         uint16_t        cmpl_ring;
30324         /*
30325          * The sequence ID is used by the driver for tracking multiple
30326          * commands. This ID is treated as opaque data by the firmware and
30327          * the value is returned in the `hwrm_resp_hdr` upon completion.
30328          */
30329         uint16_t        seq_id;
30330         /*
30331          * The target ID of the command:
30332          * * 0x0-0xFFF8 - The function ID
30333          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30334          * * 0xFFFD - Reserved for user-space HWRM interface
30335          * * 0xFFFF - HWRM
30336          */
30337         uint16_t        target_id;
30338         /*
30339          * A physical address pointer pointing to a host buffer that the
30340          * command's response data will be written. This can be either a host
30341          * physical address (HPA) or a guest physical address (GPA) and must
30342          * point to a physically contiguous block of memory.
30343          */
30344         uint64_t        resp_addr;
30345         uint32_t        flags;
30346         /*
30347          * When set to 1, indicates the configuration will apply to TX flows
30348          * which are to be offloaded.
30349          * Note if this bit is set then the path_rx bit can't be set.
30350          */
30351         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_TX \
30352                 UINT32_C(0x1)
30353         /*
30354          * When set to 1, indicates the configuration will apply to RX flows
30355          * which are to be offloaded.
30356          * Note if this bit is set then the path_tx bit can't be set.
30357          */
30358         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_RX \
30359                 UINT32_C(0x2)
30360         /* When set to 1, all offloaded flows will be sent to EEM. */
30361         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD \
30362                 UINT32_C(0x4)
30363         /* When set to 1, secondary, 0 means primary. */
30364         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_SECONDARY_PF \
30365                 UINT32_C(0x8)
30366         /*
30367          * Group_id which used by Firmware to identify memory pools belonging
30368          * to certain group.
30369          */
30370         uint16_t        group_id;
30371         uint16_t        unused_0;
30372         /*
30373          * Configured EEM with the given number of entries.  All the EEM tables KEY0, KEY1,
30374          * RECORD, EFC all have the same number of entries and all tables will be configured
30375          * using this value.  Current minimum value is 32k. Current maximum value is 128M.
30376          */
30377         uint32_t        num_entries;
30378         uint32_t        unused_1;
30379         /* Configured EEM with the given context if for KEY0 table. */
30380         uint16_t        key0_ctx_id;
30381         /* Configured EEM with the given context if for KEY1 table. */
30382         uint16_t        key1_ctx_id;
30383         /* Configured EEM with the given context if for RECORD table. */
30384         uint16_t        record_ctx_id;
30385         /* Configured EEM with the given context if for EFC table. */
30386         uint16_t        efc_ctx_id;
30387         /* Configured EEM with the given context if for EFC table. */
30388         uint16_t        fid_ctx_id;
30389         uint16_t        unused_2;
30390         uint32_t        unused_3;
30391 } __attribute__((packed));
30392
30393 /* hwrm_cfa_eem_cfg_output (size:128b/16B) */
30394 struct hwrm_cfa_eem_cfg_output {
30395         /* The specific error status for the command. */
30396         uint16_t        error_code;
30397         /* The HWRM command request type. */
30398         uint16_t        req_type;
30399         /* The sequence ID from the original command. */
30400         uint16_t        seq_id;
30401         /* The length of the response data in number of bytes. */
30402         uint16_t        resp_len;
30403         uint8_t unused_0[7];
30404         /*
30405          * This field is used in Output records to indicate that the output
30406          * is completely written to RAM.  This field should be read as '1'
30407          * to indicate that the output has been completely written.
30408          * When writing a command completion or response to an internal processor,
30409          * the order of writes has to be such that this field is written last.
30410          */
30411         uint8_t valid;
30412 } __attribute__((packed));
30413
30414 /*********************
30415  * hwrm_cfa_eem_qcfg *
30416  *********************/
30417
30418
30419 /* hwrm_cfa_eem_qcfg_input (size:192b/24B) */
30420 struct hwrm_cfa_eem_qcfg_input {
30421         /* The HWRM command request type. */
30422         uint16_t        req_type;
30423         /*
30424          * The completion ring to send the completion event on. This should
30425          * be the NQ ID returned from the `nq_alloc` HWRM command.
30426          */
30427         uint16_t        cmpl_ring;
30428         /*
30429          * The sequence ID is used by the driver for tracking multiple
30430          * commands. This ID is treated as opaque data by the firmware and
30431          * the value is returned in the `hwrm_resp_hdr` upon completion.
30432          */
30433         uint16_t        seq_id;
30434         /*
30435          * The target ID of the command:
30436          * * 0x0-0xFFF8 - The function ID
30437          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30438          * * 0xFFFD - Reserved for user-space HWRM interface
30439          * * 0xFFFF - HWRM
30440          */
30441         uint16_t        target_id;
30442         /*
30443          * A physical address pointer pointing to a host buffer that the
30444          * command's response data will be written. This can be either a host
30445          * physical address (HPA) or a guest physical address (GPA) and must
30446          * point to a physically contiguous block of memory.
30447          */
30448         uint64_t        resp_addr;
30449         uint32_t        flags;
30450         /* When set to 1, indicates the configuration is the TX flow. */
30451         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
30452         /* When set to 1, indicates the configuration is the RX flow. */
30453         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
30454         uint32_t        unused_0;
30455 } __attribute__((packed));
30456
30457 /* hwrm_cfa_eem_qcfg_output (size:256b/32B) */
30458 struct hwrm_cfa_eem_qcfg_output {
30459         /* The specific error status for the command. */
30460         uint16_t        error_code;
30461         /* The HWRM command request type. */
30462         uint16_t        req_type;
30463         /* The sequence ID from the original command. */
30464         uint16_t        seq_id;
30465         /* The length of the response data in number of bytes. */
30466         uint16_t        resp_len;
30467         uint32_t        flags;
30468         /* When set to 1, indicates the configuration is the TX flow. */
30469         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_TX \
30470                 UINT32_C(0x1)
30471         /* When set to 1, indicates the configuration is the RX flow. */
30472         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_RX \
30473                 UINT32_C(0x2)
30474         /* When set to 1, all offloaded flows will be sent to EEM. */
30475         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD \
30476                 UINT32_C(0x4)
30477         /* The number of entries the FW has configured for EEM. */
30478         uint32_t        num_entries;
30479         /* Configured EEM with the given context if for KEY0 table. */
30480         uint16_t        key0_ctx_id;
30481         /* Configured EEM with the given context if for KEY1 table. */
30482         uint16_t        key1_ctx_id;
30483         /* Configured EEM with the given context if for RECORD table. */
30484         uint16_t        record_ctx_id;
30485         /* Configured EEM with the given context if for EFC table. */
30486         uint16_t        efc_ctx_id;
30487         /* Configured EEM with the given context if for EFC table. */
30488         uint16_t        fid_ctx_id;
30489         uint8_t unused_2[5];
30490         /*
30491          * This field is used in Output records to indicate that the output
30492          * is completely written to RAM.  This field should be read as '1'
30493          * to indicate that the output has been completely written.
30494          * When writing a command completion or response to an internal processor,
30495          * the order of writes has to be such that this field is written last.
30496          */
30497         uint8_t valid;
30498 } __attribute__((packed));
30499
30500 /*******************
30501  * hwrm_cfa_eem_op *
30502  *******************/
30503
30504
30505 /* hwrm_cfa_eem_op_input (size:192b/24B) */
30506 struct hwrm_cfa_eem_op_input {
30507         /* The HWRM command request type. */
30508         uint16_t        req_type;
30509         /*
30510          * The completion ring to send the completion event on. This should
30511          * be the NQ ID returned from the `nq_alloc` HWRM command.
30512          */
30513         uint16_t        cmpl_ring;
30514         /*
30515          * The sequence ID is used by the driver for tracking multiple
30516          * commands. This ID is treated as opaque data by the firmware and
30517          * the value is returned in the `hwrm_resp_hdr` upon completion.
30518          */
30519         uint16_t        seq_id;
30520         /*
30521          * The target ID of the command:
30522          * * 0x0-0xFFF8 - The function ID
30523          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30524          * * 0xFFFD - Reserved for user-space HWRM interface
30525          * * 0xFFFF - HWRM
30526          */
30527         uint16_t        target_id;
30528         /*
30529          * A physical address pointer pointing to a host buffer that the
30530          * command's response data will be written. This can be either a host
30531          * physical address (HPA) or a guest physical address (GPA) and must
30532          * point to a physically contiguous block of memory.
30533          */
30534         uint64_t        resp_addr;
30535         uint32_t        flags;
30536         /*
30537          * When set to 1, indicates the host memory which is passed will be
30538          * used for the TX flow offload function specified in fid.
30539          * Note if this bit is set then the path_rx bit can't be set.
30540          */
30541         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
30542         /*
30543          * When set to 1, indicates the host memory which is passed will be
30544          * used for the RX flow offload function specified in fid.
30545          * Note if this bit is set then the path_tx bit can't be set.
30546          */
30547         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
30548         uint16_t        unused_0;
30549         /* The number of EEM key table entries to be configured. */
30550         uint16_t        op;
30551         /* This value is reserved and should not be used. */
30552         #define HWRM_CFA_EEM_OP_INPUT_OP_RESERVED    UINT32_C(0x0)
30553         /*
30554          * To properly stop EEM and ensure there are no DMA's, the caller
30555          * must disable EEM for the given PF, using this call.  This will
30556          * safely disable EEM and ensure that all DMA'ed to the
30557          * keys/records/efc have been completed.
30558          */
30559         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_DISABLE UINT32_C(0x1)
30560         /*
30561          * Once the EEM host memory has been configured, EEM options have
30562          * been configured. Then the caller should enable EEM for the given
30563          * PF.  Note once this call has been made, then the EEM mechanism
30564          * will be active and DMA's will occur as packets are processed.
30565          */
30566         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_ENABLE  UINT32_C(0x2)
30567         /*
30568          * Clear EEM settings for the given PF so that the register values
30569          * are reset back to there initial state.
30570          */
30571         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP UINT32_C(0x3)
30572         #define HWRM_CFA_EEM_OP_INPUT_OP_LAST \
30573                 HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP
30574 } __attribute__((packed));
30575
30576 /* hwrm_cfa_eem_op_output (size:128b/16B) */
30577 struct hwrm_cfa_eem_op_output {
30578         /* The specific error status for the command. */
30579         uint16_t        error_code;
30580         /* The HWRM command request type. */
30581         uint16_t        req_type;
30582         /* The sequence ID from the original command. */
30583         uint16_t        seq_id;
30584         /* The length of the response data in number of bytes. */
30585         uint16_t        resp_len;
30586         uint8_t unused_0[7];
30587         /*
30588          * This field is used in Output records to indicate that the output
30589          * is completely written to RAM.  This field should be read as '1'
30590          * to indicate that the output has been completely written.
30591          * When writing a command completion or response to an internal processor,
30592          * the order of writes has to be such that this field is written last.
30593          */
30594         uint8_t valid;
30595 } __attribute__((packed));
30596
30597 /********************************
30598  * hwrm_cfa_adv_flow_mgnt_qcaps *
30599  ********************************/
30600
30601
30602 /* hwrm_cfa_adv_flow_mgnt_qcaps_input (size:256b/32B) */
30603 struct hwrm_cfa_adv_flow_mgnt_qcaps_input {
30604         /* The HWRM command request type. */
30605         uint16_t        req_type;
30606         /*
30607          * The completion ring to send the completion event on. This should
30608          * be the NQ ID returned from the `nq_alloc` HWRM command.
30609          */
30610         uint16_t        cmpl_ring;
30611         /*
30612          * The sequence ID is used by the driver for tracking multiple
30613          * commands. This ID is treated as opaque data by the firmware and
30614          * the value is returned in the `hwrm_resp_hdr` upon completion.
30615          */
30616         uint16_t        seq_id;
30617         /*
30618          * The target ID of the command:
30619          * * 0x0-0xFFF8 - The function ID
30620          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30621          * * 0xFFFD - Reserved for user-space HWRM interface
30622          * * 0xFFFF - HWRM
30623          */
30624         uint16_t        target_id;
30625         /*
30626          * A physical address pointer pointing to a host buffer that the
30627          * command's response data will be written. This can be either a host
30628          * physical address (HPA) or a guest physical address (GPA) and must
30629          * point to a physically contiguous block of memory.
30630          */
30631         uint64_t        resp_addr;
30632         uint32_t        unused_0[4];
30633 } __attribute__((packed));
30634
30635 /* hwrm_cfa_adv_flow_mgnt_qcaps_output (size:128b/16B) */
30636 struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
30637         /* The specific error status for the command. */
30638         uint16_t        error_code;
30639         /* The HWRM command request type. */
30640         uint16_t        req_type;
30641         /* The sequence ID from the original command. */
30642         uint16_t        seq_id;
30643         /* The length of the response data in number of bytes. */
30644         uint16_t        resp_len;
30645         uint32_t        flags;
30646         /*
30647          * Value of 1 to indicate firmware support 16-bit flow handle.
30648          * Value of 0 to indicate firmware not support 16-bit flow handle.
30649          */
30650         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_16BIT_SUPPORTED \
30651                 UINT32_C(0x1)
30652         /*
30653          * Value of 1 to indicate firmware support 64-bit flow handle.
30654          * Value of 0 to indicate firmware not support 64-bit flow handle.
30655          */
30656         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_64BIT_SUPPORTED \
30657                 UINT32_C(0x2)
30658         /*
30659          * Value of 1 to indicate firmware support flow batch delete operation through
30660          * HWRM_CFA_FLOW_FLUSH command.
30661          * Value of 0 to indicate that the firmware does not support flow batch delete
30662          * operation.
30663          */
30664         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_BATCH_DELETE_SUPPORTED \
30665                 UINT32_C(0x4)
30666         /*
30667          * Value of 1 to indicate that the firmware support flow reset all operation through
30668          * HWRM_CFA_FLOW_FLUSH command.
30669          * Value of 0 indicates firmware does not support flow reset all operation.
30670          */
30671         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_RESET_ALL_SUPPORTED \
30672                 UINT32_C(0x8)
30673         /*
30674          * Value of 1 to indicate that firmware supports use of FID as dest_id in
30675          * HWRM_CFA_NTUPLE_ALLOC/CFG commands.
30676          * Value of 0 indicates firmware does not support use of FID as dest_id.
30677          */
30678         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_DEST_FUNC_SUPPORTED \
30679                 UINT32_C(0x10)
30680         /*
30681          * Value of 1 to indicate that firmware supports TX EEM flows.
30682          * Value of 0 indicates firmware does not support TX EEM flows.
30683          */
30684         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TX_EEM_FLOW_SUPPORTED \
30685                 UINT32_C(0x20)
30686         /*
30687          * Value of 1 to indicate that firmware supports RX EEM flows.
30688          * Value of 0 indicates firmware does not support RX EEM flows.
30689          */
30690         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RX_EEM_FLOW_SUPPORTED \
30691                 UINT32_C(0x40)
30692         /*
30693          * Value of 1 to indicate that firmware supports the dynamic allocation of an
30694          * on-chip flow counter which can be used for EEM flows.
30695          * Value of 0 indicates firmware does not support the dynamic allocation of an
30696          * on-chip flow counter.
30697          */
30698         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_COUNTER_ALLOC_SUPPORTED \
30699                 UINT32_C(0x80)
30700         /*
30701          * Value of 1 to indicate that firmware supports setting of
30702          * rfs_ring_tbl_idx in HWRM_CFA_NTUPLE_ALLOC command.
30703          * Value of 0 indicates firmware does not support rfs_ring_tbl_idx.
30704          */
30705         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_SUPPORTED \
30706                 UINT32_C(0x100)
30707         /*
30708          * Value of 1 to indicate that firmware supports untagged matching
30709          * criteria on HWRM_CFA_L2_FILTER_ALLOC command. Value of 0
30710          * indicates firmware does not support untagged matching.
30711          */
30712         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_UNTAGGED_VLAN_SUPPORTED \
30713                 UINT32_C(0x200)
30714         /*
30715          * Value of 1 to indicate that firmware supports XDP filter. Value
30716          * of 0 indicates firmware does not support XDP filter.
30717          */
30718         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_XDP_SUPPORTED \
30719                 UINT32_C(0x400)
30720         /*
30721          * Value of 1 to indicate that the firmware support L2 header source
30722          * fields matching criteria on HWRM_CFA_L2_FILTER_ALLOC command.
30723          * Value of 0 indicates firmware does not support L2 header source
30724          * fields matching.
30725          */
30726         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_HEADER_SOURCE_FIELDS_SUPPORTED \
30727                 UINT32_C(0x800)
30728         uint8_t unused_0[3];
30729         /*
30730          * This field is used in Output records to indicate that the output
30731          * is completely written to RAM.  This field should be read as '1'
30732          * to indicate that the output has been completely written.
30733          * When writing a command completion or response to an internal processor,
30734          * the order of writes has to be such that this field is written last.
30735          */
30736         uint8_t valid;
30737 } __attribute__((packed));
30738
30739 /******************
30740  * hwrm_cfa_tflib *
30741  ******************/
30742
30743
30744 /* hwrm_cfa_tflib_input (size:1024b/128B) */
30745 struct hwrm_cfa_tflib_input {
30746         /* The HWRM command request type. */
30747         uint16_t        req_type;
30748         /*
30749          * The completion ring to send the completion event on. This should
30750          * be the NQ ID returned from the `nq_alloc` HWRM command.
30751          */
30752         uint16_t        cmpl_ring;
30753         /*
30754          * The sequence ID is used by the driver for tracking multiple
30755          * commands. This ID is treated as opaque data by the firmware and
30756          * the value is returned in the `hwrm_resp_hdr` upon completion.
30757          */
30758         uint16_t        seq_id;
30759         /*
30760          * The target ID of the command:
30761          * * 0x0-0xFFF8 - The function ID
30762          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30763          * * 0xFFFD - Reserved for user-space HWRM interface
30764          * * 0xFFFF - HWRM
30765          */
30766         uint16_t        target_id;
30767         /*
30768          * A physical address pointer pointing to a host buffer that the
30769          * command's response data will be written. This can be either a host
30770          * physical address (HPA) or a guest physical address (GPA) and must
30771          * point to a physically contiguous block of memory.
30772          */
30773         uint64_t        resp_addr;
30774         /* TFLIB message type. */
30775         uint16_t        tf_type;
30776         /* TFLIB message subtype. */
30777         uint16_t        tf_subtype;
30778         /* unused. */
30779         uint8_t unused0[4];
30780         /* TFLIB request data. */
30781         uint32_t        tf_req[26];
30782 } __attribute__((packed));
30783
30784 /* hwrm_cfa_tflib_output (size:5632b/704B) */
30785 struct hwrm_cfa_tflib_output {
30786         /* The specific error status for the command. */
30787         uint16_t        error_code;
30788         /* The HWRM command request type. */
30789         uint16_t        req_type;
30790         /* The sequence ID from the original command. */
30791         uint16_t        seq_id;
30792         /* The length of the response data in number of bytes. */
30793         uint16_t        resp_len;
30794         /* TFLIB message type. */
30795         uint16_t        tf_type;
30796         /* TFLIB message subtype. */
30797         uint16_t        tf_subtype;
30798         /* TFLIB response code */
30799         uint32_t        tf_resp_code;
30800         /* TFLIB response data. */
30801         uint32_t        tf_resp[170];
30802         /* unused. */
30803         uint8_t unused1[7];
30804         /*
30805          * This field is used in Output records to indicate that the output
30806          * is completely written to RAM.  This field should be read as '1'
30807          * to indicate that the output has been completely written.
30808          * When writing a command completion or response to an internal processor,
30809          * the order of writes has to be such that this field is written last.
30810          */
30811         uint8_t valid;
30812 } __attribute__((packed));
30813
30814 /******************************
30815  * hwrm_tunnel_dst_port_query *
30816  ******************************/
30817
30818
30819 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
30820 struct hwrm_tunnel_dst_port_query_input {
30821         /* The HWRM command request type. */
30822         uint16_t        req_type;
30823         /*
30824          * The completion ring to send the completion event on. This should
30825          * be the NQ ID returned from the `nq_alloc` HWRM command.
30826          */
30827         uint16_t        cmpl_ring;
30828         /*
30829          * The sequence ID is used by the driver for tracking multiple
30830          * commands. This ID is treated as opaque data by the firmware and
30831          * the value is returned in the `hwrm_resp_hdr` upon completion.
30832          */
30833         uint16_t        seq_id;
30834         /*
30835          * The target ID of the command:
30836          * * 0x0-0xFFF8 - The function ID
30837          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30838          * * 0xFFFD - Reserved for user-space HWRM interface
30839          * * 0xFFFF - HWRM
30840          */
30841         uint16_t        target_id;
30842         /*
30843          * A physical address pointer pointing to a host buffer that the
30844          * command's response data will be written. This can be either a host
30845          * physical address (HPA) or a guest physical address (GPA) and must
30846          * point to a physically contiguous block of memory.
30847          */
30848         uint64_t        resp_addr;
30849         /* Tunnel Type. */
30850         uint8_t tunnel_type;
30851         /* Virtual eXtensible Local Area Network (VXLAN) */
30852         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
30853                 UINT32_C(0x1)
30854         /* Generic Network Virtualization Encapsulation (Geneve) */
30855         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
30856                 UINT32_C(0x5)
30857         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
30858         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 \
30859                 UINT32_C(0x9)
30860         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
30861         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 \
30862                 UINT32_C(0xa)
30863         /* Use fixed layer 2 ether type of 0xFFFF */
30864         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_L2_ETYPE \
30865                 UINT32_C(0xb)
30866         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
30867         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
30868                 UINT32_C(0xc)
30869         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST \
30870                 HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
30871         uint8_t unused_0[7];
30872 } __attribute__((packed));
30873
30874 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
30875 struct hwrm_tunnel_dst_port_query_output {
30876         /* The specific error status for the command. */
30877         uint16_t        error_code;
30878         /* The HWRM command request type. */
30879         uint16_t        req_type;
30880         /* The sequence ID from the original command. */
30881         uint16_t        seq_id;
30882         /* The length of the response data in number of bytes. */
30883         uint16_t        resp_len;
30884         /*
30885          * This field represents the identifier of L4 destination port
30886          * used for the given tunnel type. This field is valid for
30887          * specific tunnel types that use layer 4 (e.g. UDP)
30888          * transports for tunneling.
30889          */
30890         uint16_t        tunnel_dst_port_id;
30891         /*
30892          * This field represents the value of L4 destination port
30893          * identified by tunnel_dst_port_id. This field is valid for
30894          * specific tunnel types that use layer 4 (e.g. UDP)
30895          * transports for tunneling.
30896          * This field is in network byte order.
30897          *
30898          * A value of 0 means that the destination port is not
30899          * configured.
30900          */
30901         uint16_t        tunnel_dst_port_val;
30902         uint8_t unused_0[3];
30903         /*
30904          * This field is used in Output records to indicate that the output
30905          * is completely written to RAM.  This field should be read as '1'
30906          * to indicate that the output has been completely written.
30907          * When writing a command completion or response to an internal processor,
30908          * the order of writes has to be such that this field is written last.
30909          */
30910         uint8_t valid;
30911 } __attribute__((packed));
30912
30913 /******************************
30914  * hwrm_tunnel_dst_port_alloc *
30915  ******************************/
30916
30917
30918 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
30919 struct hwrm_tunnel_dst_port_alloc_input {
30920         /* The HWRM command request type. */
30921         uint16_t        req_type;
30922         /*
30923          * The completion ring to send the completion event on. This should
30924          * be the NQ ID returned from the `nq_alloc` HWRM command.
30925          */
30926         uint16_t        cmpl_ring;
30927         /*
30928          * The sequence ID is used by the driver for tracking multiple
30929          * commands. This ID is treated as opaque data by the firmware and
30930          * the value is returned in the `hwrm_resp_hdr` upon completion.
30931          */
30932         uint16_t        seq_id;
30933         /*
30934          * The target ID of the command:
30935          * * 0x0-0xFFF8 - The function ID
30936          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30937          * * 0xFFFD - Reserved for user-space HWRM interface
30938          * * 0xFFFF - HWRM
30939          */
30940         uint16_t        target_id;
30941         /*
30942          * A physical address pointer pointing to a host buffer that the
30943          * command's response data will be written. This can be either a host
30944          * physical address (HPA) or a guest physical address (GPA) and must
30945          * point to a physically contiguous block of memory.
30946          */
30947         uint64_t        resp_addr;
30948         /* Tunnel Type. */
30949         uint8_t tunnel_type;
30950         /* Virtual eXtensible Local Area Network (VXLAN) */
30951         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
30952                 UINT32_C(0x1)
30953         /* Generic Network Virtualization Encapsulation (Geneve) */
30954         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
30955                 UINT32_C(0x5)
30956         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
30957         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
30958                 UINT32_C(0x9)
30959         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
30960         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
30961                 UINT32_C(0xa)
30962         /* Use fixed layer 2 ether type of 0xFFFF */
30963         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
30964                 UINT32_C(0xb)
30965         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
30966         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
30967                 UINT32_C(0xc)
30968         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST \
30969                 HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
30970         uint8_t unused_0;
30971         /*
30972          * This field represents the value of L4 destination port used
30973          * for the given tunnel type. This field is valid for
30974          * specific tunnel types that use layer 4 (e.g. UDP)
30975          * transports for tunneling.
30976          *
30977          * This field is in network byte order.
30978          *
30979          * A value of 0 shall fail the command.
30980          */
30981         uint16_t        tunnel_dst_port_val;
30982         uint8_t unused_1[4];
30983 } __attribute__((packed));
30984
30985 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
30986 struct hwrm_tunnel_dst_port_alloc_output {
30987         /* The specific error status for the command. */
30988         uint16_t        error_code;
30989         /* The HWRM command request type. */
30990         uint16_t        req_type;
30991         /* The sequence ID from the original command. */
30992         uint16_t        seq_id;
30993         /* The length of the response data in number of bytes. */
30994         uint16_t        resp_len;
30995         /*
30996          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
30997          * types that has l4 destination port parameters.
30998          */
30999         uint16_t        tunnel_dst_port_id;
31000         uint8_t unused_0[5];
31001         /*
31002          * This field is used in Output records to indicate that the output
31003          * is completely written to RAM.  This field should be read as '1'
31004          * to indicate that the output has been completely written.
31005          * When writing a command completion or response to an internal processor,
31006          * the order of writes has to be such that this field is written last.
31007          */
31008         uint8_t valid;
31009 } __attribute__((packed));
31010
31011 /*****************************
31012  * hwrm_tunnel_dst_port_free *
31013  *****************************/
31014
31015
31016 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
31017 struct hwrm_tunnel_dst_port_free_input {
31018         /* The HWRM command request type. */
31019         uint16_t        req_type;
31020         /*
31021          * The completion ring to send the completion event on. This should
31022          * be the NQ ID returned from the `nq_alloc` HWRM command.
31023          */
31024         uint16_t        cmpl_ring;
31025         /*
31026          * The sequence ID is used by the driver for tracking multiple
31027          * commands. This ID is treated as opaque data by the firmware and
31028          * the value is returned in the `hwrm_resp_hdr` upon completion.
31029          */
31030         uint16_t        seq_id;
31031         /*
31032          * The target ID of the command:
31033          * * 0x0-0xFFF8 - The function ID
31034          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31035          * * 0xFFFD - Reserved for user-space HWRM interface
31036          * * 0xFFFF - HWRM
31037          */
31038         uint16_t        target_id;
31039         /*
31040          * A physical address pointer pointing to a host buffer that the
31041          * command's response data will be written. This can be either a host
31042          * physical address (HPA) or a guest physical address (GPA) and must
31043          * point to a physically contiguous block of memory.
31044          */
31045         uint64_t        resp_addr;
31046         /* Tunnel Type. */
31047         uint8_t tunnel_type;
31048         /* Virtual eXtensible Local Area Network (VXLAN) */
31049         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN \
31050                 UINT32_C(0x1)
31051         /* Generic Network Virtualization Encapsulation (Geneve) */
31052         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE \
31053                 UINT32_C(0x5)
31054         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
31055         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
31056                 UINT32_C(0x9)
31057         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
31058         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
31059                 UINT32_C(0xa)
31060         /* Use fixed layer 2 ether type of 0xFFFF */
31061         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
31062                 UINT32_C(0xb)
31063         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
31064         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
31065                 UINT32_C(0xc)
31066         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST \
31067                 HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
31068         uint8_t unused_0;
31069         /*
31070          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
31071          * types that has l4 destination port parameters.
31072          */
31073         uint16_t        tunnel_dst_port_id;
31074         uint8_t unused_1[4];
31075 } __attribute__((packed));
31076
31077 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
31078 struct hwrm_tunnel_dst_port_free_output {
31079         /* The specific error status for the command. */
31080         uint16_t        error_code;
31081         /* The HWRM command request type. */
31082         uint16_t        req_type;
31083         /* The sequence ID from the original command. */
31084         uint16_t        seq_id;
31085         /* The length of the response data in number of bytes. */
31086         uint16_t        resp_len;
31087         uint8_t unused_1[7];
31088         /*
31089          * This field is used in Output records to indicate that the output
31090          * is completely written to RAM.  This field should be read as '1'
31091          * to indicate that the output has been completely written.
31092          * When writing a command completion or response to an internal processor,
31093          * the order of writes has to be such that this field is written last.
31094          */
31095         uint8_t valid;
31096 } __attribute__((packed));
31097
31098 /* Periodic statistics context DMA to host. */
31099 /* ctx_hw_stats (size:1280b/160B) */
31100 struct ctx_hw_stats {
31101         /* Number of received unicast packets */
31102         uint64_t        rx_ucast_pkts;
31103         /* Number of received multicast packets */
31104         uint64_t        rx_mcast_pkts;
31105         /* Number of received broadcast packets */
31106         uint64_t        rx_bcast_pkts;
31107         /* Number of discarded packets on received path */
31108         uint64_t        rx_discard_pkts;
31109         /* Number of dropped packets on received path */
31110         uint64_t        rx_drop_pkts;
31111         /* Number of received bytes for unicast traffic */
31112         uint64_t        rx_ucast_bytes;
31113         /* Number of received bytes for multicast traffic */
31114         uint64_t        rx_mcast_bytes;
31115         /* Number of received bytes for broadcast traffic */
31116         uint64_t        rx_bcast_bytes;
31117         /* Number of transmitted unicast packets */
31118         uint64_t        tx_ucast_pkts;
31119         /* Number of transmitted multicast packets */
31120         uint64_t        tx_mcast_pkts;
31121         /* Number of transmitted broadcast packets */
31122         uint64_t        tx_bcast_pkts;
31123         /* Number of discarded packets on transmit path */
31124         uint64_t        tx_discard_pkts;
31125         /* Number of dropped packets on transmit path */
31126         uint64_t        tx_drop_pkts;
31127         /* Number of transmitted bytes for unicast traffic */
31128         uint64_t        tx_ucast_bytes;
31129         /* Number of transmitted bytes for multicast traffic */
31130         uint64_t        tx_mcast_bytes;
31131         /* Number of transmitted bytes for broadcast traffic */
31132         uint64_t        tx_bcast_bytes;
31133         /* Number of TPA packets */
31134         uint64_t        tpa_pkts;
31135         /* Number of TPA bytes */
31136         uint64_t        tpa_bytes;
31137         /* Number of TPA events */
31138         uint64_t        tpa_events;
31139         /* Number of TPA aborts */
31140         uint64_t        tpa_aborts;
31141 } __attribute__((packed));
31142
31143 /* Periodic statistics context DMA to host. */
31144 /* ctx_hw_stats_ext (size:1344b/168B) */
31145 struct ctx_hw_stats_ext {
31146         /* Number of received unicast packets */
31147         uint64_t        rx_ucast_pkts;
31148         /* Number of received multicast packets */
31149         uint64_t        rx_mcast_pkts;
31150         /* Number of received broadcast packets */
31151         uint64_t        rx_bcast_pkts;
31152         /* Number of discarded packets on received path */
31153         uint64_t        rx_discard_pkts;
31154         /* Number of dropped packets on received path */
31155         uint64_t        rx_drop_pkts;
31156         /* Number of received bytes for unicast traffic */
31157         uint64_t        rx_ucast_bytes;
31158         /* Number of received bytes for multicast traffic */
31159         uint64_t        rx_mcast_bytes;
31160         /* Number of received bytes for broadcast traffic */
31161         uint64_t        rx_bcast_bytes;
31162         /* Number of transmitted unicast packets */
31163         uint64_t        tx_ucast_pkts;
31164         /* Number of transmitted multicast packets */
31165         uint64_t        tx_mcast_pkts;
31166         /* Number of transmitted broadcast packets */
31167         uint64_t        tx_bcast_pkts;
31168         /* Number of discarded packets on transmit path */
31169         uint64_t        tx_discard_pkts;
31170         /* Number of dropped packets on transmit path */
31171         uint64_t        tx_drop_pkts;
31172         /* Number of transmitted bytes for unicast traffic */
31173         uint64_t        tx_ucast_bytes;
31174         /* Number of transmitted bytes for multicast traffic */
31175         uint64_t        tx_mcast_bytes;
31176         /* Number of transmitted bytes for broadcast traffic */
31177         uint64_t        tx_bcast_bytes;
31178         /* Number of TPA eligible packets */
31179         uint64_t        rx_tpa_eligible_pkt;
31180         /* Number of TPA eligible bytes */
31181         uint64_t        rx_tpa_eligible_bytes;
31182         /* Number of TPA packets */
31183         uint64_t        rx_tpa_pkt;
31184         /* Number of TPA bytes */
31185         uint64_t        rx_tpa_bytes;
31186         /* Number of TPA errors */
31187         uint64_t        rx_tpa_errors;
31188 } __attribute__((packed));
31189
31190 /* Periodic Engine statistics context DMA to host. */
31191 /* ctx_eng_stats (size:512b/64B) */
31192 struct ctx_eng_stats {
31193         /*
31194          * Count of data bytes into the Engine.
31195          * This includes any user supplied prefix,
31196          * but does not include any predefined
31197          * prefix data.
31198          */
31199         uint64_t        eng_bytes_in;
31200         /* Count of data bytes out of the Engine. */
31201         uint64_t        eng_bytes_out;
31202         /*
31203          * Count, in 4-byte (dword) units, of bytes
31204          * that are input as auxiliary data.
31205          * This includes the aux_cmd data.
31206          */
31207         uint64_t        aux_bytes_in;
31208         /*
31209          * Count, in 4-byte (dword) units, of bytes
31210          * that are output as auxiliary data.
31211          * This count is the buffer space for aux_data
31212          * output provided in the RQE, not the actual
31213          * aux_data written
31214          */
31215         uint64_t        aux_bytes_out;
31216         /* Count of number of commands executed. */
31217         uint64_t        commands;
31218         /*
31219          * Count of number of error commands.
31220          * These are the commands with a
31221          * non-zero status value.
31222          */
31223         uint64_t        error_commands;
31224         /*
31225          * Compression/Encryption Engine usage,
31226          * the unit is count of clock cycles
31227          */
31228         uint64_t        cce_engine_usage;
31229         /*
31230          * De-Compression/De-cryption Engine usage,
31231          * the unit is count of clock cycles
31232          */
31233         uint64_t        cdd_engine_usage;
31234 } __attribute__((packed));
31235
31236 /***********************
31237  * hwrm_stat_ctx_alloc *
31238  ***********************/
31239
31240
31241 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */
31242 struct hwrm_stat_ctx_alloc_input {
31243         /* The HWRM command request type. */
31244         uint16_t        req_type;
31245         /*
31246          * The completion ring to send the completion event on. This should
31247          * be the NQ ID returned from the `nq_alloc` HWRM command.
31248          */
31249         uint16_t        cmpl_ring;
31250         /*
31251          * The sequence ID is used by the driver for tracking multiple
31252          * commands. This ID is treated as opaque data by the firmware and
31253          * the value is returned in the `hwrm_resp_hdr` upon completion.
31254          */
31255         uint16_t        seq_id;
31256         /*
31257          * The target ID of the command:
31258          * * 0x0-0xFFF8 - The function ID
31259          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31260          * * 0xFFFD - Reserved for user-space HWRM interface
31261          * * 0xFFFF - HWRM
31262          */
31263         uint16_t        target_id;
31264         /*
31265          * A physical address pointer pointing to a host buffer that the
31266          * command's response data will be written. This can be either a host
31267          * physical address (HPA) or a guest physical address (GPA) and must
31268          * point to a physically contiguous block of memory.
31269          */
31270         uint64_t        resp_addr;
31271         /*
31272          * This is the address for statistic block.
31273          * > For new versions of the chip, this address should be 128B
31274          * > aligned.
31275          */
31276         uint64_t        stats_dma_addr;
31277         /*
31278          * The statistic block update period in ms.
31279          * e.g. 250ms, 500ms, 750ms, 1000ms.
31280          * If update_period_ms is 0, then the stats update
31281          * shall be never done and the DMA address shall not be used.
31282          * In this case, the stat block can only be read by
31283          * hwrm_stat_ctx_query command.
31284          * On Ethernet/L2 based devices:
31285          *   if tpa v2 supported (hwrm_vnic_qcaps[max_aggs_supported]>0),
31286          *       ctx_hw_stats_ext is used for DMA,
31287          *   else
31288          *       ctx_hw_stats is used for DMA.
31289          */
31290         uint32_t        update_period_ms;
31291         /*
31292          * This field is used to specify statistics context specific
31293          * configuration flags.
31294          */
31295         uint8_t stat_ctx_flags;
31296         /*
31297          * When this bit is set to '1', the statistics context shall be
31298          * allocated for RoCE traffic only. In this case, traffic other
31299          * than offloaded RoCE traffic shall not be included in this
31300          * statistic context.
31301          * When this bit is set to '0', the statistics context shall be
31302          * used for network traffic or engine traffic.
31303          */
31304         #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE     UINT32_C(0x1)
31305         uint8_t unused_0;
31306         /*
31307          * This is the size of the structure (ctx_hw_stats or
31308          * ctx_hw_stats_ext) that the driver has allocated to be used
31309          * for the periodic DMA updates.
31310          */
31311         uint16_t        stats_dma_length;
31312 } __attribute__((packed));
31313
31314 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
31315 struct hwrm_stat_ctx_alloc_output {
31316         /* The specific error status for the command. */
31317         uint16_t        error_code;
31318         /* The HWRM command request type. */
31319         uint16_t        req_type;
31320         /* The sequence ID from the original command. */
31321         uint16_t        seq_id;
31322         /* The length of the response data in number of bytes. */
31323         uint16_t        resp_len;
31324         /* This is the statistics context ID value. */
31325         uint32_t        stat_ctx_id;
31326         uint8_t unused_0[3];
31327         /*
31328          * This field is used in Output records to indicate that the output
31329          * is completely written to RAM.  This field should be read as '1'
31330          * to indicate that the output has been completely written.
31331          * When writing a command completion or response to an internal processor,
31332          * the order of writes has to be such that this field is written last.
31333          */
31334         uint8_t valid;
31335 } __attribute__((packed));
31336
31337 /**********************
31338  * hwrm_stat_ctx_free *
31339  **********************/
31340
31341
31342 /* hwrm_stat_ctx_free_input (size:192b/24B) */
31343 struct hwrm_stat_ctx_free_input {
31344         /* The HWRM command request type. */
31345         uint16_t        req_type;
31346         /*
31347          * The completion ring to send the completion event on. This should
31348          * be the NQ ID returned from the `nq_alloc` HWRM command.
31349          */
31350         uint16_t        cmpl_ring;
31351         /*
31352          * The sequence ID is used by the driver for tracking multiple
31353          * commands. This ID is treated as opaque data by the firmware and
31354          * the value is returned in the `hwrm_resp_hdr` upon completion.
31355          */
31356         uint16_t        seq_id;
31357         /*
31358          * The target ID of the command:
31359          * * 0x0-0xFFF8 - The function ID
31360          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31361          * * 0xFFFD - Reserved for user-space HWRM interface
31362          * * 0xFFFF - HWRM
31363          */
31364         uint16_t        target_id;
31365         /*
31366          * A physical address pointer pointing to a host buffer that the
31367          * command's response data will be written. This can be either a host
31368          * physical address (HPA) or a guest physical address (GPA) and must
31369          * point to a physically contiguous block of memory.
31370          */
31371         uint64_t        resp_addr;
31372         /* ID of the statistics context that is being queried. */
31373         uint32_t        stat_ctx_id;
31374         uint8_t unused_0[4];
31375 } __attribute__((packed));
31376
31377 /* hwrm_stat_ctx_free_output (size:128b/16B) */
31378 struct hwrm_stat_ctx_free_output {
31379         /* The specific error status for the command. */
31380         uint16_t        error_code;
31381         /* The HWRM command request type. */
31382         uint16_t        req_type;
31383         /* The sequence ID from the original command. */
31384         uint16_t        seq_id;
31385         /* The length of the response data in number of bytes. */
31386         uint16_t        resp_len;
31387         /* This is the statistics context ID value. */
31388         uint32_t        stat_ctx_id;
31389         uint8_t unused_0[3];
31390         /*
31391          * This field is used in Output records to indicate that the output
31392          * is completely written to RAM.  This field should be read as '1'
31393          * to indicate that the output has been completely written.
31394          * When writing a command completion or response to an internal processor,
31395          * the order of writes has to be such that this field is written last.
31396          */
31397         uint8_t valid;
31398 } __attribute__((packed));
31399
31400 /***********************
31401  * hwrm_stat_ctx_query *
31402  ***********************/
31403
31404
31405 /* hwrm_stat_ctx_query_input (size:192b/24B) */
31406 struct hwrm_stat_ctx_query_input {
31407         /* The HWRM command request type. */
31408         uint16_t        req_type;
31409         /*
31410          * The completion ring to send the completion event on. This should
31411          * be the NQ ID returned from the `nq_alloc` HWRM command.
31412          */
31413         uint16_t        cmpl_ring;
31414         /*
31415          * The sequence ID is used by the driver for tracking multiple
31416          * commands. This ID is treated as opaque data by the firmware and
31417          * the value is returned in the `hwrm_resp_hdr` upon completion.
31418          */
31419         uint16_t        seq_id;
31420         /*
31421          * The target ID of the command:
31422          * * 0x0-0xFFF8 - The function ID
31423          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31424          * * 0xFFFD - Reserved for user-space HWRM interface
31425          * * 0xFFFF - HWRM
31426          */
31427         uint16_t        target_id;
31428         /*
31429          * A physical address pointer pointing to a host buffer that the
31430          * command's response data will be written. This can be either a host
31431          * physical address (HPA) or a guest physical address (GPA) and must
31432          * point to a physically contiguous block of memory.
31433          */
31434         uint64_t        resp_addr;
31435         /* ID of the statistics context that is being queried. */
31436         uint32_t        stat_ctx_id;
31437         uint8_t unused_0[4];
31438 } __attribute__((packed));
31439
31440 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
31441 struct hwrm_stat_ctx_query_output {
31442         /* The specific error status for the command. */
31443         uint16_t        error_code;
31444         /* The HWRM command request type. */
31445         uint16_t        req_type;
31446         /* The sequence ID from the original command. */
31447         uint16_t        seq_id;
31448         /* The length of the response data in number of bytes. */
31449         uint16_t        resp_len;
31450         /* Number of transmitted unicast packets */
31451         uint64_t        tx_ucast_pkts;
31452         /* Number of transmitted multicast packets */
31453         uint64_t        tx_mcast_pkts;
31454         /* Number of transmitted broadcast packets */
31455         uint64_t        tx_bcast_pkts;
31456         /* Number of transmitted packets with error */
31457         uint64_t        tx_err_pkts;
31458         /* Number of dropped packets on transmit path */
31459         uint64_t        tx_drop_pkts;
31460         /* Number of transmitted bytes for unicast traffic */
31461         uint64_t        tx_ucast_bytes;
31462         /* Number of transmitted bytes for multicast traffic */
31463         uint64_t        tx_mcast_bytes;
31464         /* Number of transmitted bytes for broadcast traffic */
31465         uint64_t        tx_bcast_bytes;
31466         /* Number of received unicast packets */
31467         uint64_t        rx_ucast_pkts;
31468         /* Number of received multicast packets */
31469         uint64_t        rx_mcast_pkts;
31470         /* Number of received broadcast packets */
31471         uint64_t        rx_bcast_pkts;
31472         /* Number of received packets with error */
31473         uint64_t        rx_err_pkts;
31474         /* Number of dropped packets on received path */
31475         uint64_t        rx_drop_pkts;
31476         /* Number of received bytes for unicast traffic */
31477         uint64_t        rx_ucast_bytes;
31478         /* Number of received bytes for multicast traffic */
31479         uint64_t        rx_mcast_bytes;
31480         /* Number of received bytes for broadcast traffic */
31481         uint64_t        rx_bcast_bytes;
31482         /* Number of aggregated unicast packets */
31483         uint64_t        rx_agg_pkts;
31484         /* Number of aggregated unicast bytes */
31485         uint64_t        rx_agg_bytes;
31486         /* Number of aggregation events */
31487         uint64_t        rx_agg_events;
31488         /* Number of aborted aggregations */
31489         uint64_t        rx_agg_aborts;
31490         uint8_t unused_0[7];
31491         /*
31492          * This field is used in Output records to indicate that the output
31493          * is completely written to RAM.  This field should be read as '1'
31494          * to indicate that the output has been completely written.
31495          * When writing a command completion or response to an internal processor,
31496          * the order of writes has to be such that this field is written last.
31497          */
31498         uint8_t valid;
31499 } __attribute__((packed));
31500
31501 /***************************
31502  * hwrm_stat_ctx_eng_query *
31503  ***************************/
31504
31505
31506 /* hwrm_stat_ctx_eng_query_input (size:192b/24B) */
31507 struct hwrm_stat_ctx_eng_query_input {
31508         /* The HWRM command request type. */
31509         uint16_t        req_type;
31510         /*
31511          * The completion ring to send the completion event on. This should
31512          * be the NQ ID returned from the `nq_alloc` HWRM command.
31513          */
31514         uint16_t        cmpl_ring;
31515         /*
31516          * The sequence ID is used by the driver for tracking multiple
31517          * commands. This ID is treated as opaque data by the firmware and
31518          * the value is returned in the `hwrm_resp_hdr` upon completion.
31519          */
31520         uint16_t        seq_id;
31521         /*
31522          * The target ID of the command:
31523          * * 0x0-0xFFF8 - The function ID
31524          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31525          * * 0xFFFD - Reserved for user-space HWRM interface
31526          * * 0xFFFF - HWRM
31527          */
31528         uint16_t        target_id;
31529         /*
31530          * A physical address pointer pointing to a host buffer that the
31531          * command's response data will be written. This can be either a host
31532          * physical address (HPA) or a guest physical address (GPA) and must
31533          * point to a physically contiguous block of memory.
31534          */
31535         uint64_t        resp_addr;
31536         /* ID of the statistics context that is being queried. */
31537         uint32_t        stat_ctx_id;
31538         uint8_t unused_0[4];
31539 } __attribute__((packed));
31540
31541 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
31542 struct hwrm_stat_ctx_eng_query_output {
31543         /* The specific error status for the command. */
31544         uint16_t        error_code;
31545         /* The HWRM command request type. */
31546         uint16_t        req_type;
31547         /* The sequence ID from the original command. */
31548         uint16_t        seq_id;
31549         /* The length of the response data in number of bytes. */
31550         uint16_t        resp_len;
31551         /*
31552          * Count of data bytes into the Engine.
31553          * This includes any user supplied prefix,
31554          * but does not include any predefined
31555          * prefix data.
31556          */
31557         uint64_t        eng_bytes_in;
31558         /* Count of data bytes out of the Engine. */
31559         uint64_t        eng_bytes_out;
31560         /*
31561          * Count, in 4-byte (dword) units, of bytes
31562          * that are input as auxiliary data.
31563          * This includes the aux_cmd data.
31564          */
31565         uint64_t        aux_bytes_in;
31566         /*
31567          * Count, in 4-byte (dword) units, of bytes
31568          * that are output as auxiliary data.
31569          * This count is the buffer space for aux_data
31570          * output provided in the RQE, not the actual
31571          * aux_data written
31572          */
31573         uint64_t        aux_bytes_out;
31574         /* Count of number of commands executed. */
31575         uint64_t        commands;
31576         /*
31577          * Count of number of error commands.
31578          * These are the commands with a
31579          * non-zero status value.
31580          */
31581         uint64_t        error_commands;
31582         /*
31583          * Compression/Encryption Engine usage,
31584          * the unit is count of clock cycles
31585          */
31586         uint64_t        cce_engine_usage;
31587         /*
31588          * De-Compression/De-cryption Engine usage,
31589          * the unit is count of clock cycles
31590          */
31591         uint64_t        cdd_engine_usage;
31592         uint8_t unused_0[7];
31593         /*
31594          * This field is used in Output records to indicate that the output
31595          * is completely written to RAM.  This field should be read as '1'
31596          * to indicate that the output has been completely written.
31597          * When writing a command completion or response to an internal processor,
31598          * the order of writes has to be such that this field is written last.
31599          */
31600         uint8_t valid;
31601 } __attribute__((packed));
31602
31603 /***************************
31604  * hwrm_stat_ctx_clr_stats *
31605  ***************************/
31606
31607
31608 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
31609 struct hwrm_stat_ctx_clr_stats_input {
31610         /* The HWRM command request type. */
31611         uint16_t        req_type;
31612         /*
31613          * The completion ring to send the completion event on. This should
31614          * be the NQ ID returned from the `nq_alloc` HWRM command.
31615          */
31616         uint16_t        cmpl_ring;
31617         /*
31618          * The sequence ID is used by the driver for tracking multiple
31619          * commands. This ID is treated as opaque data by the firmware and
31620          * the value is returned in the `hwrm_resp_hdr` upon completion.
31621          */
31622         uint16_t        seq_id;
31623         /*
31624          * The target ID of the command:
31625          * * 0x0-0xFFF8 - The function ID
31626          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31627          * * 0xFFFD - Reserved for user-space HWRM interface
31628          * * 0xFFFF - HWRM
31629          */
31630         uint16_t        target_id;
31631         /*
31632          * A physical address pointer pointing to a host buffer that the
31633          * command's response data will be written. This can be either a host
31634          * physical address (HPA) or a guest physical address (GPA) and must
31635          * point to a physically contiguous block of memory.
31636          */
31637         uint64_t        resp_addr;
31638         /* ID of the statistics context that is being queried. */
31639         uint32_t        stat_ctx_id;
31640         uint8_t unused_0[4];
31641 } __attribute__((packed));
31642
31643 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
31644 struct hwrm_stat_ctx_clr_stats_output {
31645         /* The specific error status for the command. */
31646         uint16_t        error_code;
31647         /* The HWRM command request type. */
31648         uint16_t        req_type;
31649         /* The sequence ID from the original command. */
31650         uint16_t        seq_id;
31651         /* The length of the response data in number of bytes. */
31652         uint16_t        resp_len;
31653         uint8_t unused_0[7];
31654         /*
31655          * This field is used in Output records to indicate that the output
31656          * is completely written to RAM.  This field should be read as '1'
31657          * to indicate that the output has been completely written.
31658          * When writing a command completion or response to an internal processor,
31659          * the order of writes has to be such that this field is written last.
31660          */
31661         uint8_t valid;
31662 } __attribute__((packed));
31663
31664 /********************
31665  * hwrm_pcie_qstats *
31666  ********************/
31667
31668
31669 /* hwrm_pcie_qstats_input (size:256b/32B) */
31670 struct hwrm_pcie_qstats_input {
31671         /* The HWRM command request type. */
31672         uint16_t        req_type;
31673         /*
31674          * The completion ring to send the completion event on. This should
31675          * be the NQ ID returned from the `nq_alloc` HWRM command.
31676          */
31677         uint16_t        cmpl_ring;
31678         /*
31679          * The sequence ID is used by the driver for tracking multiple
31680          * commands. This ID is treated as opaque data by the firmware and
31681          * the value is returned in the `hwrm_resp_hdr` upon completion.
31682          */
31683         uint16_t        seq_id;
31684         /*
31685          * The target ID of the command:
31686          * * 0x0-0xFFF8 - The function ID
31687          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31688          * * 0xFFFD - Reserved for user-space HWRM interface
31689          * * 0xFFFF - HWRM
31690          */
31691         uint16_t        target_id;
31692         /*
31693          * A physical address pointer pointing to a host buffer that the
31694          * command's response data will be written. This can be either a host
31695          * physical address (HPA) or a guest physical address (GPA) and must
31696          * point to a physically contiguous block of memory.
31697          */
31698         uint64_t        resp_addr;
31699         /*
31700          * The size of PCIe statistics block in bytes.
31701          * Firmware will DMA the PCIe statistics to
31702          * the host with this field size in the response.
31703          */
31704         uint16_t        pcie_stat_size;
31705         uint8_t unused_0[6];
31706         /*
31707          * This is the host address where
31708          * PCIe statistics will be stored
31709          */
31710         uint64_t        pcie_stat_host_addr;
31711 } __attribute__((packed));
31712
31713 /* hwrm_pcie_qstats_output (size:128b/16B) */
31714 struct hwrm_pcie_qstats_output {
31715         /* The specific error status for the command. */
31716         uint16_t        error_code;
31717         /* The HWRM command request type. */
31718         uint16_t        req_type;
31719         /* The sequence ID from the original command. */
31720         uint16_t        seq_id;
31721         /* The length of the response data in number of bytes. */
31722         uint16_t        resp_len;
31723         /* The size of PCIe statistics block in bytes. */
31724         uint16_t        pcie_stat_size;
31725         uint8_t unused_0[5];
31726         /*
31727          * This field is used in Output records to indicate that the output
31728          * is completely written to RAM.  This field should be read as '1'
31729          * to indicate that the output has been completely written.
31730          * When writing a command completion or response to an internal processor,
31731          * the order of writes has to be such that this field is written last.
31732          */
31733         uint8_t valid;
31734 } __attribute__((packed));
31735
31736 /* PCIe Statistics Formats */
31737 /* pcie_ctx_hw_stats (size:768b/96B) */
31738 struct pcie_ctx_hw_stats {
31739         /* Number of physical layer receiver errors */
31740         uint64_t        pcie_pl_signal_integrity;
31741         /* Number of DLLP CRC errors detected by Data Link Layer */
31742         uint64_t        pcie_dl_signal_integrity;
31743         /*
31744          * Number of TLP LCRC and sequence number errors detected
31745          * by Data Link Layer
31746          */
31747         uint64_t        pcie_tl_signal_integrity;
31748         /* Number of times LTSSM entered Recovery state */
31749         uint64_t        pcie_link_integrity;
31750         /* Number of TLP bytes that have been trasmitted */
31751         uint64_t        pcie_tx_traffic_rate;
31752         /* Number of TLP bytes that have been received */
31753         uint64_t        pcie_rx_traffic_rate;
31754         /* Number of DLLP bytes that have been trasmitted */
31755         uint64_t        pcie_tx_dllp_statistics;
31756         /* Number of DLLP bytes that have been received */
31757         uint64_t        pcie_rx_dllp_statistics;
31758         /*
31759          * Number of times spent in each phase of gen3
31760          * equalization
31761          */
31762         uint64_t        pcie_equalization_time;
31763         /* Records the last 16 transitions of the LTSSM */
31764         uint32_t        pcie_ltssm_histogram[4];
31765         /*
31766          * Record the last 8 reasons on why LTSSM transitioned
31767          * to Recovery
31768          */
31769         uint64_t        pcie_recovery_histogram;
31770 } __attribute__((packed));
31771
31772 /**********************
31773  * hwrm_exec_fwd_resp *
31774  **********************/
31775
31776
31777 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
31778 struct hwrm_exec_fwd_resp_input {
31779         /* The HWRM command request type. */
31780         uint16_t        req_type;
31781         /*
31782          * The completion ring to send the completion event on. This should
31783          * be the NQ ID returned from the `nq_alloc` HWRM command.
31784          */
31785         uint16_t        cmpl_ring;
31786         /*
31787          * The sequence ID is used by the driver for tracking multiple
31788          * commands. This ID is treated as opaque data by the firmware and
31789          * the value is returned in the `hwrm_resp_hdr` upon completion.
31790          */
31791         uint16_t        seq_id;
31792         /*
31793          * The target ID of the command:
31794          * * 0x0-0xFFF8 - The function ID
31795          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31796          * * 0xFFFD - Reserved for user-space HWRM interface
31797          * * 0xFFFF - HWRM
31798          */
31799         uint16_t        target_id;
31800         /*
31801          * A physical address pointer pointing to a host buffer that the
31802          * command's response data will be written. This can be either a host
31803          * physical address (HPA) or a guest physical address (GPA) and must
31804          * point to a physically contiguous block of memory.
31805          */
31806         uint64_t        resp_addr;
31807         /*
31808          * This is an encapsulated request. This request should
31809          * be executed by the HWRM and the response should be
31810          * provided in the response buffer inside the encapsulated
31811          * request.
31812          */
31813         uint32_t        encap_request[26];
31814         /*
31815          * This value indicates the target id of the response to
31816          * the encapsulated request.
31817          * 0x0 - 0xFFF8 - Used for function ids
31818          * 0xFFF8 - 0xFFFE - Reserved for internal processors
31819          * 0xFFFF - HWRM
31820          */
31821         uint16_t        encap_resp_target_id;
31822         uint8_t unused_0[6];
31823 } __attribute__((packed));
31824
31825 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
31826 struct hwrm_exec_fwd_resp_output {
31827         /* The specific error status for the command. */
31828         uint16_t        error_code;
31829         /* The HWRM command request type. */
31830         uint16_t        req_type;
31831         /* The sequence ID from the original command. */
31832         uint16_t        seq_id;
31833         /* The length of the response data in number of bytes. */
31834         uint16_t        resp_len;
31835         uint8_t unused_0[7];
31836         /*
31837          * This field is used in Output records to indicate that the output
31838          * is completely written to RAM.  This field should be read as '1'
31839          * to indicate that the output has been completely written.
31840          * When writing a command completion or response to an internal processor,
31841          * the order of writes has to be such that this field is written last.
31842          */
31843         uint8_t valid;
31844 } __attribute__((packed));
31845
31846 /************************
31847  * hwrm_reject_fwd_resp *
31848  ************************/
31849
31850
31851 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
31852 struct hwrm_reject_fwd_resp_input {
31853         /* The HWRM command request type. */
31854         uint16_t        req_type;
31855         /*
31856          * The completion ring to send the completion event on. This should
31857          * be the NQ ID returned from the `nq_alloc` HWRM command.
31858          */
31859         uint16_t        cmpl_ring;
31860         /*
31861          * The sequence ID is used by the driver for tracking multiple
31862          * commands. This ID is treated as opaque data by the firmware and
31863          * the value is returned in the `hwrm_resp_hdr` upon completion.
31864          */
31865         uint16_t        seq_id;
31866         /*
31867          * The target ID of the command:
31868          * * 0x0-0xFFF8 - The function ID
31869          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31870          * * 0xFFFD - Reserved for user-space HWRM interface
31871          * * 0xFFFF - HWRM
31872          */
31873         uint16_t        target_id;
31874         /*
31875          * A physical address pointer pointing to a host buffer that the
31876          * command's response data will be written. This can be either a host
31877          * physical address (HPA) or a guest physical address (GPA) and must
31878          * point to a physically contiguous block of memory.
31879          */
31880         uint64_t        resp_addr;
31881         /*
31882          * This is an encapsulated request. This request should
31883          * be rejected by the HWRM and the error response should be
31884          * provided in the response buffer inside the encapsulated
31885          * request.
31886          */
31887         uint32_t        encap_request[26];
31888         /*
31889          * This value indicates the target id of the response to
31890          * the encapsulated request.
31891          * 0x0 - 0xFFF8 - Used for function ids
31892          * 0xFFF8 - 0xFFFE - Reserved for internal processors
31893          * 0xFFFF - HWRM
31894          */
31895         uint16_t        encap_resp_target_id;
31896         uint8_t unused_0[6];
31897 } __attribute__((packed));
31898
31899 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
31900 struct hwrm_reject_fwd_resp_output {
31901         /* The specific error status for the command. */
31902         uint16_t        error_code;
31903         /* The HWRM command request type. */
31904         uint16_t        req_type;
31905         /* The sequence ID from the original command. */
31906         uint16_t        seq_id;
31907         /* The length of the response data in number of bytes. */
31908         uint16_t        resp_len;
31909         uint8_t unused_0[7];
31910         /*
31911          * This field is used in Output records to indicate that the output
31912          * is completely written to RAM.  This field should be read as '1'
31913          * to indicate that the output has been completely written.
31914          * When writing a command completion or response to an internal processor,
31915          * the order of writes has to be such that this field is written last.
31916          */
31917         uint8_t valid;
31918 } __attribute__((packed));
31919
31920 /*****************
31921  * hwrm_fwd_resp *
31922  *****************/
31923
31924
31925 /* hwrm_fwd_resp_input (size:1024b/128B) */
31926 struct hwrm_fwd_resp_input {
31927         /* The HWRM command request type. */
31928         uint16_t        req_type;
31929         /*
31930          * The completion ring to send the completion event on. This should
31931          * be the NQ ID returned from the `nq_alloc` HWRM command.
31932          */
31933         uint16_t        cmpl_ring;
31934         /*
31935          * The sequence ID is used by the driver for tracking multiple
31936          * commands. This ID is treated as opaque data by the firmware and
31937          * the value is returned in the `hwrm_resp_hdr` upon completion.
31938          */
31939         uint16_t        seq_id;
31940         /*
31941          * The target ID of the command:
31942          * * 0x0-0xFFF8 - The function ID
31943          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31944          * * 0xFFFD - Reserved for user-space HWRM interface
31945          * * 0xFFFF - HWRM
31946          */
31947         uint16_t        target_id;
31948         /*
31949          * A physical address pointer pointing to a host buffer that the
31950          * command's response data will be written. This can be either a host
31951          * physical address (HPA) or a guest physical address (GPA) and must
31952          * point to a physically contiguous block of memory.
31953          */
31954         uint64_t        resp_addr;
31955         /*
31956          * This value indicates the target id of the encapsulated
31957          * response.
31958          * 0x0 - 0xFFF8 - Used for function ids
31959          * 0xFFF8 - 0xFFFE - Reserved for internal processors
31960          * 0xFFFF - HWRM
31961          */
31962         uint16_t        encap_resp_target_id;
31963         /*
31964          * This value indicates the completion ring the encapsulated
31965          * response will be optionally completed on.  If the value is
31966          * -1, then no CR completion shall be generated for the
31967          * encapsulated response. Any other value must be a
31968          * valid CR ring_id value. If a valid encap_resp_cmpl_ring
31969          * is provided, then a CR completion shall be generated for
31970          * the encapsulated response.
31971          */
31972         uint16_t        encap_resp_cmpl_ring;
31973         /* This field indicates the length of encapsulated response. */
31974         uint16_t        encap_resp_len;
31975         uint8_t unused_0;
31976         uint8_t unused_1;
31977         /*
31978          * This is the host address where the encapsulated response
31979          * will be written.
31980          * This area must be 16B aligned and must be cleared to zero
31981          * before the original request is made.
31982          */
31983         uint64_t        encap_resp_addr;
31984         /* This is an encapsulated response. */
31985         uint32_t        encap_resp[24];
31986 } __attribute__((packed));
31987
31988 /* hwrm_fwd_resp_output (size:128b/16B) */
31989 struct hwrm_fwd_resp_output {
31990         /* The specific error status for the command. */
31991         uint16_t        error_code;
31992         /* The HWRM command request type. */
31993         uint16_t        req_type;
31994         /* The sequence ID from the original command. */
31995         uint16_t        seq_id;
31996         /* The length of the response data in number of bytes. */
31997         uint16_t        resp_len;
31998         uint8_t unused_0[7];
31999         /*
32000          * This field is used in Output records to indicate that the output
32001          * is completely written to RAM.  This field should be read as '1'
32002          * to indicate that the output has been completely written.
32003          * When writing a command completion or response to an internal processor,
32004          * the order of writes has to be such that this field is written last.
32005          */
32006         uint8_t valid;
32007 } __attribute__((packed));
32008
32009 /*****************************
32010  * hwrm_fwd_async_event_cmpl *
32011  *****************************/
32012
32013
32014 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */
32015 struct hwrm_fwd_async_event_cmpl_input {
32016         /* The HWRM command request type. */
32017         uint16_t        req_type;
32018         /*
32019          * The completion ring to send the completion event on. This should
32020          * be the NQ ID returned from the `nq_alloc` HWRM command.
32021          */
32022         uint16_t        cmpl_ring;
32023         /*
32024          * The sequence ID is used by the driver for tracking multiple
32025          * commands. This ID is treated as opaque data by the firmware and
32026          * the value is returned in the `hwrm_resp_hdr` upon completion.
32027          */
32028         uint16_t        seq_id;
32029         /*
32030          * The target ID of the command:
32031          * * 0x0-0xFFF8 - The function ID
32032          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32033          * * 0xFFFD - Reserved for user-space HWRM interface
32034          * * 0xFFFF - HWRM
32035          */
32036         uint16_t        target_id;
32037         /*
32038          * A physical address pointer pointing to a host buffer that the
32039          * command's response data will be written. This can be either a host
32040          * physical address (HPA) or a guest physical address (GPA) and must
32041          * point to a physically contiguous block of memory.
32042          */
32043         uint64_t        resp_addr;
32044         /*
32045          * This value indicates the target id of the encapsulated
32046          * asynchronous event.
32047          * 0x0 - 0xFFF8 - Used for function ids
32048          * 0xFFF8 - 0xFFFE - Reserved for internal processors
32049          * 0xFFFF - Broadcast to all children VFs (only applicable when
32050          * a PF is the requester)
32051          */
32052         uint16_t        encap_async_event_target_id;
32053         uint8_t unused_0[6];
32054         /* This is an encapsulated asynchronous event completion. */
32055         uint32_t        encap_async_event_cmpl[4];
32056 } __attribute__((packed));
32057
32058 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
32059 struct hwrm_fwd_async_event_cmpl_output {
32060         /* The specific error status for the command. */
32061         uint16_t        error_code;
32062         /* The HWRM command request type. */
32063         uint16_t        req_type;
32064         /* The sequence ID from the original command. */
32065         uint16_t        seq_id;
32066         /* The length of the response data in number of bytes. */
32067         uint16_t        resp_len;
32068         uint8_t unused_0[7];
32069         /*
32070          * This field is used in Output records to indicate that the output
32071          * is completely written to RAM.  This field should be read as '1'
32072          * to indicate that the output has been completely written.
32073          * When writing a command completion or response to an internal processor,
32074          * the order of writes has to be such that this field is written last.
32075          */
32076         uint8_t valid;
32077 } __attribute__((packed));
32078
32079 /**************************
32080  * hwrm_nvm_raw_write_blk *
32081  **************************/
32082
32083
32084 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */
32085 struct hwrm_nvm_raw_write_blk_input {
32086         /* The HWRM command request type. */
32087         uint16_t        req_type;
32088         /*
32089          * The completion ring to send the completion event on. This should
32090          * be the NQ ID returned from the `nq_alloc` HWRM command.
32091          */
32092         uint16_t        cmpl_ring;
32093         /*
32094          * The sequence ID is used by the driver for tracking multiple
32095          * commands. This ID is treated as opaque data by the firmware and
32096          * the value is returned in the `hwrm_resp_hdr` upon completion.
32097          */
32098         uint16_t        seq_id;
32099         /*
32100          * The target ID of the command:
32101          * * 0x0-0xFFF8 - The function ID
32102          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32103          * * 0xFFFD - Reserved for user-space HWRM interface
32104          * * 0xFFFF - HWRM
32105          */
32106         uint16_t        target_id;
32107         /*
32108          * A physical address pointer pointing to a host buffer that the
32109          * command's response data will be written. This can be either a host
32110          * physical address (HPA) or a guest physical address (GPA) and must
32111          * point to a physically contiguous block of memory.
32112          */
32113         uint64_t        resp_addr;
32114         /*
32115          * 64-bit Host Source Address.
32116          * This is the loation of the source data to be written.
32117          */
32118         uint64_t        host_src_addr;
32119         /*
32120          * 32-bit Destination Address.
32121          * This is the NVRAM byte-offset where the source data will be written to.
32122          */
32123         uint32_t        dest_addr;
32124         /* Length of data to be written, in bytes. */
32125         uint32_t        len;
32126 } __attribute__((packed));
32127
32128 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
32129 struct hwrm_nvm_raw_write_blk_output {
32130         /* The specific error status for the command. */
32131         uint16_t        error_code;
32132         /* The HWRM command request type. */
32133         uint16_t        req_type;
32134         /* The sequence ID from the original command. */
32135         uint16_t        seq_id;
32136         /* The length of the response data in number of bytes. */
32137         uint16_t        resp_len;
32138         uint8_t unused_0[7];
32139         /*
32140          * This field is used in Output records to indicate that the output
32141          * is completely written to RAM.  This field should be read as '1'
32142          * to indicate that the output has been completely written.
32143          * When writing a command completion or response to an internal processor,
32144          * the order of writes has to be such that this field is written last.
32145          */
32146         uint8_t valid;
32147 } __attribute__((packed));
32148
32149 /*****************
32150  * hwrm_nvm_read *
32151  *****************/
32152
32153
32154 /* hwrm_nvm_read_input (size:320b/40B) */
32155 struct hwrm_nvm_read_input {
32156         /* The HWRM command request type. */
32157         uint16_t        req_type;
32158         /*
32159          * The completion ring to send the completion event on. This should
32160          * be the NQ ID returned from the `nq_alloc` HWRM command.
32161          */
32162         uint16_t        cmpl_ring;
32163         /*
32164          * The sequence ID is used by the driver for tracking multiple
32165          * commands. This ID is treated as opaque data by the firmware and
32166          * the value is returned in the `hwrm_resp_hdr` upon completion.
32167          */
32168         uint16_t        seq_id;
32169         /*
32170          * The target ID of the command:
32171          * * 0x0-0xFFF8 - The function ID
32172          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32173          * * 0xFFFD - Reserved for user-space HWRM interface
32174          * * 0xFFFF - HWRM
32175          */
32176         uint16_t        target_id;
32177         /*
32178          * A physical address pointer pointing to a host buffer that the
32179          * command's response data will be written. This can be either a host
32180          * physical address (HPA) or a guest physical address (GPA) and must
32181          * point to a physically contiguous block of memory.
32182          */
32183         uint64_t        resp_addr;
32184         /*
32185          * 64-bit Host Destination Address.
32186          * This is the host address where the data will be written to.
32187          */
32188         uint64_t        host_dest_addr;
32189         /* The 0-based index of the directory entry. */
32190         uint16_t        dir_idx;
32191         uint8_t unused_0[2];
32192         /* The NVRAM byte-offset to read from. */
32193         uint32_t        offset;
32194         /* The length of the data to be read, in bytes. */
32195         uint32_t        len;
32196         uint8_t unused_1[4];
32197 } __attribute__((packed));
32198
32199 /* hwrm_nvm_read_output (size:128b/16B) */
32200 struct hwrm_nvm_read_output {
32201         /* The specific error status for the command. */
32202         uint16_t        error_code;
32203         /* The HWRM command request type. */
32204         uint16_t        req_type;
32205         /* The sequence ID from the original command. */
32206         uint16_t        seq_id;
32207         /* The length of the response data in number of bytes. */
32208         uint16_t        resp_len;
32209         uint8_t unused_0[7];
32210         /*
32211          * This field is used in Output records to indicate that the output
32212          * is completely written to RAM.  This field should be read as '1'
32213          * to indicate that the output has been completely written.
32214          * When writing a command completion or response to an internal processor,
32215          * the order of writes has to be such that this field is written last.
32216          */
32217         uint8_t valid;
32218 } __attribute__((packed));
32219
32220 /*********************
32221  * hwrm_nvm_raw_dump *
32222  *********************/
32223
32224
32225 /* hwrm_nvm_raw_dump_input (size:256b/32B) */
32226 struct hwrm_nvm_raw_dump_input {
32227         /* The HWRM command request type. */
32228         uint16_t        req_type;
32229         /*
32230          * The completion ring to send the completion event on. This should
32231          * be the NQ ID returned from the `nq_alloc` HWRM command.
32232          */
32233         uint16_t        cmpl_ring;
32234         /*
32235          * The sequence ID is used by the driver for tracking multiple
32236          * commands. This ID is treated as opaque data by the firmware and
32237          * the value is returned in the `hwrm_resp_hdr` upon completion.
32238          */
32239         uint16_t        seq_id;
32240         /*
32241          * The target ID of the command:
32242          * * 0x0-0xFFF8 - The function ID
32243          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32244          * * 0xFFFD - Reserved for user-space HWRM interface
32245          * * 0xFFFF - HWRM
32246          */
32247         uint16_t        target_id;
32248         /*
32249          * A physical address pointer pointing to a host buffer that the
32250          * command's response data will be written. This can be either a host
32251          * physical address (HPA) or a guest physical address (GPA) and must
32252          * point to a physically contiguous block of memory.
32253          */
32254         uint64_t        resp_addr;
32255         /*
32256          * 64-bit Host Destination Address.
32257          * This is the host address where the data will be written to.
32258          */
32259         uint64_t        host_dest_addr;
32260         /* 32-bit NVRAM byte-offset to read from. */
32261         uint32_t        offset;
32262         /* Total length of NVRAM contents to be read, in bytes. */
32263         uint32_t        len;
32264 } __attribute__((packed));
32265
32266 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
32267 struct hwrm_nvm_raw_dump_output {
32268         /* The specific error status for the command. */
32269         uint16_t        error_code;
32270         /* The HWRM command request type. */
32271         uint16_t        req_type;
32272         /* The sequence ID from the original command. */
32273         uint16_t        seq_id;
32274         /* The length of the response data in number of bytes. */
32275         uint16_t        resp_len;
32276         uint8_t unused_0[7];
32277         /*
32278          * This field is used in Output records to indicate that the output
32279          * is completely written to RAM.  This field should be read as '1'
32280          * to indicate that the output has been completely written.
32281          * When writing a command completion or response to an internal processor,
32282          * the order of writes has to be such that this field is written last.
32283          */
32284         uint8_t valid;
32285 } __attribute__((packed));
32286
32287 /****************************
32288  * hwrm_nvm_get_dir_entries *
32289  ****************************/
32290
32291
32292 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
32293 struct hwrm_nvm_get_dir_entries_input {
32294         /* The HWRM command request type. */
32295         uint16_t        req_type;
32296         /*
32297          * The completion ring to send the completion event on. This should
32298          * be the NQ ID returned from the `nq_alloc` HWRM command.
32299          */
32300         uint16_t        cmpl_ring;
32301         /*
32302          * The sequence ID is used by the driver for tracking multiple
32303          * commands. This ID is treated as opaque data by the firmware and
32304          * the value is returned in the `hwrm_resp_hdr` upon completion.
32305          */
32306         uint16_t        seq_id;
32307         /*
32308          * The target ID of the command:
32309          * * 0x0-0xFFF8 - The function ID
32310          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32311          * * 0xFFFD - Reserved for user-space HWRM interface
32312          * * 0xFFFF - HWRM
32313          */
32314         uint16_t        target_id;
32315         /*
32316          * A physical address pointer pointing to a host buffer that the
32317          * command's response data will be written. This can be either a host
32318          * physical address (HPA) or a guest physical address (GPA) and must
32319          * point to a physically contiguous block of memory.
32320          */
32321         uint64_t        resp_addr;
32322         /*
32323          * 64-bit Host Destination Address.
32324          * This is the host address where the directory will be written.
32325          */
32326         uint64_t        host_dest_addr;
32327 } __attribute__((packed));
32328
32329 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
32330 struct hwrm_nvm_get_dir_entries_output {
32331         /* The specific error status for the command. */
32332         uint16_t        error_code;
32333         /* The HWRM command request type. */
32334         uint16_t        req_type;
32335         /* The sequence ID from the original command. */
32336         uint16_t        seq_id;
32337         /* The length of the response data in number of bytes. */
32338         uint16_t        resp_len;
32339         uint8_t unused_0[7];
32340         /*
32341          * This field is used in Output records to indicate that the output
32342          * is completely written to RAM.  This field should be read as '1'
32343          * to indicate that the output has been completely written.
32344          * When writing a command completion or response to an internal processor,
32345          * the order of writes has to be such that this field is written last.
32346          */
32347         uint8_t valid;
32348 } __attribute__((packed));
32349
32350 /*************************
32351  * hwrm_nvm_get_dir_info *
32352  *************************/
32353
32354
32355 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
32356 struct hwrm_nvm_get_dir_info_input {
32357         /* The HWRM command request type. */
32358         uint16_t        req_type;
32359         /*
32360          * The completion ring to send the completion event on. This should
32361          * be the NQ ID returned from the `nq_alloc` HWRM command.
32362          */
32363         uint16_t        cmpl_ring;
32364         /*
32365          * The sequence ID is used by the driver for tracking multiple
32366          * commands. This ID is treated as opaque data by the firmware and
32367          * the value is returned in the `hwrm_resp_hdr` upon completion.
32368          */
32369         uint16_t        seq_id;
32370         /*
32371          * The target ID of the command:
32372          * * 0x0-0xFFF8 - The function ID
32373          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32374          * * 0xFFFD - Reserved for user-space HWRM interface
32375          * * 0xFFFF - HWRM
32376          */
32377         uint16_t        target_id;
32378         /*
32379          * A physical address pointer pointing to a host buffer that the
32380          * command's response data will be written. This can be either a host
32381          * physical address (HPA) or a guest physical address (GPA) and must
32382          * point to a physically contiguous block of memory.
32383          */
32384         uint64_t        resp_addr;
32385 } __attribute__((packed));
32386
32387 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
32388 struct hwrm_nvm_get_dir_info_output {
32389         /* The specific error status for the command. */
32390         uint16_t        error_code;
32391         /* The HWRM command request type. */
32392         uint16_t        req_type;
32393         /* The sequence ID from the original command. */
32394         uint16_t        seq_id;
32395         /* The length of the response data in number of bytes. */
32396         uint16_t        resp_len;
32397         /* Number of directory entries in the directory. */
32398         uint32_t        entries;
32399         /* Size of each directory entry, in bytes. */
32400         uint32_t        entry_length;
32401         uint8_t unused_0[7];
32402         /*
32403          * This field is used in Output records to indicate that the output
32404          * is completely written to RAM.  This field should be read as '1'
32405          * to indicate that the output has been completely written.
32406          * When writing a command completion or response to an internal processor,
32407          * the order of writes has to be such that this field is written last.
32408          */
32409         uint8_t valid;
32410 } __attribute__((packed));
32411
32412 /******************
32413  * hwrm_nvm_write *
32414  ******************/
32415
32416
32417 /* hwrm_nvm_write_input (size:384b/48B) */
32418 struct hwrm_nvm_write_input {
32419         /* The HWRM command request type. */
32420         uint16_t        req_type;
32421         /*
32422          * The completion ring to send the completion event on. This should
32423          * be the NQ ID returned from the `nq_alloc` HWRM command.
32424          */
32425         uint16_t        cmpl_ring;
32426         /*
32427          * The sequence ID is used by the driver for tracking multiple
32428          * commands. This ID is treated as opaque data by the firmware and
32429          * the value is returned in the `hwrm_resp_hdr` upon completion.
32430          */
32431         uint16_t        seq_id;
32432         /*
32433          * The target ID of the command:
32434          * * 0x0-0xFFF8 - The function ID
32435          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32436          * * 0xFFFD - Reserved for user-space HWRM interface
32437          * * 0xFFFF - HWRM
32438          */
32439         uint16_t        target_id;
32440         /*
32441          * A physical address pointer pointing to a host buffer that the
32442          * command's response data will be written. This can be either a host
32443          * physical address (HPA) or a guest physical address (GPA) and must
32444          * point to a physically contiguous block of memory.
32445          */
32446         uint64_t        resp_addr;
32447         /*
32448          * 64-bit Host Source Address.
32449          * This is where the source data is.
32450          */
32451         uint64_t        host_src_addr;
32452         /* The Directory Entry Type (valid values are defined in the bnxnvm_directory_type enum defined in the file bnxnvm_defs.h). */
32453         uint16_t        dir_type;
32454         /*
32455          * Directory ordinal.
32456          * The 0-based instance of the combined Directory Entry Type and Extension.
32457          */
32458         uint16_t        dir_ordinal;
32459         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file bnxnvm_defs.h). */
32460         uint16_t        dir_ext;
32461         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file bnxnvm_defs.h). */
32462         uint16_t        dir_attr;
32463         /*
32464          * Length of data to write, in bytes. May be less than or equal to the allocated size for the directory entry.
32465          * The data length stored in the directory entry will be updated to reflect this value once the write is complete.
32466          */
32467         uint32_t        dir_data_length;
32468         /* Option. */
32469         uint16_t        option;
32470         uint16_t        flags;
32471         /*
32472          * When this bit is '1', the original active image
32473          * will not be removed. TBD: what purpose is this?
32474          */
32475         #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG \
32476                 UINT32_C(0x1)
32477         /*
32478          * 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).
32479          * If this value is less than the specified data length, it will be ignored.
32480          * The response will contain the actual allocated item length, which may be greater than the requested item length.
32481          * 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
32482          * the potential future growth of an item (e.g. upgraded firmware with a size increase, log growth, expanded configuration data).
32483          */
32484         uint32_t        dir_item_length;
32485         uint32_t        unused_0;
32486 } __attribute__((packed));
32487
32488 /* hwrm_nvm_write_output (size:128b/16B) */
32489 struct hwrm_nvm_write_output {
32490         /* The specific error status for the command. */
32491         uint16_t        error_code;
32492         /* The HWRM command request type. */
32493         uint16_t        req_type;
32494         /* The sequence ID from the original command. */
32495         uint16_t        seq_id;
32496         /* The length of the response data in number of bytes. */
32497         uint16_t        resp_len;
32498         /*
32499          * 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.
32500          * The actual item length used when creating a new directory entry will be a multiple of an NVM block size.
32501          */
32502         uint32_t        dir_item_length;
32503         /* The directory index of the created or modified item. */
32504         uint16_t        dir_idx;
32505         uint8_t unused_0;
32506         /*
32507          * This field is used in Output records to indicate that the output
32508          * is completely written to RAM.  This field should be read as '1'
32509          * to indicate that the output has been completely written.
32510          * When writing a command completion or response to an internal processor,
32511          * the order of writes has to be such that this field is written last.
32512          */
32513         uint8_t valid;
32514 } __attribute__((packed));
32515
32516 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
32517 struct hwrm_nvm_write_cmd_err {
32518         /*
32519          * command specific error codes that goes to
32520          * the cmd_err field in Common HWRM Error Response.
32521          */
32522         uint8_t code;
32523         /* Unknown error */
32524         #define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
32525         /* Unable to complete operation due to fragmentation */
32526         #define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
32527         /* nvm is completely full. */
32528         #define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
32529         #define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST \
32530                 HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
32531         uint8_t unused_0[7];
32532 } __attribute__((packed));
32533
32534 /*******************
32535  * hwrm_nvm_modify *
32536  *******************/
32537
32538
32539 /* hwrm_nvm_modify_input (size:320b/40B) */
32540 struct hwrm_nvm_modify_input {
32541         /* The HWRM command request type. */
32542         uint16_t        req_type;
32543         /*
32544          * The completion ring to send the completion event on. This should
32545          * be the NQ ID returned from the `nq_alloc` HWRM command.
32546          */
32547         uint16_t        cmpl_ring;
32548         /*
32549          * The sequence ID is used by the driver for tracking multiple
32550          * commands. This ID is treated as opaque data by the firmware and
32551          * the value is returned in the `hwrm_resp_hdr` upon completion.
32552          */
32553         uint16_t        seq_id;
32554         /*
32555          * The target ID of the command:
32556          * * 0x0-0xFFF8 - The function ID
32557          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32558          * * 0xFFFD - Reserved for user-space HWRM interface
32559          * * 0xFFFF - HWRM
32560          */
32561         uint16_t        target_id;
32562         /*
32563          * A physical address pointer pointing to a host buffer that the
32564          * command's response data will be written. This can be either a host
32565          * physical address (HPA) or a guest physical address (GPA) and must
32566          * point to a physically contiguous block of memory.
32567          */
32568         uint64_t        resp_addr;
32569         /*
32570          * 64-bit Host Source Address.
32571          * This is where the modified data is.
32572          */
32573         uint64_t        host_src_addr;
32574         /* 16-bit directory entry index. */
32575         uint16_t        dir_idx;
32576         uint8_t unused_0[2];
32577         /* 32-bit NVRAM byte-offset to modify content from. */
32578         uint32_t        offset;
32579         /*
32580          * Length of data to be modified, in bytes. The length shall
32581          * be non-zero.
32582          */
32583         uint32_t        len;
32584         uint8_t unused_1[4];
32585 } __attribute__((packed));
32586
32587 /* hwrm_nvm_modify_output (size:128b/16B) */
32588 struct hwrm_nvm_modify_output {
32589         /* The specific error status for the command. */
32590         uint16_t        error_code;
32591         /* The HWRM command request type. */
32592         uint16_t        req_type;
32593         /* The sequence ID from the original command. */
32594         uint16_t        seq_id;
32595         /* The length of the response data in number of bytes. */
32596         uint16_t        resp_len;
32597         uint8_t unused_0[7];
32598         /*
32599          * This field is used in Output records to indicate that the output
32600          * is completely written to RAM.  This field should be read as '1'
32601          * to indicate that the output has been completely written.
32602          * When writing a command completion or response to an internal processor,
32603          * the order of writes has to be such that this field is written last.
32604          */
32605         uint8_t valid;
32606 } __attribute__((packed));
32607
32608 /***************************
32609  * hwrm_nvm_find_dir_entry *
32610  ***************************/
32611
32612
32613 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
32614 struct hwrm_nvm_find_dir_entry_input {
32615         /* The HWRM command request type. */
32616         uint16_t        req_type;
32617         /*
32618          * The completion ring to send the completion event on. This should
32619          * be the NQ ID returned from the `nq_alloc` HWRM command.
32620          */
32621         uint16_t        cmpl_ring;
32622         /*
32623          * The sequence ID is used by the driver for tracking multiple
32624          * commands. This ID is treated as opaque data by the firmware and
32625          * the value is returned in the `hwrm_resp_hdr` upon completion.
32626          */
32627         uint16_t        seq_id;
32628         /*
32629          * The target ID of the command:
32630          * * 0x0-0xFFF8 - The function ID
32631          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32632          * * 0xFFFD - Reserved for user-space HWRM interface
32633          * * 0xFFFF - HWRM
32634          */
32635         uint16_t        target_id;
32636         /*
32637          * A physical address pointer pointing to a host buffer that the
32638          * command's response data will be written. This can be either a host
32639          * physical address (HPA) or a guest physical address (GPA) and must
32640          * point to a physically contiguous block of memory.
32641          */
32642         uint64_t        resp_addr;
32643         uint32_t        enables;
32644         /*
32645          * This bit must be '1' for the dir_idx_valid field to be
32646          * configured.
32647          */
32648         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID \
32649                 UINT32_C(0x1)
32650         /* Directory Entry Index */
32651         uint16_t        dir_idx;
32652         /* Directory Entry (Image) Type */
32653         uint16_t        dir_type;
32654         /*
32655          * Directory ordinal.
32656          * The instance of this Directory Type
32657          */
32658         uint16_t        dir_ordinal;
32659         /* The Directory Entry Extension flags. */
32660         uint16_t        dir_ext;
32661         /* This value indicates the search option using dir_ordinal. */
32662         uint8_t opt_ordinal;
32663         /* This value indicates the search option using dir_ordinal. */
32664         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
32665         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
32666         /* Equal to specified ordinal value. */
32667         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ    UINT32_C(0x0)
32668         /* Greater than or equal to specified ordinal value */
32669         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE    UINT32_C(0x1)
32670         /* Greater than specified ordinal value */
32671         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT    UINT32_C(0x2)
32672         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST \
32673                 HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
32674         uint8_t unused_0[3];
32675 } __attribute__((packed));
32676
32677 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
32678 struct hwrm_nvm_find_dir_entry_output {
32679         /* The specific error status for the command. */
32680         uint16_t        error_code;
32681         /* The HWRM command request type. */
32682         uint16_t        req_type;
32683         /* The sequence ID from the original command. */
32684         uint16_t        seq_id;
32685         /* The length of the response data in number of bytes. */
32686         uint16_t        resp_len;
32687         /* Allocated NVRAM for this directory entry, in bytes. */
32688         uint32_t        dir_item_length;
32689         /* Size of the stored data for this directory entry, in bytes. */
32690         uint32_t        dir_data_length;
32691         /*
32692          * Firmware version.
32693          * Only valid if the directory entry is for embedded firmware stored in APE_BIN Format.
32694          */
32695         uint32_t        fw_ver;
32696         /* Directory ordinal. */
32697         uint16_t        dir_ordinal;
32698         /* Directory Entry Index */
32699         uint16_t        dir_idx;
32700         uint8_t unused_0[7];
32701         /*
32702          * This field is used in Output records to indicate that the output
32703          * is completely written to RAM.  This field should be read as '1'
32704          * to indicate that the output has been completely written.
32705          * When writing a command completion or response to an internal processor,
32706          * the order of writes has to be such that this field is written last.
32707          */
32708         uint8_t valid;
32709 } __attribute__((packed));
32710
32711 /****************************
32712  * hwrm_nvm_erase_dir_entry *
32713  ****************************/
32714
32715
32716 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
32717 struct hwrm_nvm_erase_dir_entry_input {
32718         /* The HWRM command request type. */
32719         uint16_t        req_type;
32720         /*
32721          * The completion ring to send the completion event on. This should
32722          * be the NQ ID returned from the `nq_alloc` HWRM command.
32723          */
32724         uint16_t        cmpl_ring;
32725         /*
32726          * The sequence ID is used by the driver for tracking multiple
32727          * commands. This ID is treated as opaque data by the firmware and
32728          * the value is returned in the `hwrm_resp_hdr` upon completion.
32729          */
32730         uint16_t        seq_id;
32731         /*
32732          * The target ID of the command:
32733          * * 0x0-0xFFF8 - The function ID
32734          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32735          * * 0xFFFD - Reserved for user-space HWRM interface
32736          * * 0xFFFF - HWRM
32737          */
32738         uint16_t        target_id;
32739         /*
32740          * A physical address pointer pointing to a host buffer that the
32741          * command's response data will be written. This can be either a host
32742          * physical address (HPA) or a guest physical address (GPA) and must
32743          * point to a physically contiguous block of memory.
32744          */
32745         uint64_t        resp_addr;
32746         /* Directory Entry Index */
32747         uint16_t        dir_idx;
32748         uint8_t unused_0[6];
32749 } __attribute__((packed));
32750
32751 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
32752 struct hwrm_nvm_erase_dir_entry_output {
32753         /* The specific error status for the command. */
32754         uint16_t        error_code;
32755         /* The HWRM command request type. */
32756         uint16_t        req_type;
32757         /* The sequence ID from the original command. */
32758         uint16_t        seq_id;
32759         /* The length of the response data in number of bytes. */
32760         uint16_t        resp_len;
32761         uint8_t unused_0[7];
32762         /*
32763          * This field is used in Output records to indicate that the output
32764          * is completely written to RAM.  This field should be read as '1'
32765          * to indicate that the output has been completely written.
32766          * When writing a command completion or response to an internal processor,
32767          * the order of writes has to be such that this field is written last.
32768          */
32769         uint8_t valid;
32770 } __attribute__((packed));
32771
32772 /*************************
32773  * hwrm_nvm_get_dev_info *
32774  *************************/
32775
32776
32777 /* hwrm_nvm_get_dev_info_input (size:128b/16B) */
32778 struct hwrm_nvm_get_dev_info_input {
32779         /* The HWRM command request type. */
32780         uint16_t        req_type;
32781         /*
32782          * The completion ring to send the completion event on. This should
32783          * be the NQ ID returned from the `nq_alloc` HWRM command.
32784          */
32785         uint16_t        cmpl_ring;
32786         /*
32787          * The sequence ID is used by the driver for tracking multiple
32788          * commands. This ID is treated as opaque data by the firmware and
32789          * the value is returned in the `hwrm_resp_hdr` upon completion.
32790          */
32791         uint16_t        seq_id;
32792         /*
32793          * The target ID of the command:
32794          * * 0x0-0xFFF8 - The function ID
32795          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32796          * * 0xFFFD - Reserved for user-space HWRM interface
32797          * * 0xFFFF - HWRM
32798          */
32799         uint16_t        target_id;
32800         /*
32801          * A physical address pointer pointing to a host buffer that the
32802          * command's response data will be written. This can be either a host
32803          * physical address (HPA) or a guest physical address (GPA) and must
32804          * point to a physically contiguous block of memory.
32805          */
32806         uint64_t        resp_addr;
32807 } __attribute__((packed));
32808
32809 /* hwrm_nvm_get_dev_info_output (size:256b/32B) */
32810 struct hwrm_nvm_get_dev_info_output {
32811         /* The specific error status for the command. */
32812         uint16_t        error_code;
32813         /* The HWRM command request type. */
32814         uint16_t        req_type;
32815         /* The sequence ID from the original command. */
32816         uint16_t        seq_id;
32817         /* The length of the response data in number of bytes. */
32818         uint16_t        resp_len;
32819         /* Manufacturer ID. */
32820         uint16_t        manufacturer_id;
32821         /* Device ID. */
32822         uint16_t        device_id;
32823         /* Sector size of the NVRAM device. */
32824         uint32_t        sector_size;
32825         /* Total size, in bytes of the NVRAM device. */
32826         uint32_t        nvram_size;
32827         uint32_t        reserved_size;
32828         /* Available size that can be used, in bytes.  Available size is the NVRAM size take away the used size and reserved size. */
32829         uint32_t        available_size;
32830         /* This field represents the major version of NVM cfg */
32831         uint8_t nvm_cfg_ver_maj;
32832         /* This field represents the minor version of NVM cfg */
32833         uint8_t nvm_cfg_ver_min;
32834         /* This field represents the update version of NVM cfg */
32835         uint8_t nvm_cfg_ver_upd;
32836         /*
32837          * This field is used in Output records to indicate that the output
32838          * is completely written to RAM.  This field should be read as '1'
32839          * to indicate that the output has been completely written.
32840          * When writing a command completion or response to an internal processor,
32841          * the order of writes has to be such that this field is written last.
32842          */
32843         uint8_t valid;
32844 } __attribute__((packed));
32845
32846 /**************************
32847  * hwrm_nvm_mod_dir_entry *
32848  **************************/
32849
32850
32851 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */
32852 struct hwrm_nvm_mod_dir_entry_input {
32853         /* The HWRM command request type. */
32854         uint16_t        req_type;
32855         /*
32856          * The completion ring to send the completion event on. This should
32857          * be the NQ ID returned from the `nq_alloc` HWRM command.
32858          */
32859         uint16_t        cmpl_ring;
32860         /*
32861          * The sequence ID is used by the driver for tracking multiple
32862          * commands. This ID is treated as opaque data by the firmware and
32863          * the value is returned in the `hwrm_resp_hdr` upon completion.
32864          */
32865         uint16_t        seq_id;
32866         /*
32867          * The target ID of the command:
32868          * * 0x0-0xFFF8 - The function ID
32869          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32870          * * 0xFFFD - Reserved for user-space HWRM interface
32871          * * 0xFFFF - HWRM
32872          */
32873         uint16_t        target_id;
32874         /*
32875          * A physical address pointer pointing to a host buffer that the
32876          * command's response data will be written. This can be either a host
32877          * physical address (HPA) or a guest physical address (GPA) and must
32878          * point to a physically contiguous block of memory.
32879          */
32880         uint64_t        resp_addr;
32881         uint32_t        enables;
32882         /*
32883          * This bit must be '1' for the checksum field to be
32884          * configured.
32885          */
32886         #define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM     UINT32_C(0x1)
32887         /* Directory Entry Index */
32888         uint16_t        dir_idx;
32889         /*
32890          * Directory ordinal.
32891          * The (0-based) instance of this Directory Type.
32892          */
32893         uint16_t        dir_ordinal;
32894         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* for extension flag definitions). */
32895         uint16_t        dir_ext;
32896         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute flag definitions). */
32897         uint16_t        dir_attr;
32898         /*
32899          * If valid, then this field updates the checksum
32900          * value of the content in the directory entry.
32901          */
32902         uint32_t        checksum;
32903 } __attribute__((packed));
32904
32905 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
32906 struct hwrm_nvm_mod_dir_entry_output {
32907         /* The specific error status for the command. */
32908         uint16_t        error_code;
32909         /* The HWRM command request type. */
32910         uint16_t        req_type;
32911         /* The sequence ID from the original command. */
32912         uint16_t        seq_id;
32913         /* The length of the response data in number of bytes. */
32914         uint16_t        resp_len;
32915         uint8_t unused_0[7];
32916         /*
32917          * This field is used in Output records to indicate that the output
32918          * is completely written to RAM.  This field should be read as '1'
32919          * to indicate that the output has been completely written.
32920          * When writing a command completion or response to an internal processor,
32921          * the order of writes has to be such that this field is written last.
32922          */
32923         uint8_t valid;
32924 } __attribute__((packed));
32925
32926 /**************************
32927  * hwrm_nvm_verify_update *
32928  **************************/
32929
32930
32931 /* hwrm_nvm_verify_update_input (size:192b/24B) */
32932 struct hwrm_nvm_verify_update_input {
32933         /* The HWRM command request type. */
32934         uint16_t        req_type;
32935         /*
32936          * The completion ring to send the completion event on. This should
32937          * be the NQ ID returned from the `nq_alloc` HWRM command.
32938          */
32939         uint16_t        cmpl_ring;
32940         /*
32941          * The sequence ID is used by the driver for tracking multiple
32942          * commands. This ID is treated as opaque data by the firmware and
32943          * the value is returned in the `hwrm_resp_hdr` upon completion.
32944          */
32945         uint16_t        seq_id;
32946         /*
32947          * The target ID of the command:
32948          * * 0x0-0xFFF8 - The function ID
32949          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32950          * * 0xFFFD - Reserved for user-space HWRM interface
32951          * * 0xFFFF - HWRM
32952          */
32953         uint16_t        target_id;
32954         /*
32955          * A physical address pointer pointing to a host buffer that the
32956          * command's response data will be written. This can be either a host
32957          * physical address (HPA) or a guest physical address (GPA) and must
32958          * point to a physically contiguous block of memory.
32959          */
32960         uint64_t        resp_addr;
32961         /* Directory Entry Type, to be verified. */
32962         uint16_t        dir_type;
32963         /*
32964          * Directory ordinal.
32965          * The instance of the Directory Type to be verified.
32966          */
32967         uint16_t        dir_ordinal;
32968         /*
32969          * The Directory Entry Extension flags.
32970          * The "UPDATE" extension flag must be set in this value.
32971          * A corresponding directory entry with the same type and ordinal values but *without*
32972          * the "UPDATE" extension flag must also exist. The other flags of the extension must
32973          * be identical between the active and update entries.
32974          */
32975         uint16_t        dir_ext;
32976         uint8_t unused_0[2];
32977 } __attribute__((packed));
32978
32979 /* hwrm_nvm_verify_update_output (size:128b/16B) */
32980 struct hwrm_nvm_verify_update_output {
32981         /* The specific error status for the command. */
32982         uint16_t        error_code;
32983         /* The HWRM command request type. */
32984         uint16_t        req_type;
32985         /* The sequence ID from the original command. */
32986         uint16_t        seq_id;
32987         /* The length of the response data in number of bytes. */
32988         uint16_t        resp_len;
32989         uint8_t unused_0[7];
32990         /*
32991          * This field is used in Output records to indicate that the output
32992          * is completely written to RAM.  This field should be read as '1'
32993          * to indicate that the output has been completely written.
32994          * When writing a command completion or response to an internal processor,
32995          * the order of writes has to be such that this field is written last.
32996          */
32997         uint8_t valid;
32998 } __attribute__((packed));
32999
33000 /***************************
33001  * hwrm_nvm_install_update *
33002  ***************************/
33003
33004
33005 /* hwrm_nvm_install_update_input (size:192b/24B) */
33006 struct hwrm_nvm_install_update_input {
33007         /* The HWRM command request type. */
33008         uint16_t        req_type;
33009         /*
33010          * The completion ring to send the completion event on. This should
33011          * be the NQ ID returned from the `nq_alloc` HWRM command.
33012          */
33013         uint16_t        cmpl_ring;
33014         /*
33015          * The sequence ID is used by the driver for tracking multiple
33016          * commands. This ID is treated as opaque data by the firmware and
33017          * the value is returned in the `hwrm_resp_hdr` upon completion.
33018          */
33019         uint16_t        seq_id;
33020         /*
33021          * The target ID of the command:
33022          * * 0x0-0xFFF8 - The function ID
33023          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33024          * * 0xFFFD - Reserved for user-space HWRM interface
33025          * * 0xFFFF - HWRM
33026          */
33027         uint16_t        target_id;
33028         /*
33029          * A physical address pointer pointing to a host buffer that the
33030          * command's response data will be written. This can be either a host
33031          * physical address (HPA) or a guest physical address (GPA) and must
33032          * point to a physically contiguous block of memory.
33033          */
33034         uint64_t        resp_addr;
33035         /*
33036          * Installation type. If the value 3 through 0xffff is used,
33037          * only packaged items with that type value will be installed and
33038          * conditional installation directives for those packaged items
33039          * will be over-ridden (i.e. 'create' or 'replace' will be treated
33040          * as 'install').
33041          */
33042         uint32_t        install_type;
33043         /*
33044          * Perform a normal package installation. Conditional installation
33045          * directives (e.g. 'create' and 'replace') of packaged items
33046          * will be followed.
33047          */
33048         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
33049         /*
33050          * Install all packaged items regardless of installation directive
33051          * (i.e. treat all packaged items as though they have an installation
33052          * directive of 'install').
33053          */
33054         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL \
33055                 UINT32_C(0xffffffff)
33056         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST \
33057                 HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL
33058         uint16_t        flags;
33059         /* If set to 1, then securely erase all unused locations in persistent storage. */
33060         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE \
33061                 UINT32_C(0x1)
33062         /*
33063          * If set to 1, then unspecifed images, images not in the package file, will be safely deleted.
33064          * When combined with erase_unused_space then unspecified images will be securely erased.
33065          */
33066         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG \
33067                 UINT32_C(0x2)
33068         /*
33069          * If set to 1, FW will defragment the NVM if defragmentation is required for the update.
33070          * Allow additional time for this command to complete if this bit is set to 1.
33071          */
33072         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG \
33073                 UINT32_C(0x4)
33074         uint8_t unused_0[2];
33075 } __attribute__((packed));
33076
33077 /* hwrm_nvm_install_update_output (size:192b/24B) */
33078 struct hwrm_nvm_install_update_output {
33079         /* The specific error status for the command. */
33080         uint16_t        error_code;
33081         /* The HWRM command request type. */
33082         uint16_t        req_type;
33083         /* The sequence ID from the original command. */
33084         uint16_t        seq_id;
33085         /* The length of the response data in number of bytes. */
33086         uint16_t        resp_len;
33087         /*
33088          * Bit-mask of successfully installed items.
33089          * Bit-0 corresponding to the first packaged item, Bit-1 for the second item, etc.
33090          * A value of 0 indicates that no items were successfully installed.
33091          */
33092         uint64_t        installed_items;
33093         /* result is 8 b */
33094         uint8_t result;
33095         /* There was no problem with the package installation. */
33096         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS UINT32_C(0x0)
33097         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST \
33098                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS
33099         /* problem_item is 8 b */
33100         uint8_t problem_item;
33101         /* There was no problem with any packaged items. */
33102         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE \
33103                 UINT32_C(0x0)
33104         /* There was a problem with the NVM package itself. */
33105         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE \
33106                 UINT32_C(0xff)
33107         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST \
33108                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE
33109         /* reset_required is 8 b */
33110         uint8_t reset_required;
33111         /*
33112          * No reset is required for installed/updated firmware or
33113          * microcode to take effect.
33114          */
33115         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE \
33116                 UINT32_C(0x0)
33117         /*
33118          * A PCIe reset (e.g. system reboot) is
33119          * required for newly installed/updated firmware or
33120          * microcode to take effect.
33121          */
33122         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI \
33123                 UINT32_C(0x1)
33124         /*
33125          * A controller power reset (e.g. system power-cycle) is
33126          * required for newly installed/updated firmware or
33127          * microcode to take effect. Some newly installed/updated
33128          * firmware or microcode may still take effect upon the
33129          * next PCIe reset.
33130          */
33131         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER \
33132                 UINT32_C(0x2)
33133         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST \
33134                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER
33135         uint8_t unused_0[4];
33136         /*
33137          * This field is used in Output records to indicate that the output
33138          * is completely written to RAM.  This field should be read as '1'
33139          * to indicate that the output has been completely written.
33140          * When writing a command completion or response to an internal processor,
33141          * the order of writes has to be such that this field is written last.
33142          */
33143         uint8_t valid;
33144 } __attribute__((packed));
33145
33146 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
33147 struct hwrm_nvm_install_update_cmd_err {
33148         /*
33149          * command specific error codes that goes to
33150          * the cmd_err field in Common HWRM Error Response.
33151          */
33152         uint8_t code;
33153         /* Unknown error */
33154         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
33155         /* Unable to complete operation due to fragmentation */
33156         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
33157         /* nvm is completely full. */
33158         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
33159         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST \
33160                 HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE
33161         uint8_t unused_0[7];
33162 } __attribute__((packed));
33163
33164 /******************
33165  * hwrm_nvm_flush *
33166  ******************/
33167
33168
33169 /* hwrm_nvm_flush_input (size:128b/16B) */
33170 struct hwrm_nvm_flush_input {
33171         /* The HWRM command request type. */
33172         uint16_t        req_type;
33173         /*
33174          * The completion ring to send the completion event on. This should
33175          * be the NQ ID returned from the `nq_alloc` HWRM command.
33176          */
33177         uint16_t        cmpl_ring;
33178         /*
33179          * The sequence ID is used by the driver for tracking multiple
33180          * commands. This ID is treated as opaque data by the firmware and
33181          * the value is returned in the `hwrm_resp_hdr` upon completion.
33182          */
33183         uint16_t        seq_id;
33184         /*
33185          * The target ID of the command:
33186          * * 0x0-0xFFF8 - The function ID
33187          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33188          * * 0xFFFD - Reserved for user-space HWRM interface
33189          * * 0xFFFF - HWRM
33190          */
33191         uint16_t        target_id;
33192         /*
33193          * A physical address pointer pointing to a host buffer that the
33194          * command's response data will be written. This can be either a host
33195          * physical address (HPA) or a guest physical address (GPA) and must
33196          * point to a physically contiguous block of memory.
33197          */
33198         uint64_t        resp_addr;
33199 } __attribute__((packed));
33200
33201 /* hwrm_nvm_flush_output (size:128b/16B) */
33202 struct hwrm_nvm_flush_output {
33203         /* The specific error status for the command. */
33204         uint16_t        error_code;
33205         /* The HWRM command request type. */
33206         uint16_t        req_type;
33207         /* The sequence ID from the original command. */
33208         uint16_t        seq_id;
33209         /* The length of the response data in number of bytes. */
33210         uint16_t        resp_len;
33211         uint8_t unused_0[7];
33212         /*
33213          * This field is used in Output records to indicate that the output
33214          * is completely written to RAM.  This field should be read as '1'
33215          * to indicate that the output has been completely written.
33216          * When writing a command completion or response to an internal processor,
33217          * the order of writes has to be such that this field is written last.
33218          */
33219         uint8_t valid;
33220 } __attribute__((packed));
33221
33222 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
33223 struct hwrm_nvm_flush_cmd_err {
33224         /*
33225          * command specific error codes that goes to
33226          * the cmd_err field in Common HWRM Error Response.
33227          */
33228         uint8_t code;
33229         /* Unknown error */
33230         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
33231         /* flush could not be performed */
33232         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL    UINT32_C(0x1)
33233         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST \
33234                 HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
33235         uint8_t unused_0[7];
33236 } __attribute__((packed));
33237
33238 /*************************
33239  * hwrm_nvm_get_variable *
33240  *************************/
33241
33242
33243 /* hwrm_nvm_get_variable_input (size:320b/40B) */
33244 struct hwrm_nvm_get_variable_input {
33245         /* The HWRM command request type. */
33246         uint16_t        req_type;
33247         /*
33248          * The completion ring to send the completion event on. This should
33249          * be the NQ ID returned from the `nq_alloc` HWRM command.
33250          */
33251         uint16_t        cmpl_ring;
33252         /*
33253          * The sequence ID is used by the driver for tracking multiple
33254          * commands. This ID is treated as opaque data by the firmware and
33255          * the value is returned in the `hwrm_resp_hdr` upon completion.
33256          */
33257         uint16_t        seq_id;
33258         /*
33259          * The target ID of the command:
33260          * * 0x0-0xFFF8 - The function ID
33261          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33262          * * 0xFFFD - Reserved for user-space HWRM interface
33263          * * 0xFFFF - HWRM
33264          */
33265         uint16_t        target_id;
33266         /*
33267          * A physical address pointer pointing to a host buffer that the
33268          * command's response data will be written. This can be either a host
33269          * physical address (HPA) or a guest physical address (GPA) and must
33270          * point to a physically contiguous block of memory.
33271          */
33272         uint64_t        resp_addr;
33273         /*
33274          * This is the host address where
33275          * nvm variable will be stored
33276          */
33277         uint64_t        dest_data_addr;
33278         /* size of data in bits */
33279         uint16_t        data_len;
33280         /* nvm cfg option number */
33281         uint16_t        option_num;
33282         /* reserved. */
33283         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
33284         /* reserved. */
33285         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
33286                 UINT32_C(0xffff)
33287         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST \
33288                 HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
33289         /*
33290          * Number of dimensions for this nvm configuration variable.
33291          * This value indicates how many of the indexN values to use.
33292          * A value of 0 means that none of the indexN values are valid.
33293          * A value of 1 requires at index0 is valued, a value of 2
33294          * requires that index0 and index1 are valid, and so forth
33295          */
33296         uint16_t        dimensions;
33297         /* index for the 1st dimensions */
33298         uint16_t        index_0;
33299         /* index for the 2nd dimensions */
33300         uint16_t        index_1;
33301         /* index for the 3rd dimensions */
33302         uint16_t        index_2;
33303         /* index for the 4th dimensions */
33304         uint16_t        index_3;
33305         uint8_t flags;
33306         /*
33307          * When this bit is set to 1, the factory default value will be returned,
33308          * 0 returns the operational value.
33309          */
33310         #define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT \
33311                 UINT32_C(0x1)
33312         uint8_t unused_0;
33313 } __attribute__((packed));
33314
33315 /* hwrm_nvm_get_variable_output (size:128b/16B) */
33316 struct hwrm_nvm_get_variable_output {
33317         /* The specific error status for the command. */
33318         uint16_t        error_code;
33319         /* The HWRM command request type. */
33320         uint16_t        req_type;
33321         /* The sequence ID from the original command. */
33322         uint16_t        seq_id;
33323         /* The length of the response data in number of bytes. */
33324         uint16_t        resp_len;
33325         /* size of data of the actual variable retrieved in bits */
33326         uint16_t        data_len;
33327         /*
33328          * option_num is the option number for the data retrieved.  It is possible in the
33329          * future that the option number returned would be different than requested.  This
33330          * condition could occur if an option is deprecated and a new option id is defined
33331          * with similar characteristics, but has a slightly different definition.  This
33332          * also makes it convenient for the caller to identify the variable result with
33333          * the option id from the response.
33334          */
33335         uint16_t        option_num;
33336         /* reserved. */
33337         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
33338         /* reserved. */
33339         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF \
33340                 UINT32_C(0xffff)
33341         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST \
33342                 HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF
33343         uint8_t unused_0[3];
33344         /*
33345          * This field is used in Output records to indicate that the output
33346          * is completely written to RAM.  This field should be read as '1'
33347          * to indicate that the output has been completely written.
33348          * When writing a command completion or response to an internal processor,
33349          * the order of writes has to be such that this field is written last.
33350          */
33351         uint8_t valid;
33352 } __attribute__((packed));
33353
33354 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
33355 struct hwrm_nvm_get_variable_cmd_err {
33356         /*
33357          * command specific error codes that goes to
33358          * the cmd_err field in Common HWRM Error Response.
33359          */
33360         uint8_t code;
33361         /* Unknown error */
33362         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
33363         /* variable does not exist */
33364         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
33365         /* configuration is corrupted and the variable cannot be saved */
33366         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
33367         /* length specified is too small */
33368         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3)
33369         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST \
33370                 HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
33371         uint8_t unused_0[7];
33372 } __attribute__((packed));
33373
33374 /*************************
33375  * hwrm_nvm_set_variable *
33376  *************************/
33377
33378
33379 /* hwrm_nvm_set_variable_input (size:320b/40B) */
33380 struct hwrm_nvm_set_variable_input {
33381         /* The HWRM command request type. */
33382         uint16_t        req_type;
33383         /*
33384          * The completion ring to send the completion event on. This should
33385          * be the NQ ID returned from the `nq_alloc` HWRM command.
33386          */
33387         uint16_t        cmpl_ring;
33388         /*
33389          * The sequence ID is used by the driver for tracking multiple
33390          * commands. This ID is treated as opaque data by the firmware and
33391          * the value is returned in the `hwrm_resp_hdr` upon completion.
33392          */
33393         uint16_t        seq_id;
33394         /*
33395          * The target ID of the command:
33396          * * 0x0-0xFFF8 - The function ID
33397          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33398          * * 0xFFFD - Reserved for user-space HWRM interface
33399          * * 0xFFFF - HWRM
33400          */
33401         uint16_t        target_id;
33402         /*
33403          * A physical address pointer pointing to a host buffer that the
33404          * command's response data will be written. This can be either a host
33405          * physical address (HPA) or a guest physical address (GPA) and must
33406          * point to a physically contiguous block of memory.
33407          */
33408         uint64_t        resp_addr;
33409         /*
33410          * This is the host address where
33411          * nvm variable will be copied from
33412          */
33413         uint64_t        src_data_addr;
33414         /* size of data in bits */
33415         uint16_t        data_len;
33416         /* nvm cfg option number */
33417         uint16_t        option_num;
33418         /* reserved. */
33419         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
33420         /* reserved. */
33421         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
33422                 UINT32_C(0xffff)
33423         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST \
33424                 HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
33425         /*
33426          * Number of dimensions for this nvm configuration variable.
33427          * This value indicates how many of the indexN values to use.
33428          * A value of 0 means that none of the indexN values are valid.
33429          * A value of 1 requires at index0 is valued, a value of 2
33430          * requires that index0 and index1 are valid, and so forth
33431          */
33432         uint16_t        dimensions;
33433         /* index for the 1st dimensions */
33434         uint16_t        index_0;
33435         /* index for the 2nd dimensions */
33436         uint16_t        index_1;
33437         /* index for the 3rd dimensions */
33438         uint16_t        index_2;
33439         /* index for the 4th dimensions */
33440         uint16_t        index_3;
33441         uint8_t flags;
33442         /* When this bit is 1, flush internal cache after this write operation (see hwrm_nvm_flush command.) */
33443         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH \
33444                 UINT32_C(0x1)
33445         /* encryption method */
33446         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK \
33447                 UINT32_C(0xe)
33448         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT           1
33449         /* No encryption. */
33450         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE \
33451                 (UINT32_C(0x0) << 1)
33452         /* one-way encryption. */
33453         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1 \
33454                 (UINT32_C(0x1) << 1)
33455         /* symmetric AES256 encryption. */
33456         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256 \
33457                 (UINT32_C(0x2) << 1)
33458         /* SHA1 digest appended to plaintext contents, for authentication */
33459         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH \
33460                 (UINT32_C(0x3) << 1)
33461         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST \
33462                 HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH
33463         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_MASK \
33464                 UINT32_C(0x70)
33465         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_SFT         4
33466         /* When this bit is 1, update the factory default region */
33467         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FACTORY_DEFAULT \
33468                 UINT32_C(0x80)
33469         uint8_t unused_0;
33470 } __attribute__((packed));
33471
33472 /* hwrm_nvm_set_variable_output (size:128b/16B) */
33473 struct hwrm_nvm_set_variable_output {
33474         /* The specific error status for the command. */
33475         uint16_t        error_code;
33476         /* The HWRM command request type. */
33477         uint16_t        req_type;
33478         /* The sequence ID from the original command. */
33479         uint16_t        seq_id;
33480         /* The length of the response data in number of bytes. */
33481         uint16_t        resp_len;
33482         uint8_t unused_0[7];
33483         /*
33484          * This field is used in Output records to indicate that the output
33485          * is completely written to RAM.  This field should be read as '1'
33486          * to indicate that the output has been completely written.
33487          * When writing a command completion or response to an internal processor,
33488          * the order of writes has to be such that this field is written last.
33489          */
33490         uint8_t valid;
33491 } __attribute__((packed));
33492
33493 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
33494 struct hwrm_nvm_set_variable_cmd_err {
33495         /*
33496          * command specific error codes that goes to
33497          * the cmd_err field in Common HWRM Error Response.
33498          */
33499         uint8_t code;
33500         /* Unknown error */
33501         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
33502         /* variable does not exist */
33503         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
33504         /* configuration is corrupted and the variable cannot be saved */
33505         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
33506         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST \
33507                 HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
33508         uint8_t unused_0[7];
33509 } __attribute__((packed));
33510
33511 /****************************
33512  * hwrm_nvm_validate_option *
33513  ****************************/
33514
33515
33516 /* hwrm_nvm_validate_option_input (size:320b/40B) */
33517 struct hwrm_nvm_validate_option_input {
33518         /* The HWRM command request type. */
33519         uint16_t        req_type;
33520         /*
33521          * The completion ring to send the completion event on. This should
33522          * be the NQ ID returned from the `nq_alloc` HWRM command.
33523          */
33524         uint16_t        cmpl_ring;
33525         /*
33526          * The sequence ID is used by the driver for tracking multiple
33527          * commands. This ID is treated as opaque data by the firmware and
33528          * the value is returned in the `hwrm_resp_hdr` upon completion.
33529          */
33530         uint16_t        seq_id;
33531         /*
33532          * The target ID of the command:
33533          * * 0x0-0xFFF8 - The function ID
33534          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33535          * * 0xFFFD - Reserved for user-space HWRM interface
33536          * * 0xFFFF - HWRM
33537          */
33538         uint16_t        target_id;
33539         /*
33540          * A physical address pointer pointing to a host buffer that the
33541          * command's response data will be written. This can be either a host
33542          * physical address (HPA) or a guest physical address (GPA) and must
33543          * point to a physically contiguous block of memory.
33544          */
33545         uint64_t        resp_addr;
33546         /*
33547          * This is the host address where
33548          * nvm variable will be copied from
33549          */
33550         uint64_t        src_data_addr;
33551         /* size of data in bits */
33552         uint16_t        data_len;
33553         /* nvm cfg option number */
33554         uint16_t        option_num;
33555         /* reserved. */
33556         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0 \
33557                 UINT32_C(0x0)
33558         /* reserved. */
33559         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF \
33560                 UINT32_C(0xffff)
33561         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST \
33562                 HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF
33563         /*
33564          * Number of dimensions for this nvm configuration variable.
33565          * This value indicates how many of the indexN values to use.
33566          * A value of 0 means that none of the indexN values are valid.
33567          * A value of 1 requires at index0 is valued, a value of 2
33568          * requires that index0 and index1 are valid, and so forth
33569          */
33570         uint16_t        dimensions;
33571         /* index for the 1st dimensions */
33572         uint16_t        index_0;
33573         /* index for the 2nd dimensions */
33574         uint16_t        index_1;
33575         /* index for the 3rd dimensions */
33576         uint16_t        index_2;
33577         /* index for the 4th dimensions */
33578         uint16_t        index_3;
33579         uint8_t unused_0[2];
33580 } __attribute__((packed));
33581
33582 /* hwrm_nvm_validate_option_output (size:128b/16B) */
33583 struct hwrm_nvm_validate_option_output {
33584         /* The specific error status for the command. */
33585         uint16_t        error_code;
33586         /* The HWRM command request type. */
33587         uint16_t        req_type;
33588         /* The sequence ID from the original command. */
33589         uint16_t        seq_id;
33590         /* The length of the response data in number of bytes. */
33591         uint16_t        resp_len;
33592         uint8_t result;
33593         /* indicates that the value provided for the option is not matching with the saved data. */
33594         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0)
33595         /* indicates that the value provided for the option is matching the saved data. */
33596         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH     UINT32_C(0x1)
33597         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST \
33598                 HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH
33599         uint8_t unused_0[6];
33600         /*
33601          * This field is used in Output records to indicate that the output
33602          * is completely written to RAM.  This field should be read as '1'
33603          * to indicate that the output has been completely written.
33604          * When writing a command completion or response to an internal processor,
33605          * the order of writes has to be such that this field is written last.
33606          */
33607         uint8_t valid;
33608 } __attribute__((packed));
33609
33610 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
33611 struct hwrm_nvm_validate_option_cmd_err {
33612         /*
33613          * command specific error codes that goes to
33614          * the cmd_err field in Common HWRM Error Response.
33615          */
33616         uint8_t code;
33617         /* Unknown error */
33618         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
33619         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST \
33620                 HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
33621         uint8_t unused_0[7];
33622 } __attribute__((packed));
33623
33624 /*****************
33625  * hwrm_fw_reset *
33626  ******************/
33627
33628
33629 /* hwrm_fw_reset_input (size:192b/24B) */
33630 struct hwrm_fw_reset_input {
33631         /* The HWRM command request type. */
33632         uint16_t        req_type;
33633         /*
33634          * The completion ring to send the completion event on. This should
33635          * be the NQ ID returned from the `nq_alloc` HWRM command.
33636          */
33637         uint16_t        cmpl_ring;
33638         /*
33639          * The sequence ID is used by the driver for tracking multiple
33640          * commands. This ID is treated as opaque data by the firmware and
33641          * the value is returned in the `hwrm_resp_hdr` upon completion.
33642          */
33643         uint16_t        seq_id;
33644         /*
33645          * The target ID of the command:
33646          * * 0x0-0xFFF8 - The function ID
33647          * * 0xFFF8-0xFFFE - Reserved for internal processors
33648          * * 0xFFFF - HWRM
33649          */
33650         uint16_t        target_id;
33651         /*
33652          * A physical address pointer pointing to a host buffer that the
33653          * command's response data will be written. This can be either a host
33654          * physical address (HPA) or a guest physical address (GPA) and must
33655          * point to a physically contiguous block of memory.
33656          */
33657         uint64_t        resp_addr;
33658         /* Type of embedded processor. */
33659         uint8_t embedded_proc_type;
33660         /* Boot Processor */
33661         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_BOOT \
33662                 UINT32_C(0x0)
33663         /* Management Processor */
33664         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_MGMT \
33665                 UINT32_C(0x1)
33666         /* Network control processor */
33667         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_NETCTRL \
33668                 UINT32_C(0x2)
33669         /* RoCE control processor */
33670         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_ROCE \
33671                 UINT32_C(0x3)
33672         /*
33673          * Host (in multi-host environment): This is only valid if requester is IPC.
33674          * Reinit host hardware resources and PCIe.
33675          */
33676         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST \
33677                 UINT32_C(0x4)
33678         /* AP processor complex (in multi-host environment). Use host_idx to control which core is reset */
33679         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_AP \
33680                 UINT32_C(0x5)
33681         /* Reset all blocks of the chip (including all processors) */
33682         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_CHIP \
33683                 UINT32_C(0x6)
33684         /*
33685          * Host (in multi-host environment): This is only valid if requester is IPC.
33686          * Reinit host hardware resources.
33687          */
33688         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT \
33689                 UINT32_C(0x7)
33690         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_LAST \
33691                 HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT
33692         /* Type of self reset. */
33693         uint8_t selfrst_status;
33694         /* No Self Reset */
33695         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTNONE \
33696                 UINT32_C(0x0)
33697         /* Self Reset as soon as possible to do so safely */
33698         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP \
33699                 UINT32_C(0x1)
33700         /* Self Reset on PCIe Reset */
33701         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTPCIERST \
33702                 UINT32_C(0x2)
33703         /* Self Reset immediately after notification to all clients. */
33704         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
33705                 UINT32_C(0x3)
33706         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_LAST \
33707                 HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
33708         /*
33709          * Indicate which host is being reset. 0 means first host.
33710          * Only valid when embedded_proc_type is host in multihost
33711          * environment
33712          */
33713         uint8_t host_idx;
33714         uint8_t flags;
33715         /*
33716          * When this bit is '1', then the core firmware initiates
33717          * the reset only after graceful shut down of all registered instances.
33718          * If not, the device will continue with the existing firmware.
33719          */
33720         #define HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL     UINT32_C(0x1)
33721         uint8_t unused_0[4];
33722 } __attribute__((packed));
33723
33724 /* hwrm_fw_reset_output (size:128b/16B) */
33725 struct hwrm_fw_reset_output {
33726         /* The specific error status for the command. */
33727         uint16_t        error_code;
33728         /* The HWRM command request type. */
33729         uint16_t        req_type;
33730         /* The sequence ID from the original command. */
33731         uint16_t        seq_id;
33732         /* The length of the response data in number of bytes. */
33733         uint16_t        resp_len;
33734         /* Type of self reset. */
33735         uint8_t selfrst_status;
33736         /* No Self Reset */
33737         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTNONE \
33738                 UINT32_C(0x0)
33739         /* Self Reset as soon as possible to do so safely */
33740         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTASAP \
33741                 UINT32_C(0x1)
33742         /* Self Reset on PCIe Reset */
33743         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST \
33744                 UINT32_C(0x2)
33745         /* Self Reset immediately after notification to all clients. */
33746         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
33747                 UINT32_C(0x3)
33748         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_LAST \
33749                 HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
33750         uint8_t unused_0[6];
33751         /*
33752          * This field is used in Output records to indicate that the output
33753          * is completely written to RAM.  This field should be read as '1'
33754          * to indicate that the output has been completely written.
33755          * When writing a command completion or response to an internal processor,
33756          * the order of writes has to be such that this field is written last.
33757          */
33758         uint8_t valid;
33759 } __attribute__((packed));
33760
33761 #endif /* _HSI_STRUCT_DEF_DPDK_H_ */