net/bnxt: handle reset notify async event from FW
[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         /*
8922          * When this bit is 1, the function is indicating the support of the
8923          * Master capability. The Firmware will use this capability to select
8924          * the Master function. The master function will be used to initiate
8925          * designated functionality like error recovery etc. If none of the
8926          * registered PFs or trusted VFs indicate this support, then
8927          * firmware will select the 1st registered PF as Master capable
8928          * instance.
8929          */
8930         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_MASTER_SUPPORT \
8931                 UINT32_C(0x40)
8932         uint32_t        enables;
8933         /*
8934          * This bit must be '1' for the os_type field to be
8935          * configured.
8936          */
8937         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE \
8938                 UINT32_C(0x1)
8939         /*
8940          * This bit must be '1' for the ver field to be
8941          * configured.
8942          */
8943         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER \
8944                 UINT32_C(0x2)
8945         /*
8946          * This bit must be '1' for the timestamp field to be
8947          * configured.
8948          */
8949         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP \
8950                 UINT32_C(0x4)
8951         /*
8952          * This bit must be '1' for the vf_req_fwd field to be
8953          * configured.
8954          */
8955         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD \
8956                 UINT32_C(0x8)
8957         /*
8958          * This bit must be '1' for the async_event_fwd field to be
8959          * configured.
8960          */
8961         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
8962                 UINT32_C(0x10)
8963         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
8964         uint16_t        os_type;
8965         /* Unknown */
8966         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
8967         /* Other OS not listed below. */
8968         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER     UINT32_C(0x1)
8969         /* MSDOS OS. */
8970         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
8971         /* Windows OS. */
8972         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
8973         /* Solaris OS. */
8974         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
8975         /* Linux OS. */
8976         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX     UINT32_C(0x24)
8977         /* FreeBSD OS. */
8978         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
8979         /* VMware ESXi OS. */
8980         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI      UINT32_C(0x68)
8981         /* Microsoft Windows 8 64-bit OS. */
8982         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864    UINT32_C(0x73)
8983         /* Microsoft Windows Server 2012 R2 OS. */
8984         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
8985         /* UEFI driver. */
8986         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
8987         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST \
8988                 HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
8989         /* This is the 8bit major version of the driver. */
8990         uint8_t ver_maj_8b;
8991         /* This is the 8bit minor version of the driver. */
8992         uint8_t ver_min_8b;
8993         /* This is the 8bit update version of the driver. */
8994         uint8_t ver_upd_8b;
8995         uint8_t unused_0[3];
8996         /*
8997          * This is a 32-bit timestamp provided by the driver for
8998          * keep alive.
8999          * The timestamp is in multiples of 1ms.
9000          */
9001         uint32_t        timestamp;
9002         uint8_t unused_1[4];
9003         /*
9004          * This is a 256-bit bit mask provided by the PF driver for
9005          * letting the HWRM know what commands issued by the VF driver
9006          * to the HWRM should be forwarded to the PF driver.
9007          * Nth bit refers to the Nth req_type.
9008          *
9009          * Setting Nth bit to 1 indicates that requests from the
9010          * VF driver with req_type equal to N shall be forwarded to
9011          * the parent PF driver.
9012          *
9013          * This field is not valid for the VF driver.
9014          */
9015         uint32_t        vf_req_fwd[8];
9016         /*
9017          * This is a 256-bit bit mask provided by the function driver
9018          * (PF or VF driver) to indicate the list of asynchronous event
9019          * completions to be forwarded.
9020          *
9021          * Nth bit refers to the Nth event_id.
9022          *
9023          * Setting Nth bit to 1 by the function driver shall result in
9024          * the HWRM forwarding asynchronous event completion with
9025          * event_id equal to N.
9026          *
9027          * If all bits are set to 0 (value of 0), then the HWRM shall
9028          * not forward any asynchronous event completion to this
9029          * function driver.
9030          */
9031         uint32_t        async_event_fwd[8];
9032         /* This is the 16bit major version of the driver. */
9033         uint16_t        ver_maj;
9034         /* This is the 16bit minor version of the driver. */
9035         uint16_t        ver_min;
9036         /* This is the 16bit update version of the driver. */
9037         uint16_t        ver_upd;
9038         /* This is the 16bit patch version of the driver. */
9039         uint16_t        ver_patch;
9040 } __attribute__((packed));
9041
9042 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
9043 struct hwrm_func_drv_rgtr_output {
9044         /* The specific error status for the command. */
9045         uint16_t        error_code;
9046         /* The HWRM command request type. */
9047         uint16_t        req_type;
9048         /* The sequence ID from the original command. */
9049         uint16_t        seq_id;
9050         /* The length of the response data in number of bytes. */
9051         uint16_t        resp_len;
9052         uint32_t        flags;
9053         /*
9054          * When this bit is '1', it indicates that the
9055          * HWRM_FUNC_DRV_IF_CHANGE call is supported.
9056          */
9057         #define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED \
9058                 UINT32_C(0x1)
9059         uint8_t unused_0[3];
9060         /*
9061          * This field is used in Output records to indicate that the output
9062          * is completely written to RAM.  This field should be read as '1'
9063          * to indicate that the output has been completely written.
9064          * When writing a command completion or response to an internal processor,
9065          * the order of writes has to be such that this field is written last.
9066          */
9067         uint8_t valid;
9068 } __attribute__((packed));
9069
9070 /************************
9071  * hwrm_func_drv_unrgtr *
9072  ************************/
9073
9074
9075 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
9076 struct hwrm_func_drv_unrgtr_input {
9077         /* The HWRM command request type. */
9078         uint16_t        req_type;
9079         /*
9080          * The completion ring to send the completion event on. This should
9081          * be the NQ ID returned from the `nq_alloc` HWRM command.
9082          */
9083         uint16_t        cmpl_ring;
9084         /*
9085          * The sequence ID is used by the driver for tracking multiple
9086          * commands. This ID is treated as opaque data by the firmware and
9087          * the value is returned in the `hwrm_resp_hdr` upon completion.
9088          */
9089         uint16_t        seq_id;
9090         /*
9091          * The target ID of the command:
9092          * * 0x0-0xFFF8 - The function ID
9093          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9094          * * 0xFFFD - Reserved for user-space HWRM interface
9095          * * 0xFFFF - HWRM
9096          */
9097         uint16_t        target_id;
9098         /*
9099          * A physical address pointer pointing to a host buffer that the
9100          * command's response data will be written. This can be either a host
9101          * physical address (HPA) or a guest physical address (GPA) and must
9102          * point to a physically contiguous block of memory.
9103          */
9104         uint64_t        resp_addr;
9105         uint32_t        flags;
9106         /*
9107          * When this bit is '1', the function driver is notifying
9108          * the HWRM to prepare for the shutdown.
9109          */
9110         #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
9111                 UINT32_C(0x1)
9112         uint8_t unused_0[4];
9113 } __attribute__((packed));
9114
9115 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
9116 struct hwrm_func_drv_unrgtr_output {
9117         /* The specific error status for the command. */
9118         uint16_t        error_code;
9119         /* The HWRM command request type. */
9120         uint16_t        req_type;
9121         /* The sequence ID from the original command. */
9122         uint16_t        seq_id;
9123         /* The length of the response data in number of bytes. */
9124         uint16_t        resp_len;
9125         uint8_t unused_0[7];
9126         /*
9127          * This field is used in Output records to indicate that the output
9128          * is completely written to RAM.  This field should be read as '1'
9129          * to indicate that the output has been completely written.
9130          * When writing a command completion or response to an internal processor,
9131          * the order of writes has to be such that this field is written last.
9132          */
9133         uint8_t valid;
9134 } __attribute__((packed));
9135
9136 /**********************
9137  * hwrm_func_buf_rgtr *
9138  **********************/
9139
9140
9141 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
9142 struct hwrm_func_buf_rgtr_input {
9143         /* The HWRM command request type. */
9144         uint16_t        req_type;
9145         /*
9146          * The completion ring to send the completion event on. This should
9147          * be the NQ ID returned from the `nq_alloc` HWRM command.
9148          */
9149         uint16_t        cmpl_ring;
9150         /*
9151          * The sequence ID is used by the driver for tracking multiple
9152          * commands. This ID is treated as opaque data by the firmware and
9153          * the value is returned in the `hwrm_resp_hdr` upon completion.
9154          */
9155         uint16_t        seq_id;
9156         /*
9157          * The target ID of the command:
9158          * * 0x0-0xFFF8 - The function ID
9159          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9160          * * 0xFFFD - Reserved for user-space HWRM interface
9161          * * 0xFFFF - HWRM
9162          */
9163         uint16_t        target_id;
9164         /*
9165          * A physical address pointer pointing to a host buffer that the
9166          * command's response data will be written. This can be either a host
9167          * physical address (HPA) or a guest physical address (GPA) and must
9168          * point to a physically contiguous block of memory.
9169          */
9170         uint64_t        resp_addr;
9171         uint32_t        enables;
9172         /*
9173          * This bit must be '1' for the vf_id field to be
9174          * configured.
9175          */
9176         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID            UINT32_C(0x1)
9177         /*
9178          * This bit must be '1' for the err_buf_addr field to be
9179          * configured.
9180          */
9181         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR     UINT32_C(0x2)
9182         /*
9183          * This value is used to identify a Virtual Function (VF).
9184          * The scope of VF ID is local within a PF.
9185          */
9186         uint16_t        vf_id;
9187         /*
9188          * This field represents the number of pages used for request
9189          * buffer(s).
9190          */
9191         uint16_t        req_buf_num_pages;
9192         /*
9193          * This field represents the page size used for request
9194          * buffer(s).
9195          */
9196         uint16_t        req_buf_page_size;
9197         /* 16 bytes */
9198         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
9199         /* 4 Kbytes */
9200         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K  UINT32_C(0xc)
9201         /* 8 Kbytes */
9202         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K  UINT32_C(0xd)
9203         /* 64 Kbytes */
9204         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
9205         /* 2 Mbytes */
9206         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M  UINT32_C(0x15)
9207         /* 4 Mbytes */
9208         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M  UINT32_C(0x16)
9209         /* 1 Gbytes */
9210         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G  UINT32_C(0x1e)
9211         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST \
9212                 HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
9213         /* The length of the request buffer per VF in bytes. */
9214         uint16_t        req_buf_len;
9215         /* The length of the response buffer in bytes. */
9216         uint16_t        resp_buf_len;
9217         uint8_t unused_0[2];
9218         /* This field represents the page address of page #0. */
9219         uint64_t        req_buf_page_addr0;
9220         /* This field represents the page address of page #1. */
9221         uint64_t        req_buf_page_addr1;
9222         /* This field represents the page address of page #2. */
9223         uint64_t        req_buf_page_addr2;
9224         /* This field represents the page address of page #3. */
9225         uint64_t        req_buf_page_addr3;
9226         /* This field represents the page address of page #4. */
9227         uint64_t        req_buf_page_addr4;
9228         /* This field represents the page address of page #5. */
9229         uint64_t        req_buf_page_addr5;
9230         /* This field represents the page address of page #6. */
9231         uint64_t        req_buf_page_addr6;
9232         /* This field represents the page address of page #7. */
9233         uint64_t        req_buf_page_addr7;
9234         /* This field represents the page address of page #8. */
9235         uint64_t        req_buf_page_addr8;
9236         /* This field represents the page address of page #9. */
9237         uint64_t        req_buf_page_addr9;
9238         /*
9239          * This field is used to receive the error reporting from
9240          * the chipset. Only applicable for PFs.
9241          */
9242         uint64_t        error_buf_addr;
9243         /*
9244          * This field is used to receive the response forwarded by the
9245          * HWRM.
9246          */
9247         uint64_t        resp_buf_addr;
9248 } __attribute__((packed));
9249
9250 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
9251 struct hwrm_func_buf_rgtr_output {
9252         /* The specific error status for the command. */
9253         uint16_t        error_code;
9254         /* The HWRM command request type. */
9255         uint16_t        req_type;
9256         /* The sequence ID from the original command. */
9257         uint16_t        seq_id;
9258         /* The length of the response data in number of bytes. */
9259         uint16_t        resp_len;
9260         uint8_t unused_0[7];
9261         /*
9262          * This field is used in Output records to indicate that the output
9263          * is completely written to RAM.  This field should be read as '1'
9264          * to indicate that the output has been completely written.
9265          * When writing a command completion or response to an internal processor,
9266          * the order of writes has to be such that this field is written last.
9267          */
9268         uint8_t valid;
9269 } __attribute__((packed));
9270
9271 /************************
9272  * hwrm_func_buf_unrgtr *
9273  ************************/
9274
9275
9276 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
9277 struct hwrm_func_buf_unrgtr_input {
9278         /* The HWRM command request type. */
9279         uint16_t        req_type;
9280         /*
9281          * The completion ring to send the completion event on. This should
9282          * be the NQ ID returned from the `nq_alloc` HWRM command.
9283          */
9284         uint16_t        cmpl_ring;
9285         /*
9286          * The sequence ID is used by the driver for tracking multiple
9287          * commands. This ID is treated as opaque data by the firmware and
9288          * the value is returned in the `hwrm_resp_hdr` upon completion.
9289          */
9290         uint16_t        seq_id;
9291         /*
9292          * The target ID of the command:
9293          * * 0x0-0xFFF8 - The function ID
9294          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9295          * * 0xFFFD - Reserved for user-space HWRM interface
9296          * * 0xFFFF - HWRM
9297          */
9298         uint16_t        target_id;
9299         /*
9300          * A physical address pointer pointing to a host buffer that the
9301          * command's response data will be written. This can be either a host
9302          * physical address (HPA) or a guest physical address (GPA) and must
9303          * point to a physically contiguous block of memory.
9304          */
9305         uint64_t        resp_addr;
9306         uint32_t        enables;
9307         /*
9308          * This bit must be '1' for the vf_id field to be
9309          * configured.
9310          */
9311         #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID     UINT32_C(0x1)
9312         /*
9313          * This value is used to identify a Virtual Function (VF).
9314          * The scope of VF ID is local within a PF.
9315          */
9316         uint16_t        vf_id;
9317         uint8_t unused_0[2];
9318 } __attribute__((packed));
9319
9320 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
9321 struct hwrm_func_buf_unrgtr_output {
9322         /* The specific error status for the command. */
9323         uint16_t        error_code;
9324         /* The HWRM command request type. */
9325         uint16_t        req_type;
9326         /* The sequence ID from the original command. */
9327         uint16_t        seq_id;
9328         /* The length of the response data in number of bytes. */
9329         uint16_t        resp_len;
9330         uint8_t unused_0[7];
9331         /*
9332          * This field is used in Output records to indicate that the output
9333          * is completely written to RAM.  This field should be read as '1'
9334          * to indicate that the output has been completely written.
9335          * When writing a command completion or response to an internal processor,
9336          * the order of writes has to be such that this field is written last.
9337          */
9338         uint8_t valid;
9339 } __attribute__((packed));
9340
9341 /**********************
9342  * hwrm_func_drv_qver *
9343  **********************/
9344
9345
9346 /* hwrm_func_drv_qver_input (size:192b/24B) */
9347 struct hwrm_func_drv_qver_input {
9348         /* The HWRM command request type. */
9349         uint16_t        req_type;
9350         /*
9351          * The completion ring to send the completion event on. This should
9352          * be the NQ ID returned from the `nq_alloc` HWRM command.
9353          */
9354         uint16_t        cmpl_ring;
9355         /*
9356          * The sequence ID is used by the driver for tracking multiple
9357          * commands. This ID is treated as opaque data by the firmware and
9358          * the value is returned in the `hwrm_resp_hdr` upon completion.
9359          */
9360         uint16_t        seq_id;
9361         /*
9362          * The target ID of the command:
9363          * * 0x0-0xFFF8 - The function ID
9364          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9365          * * 0xFFFD - Reserved for user-space HWRM interface
9366          * * 0xFFFF - HWRM
9367          */
9368         uint16_t        target_id;
9369         /*
9370          * A physical address pointer pointing to a host buffer that the
9371          * command's response data will be written. This can be either a host
9372          * physical address (HPA) or a guest physical address (GPA) and must
9373          * point to a physically contiguous block of memory.
9374          */
9375         uint64_t        resp_addr;
9376         /* Reserved for future use. */
9377         uint32_t        reserved;
9378         /*
9379          * Function ID of the function that is being queried.
9380          * 0xFF... (All Fs) if the query is for the requesting
9381          * function.
9382          */
9383         uint16_t        fid;
9384         uint8_t unused_0[2];
9385 } __attribute__((packed));
9386
9387 /* hwrm_func_drv_qver_output (size:256b/32B) */
9388 struct hwrm_func_drv_qver_output {
9389         /* The specific error status for the command. */
9390         uint16_t        error_code;
9391         /* The HWRM command request type. */
9392         uint16_t        req_type;
9393         /* The sequence ID from the original command. */
9394         uint16_t        seq_id;
9395         /* The length of the response data in number of bytes. */
9396         uint16_t        resp_len;
9397         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
9398         uint16_t        os_type;
9399         /* Unknown */
9400         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
9401         /* Other OS not listed below. */
9402         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER     UINT32_C(0x1)
9403         /* MSDOS OS. */
9404         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
9405         /* Windows OS. */
9406         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
9407         /* Solaris OS. */
9408         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
9409         /* Linux OS. */
9410         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX     UINT32_C(0x24)
9411         /* FreeBSD OS. */
9412         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
9413         /* VMware ESXi OS. */
9414         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI      UINT32_C(0x68)
9415         /* Microsoft Windows 8 64-bit OS. */
9416         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864    UINT32_C(0x73)
9417         /* Microsoft Windows Server 2012 R2 OS. */
9418         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
9419         /* UEFI driver. */
9420         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
9421         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST \
9422                 HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
9423         /* This is the 8bit major version of the driver. */
9424         uint8_t ver_maj_8b;
9425         /* This is the 8bit minor version of the driver. */
9426         uint8_t ver_min_8b;
9427         /* This is the 8bit update version of the driver. */
9428         uint8_t ver_upd_8b;
9429         uint8_t unused_0[3];
9430         /* This is the 16bit major version of the driver. */
9431         uint16_t        ver_maj;
9432         /* This is the 16bit minor version of the driver. */
9433         uint16_t        ver_min;
9434         /* This is the 16bit update version of the driver. */
9435         uint16_t        ver_upd;
9436         /* This is the 16bit patch version of the driver. */
9437         uint16_t        ver_patch;
9438         uint8_t unused_1[7];
9439         /*
9440          * This field is used in Output records to indicate that the output
9441          * is completely written to RAM.  This field should be read as '1'
9442          * to indicate that the output has been completely written.
9443          * When writing a command completion or response to an internal processor,
9444          * the order of writes has to be such that this field is written last.
9445          */
9446         uint8_t valid;
9447 } __attribute__((packed));
9448
9449 /****************************
9450  * hwrm_func_resource_qcaps *
9451  ****************************/
9452
9453
9454 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
9455 struct hwrm_func_resource_qcaps_input {
9456         /* The HWRM command request type. */
9457         uint16_t        req_type;
9458         /*
9459          * The completion ring to send the completion event on. This should
9460          * be the NQ ID returned from the `nq_alloc` HWRM command.
9461          */
9462         uint16_t        cmpl_ring;
9463         /*
9464          * The sequence ID is used by the driver for tracking multiple
9465          * commands. This ID is treated as opaque data by the firmware and
9466          * the value is returned in the `hwrm_resp_hdr` upon completion.
9467          */
9468         uint16_t        seq_id;
9469         /*
9470          * The target ID of the command:
9471          * * 0x0-0xFFF8 - The function ID
9472          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9473          * * 0xFFFD - Reserved for user-space HWRM interface
9474          * * 0xFFFF - HWRM
9475          */
9476         uint16_t        target_id;
9477         /*
9478          * A physical address pointer pointing to a host buffer that the
9479          * command's response data will be written. This can be either a host
9480          * physical address (HPA) or a guest physical address (GPA) and must
9481          * point to a physically contiguous block of memory.
9482          */
9483         uint64_t        resp_addr;
9484         /*
9485          * Function ID of the function that is being queried.
9486          * 0xFF... (All Fs) if the query is for the requesting
9487          * function.
9488          */
9489         uint16_t        fid;
9490         uint8_t unused_0[6];
9491 } __attribute__((packed));
9492
9493 /* hwrm_func_resource_qcaps_output (size:448b/56B) */
9494 struct hwrm_func_resource_qcaps_output {
9495         /* The specific error status for the command. */
9496         uint16_t        error_code;
9497         /* The HWRM command request type. */
9498         uint16_t        req_type;
9499         /* The sequence ID from the original command. */
9500         uint16_t        seq_id;
9501         /* The length of the response data in number of bytes. */
9502         uint16_t        resp_len;
9503         /* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */
9504         uint16_t        max_vfs;
9505         /* Maximum guaranteed number of MSI-X vectors supported by function */
9506         uint16_t        max_msix;
9507         /* Hint of strategy to be used by PF driver to reserve resources for its VF */
9508         uint16_t        vf_reservation_strategy;
9509         /* The PF driver should evenly divide its remaining resources among all VFs. */
9510         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL \
9511                 UINT32_C(0x0)
9512         /* The PF driver should only reserve minimal resources for each VF. */
9513         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL \
9514                 UINT32_C(0x1)
9515         /*
9516          * The PF driver should not reserve any resources for each VF until the
9517          * the VF interface is brought up.
9518          */
9519         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC \
9520                 UINT32_C(0x2)
9521         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST \
9522                 HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
9523         /* Minimum guaranteed number of RSS/COS contexts */
9524         uint16_t        min_rsscos_ctx;
9525         /* Maximum non-guaranteed number of RSS/COS contexts */
9526         uint16_t        max_rsscos_ctx;
9527         /* Minimum guaranteed number of completion rings */
9528         uint16_t        min_cmpl_rings;
9529         /* Maximum non-guaranteed number of completion rings */
9530         uint16_t        max_cmpl_rings;
9531         /* Minimum guaranteed number of transmit rings */
9532         uint16_t        min_tx_rings;
9533         /* Maximum non-guaranteed number of transmit rings */
9534         uint16_t        max_tx_rings;
9535         /* Minimum guaranteed number of receive rings */
9536         uint16_t        min_rx_rings;
9537         /* Maximum non-guaranteed number of receive rings */
9538         uint16_t        max_rx_rings;
9539         /* Minimum guaranteed number of L2 contexts */
9540         uint16_t        min_l2_ctxs;
9541         /* Maximum non-guaranteed number of L2 contexts */
9542         uint16_t        max_l2_ctxs;
9543         /* Minimum guaranteed number of VNICs */
9544         uint16_t        min_vnics;
9545         /* Maximum non-guaranteed number of VNICs */
9546         uint16_t        max_vnics;
9547         /* Minimum guaranteed number of statistic contexts */
9548         uint16_t        min_stat_ctx;
9549         /* Maximum non-guaranteed number of statistic contexts */
9550         uint16_t        max_stat_ctx;
9551         /* Minimum guaranteed number of ring groups */
9552         uint16_t        min_hw_ring_grps;
9553         /* Maximum non-guaranteed number of ring groups */
9554         uint16_t        max_hw_ring_grps;
9555         /*
9556          * Maximum number of inputs into the transmit scheduler for this function.
9557          * The number of TX rings assigned to the function cannot exceed this value.
9558          */
9559         uint16_t        max_tx_scheduler_inputs;
9560         uint16_t        flags;
9561         /*
9562          * When this bit is '1', it indicates that VF_RESOURCE_CFG supports
9563          * feature to reserve all minimum resources when minimum >= 1, otherwise
9564          * returns an error.
9565          */
9566         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED \
9567                 UINT32_C(0x1)
9568         uint8_t unused_0[5];
9569         /*
9570          * This field is used in Output records to indicate that the output
9571          * is completely written to RAM.  This field should be read as '1'
9572          * to indicate that the output has been completely written.
9573          * When writing a command completion or response to an internal processor,
9574          * the order of writes has to be such that this field is written last.
9575          */
9576         uint8_t valid;
9577 } __attribute__((packed));
9578
9579 /*********************************
9580  * hwrm_func_backing_store_qcaps *
9581  *********************************/
9582
9583
9584 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
9585 struct hwrm_func_backing_store_qcaps_input {
9586         /* The HWRM command request type. */
9587         uint16_t        req_type;
9588         /*
9589          * The completion ring to send the completion event on. This should
9590          * be the NQ ID returned from the `nq_alloc` HWRM command.
9591          */
9592         uint16_t        cmpl_ring;
9593         /*
9594          * The sequence ID is used by the driver for tracking multiple
9595          * commands. This ID is treated as opaque data by the firmware and
9596          * the value is returned in the `hwrm_resp_hdr` upon completion.
9597          */
9598         uint16_t        seq_id;
9599         /*
9600          * The target ID of the command:
9601          * * 0x0-0xFFF8 - The function ID
9602          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9603          * * 0xFFFD - Reserved for user-space HWRM interface
9604          * * 0xFFFF - HWRM
9605          */
9606         uint16_t        target_id;
9607         /*
9608          * A physical address pointer pointing to a host buffer that the
9609          * command's response data will be written. This can be either a host
9610          * physical address (HPA) or a guest physical address (GPA) and must
9611          * point to a physically contiguous block of memory.
9612          */
9613         uint64_t        resp_addr;
9614 } __attribute__((packed));
9615
9616 /* hwrm_func_backing_store_qcaps_output (size:576b/72B) */
9617 struct hwrm_func_backing_store_qcaps_output {
9618         /* The specific error status for the command. */
9619         uint16_t        error_code;
9620         /* The HWRM command request type. */
9621         uint16_t        req_type;
9622         /* The sequence ID from the original command. */
9623         uint16_t        seq_id;
9624         /* The length of the response data in number of bytes. */
9625         uint16_t        resp_len;
9626         /* Maximum number of QP context entries supported for this function. */
9627         uint32_t        qp_max_entries;
9628         /*
9629          * Minimum number of QP context entries that are needed to be reserved
9630          * for QP1 for the PF and its VFs. PF drivers must allocate at least
9631          * this many QP context entries, even if RoCE will not be used.
9632          */
9633         uint16_t        qp_min_qp1_entries;
9634         /* Maximum number of QP context entries that can be used for L2. */
9635         uint16_t        qp_max_l2_entries;
9636         /* Number of bytes that must be allocated for each context entry. */
9637         uint16_t        qp_entry_size;
9638         /* Maximum number of SRQ context entries that can be used for L2. */
9639         uint16_t        srq_max_l2_entries;
9640         /* Maximum number of SRQ context entries supported for this function. */
9641         uint32_t        srq_max_entries;
9642         /* Number of bytes that must be allocated for each context entry. */
9643         uint16_t        srq_entry_size;
9644         /* Maximum number of CQ context entries that can be used for L2. */
9645         uint16_t        cq_max_l2_entries;
9646         /* Maximum number of CQ context entries supported for this function. */
9647         uint32_t        cq_max_entries;
9648         /* Number of bytes that must be allocated for each context entry. */
9649         uint16_t        cq_entry_size;
9650         /* Maximum number of VNIC context entries supported for this function. */
9651         uint16_t        vnic_max_vnic_entries;
9652         /* Maximum number of Ring table context entries supported for this function. */
9653         uint16_t        vnic_max_ring_table_entries;
9654         /* Number of bytes that must be allocated for each context entry. */
9655         uint16_t        vnic_entry_size;
9656         /* Maximum number of statistic context entries supported for this function. */
9657         uint32_t        stat_max_entries;
9658         /* Number of bytes that must be allocated for each context entry. */
9659         uint16_t        stat_entry_size;
9660         /* Number of bytes that must be allocated for each context entry. */
9661         uint16_t        tqm_entry_size;
9662         /* Minimum number of TQM context entries required per ring. */
9663         uint32_t        tqm_min_entries_per_ring;
9664         /*
9665          * Maximum number of TQM context entries supported per ring. This is
9666          * actually a recommended TQM queue size based on worst case usage of
9667          * the TQM queue.
9668          *
9669          * TQM fastpath rings should be sized large enough to accommodate the
9670          * maximum number of QPs (either L2 or RoCE, or both if shared)
9671          * that can be enqueued to the TQM ring.
9672          *
9673          * TQM slowpath rings should be sized as follows:
9674          *
9675          * num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size
9676          *
9677          * Where:
9678          *   num_vnics is the number of VNICs allocated in the VNIC backing store
9679          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
9680          *   num_roce_qps is the number of RoCE QPs in the QP backing store
9681          *   tqm_min_size is tqm_min_entries_per_ring reported by
9682          *     HWRM_FUNC_BACKING_STORE_QCAPS
9683          *
9684          * Note that TQM ring sizes cannot be extended while the system is
9685          * operational. If a PF driver needs to extend a TQM ring, it needs
9686          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9687          * the backing store.
9688          */
9689         uint32_t        tqm_max_entries_per_ring;
9690         /*
9691          * Maximum number of MR plus AV context entries supported for this
9692          * function.
9693          */
9694         uint32_t        mrav_max_entries;
9695         /* Number of bytes that must be allocated for each context entry. */
9696         uint16_t        mrav_entry_size;
9697         /* Number of bytes that must be allocated for each context entry. */
9698         uint16_t        tim_entry_size;
9699         /* Maximum number of Timer context entries supported for this function. */
9700         uint32_t        tim_max_entries;
9701         /*
9702          * When this field is zero, the 32b `mrav_num_entries` field in the
9703          * `backing_store_cfg` and `backing_store_qcfg` commands represents
9704          * the total number of MR plus AV entries allowed in the MR/AV backing
9705          * store PBL.
9706          *
9707          * When this field is non-zero, the 32b `mrav_num_entries` field in
9708          * the `backing_store_cfg` and `backing_store_qcfg` commands is
9709          * logically divided into two 16b fields. Bits `[31:16]` represents
9710          * the `mr_num_entries` and bits `[15:0]` represents `av_num_entries`.
9711          * Both of these values are represented in a unit granularity
9712          * specified by this field. For example, if this field is 16 and
9713          * `mrav_num_entries` is `0x02000100`, then the number of MR entries
9714          * is 8192 and the number of AV entries is 4096.
9715          */
9716         uint16_t        mrav_num_entries_units;
9717         /*
9718          * The number of entries specified for any TQM ring must be a
9719          * multiple of this value to prevent any resource allocation
9720          * limitations.
9721          */
9722         uint8_t tqm_entries_multiple;
9723         /*
9724          * This field is used in Output records to indicate that the output
9725          * is completely written to RAM.  This field should be read as '1'
9726          * to indicate that the output has been completely written.
9727          * When writing a command completion or response to an internal processor,
9728          * the order of writes has to be such that this field is written last.
9729          */
9730         uint8_t valid;
9731 } __attribute__((packed));
9732
9733 /*******************************
9734  * hwrm_func_backing_store_cfg *
9735  *******************************/
9736
9737
9738 /* hwrm_func_backing_store_cfg_input (size:2048b/256B) */
9739 struct hwrm_func_backing_store_cfg_input {
9740         /* The HWRM command request type. */
9741         uint16_t        req_type;
9742         /*
9743          * The completion ring to send the completion event on. This should
9744          * be the NQ ID returned from the `nq_alloc` HWRM command.
9745          */
9746         uint16_t        cmpl_ring;
9747         /*
9748          * The sequence ID is used by the driver for tracking multiple
9749          * commands. This ID is treated as opaque data by the firmware and
9750          * the value is returned in the `hwrm_resp_hdr` upon completion.
9751          */
9752         uint16_t        seq_id;
9753         /*
9754          * The target ID of the command:
9755          * * 0x0-0xFFF8 - The function ID
9756          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9757          * * 0xFFFD - Reserved for user-space HWRM interface
9758          * * 0xFFFF - HWRM
9759          */
9760         uint16_t        target_id;
9761         /*
9762          * A physical address pointer pointing to a host buffer that the
9763          * command's response data will be written. This can be either a host
9764          * physical address (HPA) or a guest physical address (GPA) and must
9765          * point to a physically contiguous block of memory.
9766          */
9767         uint64_t        resp_addr;
9768         uint32_t        flags;
9769         /*
9770          * When set, the firmware only uses on-chip resources and does not
9771          * expect any backing store to be provided by the host driver. This
9772          * mode provides minimal L2 functionality (e.g. limited L2 resources,
9773          * no RoCE).
9774          */
9775         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE \
9776                 UINT32_C(0x1)
9777         /*
9778          * When set, the 32b `mrav_num_entries` field is logically divided
9779          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
9780          */
9781         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_MRAV_RESERVATION_SPLIT \
9782                 UINT32_C(0x2)
9783         uint32_t        enables;
9784         /*
9785          * This bit must be '1' for the qp fields to be
9786          * configured.
9787          */
9788         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP \
9789                 UINT32_C(0x1)
9790         /*
9791          * This bit must be '1' for the srq fields to be
9792          * configured.
9793          */
9794         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ \
9795                 UINT32_C(0x2)
9796         /*
9797          * This bit must be '1' for the cq fields to be
9798          * configured.
9799          */
9800         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ \
9801                 UINT32_C(0x4)
9802         /*
9803          * This bit must be '1' for the vnic fields to be
9804          * configured.
9805          */
9806         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC \
9807                 UINT32_C(0x8)
9808         /*
9809          * This bit must be '1' for the stat fields to be
9810          * configured.
9811          */
9812         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT \
9813                 UINT32_C(0x10)
9814         /*
9815          * This bit must be '1' for the tqm_sp fields to be
9816          * configured.
9817          */
9818         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP \
9819                 UINT32_C(0x20)
9820         /*
9821          * This bit must be '1' for the tqm_ring0 fields to be
9822          * configured.
9823          */
9824         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0 \
9825                 UINT32_C(0x40)
9826         /*
9827          * This bit must be '1' for the tqm_ring1 fields to be
9828          * configured.
9829          */
9830         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1 \
9831                 UINT32_C(0x80)
9832         /*
9833          * This bit must be '1' for the tqm_ring2 fields to be
9834          * configured.
9835          */
9836         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2 \
9837                 UINT32_C(0x100)
9838         /*
9839          * This bit must be '1' for the tqm_ring3 fields to be
9840          * configured.
9841          */
9842         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3 \
9843                 UINT32_C(0x200)
9844         /*
9845          * This bit must be '1' for the tqm_ring4 fields to be
9846          * configured.
9847          */
9848         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4 \
9849                 UINT32_C(0x400)
9850         /*
9851          * This bit must be '1' for the tqm_ring5 fields to be
9852          * configured.
9853          */
9854         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5 \
9855                 UINT32_C(0x800)
9856         /*
9857          * This bit must be '1' for the tqm_ring6 fields to be
9858          * configured.
9859          */
9860         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6 \
9861                 UINT32_C(0x1000)
9862         /*
9863          * This bit must be '1' for the tqm_ring7 fields to be
9864          * configured.
9865          */
9866         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7 \
9867                 UINT32_C(0x2000)
9868         /*
9869          * This bit must be '1' for the mrav fields to be
9870          * configured.
9871          */
9872         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV \
9873                 UINT32_C(0x4000)
9874         /*
9875          * This bit must be '1' for the tim fields to be
9876          * configured.
9877          */
9878         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM \
9879                 UINT32_C(0x8000)
9880         /* QPC page size and level. */
9881         uint8_t qpc_pg_size_qpc_lvl;
9882         /* QPC PBL indirect levels. */
9883         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK \
9884                 UINT32_C(0xf)
9885         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT       0
9886         /* PBL pointer is physical start address. */
9887         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0 \
9888                 UINT32_C(0x0)
9889         /* PBL pointer points to PTE table. */
9890         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1 \
9891                 UINT32_C(0x1)
9892         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9893         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 \
9894                 UINT32_C(0x2)
9895         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST \
9896                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
9897         /* QPC page size. */
9898         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK \
9899                 UINT32_C(0xf0)
9900         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT   4
9901         /* 4KB. */
9902         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K \
9903                 (UINT32_C(0x0) << 4)
9904         /* 8KB. */
9905         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K \
9906                 (UINT32_C(0x1) << 4)
9907         /* 64KB. */
9908         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K \
9909                 (UINT32_C(0x2) << 4)
9910         /* 2MB. */
9911         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M \
9912                 (UINT32_C(0x3) << 4)
9913         /* 8MB. */
9914         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M \
9915                 (UINT32_C(0x4) << 4)
9916         /* 1GB. */
9917         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G \
9918                 (UINT32_C(0x5) << 4)
9919         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST \
9920                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
9921         /* SRQ page size and level. */
9922         uint8_t srq_pg_size_srq_lvl;
9923         /* SRQ PBL indirect levels. */
9924         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK \
9925                 UINT32_C(0xf)
9926         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT       0
9927         /* PBL pointer is physical start address. */
9928         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0 \
9929                 UINT32_C(0x0)
9930         /* PBL pointer points to PTE table. */
9931         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1 \
9932                 UINT32_C(0x1)
9933         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9934         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 \
9935                 UINT32_C(0x2)
9936         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST \
9937                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
9938         /* SRQ page size. */
9939         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK \
9940                 UINT32_C(0xf0)
9941         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT   4
9942         /* 4KB. */
9943         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K \
9944                 (UINT32_C(0x0) << 4)
9945         /* 8KB. */
9946         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K \
9947                 (UINT32_C(0x1) << 4)
9948         /* 64KB. */
9949         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K \
9950                 (UINT32_C(0x2) << 4)
9951         /* 2MB. */
9952         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M \
9953                 (UINT32_C(0x3) << 4)
9954         /* 8MB. */
9955         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M \
9956                 (UINT32_C(0x4) << 4)
9957         /* 1GB. */
9958         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G \
9959                 (UINT32_C(0x5) << 4)
9960         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST \
9961                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
9962         /* CQ page size and level. */
9963         uint8_t cq_pg_size_cq_lvl;
9964         /* CQ PBL indirect levels. */
9965         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK \
9966                 UINT32_C(0xf)
9967         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT       0
9968         /* PBL pointer is physical start address. */
9969         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0 \
9970                 UINT32_C(0x0)
9971         /* PBL pointer points to PTE table. */
9972         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1 \
9973                 UINT32_C(0x1)
9974         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9975         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 \
9976                 UINT32_C(0x2)
9977         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST \
9978                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
9979         /* CQ page size. */
9980         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK \
9981                 UINT32_C(0xf0)
9982         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT   4
9983         /* 4KB. */
9984         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K \
9985                 (UINT32_C(0x0) << 4)
9986         /* 8KB. */
9987         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K \
9988                 (UINT32_C(0x1) << 4)
9989         /* 64KB. */
9990         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K \
9991                 (UINT32_C(0x2) << 4)
9992         /* 2MB. */
9993         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M \
9994                 (UINT32_C(0x3) << 4)
9995         /* 8MB. */
9996         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M \
9997                 (UINT32_C(0x4) << 4)
9998         /* 1GB. */
9999         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G \
10000                 (UINT32_C(0x5) << 4)
10001         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST \
10002                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
10003         /* VNIC page size and level. */
10004         uint8_t vnic_pg_size_vnic_lvl;
10005         /* VNIC PBL indirect levels. */
10006         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK \
10007                 UINT32_C(0xf)
10008         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT       0
10009         /* PBL pointer is physical start address. */
10010         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0 \
10011                 UINT32_C(0x0)
10012         /* PBL pointer points to PTE table. */
10013         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1 \
10014                 UINT32_C(0x1)
10015         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10016         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 \
10017                 UINT32_C(0x2)
10018         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST \
10019                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
10020         /* VNIC page size. */
10021         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK \
10022                 UINT32_C(0xf0)
10023         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT   4
10024         /* 4KB. */
10025         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K \
10026                 (UINT32_C(0x0) << 4)
10027         /* 8KB. */
10028         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K \
10029                 (UINT32_C(0x1) << 4)
10030         /* 64KB. */
10031         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K \
10032                 (UINT32_C(0x2) << 4)
10033         /* 2MB. */
10034         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M \
10035                 (UINT32_C(0x3) << 4)
10036         /* 8MB. */
10037         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M \
10038                 (UINT32_C(0x4) << 4)
10039         /* 1GB. */
10040         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G \
10041                 (UINT32_C(0x5) << 4)
10042         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST \
10043                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
10044         /* Stat page size and level. */
10045         uint8_t stat_pg_size_stat_lvl;
10046         /* Stat PBL indirect levels. */
10047         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK \
10048                 UINT32_C(0xf)
10049         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT       0
10050         /* PBL pointer is physical start address. */
10051         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0 \
10052                 UINT32_C(0x0)
10053         /* PBL pointer points to PTE table. */
10054         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1 \
10055                 UINT32_C(0x1)
10056         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10057         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 \
10058                 UINT32_C(0x2)
10059         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST \
10060                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
10061         /* Stat page size. */
10062         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK \
10063                 UINT32_C(0xf0)
10064         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT   4
10065         /* 4KB. */
10066         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K \
10067                 (UINT32_C(0x0) << 4)
10068         /* 8KB. */
10069         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K \
10070                 (UINT32_C(0x1) << 4)
10071         /* 64KB. */
10072         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K \
10073                 (UINT32_C(0x2) << 4)
10074         /* 2MB. */
10075         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M \
10076                 (UINT32_C(0x3) << 4)
10077         /* 8MB. */
10078         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M \
10079                 (UINT32_C(0x4) << 4)
10080         /* 1GB. */
10081         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G \
10082                 (UINT32_C(0x5) << 4)
10083         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST \
10084                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
10085         /* TQM slow path page size and level. */
10086         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
10087         /* TQM slow path PBL indirect levels. */
10088         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK \
10089                 UINT32_C(0xf)
10090         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT       0
10091         /* PBL pointer is physical start address. */
10092         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0 \
10093                 UINT32_C(0x0)
10094         /* PBL pointer points to PTE table. */
10095         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1 \
10096                 UINT32_C(0x1)
10097         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10098         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 \
10099                 UINT32_C(0x2)
10100         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST \
10101                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
10102         /* TQM slow path page size. */
10103         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK \
10104                 UINT32_C(0xf0)
10105         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT   4
10106         /* 4KB. */
10107         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K \
10108                 (UINT32_C(0x0) << 4)
10109         /* 8KB. */
10110         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K \
10111                 (UINT32_C(0x1) << 4)
10112         /* 64KB. */
10113         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K \
10114                 (UINT32_C(0x2) << 4)
10115         /* 2MB. */
10116         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M \
10117                 (UINT32_C(0x3) << 4)
10118         /* 8MB. */
10119         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M \
10120                 (UINT32_C(0x4) << 4)
10121         /* 1GB. */
10122         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G \
10123                 (UINT32_C(0x5) << 4)
10124         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST \
10125                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
10126         /* TQM ring 0 page size and level. */
10127         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
10128         /* TQM ring 0 PBL indirect levels. */
10129         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK \
10130                 UINT32_C(0xf)
10131         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT       0
10132         /* PBL pointer is physical start address. */
10133         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0 \
10134                 UINT32_C(0x0)
10135         /* PBL pointer points to PTE table. */
10136         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1 \
10137                 UINT32_C(0x1)
10138         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10139         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 \
10140                 UINT32_C(0x2)
10141         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST \
10142                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
10143         /* TQM ring 0 page size. */
10144         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK \
10145                 UINT32_C(0xf0)
10146         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT   4
10147         /* 4KB. */
10148         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K \
10149                 (UINT32_C(0x0) << 4)
10150         /* 8KB. */
10151         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K \
10152                 (UINT32_C(0x1) << 4)
10153         /* 64KB. */
10154         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K \
10155                 (UINT32_C(0x2) << 4)
10156         /* 2MB. */
10157         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M \
10158                 (UINT32_C(0x3) << 4)
10159         /* 8MB. */
10160         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M \
10161                 (UINT32_C(0x4) << 4)
10162         /* 1GB. */
10163         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G \
10164                 (UINT32_C(0x5) << 4)
10165         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST \
10166                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
10167         /* TQM ring 1 page size and level. */
10168         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
10169         /* TQM ring 1 PBL indirect levels. */
10170         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK \
10171                 UINT32_C(0xf)
10172         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT       0
10173         /* PBL pointer is physical start address. */
10174         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0 \
10175                 UINT32_C(0x0)
10176         /* PBL pointer points to PTE table. */
10177         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1 \
10178                 UINT32_C(0x1)
10179         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10180         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 \
10181                 UINT32_C(0x2)
10182         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST \
10183                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
10184         /* TQM ring 1 page size. */
10185         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK \
10186                 UINT32_C(0xf0)
10187         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT   4
10188         /* 4KB. */
10189         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K \
10190                 (UINT32_C(0x0) << 4)
10191         /* 8KB. */
10192         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K \
10193                 (UINT32_C(0x1) << 4)
10194         /* 64KB. */
10195         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K \
10196                 (UINT32_C(0x2) << 4)
10197         /* 2MB. */
10198         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M \
10199                 (UINT32_C(0x3) << 4)
10200         /* 8MB. */
10201         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M \
10202                 (UINT32_C(0x4) << 4)
10203         /* 1GB. */
10204         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G \
10205                 (UINT32_C(0x5) << 4)
10206         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST \
10207                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
10208         /* TQM ring 2 page size and level. */
10209         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
10210         /* TQM ring 2 PBL indirect levels. */
10211         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK \
10212                 UINT32_C(0xf)
10213         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT       0
10214         /* PBL pointer is physical start address. */
10215         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0 \
10216                 UINT32_C(0x0)
10217         /* PBL pointer points to PTE table. */
10218         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1 \
10219                 UINT32_C(0x1)
10220         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10221         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 \
10222                 UINT32_C(0x2)
10223         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST \
10224                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
10225         /* TQM ring 2 page size. */
10226         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK \
10227                 UINT32_C(0xf0)
10228         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT   4
10229         /* 4KB. */
10230         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K \
10231                 (UINT32_C(0x0) << 4)
10232         /* 8KB. */
10233         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K \
10234                 (UINT32_C(0x1) << 4)
10235         /* 64KB. */
10236         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K \
10237                 (UINT32_C(0x2) << 4)
10238         /* 2MB. */
10239         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M \
10240                 (UINT32_C(0x3) << 4)
10241         /* 8MB. */
10242         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M \
10243                 (UINT32_C(0x4) << 4)
10244         /* 1GB. */
10245         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G \
10246                 (UINT32_C(0x5) << 4)
10247         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST \
10248                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
10249         /* TQM ring 3 page size and level. */
10250         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
10251         /* TQM ring 3 PBL indirect levels. */
10252         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK \
10253                 UINT32_C(0xf)
10254         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT       0
10255         /* PBL pointer is physical start address. */
10256         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0 \
10257                 UINT32_C(0x0)
10258         /* PBL pointer points to PTE table. */
10259         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1 \
10260                 UINT32_C(0x1)
10261         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10262         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 \
10263                 UINT32_C(0x2)
10264         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST \
10265                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
10266         /* TQM ring 3 page size. */
10267         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK \
10268                 UINT32_C(0xf0)
10269         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT   4
10270         /* 4KB. */
10271         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K \
10272                 (UINT32_C(0x0) << 4)
10273         /* 8KB. */
10274         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K \
10275                 (UINT32_C(0x1) << 4)
10276         /* 64KB. */
10277         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K \
10278                 (UINT32_C(0x2) << 4)
10279         /* 2MB. */
10280         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M \
10281                 (UINT32_C(0x3) << 4)
10282         /* 8MB. */
10283         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M \
10284                 (UINT32_C(0x4) << 4)
10285         /* 1GB. */
10286         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G \
10287                 (UINT32_C(0x5) << 4)
10288         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST \
10289                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
10290         /* TQM ring 4 page size and level. */
10291         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
10292         /* TQM ring 4 PBL indirect levels. */
10293         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK \
10294                 UINT32_C(0xf)
10295         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT       0
10296         /* PBL pointer is physical start address. */
10297         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0 \
10298                 UINT32_C(0x0)
10299         /* PBL pointer points to PTE table. */
10300         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1 \
10301                 UINT32_C(0x1)
10302         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10303         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 \
10304                 UINT32_C(0x2)
10305         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST \
10306                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
10307         /* TQM ring 4 page size. */
10308         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK \
10309                 UINT32_C(0xf0)
10310         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT   4
10311         /* 4KB. */
10312         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K \
10313                 (UINT32_C(0x0) << 4)
10314         /* 8KB. */
10315         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K \
10316                 (UINT32_C(0x1) << 4)
10317         /* 64KB. */
10318         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K \
10319                 (UINT32_C(0x2) << 4)
10320         /* 2MB. */
10321         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M \
10322                 (UINT32_C(0x3) << 4)
10323         /* 8MB. */
10324         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M \
10325                 (UINT32_C(0x4) << 4)
10326         /* 1GB. */
10327         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G \
10328                 (UINT32_C(0x5) << 4)
10329         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST \
10330                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
10331         /* TQM ring 5 page size and level. */
10332         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
10333         /* TQM ring 5 PBL indirect levels. */
10334         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK \
10335                 UINT32_C(0xf)
10336         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT       0
10337         /* PBL pointer is physical start address. */
10338         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0 \
10339                 UINT32_C(0x0)
10340         /* PBL pointer points to PTE table. */
10341         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1 \
10342                 UINT32_C(0x1)
10343         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10344         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 \
10345                 UINT32_C(0x2)
10346         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST \
10347                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
10348         /* TQM ring 5 page size. */
10349         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK \
10350                 UINT32_C(0xf0)
10351         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT   4
10352         /* 4KB. */
10353         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K \
10354                 (UINT32_C(0x0) << 4)
10355         /* 8KB. */
10356         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K \
10357                 (UINT32_C(0x1) << 4)
10358         /* 64KB. */
10359         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K \
10360                 (UINT32_C(0x2) << 4)
10361         /* 2MB. */
10362         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M \
10363                 (UINT32_C(0x3) << 4)
10364         /* 8MB. */
10365         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M \
10366                 (UINT32_C(0x4) << 4)
10367         /* 1GB. */
10368         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G \
10369                 (UINT32_C(0x5) << 4)
10370         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST \
10371                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
10372         /* TQM ring 6 page size and level. */
10373         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
10374         /* TQM ring 6 PBL indirect levels. */
10375         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK \
10376                 UINT32_C(0xf)
10377         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT       0
10378         /* PBL pointer is physical start address. */
10379         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0 \
10380                 UINT32_C(0x0)
10381         /* PBL pointer points to PTE table. */
10382         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1 \
10383                 UINT32_C(0x1)
10384         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10385         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 \
10386                 UINT32_C(0x2)
10387         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST \
10388                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
10389         /* TQM ring 6 page size. */
10390         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK \
10391                 UINT32_C(0xf0)
10392         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT   4
10393         /* 4KB. */
10394         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K \
10395                 (UINT32_C(0x0) << 4)
10396         /* 8KB. */
10397         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K \
10398                 (UINT32_C(0x1) << 4)
10399         /* 64KB. */
10400         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K \
10401                 (UINT32_C(0x2) << 4)
10402         /* 2MB. */
10403         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M \
10404                 (UINT32_C(0x3) << 4)
10405         /* 8MB. */
10406         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M \
10407                 (UINT32_C(0x4) << 4)
10408         /* 1GB. */
10409         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G \
10410                 (UINT32_C(0x5) << 4)
10411         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST \
10412                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
10413         /* TQM ring 7 page size and level. */
10414         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
10415         /* TQM ring 7 PBL indirect levels. */
10416         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK \
10417                 UINT32_C(0xf)
10418         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT       0
10419         /* PBL pointer is physical start address. */
10420         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0 \
10421                 UINT32_C(0x0)
10422         /* PBL pointer points to PTE table. */
10423         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1 \
10424                 UINT32_C(0x1)
10425         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10426         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 \
10427                 UINT32_C(0x2)
10428         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST \
10429                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
10430         /* TQM ring 7 page size. */
10431         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK \
10432                 UINT32_C(0xf0)
10433         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT   4
10434         /* 4KB. */
10435         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K \
10436                 (UINT32_C(0x0) << 4)
10437         /* 8KB. */
10438         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K \
10439                 (UINT32_C(0x1) << 4)
10440         /* 64KB. */
10441         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K \
10442                 (UINT32_C(0x2) << 4)
10443         /* 2MB. */
10444         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M \
10445                 (UINT32_C(0x3) << 4)
10446         /* 8MB. */
10447         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M \
10448                 (UINT32_C(0x4) << 4)
10449         /* 1GB. */
10450         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G \
10451                 (UINT32_C(0x5) << 4)
10452         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST \
10453                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
10454         /* MR/AV page size and level. */
10455         uint8_t mrav_pg_size_mrav_lvl;
10456         /* MR/AV PBL indirect levels. */
10457         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK \
10458                 UINT32_C(0xf)
10459         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT       0
10460         /* PBL pointer is physical start address. */
10461         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0 \
10462                 UINT32_C(0x0)
10463         /* PBL pointer points to PTE table. */
10464         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1 \
10465                 UINT32_C(0x1)
10466         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10467         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 \
10468                 UINT32_C(0x2)
10469         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST \
10470                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
10471         /* MR/AV page size. */
10472         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK \
10473                 UINT32_C(0xf0)
10474         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT   4
10475         /* 4KB. */
10476         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K \
10477                 (UINT32_C(0x0) << 4)
10478         /* 8KB. */
10479         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K \
10480                 (UINT32_C(0x1) << 4)
10481         /* 64KB. */
10482         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K \
10483                 (UINT32_C(0x2) << 4)
10484         /* 2MB. */
10485         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M \
10486                 (UINT32_C(0x3) << 4)
10487         /* 8MB. */
10488         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M \
10489                 (UINT32_C(0x4) << 4)
10490         /* 1GB. */
10491         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G \
10492                 (UINT32_C(0x5) << 4)
10493         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST \
10494                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
10495         /* Timer page size and level. */
10496         uint8_t tim_pg_size_tim_lvl;
10497         /* Timer PBL indirect levels. */
10498         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK \
10499                 UINT32_C(0xf)
10500         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT       0
10501         /* PBL pointer is physical start address. */
10502         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0 \
10503                 UINT32_C(0x0)
10504         /* PBL pointer points to PTE table. */
10505         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1 \
10506                 UINT32_C(0x1)
10507         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10508         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 \
10509                 UINT32_C(0x2)
10510         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST \
10511                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
10512         /* Timer page size. */
10513         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK \
10514                 UINT32_C(0xf0)
10515         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT   4
10516         /* 4KB. */
10517         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K \
10518                 (UINT32_C(0x0) << 4)
10519         /* 8KB. */
10520         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K \
10521                 (UINT32_C(0x1) << 4)
10522         /* 64KB. */
10523         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K \
10524                 (UINT32_C(0x2) << 4)
10525         /* 2MB. */
10526         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M \
10527                 (UINT32_C(0x3) << 4)
10528         /* 8MB. */
10529         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M \
10530                 (UINT32_C(0x4) << 4)
10531         /* 1GB. */
10532         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G \
10533                 (UINT32_C(0x5) << 4)
10534         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST \
10535                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
10536         /* QP page directory. */
10537         uint64_t        qpc_page_dir;
10538         /* SRQ page directory. */
10539         uint64_t        srq_page_dir;
10540         /* CQ page directory. */
10541         uint64_t        cq_page_dir;
10542         /* VNIC page directory. */
10543         uint64_t        vnic_page_dir;
10544         /* Stat page directory. */
10545         uint64_t        stat_page_dir;
10546         /* TQM slowpath page directory. */
10547         uint64_t        tqm_sp_page_dir;
10548         /* TQM ring 0 page directory. */
10549         uint64_t        tqm_ring0_page_dir;
10550         /* TQM ring 1 page directory. */
10551         uint64_t        tqm_ring1_page_dir;
10552         /* TQM ring 2 page directory. */
10553         uint64_t        tqm_ring2_page_dir;
10554         /* TQM ring 3 page directory. */
10555         uint64_t        tqm_ring3_page_dir;
10556         /* TQM ring 4 page directory. */
10557         uint64_t        tqm_ring4_page_dir;
10558         /* TQM ring 5 page directory. */
10559         uint64_t        tqm_ring5_page_dir;
10560         /* TQM ring 6 page directory. */
10561         uint64_t        tqm_ring6_page_dir;
10562         /* TQM ring 7 page directory. */
10563         uint64_t        tqm_ring7_page_dir;
10564         /* MR/AV page directory. */
10565         uint64_t        mrav_page_dir;
10566         /* Timer page directory. */
10567         uint64_t        tim_page_dir;
10568         /* Number of QPs. */
10569         uint32_t        qp_num_entries;
10570         /* Number of SRQs. */
10571         uint32_t        srq_num_entries;
10572         /* Number of CQs. */
10573         uint32_t        cq_num_entries;
10574         /* Number of Stats. */
10575         uint32_t        stat_num_entries;
10576         /*
10577          * Number of TQM slowpath entries.
10578          *
10579          * TQM slowpath rings should be sized as follows:
10580          *
10581          * num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size
10582          *
10583          * Where:
10584          *   num_vnics is the number of VNICs allocated in the VNIC backing store
10585          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
10586          *   num_roce_qps is the number of RoCE QPs in the QP backing store
10587          *   tqm_min_size is tqm_min_entries_per_ring reported by
10588          *     HWRM_FUNC_BACKING_STORE_QCAPS
10589          *
10590          * Note that TQM ring sizes cannot be extended while the system is
10591          * operational. If a PF driver needs to extend a TQM ring, it needs
10592          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10593          * the backing store.
10594          */
10595         uint32_t        tqm_sp_num_entries;
10596         /*
10597          * Number of TQM ring 0 entries.
10598          *
10599          * TQM fastpath rings should be sized large enough to accommodate the
10600          * maximum number of QPs (either L2 or RoCE, or both if shared)
10601          * that can be enqueued to the TQM ring.
10602          *
10603          * Note that TQM ring sizes cannot be extended while the system is
10604          * operational. If a PF driver needs to extend a TQM ring, it needs
10605          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10606          * the backing store.
10607          */
10608         uint32_t        tqm_ring0_num_entries;
10609         /*
10610          * Number of TQM ring 1 entries.
10611          *
10612          * TQM fastpath rings should be sized large enough to accommodate the
10613          * maximum number of QPs (either L2 or RoCE, or both if shared)
10614          * that can be enqueued to the TQM ring.
10615          *
10616          * Note that TQM ring sizes cannot be extended while the system is
10617          * operational. If a PF driver needs to extend a TQM ring, it needs
10618          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10619          * the backing store.
10620          */
10621         uint32_t        tqm_ring1_num_entries;
10622         /*
10623          * Number of TQM ring 2 entries.
10624          *
10625          * TQM fastpath rings should be sized large enough to accommodate the
10626          * maximum number of QPs (either L2 or RoCE, or both if shared)
10627          * that can be enqueued to the TQM ring.
10628          *
10629          * Note that TQM ring sizes cannot be extended while the system is
10630          * operational. If a PF driver needs to extend a TQM ring, it needs
10631          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10632          * the backing store.
10633          */
10634         uint32_t        tqm_ring2_num_entries;
10635         /*
10636          * Number of TQM ring 3 entries.
10637          *
10638          * TQM fastpath rings should be sized large enough to accommodate the
10639          * maximum number of QPs (either L2 or RoCE, or both if shared)
10640          * that can be enqueued to the TQM ring.
10641          *
10642          * Note that TQM ring sizes cannot be extended while the system is
10643          * operational. If a PF driver needs to extend a TQM ring, it needs
10644          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10645          * the backing store.
10646          */
10647         uint32_t        tqm_ring3_num_entries;
10648         /*
10649          * Number of TQM ring 4 entries.
10650          *
10651          * TQM fastpath rings should be sized large enough to accommodate the
10652          * maximum number of QPs (either L2 or RoCE, or both if shared)
10653          * that can be enqueued to the TQM ring.
10654          *
10655          * Note that TQM ring sizes cannot be extended while the system is
10656          * operational. If a PF driver needs to extend a TQM ring, it needs
10657          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10658          * the backing store.
10659          */
10660         uint32_t        tqm_ring4_num_entries;
10661         /*
10662          * Number of TQM ring 5 entries.
10663          *
10664          * TQM fastpath rings should be sized large enough to accommodate the
10665          * maximum number of QPs (either L2 or RoCE, or both if shared)
10666          * that can be enqueued to the TQM ring.
10667          *
10668          * Note that TQM ring sizes cannot be extended while the system is
10669          * operational. If a PF driver needs to extend a TQM ring, it needs
10670          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10671          * the backing store.
10672          */
10673         uint32_t        tqm_ring5_num_entries;
10674         /*
10675          * Number of TQM ring 6 entries.
10676          *
10677          * TQM fastpath rings should be sized large enough to accommodate the
10678          * maximum number of QPs (either L2 or RoCE, or both if shared)
10679          * that can be enqueued to the TQM ring.
10680          *
10681          * Note that TQM ring sizes cannot be extended while the system is
10682          * operational. If a PF driver needs to extend a TQM ring, it needs
10683          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10684          * the backing store.
10685          */
10686         uint32_t        tqm_ring6_num_entries;
10687         /*
10688          * Number of TQM ring 7 entries.
10689          *
10690          * TQM fastpath rings should be sized large enough to accommodate the
10691          * maximum number of QPs (either L2 or RoCE, or both if shared)
10692          * that can be enqueued to the TQM ring.
10693          *
10694          * Note that TQM ring sizes cannot be extended while the system is
10695          * operational. If a PF driver needs to extend a TQM ring, it needs
10696          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10697          * the backing store.
10698          */
10699         uint32_t        tqm_ring7_num_entries;
10700         /*
10701          * If the MR/AV split reservation flag is not set, then this field
10702          * represents the total number of MR plus AV entries. For versions
10703          * of firmware that support the split reservation, when it is not
10704          * specified half of the entries will be reserved for MRs and the
10705          * other half for AVs.
10706          *
10707          * If the MR/AV split reservation flag is set, then this
10708          * field is logically divided into two 16b fields. Bits `[31:16]`
10709          * represents the `mr_num_entries` and bits `[15:0]` represents
10710          * `av_num_entries`. The granularity of these values is defined by
10711          * the `mrav_num_entries_unit` field returned by the
10712          * `backing_store_qcaps` command.
10713          */
10714         uint32_t        mrav_num_entries;
10715         /* Number of Timer entries. */
10716         uint32_t        tim_num_entries;
10717         /* Number of entries to reserve for QP1 */
10718         uint16_t        qp_num_qp1_entries;
10719         /* Number of entries to reserve for L2 */
10720         uint16_t        qp_num_l2_entries;
10721         /* Number of bytes that have been allocated for each context entry. */
10722         uint16_t        qp_entry_size;
10723         /* Number of entries to reserve for L2 */
10724         uint16_t        srq_num_l2_entries;
10725         /* Number of bytes that have been allocated for each context entry. */
10726         uint16_t        srq_entry_size;
10727         /* Number of entries to reserve for L2 */
10728         uint16_t        cq_num_l2_entries;
10729         /* Number of bytes that have been allocated for each context entry. */
10730         uint16_t        cq_entry_size;
10731         /* Number of entries to reserve for VNIC entries */
10732         uint16_t        vnic_num_vnic_entries;
10733         /* Number of entries to reserve for Ring table entries */
10734         uint16_t        vnic_num_ring_table_entries;
10735         /* Number of bytes that have been allocated for each context entry. */
10736         uint16_t        vnic_entry_size;
10737         /* Number of bytes that have been allocated for each context entry. */
10738         uint16_t        stat_entry_size;
10739         /* Number of bytes that have been allocated for each context entry. */
10740         uint16_t        tqm_entry_size;
10741         /* Number of bytes that have been allocated for each context entry. */
10742         uint16_t        mrav_entry_size;
10743         /* Number of bytes that have been allocated for each context entry. */
10744         uint16_t        tim_entry_size;
10745 } __attribute__((packed));
10746
10747 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
10748 struct hwrm_func_backing_store_cfg_output {
10749         /* The specific error status for the command. */
10750         uint16_t        error_code;
10751         /* The HWRM command request type. */
10752         uint16_t        req_type;
10753         /* The sequence ID from the original command. */
10754         uint16_t        seq_id;
10755         /* The length of the response data in number of bytes. */
10756         uint16_t        resp_len;
10757         uint8_t unused_0[7];
10758         /*
10759          * This field is used in Output records to indicate that the output
10760          * is completely written to RAM.  This field should be read as '1'
10761          * to indicate that the output has been completely written.
10762          * When writing a command completion or response to an internal processor,
10763          * the order of writes has to be such that this field is written last.
10764          */
10765         uint8_t valid;
10766 } __attribute__((packed));
10767
10768 /********************************
10769  * hwrm_func_backing_store_qcfg *
10770  ********************************/
10771
10772
10773 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
10774 struct hwrm_func_backing_store_qcfg_input {
10775         /* The HWRM command request type. */
10776         uint16_t        req_type;
10777         /*
10778          * The completion ring to send the completion event on. This should
10779          * be the NQ ID returned from the `nq_alloc` HWRM command.
10780          */
10781         uint16_t        cmpl_ring;
10782         /*
10783          * The sequence ID is used by the driver for tracking multiple
10784          * commands. This ID is treated as opaque data by the firmware and
10785          * the value is returned in the `hwrm_resp_hdr` upon completion.
10786          */
10787         uint16_t        seq_id;
10788         /*
10789          * The target ID of the command:
10790          * * 0x0-0xFFF8 - The function ID
10791          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10792          * * 0xFFFD - Reserved for user-space HWRM interface
10793          * * 0xFFFF - HWRM
10794          */
10795         uint16_t        target_id;
10796         /*
10797          * A physical address pointer pointing to a host buffer that the
10798          * command's response data will be written. This can be either a host
10799          * physical address (HPA) or a guest physical address (GPA) and must
10800          * point to a physically contiguous block of memory.
10801          */
10802         uint64_t        resp_addr;
10803 } __attribute__((packed));
10804
10805 /* hwrm_func_backing_store_qcfg_output (size:1920b/240B) */
10806 struct hwrm_func_backing_store_qcfg_output {
10807         /* The specific error status for the command. */
10808         uint16_t        error_code;
10809         /* The HWRM command request type. */
10810         uint16_t        req_type;
10811         /* The sequence ID from the original command. */
10812         uint16_t        seq_id;
10813         /* The length of the response data in number of bytes. */
10814         uint16_t        resp_len;
10815         uint32_t        flags;
10816         /*
10817          * When set, the firmware only uses on-chip resources and does not
10818          * expect any backing store to be provided by the host driver. This
10819          * mode provides minimal L2 functionality (e.g. limited L2 resources,
10820          * no RoCE).
10821          */
10822         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE \
10823                 UINT32_C(0x1)
10824         /*
10825          * When set, the 32b `mrav_num_entries` field is logically divided
10826          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
10827          */
10828         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_MRAV_RESERVATION_SPLIT \
10829                 UINT32_C(0x2)
10830         uint8_t unused_0[4];
10831         /*
10832          * This bit must be '1' for the qp fields to be
10833          * configured.
10834          */
10835         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_QP \
10836                 UINT32_C(0x1)
10837         /*
10838          * This bit must be '1' for the srq fields to be
10839          * configured.
10840          */
10841         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_SRQ \
10842                 UINT32_C(0x2)
10843         /*
10844          * This bit must be '1' for the cq fields to be
10845          * configured.
10846          */
10847         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_CQ \
10848                 UINT32_C(0x4)
10849         /*
10850          * This bit must be '1' for the vnic fields to be
10851          * configured.
10852          */
10853         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_VNIC \
10854                 UINT32_C(0x8)
10855         /*
10856          * This bit must be '1' for the stat fields to be
10857          * configured.
10858          */
10859         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_STAT \
10860                 UINT32_C(0x10)
10861         /*
10862          * This bit must be '1' for the tqm_sp fields to be
10863          * configured.
10864          */
10865         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_SP \
10866                 UINT32_C(0x20)
10867         /*
10868          * This bit must be '1' for the tqm_ring0 fields to be
10869          * configured.
10870          */
10871         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING0 \
10872                 UINT32_C(0x40)
10873         /*
10874          * This bit must be '1' for the tqm_ring1 fields to be
10875          * configured.
10876          */
10877         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING1 \
10878                 UINT32_C(0x80)
10879         /*
10880          * This bit must be '1' for the tqm_ring2 fields to be
10881          * configured.
10882          */
10883         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING2 \
10884                 UINT32_C(0x100)
10885         /*
10886          * This bit must be '1' for the tqm_ring3 fields to be
10887          * configured.
10888          */
10889         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING3 \
10890                 UINT32_C(0x200)
10891         /*
10892          * This bit must be '1' for the tqm_ring4 fields to be
10893          * configured.
10894          */
10895         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING4 \
10896                 UINT32_C(0x400)
10897         /*
10898          * This bit must be '1' for the tqm_ring5 fields to be
10899          * configured.
10900          */
10901         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING5 \
10902                 UINT32_C(0x800)
10903         /*
10904          * This bit must be '1' for the tqm_ring6 fields to be
10905          * configured.
10906          */
10907         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING6 \
10908                 UINT32_C(0x1000)
10909         /*
10910          * This bit must be '1' for the tqm_ring7 fields to be
10911          * configured.
10912          */
10913         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING7 \
10914                 UINT32_C(0x2000)
10915         /*
10916          * This bit must be '1' for the mrav fields to be
10917          * configured.
10918          */
10919         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_MRAV \
10920                 UINT32_C(0x4000)
10921         /*
10922          * This bit must be '1' for the tim fields to be
10923          * configured.
10924          */
10925         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TIM \
10926                 UINT32_C(0x8000)
10927         /* QPC page size and level. */
10928         uint8_t qpc_pg_size_qpc_lvl;
10929         /* QPC PBL indirect levels. */
10930         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK \
10931                 UINT32_C(0xf)
10932         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT       0
10933         /* PBL pointer is physical start address. */
10934         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0 \
10935                 UINT32_C(0x0)
10936         /* PBL pointer points to PTE table. */
10937         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1 \
10938                 UINT32_C(0x1)
10939         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10940         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 \
10941                 UINT32_C(0x2)
10942         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST \
10943                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
10944         /* QPC page size. */
10945         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK \
10946                 UINT32_C(0xf0)
10947         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT   4
10948         /* 4KB. */
10949         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K \
10950                 (UINT32_C(0x0) << 4)
10951         /* 8KB. */
10952         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K \
10953                 (UINT32_C(0x1) << 4)
10954         /* 64KB. */
10955         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K \
10956                 (UINT32_C(0x2) << 4)
10957         /* 2MB. */
10958         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M \
10959                 (UINT32_C(0x3) << 4)
10960         /* 8MB. */
10961         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M \
10962                 (UINT32_C(0x4) << 4)
10963         /* 1GB. */
10964         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G \
10965                 (UINT32_C(0x5) << 4)
10966         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST \
10967                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
10968         /* SRQ page size and level. */
10969         uint8_t srq_pg_size_srq_lvl;
10970         /* SRQ PBL indirect levels. */
10971         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK \
10972                 UINT32_C(0xf)
10973         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT       0
10974         /* PBL pointer is physical start address. */
10975         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0 \
10976                 UINT32_C(0x0)
10977         /* PBL pointer points to PTE table. */
10978         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1 \
10979                 UINT32_C(0x1)
10980         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10981         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 \
10982                 UINT32_C(0x2)
10983         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST \
10984                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
10985         /* SRQ page size. */
10986         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK \
10987                 UINT32_C(0xf0)
10988         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT   4
10989         /* 4KB. */
10990         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K \
10991                 (UINT32_C(0x0) << 4)
10992         /* 8KB. */
10993         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K \
10994                 (UINT32_C(0x1) << 4)
10995         /* 64KB. */
10996         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K \
10997                 (UINT32_C(0x2) << 4)
10998         /* 2MB. */
10999         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M \
11000                 (UINT32_C(0x3) << 4)
11001         /* 8MB. */
11002         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M \
11003                 (UINT32_C(0x4) << 4)
11004         /* 1GB. */
11005         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G \
11006                 (UINT32_C(0x5) << 4)
11007         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST \
11008                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
11009         /* CQ page size and level. */
11010         uint8_t cq_pg_size_cq_lvl;
11011         /* CQ PBL indirect levels. */
11012         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK \
11013                 UINT32_C(0xf)
11014         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT       0
11015         /* PBL pointer is physical start address. */
11016         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0 \
11017                 UINT32_C(0x0)
11018         /* PBL pointer points to PTE table. */
11019         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1 \
11020                 UINT32_C(0x1)
11021         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11022         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 \
11023                 UINT32_C(0x2)
11024         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST \
11025                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
11026         /* CQ page size. */
11027         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK \
11028                 UINT32_C(0xf0)
11029         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT   4
11030         /* 4KB. */
11031         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K \
11032                 (UINT32_C(0x0) << 4)
11033         /* 8KB. */
11034         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K \
11035                 (UINT32_C(0x1) << 4)
11036         /* 64KB. */
11037         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K \
11038                 (UINT32_C(0x2) << 4)
11039         /* 2MB. */
11040         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M \
11041                 (UINT32_C(0x3) << 4)
11042         /* 8MB. */
11043         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M \
11044                 (UINT32_C(0x4) << 4)
11045         /* 1GB. */
11046         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G \
11047                 (UINT32_C(0x5) << 4)
11048         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST \
11049                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
11050         /* VNIC page size and level. */
11051         uint8_t vnic_pg_size_vnic_lvl;
11052         /* VNIC PBL indirect levels. */
11053         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK \
11054                 UINT32_C(0xf)
11055         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT       0
11056         /* PBL pointer is physical start address. */
11057         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0 \
11058                 UINT32_C(0x0)
11059         /* PBL pointer points to PTE table. */
11060         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1 \
11061                 UINT32_C(0x1)
11062         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11063         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 \
11064                 UINT32_C(0x2)
11065         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST \
11066                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
11067         /* VNIC page size. */
11068         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK \
11069                 UINT32_C(0xf0)
11070         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT   4
11071         /* 4KB. */
11072         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K \
11073                 (UINT32_C(0x0) << 4)
11074         /* 8KB. */
11075         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K \
11076                 (UINT32_C(0x1) << 4)
11077         /* 64KB. */
11078         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K \
11079                 (UINT32_C(0x2) << 4)
11080         /* 2MB. */
11081         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M \
11082                 (UINT32_C(0x3) << 4)
11083         /* 8MB. */
11084         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M \
11085                 (UINT32_C(0x4) << 4)
11086         /* 1GB. */
11087         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G \
11088                 (UINT32_C(0x5) << 4)
11089         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST \
11090                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
11091         /* Stat page size and level. */
11092         uint8_t stat_pg_size_stat_lvl;
11093         /* Stat PBL indirect levels. */
11094         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK \
11095                 UINT32_C(0xf)
11096         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT       0
11097         /* PBL pointer is physical start address. */
11098         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0 \
11099                 UINT32_C(0x0)
11100         /* PBL pointer points to PTE table. */
11101         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1 \
11102                 UINT32_C(0x1)
11103         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11104         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 \
11105                 UINT32_C(0x2)
11106         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST \
11107                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
11108         /* Stat page size. */
11109         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK \
11110                 UINT32_C(0xf0)
11111         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT   4
11112         /* 4KB. */
11113         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K \
11114                 (UINT32_C(0x0) << 4)
11115         /* 8KB. */
11116         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K \
11117                 (UINT32_C(0x1) << 4)
11118         /* 64KB. */
11119         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K \
11120                 (UINT32_C(0x2) << 4)
11121         /* 2MB. */
11122         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M \
11123                 (UINT32_C(0x3) << 4)
11124         /* 8MB. */
11125         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M \
11126                 (UINT32_C(0x4) << 4)
11127         /* 1GB. */
11128         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G \
11129                 (UINT32_C(0x5) << 4)
11130         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST \
11131                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
11132         /* TQM slow path page size and level. */
11133         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
11134         /* TQM slow path PBL indirect levels. */
11135         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK \
11136                 UINT32_C(0xf)
11137         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT       0
11138         /* PBL pointer is physical start address. */
11139         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0 \
11140                 UINT32_C(0x0)
11141         /* PBL pointer points to PTE table. */
11142         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1 \
11143                 UINT32_C(0x1)
11144         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11145         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 \
11146                 UINT32_C(0x2)
11147         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST \
11148                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
11149         /* TQM slow path page size. */
11150         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK \
11151                 UINT32_C(0xf0)
11152         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT   4
11153         /* 4KB. */
11154         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K \
11155                 (UINT32_C(0x0) << 4)
11156         /* 8KB. */
11157         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K \
11158                 (UINT32_C(0x1) << 4)
11159         /* 64KB. */
11160         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K \
11161                 (UINT32_C(0x2) << 4)
11162         /* 2MB. */
11163         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M \
11164                 (UINT32_C(0x3) << 4)
11165         /* 8MB. */
11166         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M \
11167                 (UINT32_C(0x4) << 4)
11168         /* 1GB. */
11169         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G \
11170                 (UINT32_C(0x5) << 4)
11171         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST \
11172                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
11173         /* TQM ring 0 page size and level. */
11174         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
11175         /* TQM ring 0 PBL indirect levels. */
11176         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK \
11177                 UINT32_C(0xf)
11178         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT       0
11179         /* PBL pointer is physical start address. */
11180         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0 \
11181                 UINT32_C(0x0)
11182         /* PBL pointer points to PTE table. */
11183         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1 \
11184                 UINT32_C(0x1)
11185         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11186         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 \
11187                 UINT32_C(0x2)
11188         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST \
11189                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
11190         /* TQM ring 0 page size. */
11191         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK \
11192                 UINT32_C(0xf0)
11193         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT   4
11194         /* 4KB. */
11195         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K \
11196                 (UINT32_C(0x0) << 4)
11197         /* 8KB. */
11198         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K \
11199                 (UINT32_C(0x1) << 4)
11200         /* 64KB. */
11201         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K \
11202                 (UINT32_C(0x2) << 4)
11203         /* 2MB. */
11204         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M \
11205                 (UINT32_C(0x3) << 4)
11206         /* 8MB. */
11207         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M \
11208                 (UINT32_C(0x4) << 4)
11209         /* 1GB. */
11210         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G \
11211                 (UINT32_C(0x5) << 4)
11212         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST \
11213                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
11214         /* TQM ring 1 page size and level. */
11215         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
11216         /* TQM ring 1 PBL indirect levels. */
11217         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK \
11218                 UINT32_C(0xf)
11219         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT       0
11220         /* PBL pointer is physical start address. */
11221         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0 \
11222                 UINT32_C(0x0)
11223         /* PBL pointer points to PTE table. */
11224         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1 \
11225                 UINT32_C(0x1)
11226         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11227         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 \
11228                 UINT32_C(0x2)
11229         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST \
11230                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
11231         /* TQM ring 1 page size. */
11232         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK \
11233                 UINT32_C(0xf0)
11234         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT   4
11235         /* 4KB. */
11236         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K \
11237                 (UINT32_C(0x0) << 4)
11238         /* 8KB. */
11239         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K \
11240                 (UINT32_C(0x1) << 4)
11241         /* 64KB. */
11242         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K \
11243                 (UINT32_C(0x2) << 4)
11244         /* 2MB. */
11245         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M \
11246                 (UINT32_C(0x3) << 4)
11247         /* 8MB. */
11248         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M \
11249                 (UINT32_C(0x4) << 4)
11250         /* 1GB. */
11251         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G \
11252                 (UINT32_C(0x5) << 4)
11253         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST \
11254                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
11255         /* TQM ring 2 page size and level. */
11256         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
11257         /* TQM ring 2 PBL indirect levels. */
11258         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK \
11259                 UINT32_C(0xf)
11260         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT       0
11261         /* PBL pointer is physical start address. */
11262         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0 \
11263                 UINT32_C(0x0)
11264         /* PBL pointer points to PTE table. */
11265         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1 \
11266                 UINT32_C(0x1)
11267         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11268         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 \
11269                 UINT32_C(0x2)
11270         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST \
11271                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
11272         /* TQM ring 2 page size. */
11273         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK \
11274                 UINT32_C(0xf0)
11275         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT   4
11276         /* 4KB. */
11277         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K \
11278                 (UINT32_C(0x0) << 4)
11279         /* 8KB. */
11280         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K \
11281                 (UINT32_C(0x1) << 4)
11282         /* 64KB. */
11283         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K \
11284                 (UINT32_C(0x2) << 4)
11285         /* 2MB. */
11286         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M \
11287                 (UINT32_C(0x3) << 4)
11288         /* 8MB. */
11289         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M \
11290                 (UINT32_C(0x4) << 4)
11291         /* 1GB. */
11292         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G \
11293                 (UINT32_C(0x5) << 4)
11294         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST \
11295                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
11296         /* TQM ring 3 page size and level. */
11297         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
11298         /* TQM ring 3 PBL indirect levels. */
11299         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK \
11300                 UINT32_C(0xf)
11301         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT       0
11302         /* PBL pointer is physical start address. */
11303         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0 \
11304                 UINT32_C(0x0)
11305         /* PBL pointer points to PTE table. */
11306         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1 \
11307                 UINT32_C(0x1)
11308         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11309         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 \
11310                 UINT32_C(0x2)
11311         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST \
11312                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
11313         /* TQM ring 3 page size. */
11314         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK \
11315                 UINT32_C(0xf0)
11316         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT   4
11317         /* 4KB. */
11318         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K \
11319                 (UINT32_C(0x0) << 4)
11320         /* 8KB. */
11321         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K \
11322                 (UINT32_C(0x1) << 4)
11323         /* 64KB. */
11324         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K \
11325                 (UINT32_C(0x2) << 4)
11326         /* 2MB. */
11327         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M \
11328                 (UINT32_C(0x3) << 4)
11329         /* 8MB. */
11330         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M \
11331                 (UINT32_C(0x4) << 4)
11332         /* 1GB. */
11333         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G \
11334                 (UINT32_C(0x5) << 4)
11335         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST \
11336                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
11337         /* TQM ring 4 page size and level. */
11338         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
11339         /* TQM ring 4 PBL indirect levels. */
11340         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK \
11341                 UINT32_C(0xf)
11342         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT       0
11343         /* PBL pointer is physical start address. */
11344         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0 \
11345                 UINT32_C(0x0)
11346         /* PBL pointer points to PTE table. */
11347         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1 \
11348                 UINT32_C(0x1)
11349         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11350         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 \
11351                 UINT32_C(0x2)
11352         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST \
11353                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
11354         /* TQM ring 4 page size. */
11355         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK \
11356                 UINT32_C(0xf0)
11357         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT   4
11358         /* 4KB. */
11359         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K \
11360                 (UINT32_C(0x0) << 4)
11361         /* 8KB. */
11362         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K \
11363                 (UINT32_C(0x1) << 4)
11364         /* 64KB. */
11365         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K \
11366                 (UINT32_C(0x2) << 4)
11367         /* 2MB. */
11368         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M \
11369                 (UINT32_C(0x3) << 4)
11370         /* 8MB. */
11371         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M \
11372                 (UINT32_C(0x4) << 4)
11373         /* 1GB. */
11374         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G \
11375                 (UINT32_C(0x5) << 4)
11376         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST \
11377                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
11378         /* TQM ring 5 page size and level. */
11379         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
11380         /* TQM ring 5 PBL indirect levels. */
11381         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK \
11382                 UINT32_C(0xf)
11383         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT       0
11384         /* PBL pointer is physical start address. */
11385         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0 \
11386                 UINT32_C(0x0)
11387         /* PBL pointer points to PTE table. */
11388         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1 \
11389                 UINT32_C(0x1)
11390         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11391         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 \
11392                 UINT32_C(0x2)
11393         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST \
11394                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
11395         /* TQM ring 5 page size. */
11396         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK \
11397                 UINT32_C(0xf0)
11398         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT   4
11399         /* 4KB. */
11400         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K \
11401                 (UINT32_C(0x0) << 4)
11402         /* 8KB. */
11403         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K \
11404                 (UINT32_C(0x1) << 4)
11405         /* 64KB. */
11406         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K \
11407                 (UINT32_C(0x2) << 4)
11408         /* 2MB. */
11409         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M \
11410                 (UINT32_C(0x3) << 4)
11411         /* 8MB. */
11412         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M \
11413                 (UINT32_C(0x4) << 4)
11414         /* 1GB. */
11415         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G \
11416                 (UINT32_C(0x5) << 4)
11417         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST \
11418                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
11419         /* TQM ring 6 page size and level. */
11420         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
11421         /* TQM ring 6 PBL indirect levels. */
11422         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK \
11423                 UINT32_C(0xf)
11424         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT       0
11425         /* PBL pointer is physical start address. */
11426         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0 \
11427                 UINT32_C(0x0)
11428         /* PBL pointer points to PTE table. */
11429         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1 \
11430                 UINT32_C(0x1)
11431         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11432         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 \
11433                 UINT32_C(0x2)
11434         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST \
11435                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
11436         /* TQM ring 6 page size. */
11437         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK \
11438                 UINT32_C(0xf0)
11439         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT   4
11440         /* 4KB. */
11441         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K \
11442                 (UINT32_C(0x0) << 4)
11443         /* 8KB. */
11444         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K \
11445                 (UINT32_C(0x1) << 4)
11446         /* 64KB. */
11447         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K \
11448                 (UINT32_C(0x2) << 4)
11449         /* 2MB. */
11450         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M \
11451                 (UINT32_C(0x3) << 4)
11452         /* 8MB. */
11453         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M \
11454                 (UINT32_C(0x4) << 4)
11455         /* 1GB. */
11456         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G \
11457                 (UINT32_C(0x5) << 4)
11458         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST \
11459                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
11460         /* TQM ring 7 page size and level. */
11461         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
11462         /* TQM ring 7 PBL indirect levels. */
11463         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK \
11464                 UINT32_C(0xf)
11465         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT       0
11466         /* PBL pointer is physical start address. */
11467         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0 \
11468                 UINT32_C(0x0)
11469         /* PBL pointer points to PTE table. */
11470         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1 \
11471                 UINT32_C(0x1)
11472         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11473         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 \
11474                 UINT32_C(0x2)
11475         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST \
11476                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
11477         /* TQM ring 7 page size. */
11478         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK \
11479                 UINT32_C(0xf0)
11480         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT   4
11481         /* 4KB. */
11482         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K \
11483                 (UINT32_C(0x0) << 4)
11484         /* 8KB. */
11485         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K \
11486                 (UINT32_C(0x1) << 4)
11487         /* 64KB. */
11488         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K \
11489                 (UINT32_C(0x2) << 4)
11490         /* 2MB. */
11491         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M \
11492                 (UINT32_C(0x3) << 4)
11493         /* 8MB. */
11494         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M \
11495                 (UINT32_C(0x4) << 4)
11496         /* 1GB. */
11497         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G \
11498                 (UINT32_C(0x5) << 4)
11499         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST \
11500                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
11501         /* MR/AV page size and level. */
11502         uint8_t mrav_pg_size_mrav_lvl;
11503         /* MR/AV PBL indirect levels. */
11504         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK \
11505                 UINT32_C(0xf)
11506         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT       0
11507         /* PBL pointer is physical start address. */
11508         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0 \
11509                 UINT32_C(0x0)
11510         /* PBL pointer points to PTE table. */
11511         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1 \
11512                 UINT32_C(0x1)
11513         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11514         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 \
11515                 UINT32_C(0x2)
11516         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST \
11517                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
11518         /* MR/AV page size. */
11519         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK \
11520                 UINT32_C(0xf0)
11521         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT   4
11522         /* 4KB. */
11523         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K \
11524                 (UINT32_C(0x0) << 4)
11525         /* 8KB. */
11526         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K \
11527                 (UINT32_C(0x1) << 4)
11528         /* 64KB. */
11529         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K \
11530                 (UINT32_C(0x2) << 4)
11531         /* 2MB. */
11532         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M \
11533                 (UINT32_C(0x3) << 4)
11534         /* 8MB. */
11535         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M \
11536                 (UINT32_C(0x4) << 4)
11537         /* 1GB. */
11538         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G \
11539                 (UINT32_C(0x5) << 4)
11540         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST \
11541                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
11542         /* Timer page size and level. */
11543         uint8_t tim_pg_size_tim_lvl;
11544         /* Timer PBL indirect levels. */
11545         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK \
11546                 UINT32_C(0xf)
11547         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT       0
11548         /* PBL pointer is physical start address. */
11549         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0 \
11550                 UINT32_C(0x0)
11551         /* PBL pointer points to PTE table. */
11552         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1 \
11553                 UINT32_C(0x1)
11554         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11555         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 \
11556                 UINT32_C(0x2)
11557         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST \
11558                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
11559         /* Timer page size. */
11560         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK \
11561                 UINT32_C(0xf0)
11562         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT   4
11563         /* 4KB. */
11564         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K \
11565                 (UINT32_C(0x0) << 4)
11566         /* 8KB. */
11567         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K \
11568                 (UINT32_C(0x1) << 4)
11569         /* 64KB. */
11570         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K \
11571                 (UINT32_C(0x2) << 4)
11572         /* 2MB. */
11573         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M \
11574                 (UINT32_C(0x3) << 4)
11575         /* 8MB. */
11576         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M \
11577                 (UINT32_C(0x4) << 4)
11578         /* 1GB. */
11579         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G \
11580                 (UINT32_C(0x5) << 4)
11581         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST \
11582                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
11583         /* QP page directory. */
11584         uint64_t        qpc_page_dir;
11585         /* SRQ page directory. */
11586         uint64_t        srq_page_dir;
11587         /* CQ page directory. */
11588         uint64_t        cq_page_dir;
11589         /* VNIC page directory. */
11590         uint64_t        vnic_page_dir;
11591         /* Stat page directory. */
11592         uint64_t        stat_page_dir;
11593         /* TQM slowpath page directory. */
11594         uint64_t        tqm_sp_page_dir;
11595         /* TQM ring 0 page directory. */
11596         uint64_t        tqm_ring0_page_dir;
11597         /* TQM ring 1 page directory. */
11598         uint64_t        tqm_ring1_page_dir;
11599         /* TQM ring 2 page directory. */
11600         uint64_t        tqm_ring2_page_dir;
11601         /* TQM ring 3 page directory. */
11602         uint64_t        tqm_ring3_page_dir;
11603         /* TQM ring 4 page directory. */
11604         uint64_t        tqm_ring4_page_dir;
11605         /* TQM ring 5 page directory. */
11606         uint64_t        tqm_ring5_page_dir;
11607         /* TQM ring 6 page directory. */
11608         uint64_t        tqm_ring6_page_dir;
11609         /* TQM ring 7 page directory. */
11610         uint64_t        tqm_ring7_page_dir;
11611         /* MR/AV page directory. */
11612         uint64_t        mrav_page_dir;
11613         /* Timer page directory. */
11614         uint64_t        tim_page_dir;
11615         /* Number of entries to reserve for QP1 */
11616         uint16_t        qp_num_qp1_entries;
11617         /* Number of entries to reserve for L2 */
11618         uint16_t        qp_num_l2_entries;
11619         /* Number of QPs. */
11620         uint32_t        qp_num_entries;
11621         /* Number of SRQs. */
11622         uint32_t        srq_num_entries;
11623         /* Number of entries to reserve for L2 */
11624         uint16_t        srq_num_l2_entries;
11625         /* Number of entries to reserve for L2 */
11626         uint16_t        cq_num_l2_entries;
11627         /* Number of CQs. */
11628         uint32_t        cq_num_entries;
11629         /* Number of entries to reserve for VNIC entries */
11630         uint16_t        vnic_num_vnic_entries;
11631         /* Number of entries to reserve for Ring table entries */
11632         uint16_t        vnic_num_ring_table_entries;
11633         /* Number of Stats. */
11634         uint32_t        stat_num_entries;
11635         /* Number of TQM slowpath entries. */
11636         uint32_t        tqm_sp_num_entries;
11637         /* Number of TQM ring 0 entries. */
11638         uint32_t        tqm_ring0_num_entries;
11639         /* Number of TQM ring 1 entries. */
11640         uint32_t        tqm_ring1_num_entries;
11641         /* Number of TQM ring 2 entries. */
11642         uint32_t        tqm_ring2_num_entries;
11643         /* Number of TQM ring 3 entries. */
11644         uint32_t        tqm_ring3_num_entries;
11645         /* Number of TQM ring 4 entries. */
11646         uint32_t        tqm_ring4_num_entries;
11647         /* Number of TQM ring 5 entries. */
11648         uint32_t        tqm_ring5_num_entries;
11649         /* Number of TQM ring 6 entries. */
11650         uint32_t        tqm_ring6_num_entries;
11651         /* Number of TQM ring 7 entries. */
11652         uint32_t        tqm_ring7_num_entries;
11653         /*
11654          * If the MR/AV split reservation flag is not set, then this field
11655          * represents the total number of MR plus AV entries. For versions
11656          * of firmware that support the split reservation, when it is not
11657          * specified half of the entries will be reserved for MRs and the
11658          * other half for AVs.
11659          *
11660          * If the MR/AV split reservation flag is set, then this
11661          * field is logically divided into two 16b fields. Bits `[31:16]`
11662          * represents the `mr_num_entries` and bits `[15:0]` represents
11663          * `av_num_entries`. The granularity of these values is defined by
11664          * the `mrav_num_entries_unit` field returned by the
11665          * `backing_store_qcaps` command.
11666          */
11667         uint32_t        mrav_num_entries;
11668         /* Number of Timer entries. */
11669         uint32_t        tim_num_entries;
11670         uint8_t unused_1[7];
11671         /*
11672          * This field is used in Output records to indicate that the output
11673          * is completely written to RAM.  This field should be read as 1
11674          * to indicate that the output has been completely written.
11675          * When writing a command completion or response to an internal
11676          * processor, the order of writes has to be such that this field
11677          * is written last.
11678          */
11679         uint8_t valid;
11680 } __attribute__((packed));
11681
11682 /****************************
11683  * hwrm_error_recovery_qcfg *
11684  ****************************/
11685
11686
11687 /* hwrm_error_recovery_qcfg_input (size:192b/24B) */
11688 struct hwrm_error_recovery_qcfg_input {
11689         /* The HWRM command request type. */
11690         uint16_t        req_type;
11691         /*
11692          * The completion ring to send the completion event on. This should
11693          * be the NQ ID returned from the `nq_alloc` HWRM command.
11694          */
11695         uint16_t        cmpl_ring;
11696         /*
11697          * The sequence ID is used by the driver for tracking multiple
11698          * commands. This ID is treated as opaque data by the firmware and
11699          * the value is returned in the `hwrm_resp_hdr` upon completion.
11700          */
11701         uint16_t        seq_id;
11702         /*
11703          * The target ID of the command:
11704          * * 0x0-0xFFF8 - The function ID
11705          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11706          * * 0xFFFD - Reserved for user-space HWRM interface
11707          * * 0xFFFF - HWRM
11708          */
11709         uint16_t        target_id;
11710         /*
11711          * A physical address pointer pointing to a host buffer that the
11712          * command's response data will be written. This can be either a host
11713          * physical address (HPA) or a guest physical address (GPA) and must
11714          * point to a physically contiguous block of memory.
11715          */
11716         uint64_t        resp_addr;
11717         uint8_t unused_0[8];
11718 } __attribute__((packed));
11719
11720 /* hwrm_error_recovery_qcfg_output (size:1664b/208B) */
11721 struct hwrm_error_recovery_qcfg_output {
11722         /* The specific error status for the command. */
11723         uint16_t        error_code;
11724         /* The HWRM command request type. */
11725         uint16_t        req_type;
11726         /* The sequence ID from the original command. */
11727         uint16_t        seq_id;
11728         /* The length of the response data in number of bytes. */
11729         uint16_t        resp_len;
11730         uint32_t        flags;
11731         /*
11732          * When this flag is set to 1, error recovery will be initiated
11733          * through master function driver.
11734          */
11735         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST       UINT32_C(0x1)
11736         /*
11737          * When this flag is set to 1, error recovery will be performed
11738          * through Co processor.
11739          */
11740         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU     UINT32_C(0x2)
11741         /*
11742          * Driver Polling frequency. This value is in units of 100msec.
11743          * Typical value would be 10 to indicate 1sec.
11744          * Drivers can poll FW health status, Heartbeat, reset_counter with
11745          * this frequency.
11746          */
11747         uint32_t        driver_polling_freq;
11748         /*
11749          * This value is in units of 100msec.
11750          * Typical value would be 30 to indicate 3sec.
11751          * Master function wait period from detecting a fatal error to
11752          * initiating reset. In this time period Master PF expects every
11753          * active driver will detect fatal error.
11754          */
11755         uint32_t        master_func_wait_period;
11756         /*
11757          * This value is in units of 100msec.
11758          * Typical value would be 50 to indicate 5sec.
11759          * Normal function wait period from fatal error detection to
11760          * polling FW health status. In this time period, drivers should not
11761          * do any PCIe MMIO transaction and should not send any HWRM commands.
11762          */
11763         uint32_t        normal_func_wait_period;
11764         /*
11765          * This value is in units of 100msec.
11766          * Typical value would be 20 to indicate 2sec.
11767          * This field indicates that, master function wait period after chip
11768          * reset. After this time, master function should reinitialize with
11769          * FW.
11770          */
11771         uint32_t        master_func_wait_period_after_reset;
11772         /*
11773          * This value is in units of 100msec.
11774          * Typical value would be 60 to indicate 6sec.
11775          * This field is applicable to both master and normal functions.
11776          * Even after chip reset, if FW status not changed to ready,
11777          * then all the functions can poll for this much time and bailout.
11778          */
11779         uint32_t        max_bailout_time_after_reset;
11780         /*
11781          * FW health status register.
11782          * Lower 2 bits indicates address space location and upper 30 bits
11783          * indicates upper 30bits of the register address.
11784          * A value of 0xFFFF-FFFF indicates this register does not exist.
11785          */
11786         uint32_t        fw_health_status_reg;
11787         /* Lower 2 bits indicates address space location. */
11788         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_MASK \
11789                 UINT32_C(0x3)
11790         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_SFT \
11791                 0
11792         /*
11793          * If value is 0, this register is located in PCIe config space.
11794          * Drivers have to map appropriate window to access this
11795          * register.
11796          */
11797         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_PCIE_CFG \
11798                 UINT32_C(0x0)
11799         /*
11800          * If value is 1, this register is located in GRC address space.
11801          * Drivers have to map appropriate window to access this
11802          * register.
11803          */
11804         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_GRC \
11805                 UINT32_C(0x1)
11806         /*
11807          * If value is 2, this register is located in first BAR address
11808          * space. Drivers have to map appropriate window to access this
11809          * register.
11810          */
11811         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR0 \
11812                 UINT32_C(0x2)
11813         /*
11814          * If value is 3, this register is located in second BAR address
11815          * space. Drivers have to map appropriate window to access this
11816          * Drivers have to map appropriate window to access this
11817          * register.
11818          */
11819         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1 \
11820                 UINT32_C(0x3)
11821         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_LAST \
11822                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1
11823         /* Upper 30bits of the register address. */
11824         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_MASK \
11825                 UINT32_C(0xfffffffc)
11826         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SFT \
11827                 2
11828         /*
11829          * FW HeartBeat register.
11830          * Lower 2 bits indicates address space location and upper 30 bits
11831          * indicates actual address.
11832          * A value of 0xFFFF-FFFF indicates this register does not exist.
11833          */
11834         uint32_t        fw_heartbeat_reg;
11835         /* Lower 2 bits indicates address space location. */
11836         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_MASK \
11837                 UINT32_C(0x3)
11838         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_SFT \
11839                 0
11840         /*
11841          * If value is 0, this register is located in PCIe config space.
11842          * Drivers have to map appropriate window to access this
11843          * register.
11844          */
11845         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_PCIE_CFG \
11846                 UINT32_C(0x0)
11847         /*
11848          * If value is 1, this register is located in GRC address space.
11849          * Drivers have to map appropriate window to access this
11850          * register.
11851          */
11852         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_GRC \
11853                 UINT32_C(0x1)
11854         /*
11855          * If value is 2, this register is located in first BAR address
11856          * space. Drivers have to map appropriate window to access this
11857          * register.
11858          */
11859         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR0 \
11860                 UINT32_C(0x2)
11861         /*
11862          * If value is 3, this register is located in second BAR address
11863          * space. Drivers have to map appropriate window to access this
11864          * register.
11865          */
11866         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1 \
11867                 UINT32_C(0x3)
11868         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_LAST \
11869                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1
11870         /* Upper 30bits of the register address. */
11871         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_MASK \
11872                 UINT32_C(0xfffffffc)
11873         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SFT \
11874                 2
11875         /*
11876          * FW reset counter.
11877          * Lower 2 bits indicates address space location and upper 30 bits
11878          * indicates actual address.
11879          * A value of 0xFFFF-FFFF indicates this register does not exist.
11880          */
11881         uint32_t        fw_reset_cnt_reg;
11882         /* Lower 2 bits indicates address space location. */
11883         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_MASK \
11884                 UINT32_C(0x3)
11885         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_SFT \
11886                 0
11887         /*
11888          * If value is 0, this register is located in PCIe config space.
11889          * Drivers have to map appropriate window to access this
11890          * register.
11891          */
11892         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_PCIE_CFG \
11893                 UINT32_C(0x0)
11894         /*
11895          * If value is 1, this register is located in GRC address space.
11896          * Drivers have to map appropriate window to access this
11897          * register.
11898          */
11899         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_GRC \
11900                 UINT32_C(0x1)
11901         /*
11902          * If value is 2, this register is located in first BAR address
11903          * space. Drivers have to map appropriate window to access this
11904          * register.
11905          */
11906         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR0 \
11907                 UINT32_C(0x2)
11908         /*
11909          * If value is 3, this register is located in second BAR address
11910          * space. Drivers have to map appropriate window to access this
11911          * register.
11912          */
11913         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1 \
11914                 UINT32_C(0x3)
11915         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_LAST \
11916                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1
11917         /* Upper 30bits of the register address. */
11918         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_MASK \
11919                 UINT32_C(0xfffffffc)
11920         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SFT \
11921                 2
11922         /*
11923          * Reset Inprogress Register address for PFs.
11924          * Lower 2 bits indicates address space location and upper 30 bits
11925          * indicates actual address.
11926          * A value of 0xFFFF-FFFF indicates this register does not exist.
11927          */
11928         uint32_t        reset_inprogress_reg;
11929         /* Lower 2 bits indicates address space location. */
11930         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_MASK \
11931                 UINT32_C(0x3)
11932         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_SFT \
11933                 0
11934         /*
11935          * If value is 0, this register is located in PCIe config space.
11936          * Drivers have to map appropriate window to access this
11937          * register.
11938          */
11939         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_PCIE_CFG \
11940                 UINT32_C(0x0)
11941         /*
11942          * If value is 1, this register is located in GRC address space.
11943          * Drivers have to map appropriate window to access this
11944          * register.
11945          */
11946         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_GRC \
11947                 UINT32_C(0x1)
11948         /*
11949          * If value is 2, this register is located in first BAR address
11950          * space. Drivers have to map appropriate window to access this
11951          * register.
11952          */
11953         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR0 \
11954                 UINT32_C(0x2)
11955         /*
11956          * If value is 3, this register is located in second BAR address
11957          * space. Drivers have to map appropriate window to access this
11958          * register.
11959          */
11960         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1 \
11961                 UINT32_C(0x3)
11962         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_LAST \
11963                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1
11964         /* Upper 30bits of the register address. */
11965         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_MASK \
11966                 UINT32_C(0xfffffffc)
11967         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SFT \
11968                 2
11969         /* This field indicates the mask value for reset_inprogress_reg. */
11970         uint32_t        reset_inprogress_reg_mask;
11971         uint8_t unused_0[3];
11972         /*
11973          * Array of registers and value count to reset the Chip
11974          * Each array count has reset_reg, reset_reg_val, delay_after_reset
11975          * in TLV format. Depending upon Chip type, number of reset registers
11976          * will vary. Drivers have to write reset_reg_val in the reset_reg
11977          * location in the same sequence in order to recover from a fatal
11978          * error.
11979          */
11980         uint8_t reg_array_cnt;
11981         /*
11982          * Reset register.
11983          * Lower 2 bits indicates address space location and upper 30 bits
11984          * indicates actual address.
11985          * A value of 0xFFFF-FFFF indicates this register does not exist.
11986          */
11987         uint32_t        reset_reg[16];
11988         /* Lower 2 bits indicates address space location. */
11989         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_MASK \
11990                 UINT32_C(0x3)
11991         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_SFT     0
11992         /*
11993          * If value is 0, this register is located in PCIe config space.
11994          * Drivers have to map appropriate window to access this
11995          * register.
11996          */
11997         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_PCIE_CFG \
11998                 UINT32_C(0x0)
11999         /*
12000          * If value is 1, this register is located in GRC address space.
12001          * Drivers have to map appropriate window to access this
12002          * register.
12003          */
12004         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_GRC \
12005                 UINT32_C(0x1)
12006         /*
12007          * If value is 2, this register is located in first BAR address
12008          * space. Drivers have to map appropriate window to access this
12009          * register.
12010          */
12011         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR0 \
12012                 UINT32_C(0x2)
12013         /*
12014          * If value is 3, this register is located in second BAR address
12015          * space. Drivers have to map appropriate window to access this
12016          * register.
12017          */
12018         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1 \
12019                 UINT32_C(0x3)
12020         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_LAST \
12021                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1
12022         /* Upper 30bits of the register address. */
12023         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_MASK \
12024                 UINT32_C(0xfffffffc)
12025         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SFT           2
12026         /* Value to be written in reset_reg to reset the controller. */
12027         uint32_t        reset_reg_val[16];
12028         /*
12029          * This value is in units of 1msec.
12030          * Typical value would be 10 to indicate 10msec.
12031          * Some of the operations like Core reset require delay before
12032          * accessing PCIE MMIO register space.
12033          * If this value is non-zero, drivers have to wait for
12034          * this much time after writing reset_reg_val in reset_reg.
12035          */
12036         uint8_t delay_after_reset[16];
12037         uint8_t unused_1[7];
12038         /*
12039          * This field is used in Output records to indicate that the output
12040          * is completely written to RAM.  This field should be read as '1'
12041          * to indicate that the output has been completely written.
12042          * When writing a command completion or response to an internal
12043          * processor, the order of writes has to be such that this field
12044          * is written last.
12045          */
12046         uint8_t valid;
12047 } __attribute__((packed));
12048
12049 /***********************
12050  * hwrm_func_vlan_qcfg *
12051  ***********************/
12052
12053
12054 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
12055 struct hwrm_func_vlan_qcfg_input {
12056         /* The HWRM command request type. */
12057         uint16_t        req_type;
12058         /*
12059          * The completion ring to send the completion event on. This should
12060          * be the NQ ID returned from the `nq_alloc` HWRM command.
12061          */
12062         uint16_t        cmpl_ring;
12063         /*
12064          * The sequence ID is used by the driver for tracking multiple
12065          * commands. This ID is treated as opaque data by the firmware and
12066          * the value is returned in the `hwrm_resp_hdr` upon completion.
12067          */
12068         uint16_t        seq_id;
12069         /*
12070          * The target ID of the command:
12071          * * 0x0-0xFFF8 - The function ID
12072          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12073          * * 0xFFFD - Reserved for user-space HWRM interface
12074          * * 0xFFFF - HWRM
12075          */
12076         uint16_t        target_id;
12077         /*
12078          * A physical address pointer pointing to a host buffer that the
12079          * command's response data will be written. This can be either a host
12080          * physical address (HPA) or a guest physical address (GPA) and must
12081          * point to a physically contiguous block of memory.
12082          */
12083         uint64_t        resp_addr;
12084         /*
12085          * Function ID of the function that is being
12086          * configured.
12087          * If set to 0xFF... (All Fs), then the configuration is
12088          * for the requesting function.
12089          */
12090         uint16_t        fid;
12091         uint8_t unused_0[6];
12092 } __attribute__((packed));
12093
12094 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
12095 struct hwrm_func_vlan_qcfg_output {
12096         /* The specific error status for the command. */
12097         uint16_t        error_code;
12098         /* The HWRM command request type. */
12099         uint16_t        req_type;
12100         /* The sequence ID from the original command. */
12101         uint16_t        seq_id;
12102         /* The length of the response data in number of bytes. */
12103         uint16_t        resp_len;
12104         uint64_t        unused_0;
12105         /* S-TAG VLAN identifier configured for the function. */
12106         uint16_t        stag_vid;
12107         /* S-TAG PCP value configured for the function. */
12108         uint8_t stag_pcp;
12109         uint8_t unused_1;
12110         /*
12111          * S-TAG TPID value configured for the function. This field is specified in
12112          * network byte order.
12113          */
12114         uint16_t        stag_tpid;
12115         /* C-TAG VLAN identifier configured for the function. */
12116         uint16_t        ctag_vid;
12117         /* C-TAG PCP value configured for the function. */
12118         uint8_t ctag_pcp;
12119         uint8_t unused_2;
12120         /*
12121          * C-TAG TPID value configured for the function. This field is specified in
12122          * network byte order.
12123          */
12124         uint16_t        ctag_tpid;
12125         /* Future use. */
12126         uint32_t        rsvd2;
12127         /* Future use. */
12128         uint32_t        rsvd3;
12129         uint8_t unused_3[3];
12130         /*
12131          * This field is used in Output records to indicate that the output
12132          * is completely written to RAM.  This field should be read as '1'
12133          * to indicate that the output has been completely written.
12134          * When writing a command completion or response to an internal processor,
12135          * the order of writes has to be such that this field is written last.
12136          */
12137         uint8_t valid;
12138 } __attribute__((packed));
12139
12140 /**********************
12141  * hwrm_func_vlan_cfg *
12142  **********************/
12143
12144
12145 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
12146 struct hwrm_func_vlan_cfg_input {
12147         /* The HWRM command request type. */
12148         uint16_t        req_type;
12149         /*
12150          * The completion ring to send the completion event on. This should
12151          * be the NQ ID returned from the `nq_alloc` HWRM command.
12152          */
12153         uint16_t        cmpl_ring;
12154         /*
12155          * The sequence ID is used by the driver for tracking multiple
12156          * commands. This ID is treated as opaque data by the firmware and
12157          * the value is returned in the `hwrm_resp_hdr` upon completion.
12158          */
12159         uint16_t        seq_id;
12160         /*
12161          * The target ID of the command:
12162          * * 0x0-0xFFF8 - The function ID
12163          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12164          * * 0xFFFD - Reserved for user-space HWRM interface
12165          * * 0xFFFF - HWRM
12166          */
12167         uint16_t        target_id;
12168         /*
12169          * A physical address pointer pointing to a host buffer that the
12170          * command's response data will be written. This can be either a host
12171          * physical address (HPA) or a guest physical address (GPA) and must
12172          * point to a physically contiguous block of memory.
12173          */
12174         uint64_t        resp_addr;
12175         /*
12176          * Function ID of the function that is being
12177          * configured.
12178          * If set to 0xFF... (All Fs), then the configuration is
12179          * for the requesting function.
12180          */
12181         uint16_t        fid;
12182         uint8_t unused_0[2];
12183         uint32_t        enables;
12184         /*
12185          * This bit must be '1' for the stag_vid field to be
12186          * configured.
12187          */
12188         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID      UINT32_C(0x1)
12189         /*
12190          * This bit must be '1' for the ctag_vid field to be
12191          * configured.
12192          */
12193         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID      UINT32_C(0x2)
12194         /*
12195          * This bit must be '1' for the stag_pcp field to be
12196          * configured.
12197          */
12198         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP      UINT32_C(0x4)
12199         /*
12200          * This bit must be '1' for the ctag_pcp field to be
12201          * configured.
12202          */
12203         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP      UINT32_C(0x8)
12204         /*
12205          * This bit must be '1' for the stag_tpid field to be
12206          * configured.
12207          */
12208         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID     UINT32_C(0x10)
12209         /*
12210          * This bit must be '1' for the ctag_tpid field to be
12211          * configured.
12212          */
12213         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID     UINT32_C(0x20)
12214         /* S-TAG VLAN identifier configured for the function. */
12215         uint16_t        stag_vid;
12216         /* S-TAG PCP value configured for the function. */
12217         uint8_t stag_pcp;
12218         uint8_t unused_1;
12219         /*
12220          * S-TAG TPID value configured for the function. This field is specified in
12221          * network byte order.
12222          */
12223         uint16_t        stag_tpid;
12224         /* C-TAG VLAN identifier configured for the function. */
12225         uint16_t        ctag_vid;
12226         /* C-TAG PCP value configured for the function. */
12227         uint8_t ctag_pcp;
12228         uint8_t unused_2;
12229         /*
12230          * C-TAG TPID value configured for the function. This field is specified in
12231          * network byte order.
12232          */
12233         uint16_t        ctag_tpid;
12234         /* Future use. */
12235         uint32_t        rsvd1;
12236         /* Future use. */
12237         uint32_t        rsvd2;
12238         uint8_t unused_3[4];
12239 } __attribute__((packed));
12240
12241 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
12242 struct hwrm_func_vlan_cfg_output {
12243         /* The specific error status for the command. */
12244         uint16_t        error_code;
12245         /* The HWRM command request type. */
12246         uint16_t        req_type;
12247         /* The sequence ID from the original command. */
12248         uint16_t        seq_id;
12249         /* The length of the response data in number of bytes. */
12250         uint16_t        resp_len;
12251         uint8_t unused_0[7];
12252         /*
12253          * This field is used in Output records to indicate that the output
12254          * is completely written to RAM.  This field should be read as '1'
12255          * to indicate that the output has been completely written.
12256          * When writing a command completion or response to an internal processor,
12257          * the order of writes has to be such that this field is written last.
12258          */
12259         uint8_t valid;
12260 } __attribute__((packed));
12261
12262 /*******************************
12263  * hwrm_func_vf_vnic_ids_query *
12264  *******************************/
12265
12266
12267 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
12268 struct hwrm_func_vf_vnic_ids_query_input {
12269         /* The HWRM command request type. */
12270         uint16_t        req_type;
12271         /*
12272          * The completion ring to send the completion event on. This should
12273          * be the NQ ID returned from the `nq_alloc` HWRM command.
12274          */
12275         uint16_t        cmpl_ring;
12276         /*
12277          * The sequence ID is used by the driver for tracking multiple
12278          * commands. This ID is treated as opaque data by the firmware and
12279          * the value is returned in the `hwrm_resp_hdr` upon completion.
12280          */
12281         uint16_t        seq_id;
12282         /*
12283          * The target ID of the command:
12284          * * 0x0-0xFFF8 - The function ID
12285          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12286          * * 0xFFFD - Reserved for user-space HWRM interface
12287          * * 0xFFFF - HWRM
12288          */
12289         uint16_t        target_id;
12290         /*
12291          * A physical address pointer pointing to a host buffer that the
12292          * command's response data will be written. This can be either a host
12293          * physical address (HPA) or a guest physical address (GPA) and must
12294          * point to a physically contiguous block of memory.
12295          */
12296         uint64_t        resp_addr;
12297         /*
12298          * This value is used to identify a Virtual Function (VF).
12299          * The scope of VF ID is local within a PF.
12300          */
12301         uint16_t        vf_id;
12302         uint8_t unused_0[2];
12303         /* Max number of vnic ids in vnic id table */
12304         uint32_t        max_vnic_id_cnt;
12305         /* This is the address for VF VNIC ID table */
12306         uint64_t        vnic_id_tbl_addr;
12307 } __attribute__((packed));
12308
12309 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
12310 struct hwrm_func_vf_vnic_ids_query_output {
12311         /* The specific error status for the command. */
12312         uint16_t        error_code;
12313         /* The HWRM command request type. */
12314         uint16_t        req_type;
12315         /* The sequence ID from the original command. */
12316         uint16_t        seq_id;
12317         /* The length of the response data in number of bytes. */
12318         uint16_t        resp_len;
12319         /*
12320          * Actual number of vnic ids
12321          *
12322          * Each VNIC ID is written as a 32-bit number.
12323          */
12324         uint32_t        vnic_id_cnt;
12325         uint8_t unused_0[3];
12326         /*
12327          * This field is used in Output records to indicate that the output
12328          * is completely written to RAM.  This field should be read as '1'
12329          * to indicate that the output has been completely written.
12330          * When writing a command completion or response to an internal processor,
12331          * the order of writes has to be such that this field is written last.
12332          */
12333         uint8_t valid;
12334 } __attribute__((packed));
12335
12336 /***********************
12337  * hwrm_func_vf_bw_cfg *
12338  ***********************/
12339
12340
12341 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */
12342 struct hwrm_func_vf_bw_cfg_input {
12343         /* The HWRM command request type. */
12344         uint16_t        req_type;
12345         /*
12346          * The completion ring to send the completion event on. This should
12347          * be the NQ ID returned from the `nq_alloc` HWRM command.
12348          */
12349         uint16_t        cmpl_ring;
12350         /*
12351          * The sequence ID is used by the driver for tracking multiple
12352          * commands. This ID is treated as opaque data by the firmware and
12353          * the value is returned in the `hwrm_resp_hdr` upon completion.
12354          */
12355         uint16_t        seq_id;
12356         /*
12357          * The target ID of the command:
12358          * * 0x0-0xFFF8 - The function ID
12359          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12360          * * 0xFFFD - Reserved for user-space HWRM interface
12361          * * 0xFFFF - HWRM
12362          */
12363         uint16_t        target_id;
12364         /*
12365          * A physical address pointer pointing to a host buffer that the
12366          * command's response data will be written. This can be either a host
12367          * physical address (HPA) or a guest physical address (GPA) and must
12368          * point to a physically contiguous block of memory.
12369          */
12370         uint64_t        resp_addr;
12371         /*
12372          * The number of VF functions that are being configured.
12373          * The cmd space allows up to 50 VFs' BW to be configured with one cmd.
12374          */
12375         uint16_t        num_vfs;
12376         uint16_t        unused[3];
12377         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
12378         uint16_t        vfn[48];
12379         /* The physical VF id the adjustment will be made to. */
12380         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK     UINT32_C(0xfff)
12381         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT      0
12382         /*
12383          * This field configures the rate scale percentage of the VF as specified
12384          * by the physical VF id.
12385          */
12386         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK     UINT32_C(0xf000)
12387         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT      12
12388         /* 0% of the max tx rate */
12389         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0 \
12390                 (UINT32_C(0x0) << 12)
12391         /* 6.66% of the max tx rate */
12392         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66 \
12393                 (UINT32_C(0x1) << 12)
12394         /* 13.33% of the max tx rate */
12395         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33 \
12396                 (UINT32_C(0x2) << 12)
12397         /* 20% of the max tx rate */
12398         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20 \
12399                 (UINT32_C(0x3) << 12)
12400         /* 26.66% of the max tx rate */
12401         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66 \
12402                 (UINT32_C(0x4) << 12)
12403         /* 33% of the max tx rate */
12404         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33 \
12405                 (UINT32_C(0x5) << 12)
12406         /* 40% of the max tx rate */
12407         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40 \
12408                 (UINT32_C(0x6) << 12)
12409         /* 46.66% of the max tx rate */
12410         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66 \
12411                 (UINT32_C(0x7) << 12)
12412         /* 53.33% of the max tx rate */
12413         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33 \
12414                 (UINT32_C(0x8) << 12)
12415         /* 60% of the max tx rate */
12416         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60 \
12417                 (UINT32_C(0x9) << 12)
12418         /* 66.66% of the max tx rate */
12419         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66 \
12420                 (UINT32_C(0xa) << 12)
12421         /* 53.33% of the max tx rate */
12422         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33 \
12423                 (UINT32_C(0xb) << 12)
12424         /* 80% of the max tx rate */
12425         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80 \
12426                 (UINT32_C(0xc) << 12)
12427         /* 86.66% of the max tx rate */
12428         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66 \
12429                 (UINT32_C(0xd) << 12)
12430         /* 93.33% of the max tx rate */
12431         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33 \
12432                 (UINT32_C(0xe) << 12)
12433         /* 100% of the max tx rate */
12434         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100 \
12435                 (UINT32_C(0xf) << 12)
12436         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST \
12437                 HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
12438 } __attribute__((packed));
12439
12440 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
12441 struct hwrm_func_vf_bw_cfg_output {
12442         /* The specific error status for the command. */
12443         uint16_t        error_code;
12444         /* The HWRM command request type. */
12445         uint16_t        req_type;
12446         /* The sequence ID from the original command. */
12447         uint16_t        seq_id;
12448         /* The length of the response data in number of bytes. */
12449         uint16_t        resp_len;
12450         uint8_t unused_0[7];
12451         /*
12452          * This field is used in Output records to indicate that the output
12453          * is completely written to RAM.  This field should be read as '1'
12454          * to indicate that the output has been completely written.
12455          * When writing a command completion or response to an internal processor,
12456          * the order of writes has to be such that this field is written last.
12457          */
12458         uint8_t valid;
12459 } __attribute__((packed));
12460
12461 /************************
12462  * hwrm_func_vf_bw_qcfg *
12463  ************************/
12464
12465
12466 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */
12467 struct hwrm_func_vf_bw_qcfg_input {
12468         /* The HWRM command request type. */
12469         uint16_t        req_type;
12470         /*
12471          * The completion ring to send the completion event on. This should
12472          * be the NQ ID returned from the `nq_alloc` HWRM command.
12473          */
12474         uint16_t        cmpl_ring;
12475         /*
12476          * The sequence ID is used by the driver for tracking multiple
12477          * commands. This ID is treated as opaque data by the firmware and
12478          * the value is returned in the `hwrm_resp_hdr` upon completion.
12479          */
12480         uint16_t        seq_id;
12481         /*
12482          * The target ID of the command:
12483          * * 0x0-0xFFF8 - The function ID
12484          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12485          * * 0xFFFD - Reserved for user-space HWRM interface
12486          * * 0xFFFF - HWRM
12487          */
12488         uint16_t        target_id;
12489         /*
12490          * A physical address pointer pointing to a host buffer that the
12491          * command's response data will be written. This can be either a host
12492          * physical address (HPA) or a guest physical address (GPA) and must
12493          * point to a physically contiguous block of memory.
12494          */
12495         uint64_t        resp_addr;
12496         /*
12497          * The number of VF functions that are being queried.
12498          * The inline response space allows the host to query up to 50 VFs'
12499          * rate scale percentage
12500          */
12501         uint16_t        num_vfs;
12502         uint16_t        unused[3];
12503         /* These 16-bit fields contain the VF fid */
12504         uint16_t        vfn[48];
12505         /* The physical VF id of interest */
12506         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
12507         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
12508 } __attribute__((packed));
12509
12510 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
12511 struct hwrm_func_vf_bw_qcfg_output {
12512         /* The specific error status for the command. */
12513         uint16_t        error_code;
12514         /* The HWRM command request type. */
12515         uint16_t        req_type;
12516         /* The sequence ID from the original command. */
12517         uint16_t        seq_id;
12518         /* The length of the response data in number of bytes. */
12519         uint16_t        resp_len;
12520         /*
12521          * The number of VF functions that are being queried.
12522          * The inline response space allows the host to query up to 50 VFs' rate
12523          * scale percentage
12524          */
12525         uint16_t        num_vfs;
12526         uint16_t        unused[3];
12527         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
12528         uint16_t        vfn[48];
12529         /* The physical VF id the adjustment will be made to. */
12530         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK     UINT32_C(0xfff)
12531         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT      0
12532         /*
12533          * This field configures the rate scale percentage of the VF as specified
12534          * by the physical VF id.
12535          */
12536         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK     UINT32_C(0xf000)
12537         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT      12
12538         /* 0% of the max tx rate */
12539         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0 \
12540                 (UINT32_C(0x0) << 12)
12541         /* 6.66% of the max tx rate */
12542         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66 \
12543                 (UINT32_C(0x1) << 12)
12544         /* 13.33% of the max tx rate */
12545         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33 \
12546                 (UINT32_C(0x2) << 12)
12547         /* 20% of the max tx rate */
12548         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20 \
12549                 (UINT32_C(0x3) << 12)
12550         /* 26.66% of the max tx rate */
12551         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66 \
12552                 (UINT32_C(0x4) << 12)
12553         /* 33% of the max tx rate */
12554         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33 \
12555                 (UINT32_C(0x5) << 12)
12556         /* 40% of the max tx rate */
12557         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40 \
12558                 (UINT32_C(0x6) << 12)
12559         /* 46.66% of the max tx rate */
12560         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66 \
12561                 (UINT32_C(0x7) << 12)
12562         /* 53.33% of the max tx rate */
12563         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33 \
12564                 (UINT32_C(0x8) << 12)
12565         /* 60% of the max tx rate */
12566         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60 \
12567                 (UINT32_C(0x9) << 12)
12568         /* 66.66% of the max tx rate */
12569         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66 \
12570                 (UINT32_C(0xa) << 12)
12571         /* 53.33% of the max tx rate */
12572         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33 \
12573                 (UINT32_C(0xb) << 12)
12574         /* 80% of the max tx rate */
12575         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80 \
12576                 (UINT32_C(0xc) << 12)
12577         /* 86.66% of the max tx rate */
12578         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66 \
12579                 (UINT32_C(0xd) << 12)
12580         /* 93.33% of the max tx rate */
12581         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33 \
12582                 (UINT32_C(0xe) << 12)
12583         /* 100% of the max tx rate */
12584         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100 \
12585                 (UINT32_C(0xf) << 12)
12586         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST \
12587                 HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100
12588         uint8_t unused_0[7];
12589         /*
12590          * This field is used in Output records to indicate that the output
12591          * is completely written to RAM.  This field should be read as '1'
12592          * to indicate that the output has been completely written.
12593          * When writing a command completion or response to an internal processor,
12594          * the order of writes has to be such that this field is written last.
12595          */
12596         uint8_t valid;
12597 } __attribute__((packed));
12598
12599 /***************************
12600  * hwrm_func_drv_if_change *
12601  ***************************/
12602
12603
12604 /* hwrm_func_drv_if_change_input (size:192b/24B) */
12605 struct hwrm_func_drv_if_change_input {
12606         /* The HWRM command request type. */
12607         uint16_t        req_type;
12608         /*
12609          * The completion ring to send the completion event on. This should
12610          * be the NQ ID returned from the `nq_alloc` HWRM command.
12611          */
12612         uint16_t        cmpl_ring;
12613         /*
12614          * The sequence ID is used by the driver for tracking multiple
12615          * commands. This ID is treated as opaque data by the firmware and
12616          * the value is returned in the `hwrm_resp_hdr` upon completion.
12617          */
12618         uint16_t        seq_id;
12619         /*
12620          * The target ID of the command:
12621          * * 0x0-0xFFF8 - The function ID
12622          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12623          * * 0xFFFD - Reserved for user-space HWRM interface
12624          * * 0xFFFF - HWRM
12625          */
12626         uint16_t        target_id;
12627         /*
12628          * A physical address pointer pointing to a host buffer that the
12629          * command's response data will be written. This can be either a host
12630          * physical address (HPA) or a guest physical address (GPA) and must
12631          * point to a physically contiguous block of memory.
12632          */
12633         uint64_t        resp_addr;
12634         uint32_t        flags;
12635         /*
12636          * When this bit is '1', the function driver is indicating
12637          * that the IF state is changing to UP state.  The call should
12638          * be made at the beginning of the driver's open call before
12639          * resources are allocated.  After making the call, the driver
12640          * should check the response to see if any resources may have
12641          * changed (see the response below).  If the driver fails
12642          * the open call, the driver should make this call again with
12643          * this bit cleared to indicate that the IF state is not UP.
12644          * During the driver's close call when the IF state is changing
12645          * to DOWN, the driver should make this call with the bit cleared
12646          * after all resources have been freed.
12647          */
12648         #define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP     UINT32_C(0x1)
12649         uint32_t        unused;
12650 } __attribute__((packed));
12651
12652 /* hwrm_func_drv_if_change_output (size:128b/16B) */
12653 struct hwrm_func_drv_if_change_output {
12654         /* The specific error status for the command. */
12655         uint16_t        error_code;
12656         /* The HWRM command request type. */
12657         uint16_t        req_type;
12658         /* The sequence ID from the original command. */
12659         uint16_t        seq_id;
12660         /* The length of the response data in number of bytes. */
12661         uint16_t        resp_len;
12662         uint32_t        flags;
12663         /*
12664          * When this bit is '1', it indicates that the resources reserved
12665          * for this function may have changed.  The driver should check
12666          * resource capabilities and reserve resources again before
12667          * allocating resources.
12668          */
12669         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE \
12670                 UINT32_C(0x1)
12671         /*
12672          * When this bit is '1', it indicates that the firmware got changed / reset.
12673          * The driver should do complete re-initialization when that bit is set.
12674          */
12675         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE \
12676                 UINT32_C(0x2)
12677         uint8_t unused_0[3];
12678         /*
12679          * This field is used in Output records to indicate that the output
12680          * is completely written to RAM.  This field should be read as '1'
12681          * to indicate that the output has been completely written.
12682          * When writing a command completion or response to an internal processor,
12683          * the order of writes has to be such that this field is written last.
12684          */
12685         uint8_t valid;
12686 } __attribute__((packed));
12687
12688 /*******************************
12689  * hwrm_func_host_pf_ids_query *
12690  *******************************/
12691
12692
12693 /* hwrm_func_host_pf_ids_query_input (size:192b/24B) */
12694 struct hwrm_func_host_pf_ids_query_input {
12695         /* The HWRM command request type. */
12696         uint16_t        req_type;
12697         /*
12698          * The completion ring to send the completion event on. This should
12699          * be the NQ ID returned from the `nq_alloc` HWRM command.
12700          */
12701         uint16_t        cmpl_ring;
12702         /*
12703          * The sequence ID is used by the driver for tracking multiple
12704          * commands. This ID is treated as opaque data by the firmware and
12705          * the value is returned in the `hwrm_resp_hdr` upon completion.
12706          */
12707         uint16_t        seq_id;
12708         /*
12709          * The target ID of the command:
12710          * * 0x0-0xFFF8 - The function ID
12711          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12712          * * 0xFFFD - Reserved for user-space HWRM interface
12713          * * 0xFFFF - HWRM
12714          */
12715         uint16_t        target_id;
12716         /*
12717          * A physical address pointer pointing to a host buffer that the
12718          * command's response data will be written. This can be either a host
12719          * physical address (HPA) or a guest physical address (GPA) and must
12720          * point to a physically contiguous block of memory.
12721          */
12722         uint64_t        resp_addr;
12723         uint8_t host;
12724         /*
12725          * # If this bit is set to '1', the query will contain PF(s)
12726          * belongs to SOC host.
12727          */
12728         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_SOC      UINT32_C(0x1)
12729         /*
12730          * # If this bit is set to '1', the query will contain PF(s)
12731          * belongs to EP0 host.
12732          */
12733         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_0     UINT32_C(0x2)
12734         /*
12735          * # If this bit is set to '1', the query will contain PF(s)
12736          * belongs to EP1 host.
12737          */
12738         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_1     UINT32_C(0x4)
12739         /*
12740          * # If this bit is set to '1', the query will contain PF(s)
12741          * belongs to EP2 host.
12742          */
12743         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_2     UINT32_C(0x8)
12744         /*
12745          * # If this bit is set to '1', the query will contain PF(s)
12746          * belongs to EP3 host.
12747          */
12748         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_3     UINT32_C(0x10)
12749         /*
12750          * This provides a filter of what PF(s) will be returned in the
12751          * query..
12752          */
12753         uint8_t filter;
12754         /*
12755          * all available PF(s) belong to the host(s) (defined in the
12756          * host field). This includes the hidden PFs.
12757          */
12758         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ALL  UINT32_C(0x0)
12759         /*
12760          * all available PF(s) belong to the host(s) (defined in the
12761          * host field) that is available for L2 traffic.
12762          */
12763         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_L2   UINT32_C(0x1)
12764         /*
12765          * all available PF(s) belong to the host(s) (defined in the
12766          * host field) that is available for ROCE traffic.
12767          */
12768         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE UINT32_C(0x2)
12769         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_LAST \
12770                 HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE
12771         uint8_t unused_1[6];
12772 } __attribute__((packed));
12773
12774 /* hwrm_func_host_pf_ids_query_output (size:128b/16B) */
12775 struct hwrm_func_host_pf_ids_query_output {
12776         /* The specific error status for the command. */
12777         uint16_t        error_code;
12778         /* The HWRM command request type. */
12779         uint16_t        req_type;
12780         /* The sequence ID from the original command. */
12781         uint16_t        seq_id;
12782         /* The length of the response data in number of bytes. */
12783         uint16_t        resp_len;
12784         /* This provides the first PF ID of the device. */
12785         uint16_t        first_pf_id;
12786         uint16_t        pf_ordinal_mask;
12787         /*
12788          * When this bit is '1', it indicates first PF belongs to one of
12789          * the hosts defined in the input request.
12790          */
12791         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_0 \
12792                 UINT32_C(0x1)
12793         /*
12794          * When this bit is '1', it indicates 2nd PF belongs to one of the
12795          * hosts defined in the input request.
12796          */
12797         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_1 \
12798                 UINT32_C(0x2)
12799         /*
12800          * When this bit is '1', it indicates 3rd PF belongs to one of the
12801          * hosts defined in the input request.
12802          */
12803         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_2 \
12804                 UINT32_C(0x4)
12805         /*
12806          * When this bit is '1', it indicates 4th PF belongs to one of the
12807          * hosts defined in the input request.
12808          */
12809         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_3 \
12810                 UINT32_C(0x8)
12811         /*
12812          * When this bit is '1', it indicates 5th PF belongs to one of the
12813          * hosts defined in the input request.
12814          */
12815         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_4 \
12816                 UINT32_C(0x10)
12817         /*
12818          * When this bit is '1', it indicates 6th PF belongs to one of the
12819          * hosts defined in the input request.
12820          */
12821         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_5 \
12822                 UINT32_C(0x20)
12823         /*
12824          * When this bit is '1', it indicates 7th PF belongs to one of the
12825          * hosts defined in the input request.
12826          */
12827         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_6 \
12828                 UINT32_C(0x40)
12829         /*
12830          * When this bit is '1', it indicates 8th PF belongs to one of the
12831          * hosts defined in the input request.
12832          */
12833         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_7 \
12834                 UINT32_C(0x80)
12835         /*
12836          * When this bit is '1', it indicates 9th PF belongs to one of the
12837          * hosts defined in the input request.
12838          */
12839         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_8 \
12840                 UINT32_C(0x100)
12841         /*
12842          * When this bit is '1', it indicates 10th PF belongs to one of the
12843          * hosts defined in the input request.
12844          */
12845         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_9 \
12846                 UINT32_C(0x200)
12847         /*
12848          * When this bit is '1', it indicates 11th PF belongs to one of the
12849          * hosts defined in the input request.
12850          */
12851         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_10 \
12852                 UINT32_C(0x400)
12853         /*
12854          * When this bit is '1', it indicates 12th PF belongs to one of the
12855          * hosts defined in the input request.
12856          */
12857         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_11 \
12858                 UINT32_C(0x800)
12859         /*
12860          * When this bit is '1', it indicates 13th PF belongs to one of the
12861          * hosts defined in the input request.
12862          */
12863         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_12 \
12864                 UINT32_C(0x1000)
12865         /*
12866          * When this bit is '1', it indicates 14th PF belongs to one of the
12867          * hosts defined in the input request.
12868          */
12869         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_13 \
12870                 UINT32_C(0x2000)
12871         /*
12872          * When this bit is '1', it indicates 15th PF belongs to one of the
12873          * hosts defined in the input request.
12874          */
12875         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_14 \
12876                 UINT32_C(0x4000)
12877         /*
12878          * When this bit is '1', it indicates 16th PF belongs to one of the
12879          * hosts defined in the input request.
12880          */
12881         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_15 \
12882                 UINT32_C(0x8000)
12883         uint8_t unused_1[3];
12884         /*
12885          * This field is used in Output records to indicate that the output
12886          * is completely written to RAM.  This field should be read as '1'
12887          * to indicate that the output has been completely written.
12888          * When writing a command completion or response to an internal processor,
12889          * the order of writes has to be such that this field is written last.
12890          */
12891         uint8_t valid;
12892 } __attribute__((packed));
12893
12894 /*********************
12895  * hwrm_port_phy_cfg *
12896  *********************/
12897
12898
12899 /* hwrm_port_phy_cfg_input (size:448b/56B) */
12900 struct hwrm_port_phy_cfg_input {
12901         /* The HWRM command request type. */
12902         uint16_t        req_type;
12903         /*
12904          * The completion ring to send the completion event on. This should
12905          * be the NQ ID returned from the `nq_alloc` HWRM command.
12906          */
12907         uint16_t        cmpl_ring;
12908         /*
12909          * The sequence ID is used by the driver for tracking multiple
12910          * commands. This ID is treated as opaque data by the firmware and
12911          * the value is returned in the `hwrm_resp_hdr` upon completion.
12912          */
12913         uint16_t        seq_id;
12914         /*
12915          * The target ID of the command:
12916          * * 0x0-0xFFF8 - The function ID
12917          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12918          * * 0xFFFD - Reserved for user-space HWRM interface
12919          * * 0xFFFF - HWRM
12920          */
12921         uint16_t        target_id;
12922         /*
12923          * A physical address pointer pointing to a host buffer that the
12924          * command's response data will be written. This can be either a host
12925          * physical address (HPA) or a guest physical address (GPA) and must
12926          * point to a physically contiguous block of memory.
12927          */
12928         uint64_t        resp_addr;
12929         uint32_t        flags;
12930         /*
12931          * When this bit is set to '1', the PHY for the port shall
12932          * be reset.
12933          *
12934          * # If this bit is set to 1, then the HWRM shall reset the
12935          * PHY after applying PHY configuration changes specified
12936          * in this command.
12937          * # In order to guarantee that PHY configuration changes
12938          * specified in this command take effect, the HWRM
12939          * client should set this flag to 1.
12940          * # If this bit is not set to 1, then the HWRM may reset
12941          * the PHY depending on the current PHY configuration and
12942          * settings specified in this command.
12943          */
12944         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY \
12945                 UINT32_C(0x1)
12946         /* deprecated bit.  Do not use!!! */
12947         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED \
12948                 UINT32_C(0x2)
12949         /*
12950          * When this bit is set to '1', the link shall be forced to
12951          * the force_link_speed value.
12952          *
12953          * When this bit is set to '1', the HWRM client should
12954          * not enable any of the auto negotiation related
12955          * fields represented by auto_XXX fields in this command.
12956          * When this bit is set to '1' and the HWRM client has
12957          * enabled a auto_XXX field in this command, then the
12958          * HWRM shall ignore the enabled auto_XXX field.
12959          *
12960          * When this bit is set to zero, the link
12961          * shall be allowed to autoneg.
12962          */
12963         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE \
12964                 UINT32_C(0x4)
12965         /*
12966          * When this bit is set to '1', the auto-negotiation process
12967          * shall be restarted on the link.
12968          */
12969         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG \
12970                 UINT32_C(0x8)
12971         /*
12972          * When this bit is set to '1', Energy Efficient Ethernet
12973          * (EEE) is requested to be enabled on this link.
12974          * If EEE is not supported on this port, then this flag
12975          * shall be ignored by the HWRM.
12976          */
12977         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE \
12978                 UINT32_C(0x10)
12979         /*
12980          * When this bit is set to '1', Energy Efficient Ethernet
12981          * (EEE) is requested to be disabled on this link.
12982          * If EEE is not supported on this port, then this flag
12983          * shall be ignored by the HWRM.
12984          */
12985         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE \
12986                 UINT32_C(0x20)
12987         /*
12988          * When this bit is set to '1' and EEE is enabled on this
12989          * link, then TX LPI is requested to be enabled on the link.
12990          * If EEE is not supported on this port, then this flag
12991          * shall be ignored by the HWRM.
12992          * If EEE is disabled on this port, then this flag shall be
12993          * ignored by the HWRM.
12994          */
12995         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE \
12996                 UINT32_C(0x40)
12997         /*
12998          * When this bit is set to '1' and EEE is enabled on this
12999          * link, then TX LPI is requested to be disabled on the link.
13000          * If EEE is not supported on this port, then this flag
13001          * shall be ignored by the HWRM.
13002          * If EEE is disabled on this port, then this flag shall be
13003          * ignored by the HWRM.
13004          */
13005         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE \
13006                 UINT32_C(0x80)
13007         /*
13008          * When set to 1, then the HWRM shall enable FEC autonegotitation
13009          * on this port if supported.
13010          * When set to 0, then this flag shall be ignored.
13011          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
13012          * flag.
13013          */
13014         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE \
13015                 UINT32_C(0x100)
13016         /*
13017          * When set to 1, then the HWRM shall disable FEC autonegotiation
13018          * on this port if supported.
13019          * When set to 0, then this flag shall be ignored.
13020          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
13021          * flag.
13022          */
13023         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
13024                 UINT32_C(0x200)
13025         /*
13026          * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
13027          * on this port if supported.
13028          * When set to 0, then this flag shall be ignored.
13029          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
13030          * flag.
13031          */
13032         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
13033                 UINT32_C(0x400)
13034         /*
13035          * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
13036          * on this port if supported.
13037          * When set to 0, then this flag shall be ignored.
13038          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
13039          * flag.
13040          */
13041         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
13042                 UINT32_C(0x800)
13043         /*
13044          * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed Solomon)
13045          * on this port if supported.
13046          * When set to 0, then this flag shall be ignored.
13047          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
13048          * flag.
13049          */
13050         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
13051                 UINT32_C(0x1000)
13052         /*
13053          * When set to 1, then the HWRM shall disable FEC CLAUSE 91 (Reed Solomon)
13054          * on this port if supported.
13055          * When set to 0, then this flag shall be ignored.
13056          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
13057          * flag.
13058          */
13059         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
13060                 UINT32_C(0x2000)
13061         /*
13062          * When this bit is set to '1', the link shall be forced to
13063          * be taken down.
13064          *
13065          * # When this bit is set to '1", all other
13066          * command input settings related to the link speed shall
13067          * be ignored.
13068          * Once the link state is forced down, it can be
13069          * explicitly cleared from that state by setting this flag
13070          * to '0'.
13071          * # If this flag is set to '0', then the link shall be
13072          * cleared from forced down state if the link is in forced
13073          * down state.
13074          * There may be conditions (e.g. out-of-band or sideband
13075          * configuration changes for the link) outside the scope
13076          * of the HWRM implementation that may clear forced down
13077          * link state.
13078          */
13079         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN \
13080                 UINT32_C(0x4000)
13081         uint32_t        enables;
13082         /*
13083          * This bit must be '1' for the auto_mode field to be
13084          * configured.
13085          */
13086         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE \
13087                 UINT32_C(0x1)
13088         /*
13089          * This bit must be '1' for the auto_duplex field to be
13090          * configured.
13091          */
13092         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX \
13093                 UINT32_C(0x2)
13094         /*
13095          * This bit must be '1' for the auto_pause field to be
13096          * configured.
13097          */
13098         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE \
13099                 UINT32_C(0x4)
13100         /*
13101          * This bit must be '1' for the auto_link_speed field to be
13102          * configured.
13103          */
13104         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED \
13105                 UINT32_C(0x8)
13106         /*
13107          * This bit must be '1' for the auto_link_speed_mask field to be
13108          * configured.
13109          */
13110         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
13111                 UINT32_C(0x10)
13112         /*
13113          * This bit must be '1' for the wirespeed field to be
13114          * configured.
13115          */
13116         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED \
13117                 UINT32_C(0x20)
13118         /*
13119          * This bit must be '1' for the lpbk field to be
13120          * configured.
13121          */
13122         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK \
13123                 UINT32_C(0x40)
13124         /*
13125          * This bit must be '1' for the preemphasis field to be
13126          * configured.
13127          */
13128         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS \
13129                 UINT32_C(0x80)
13130         /*
13131          * This bit must be '1' for the force_pause field to be
13132          * configured.
13133          */
13134         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE \
13135                 UINT32_C(0x100)
13136         /*
13137          * This bit must be '1' for the eee_link_speed_mask field to be
13138          * configured.
13139          */
13140         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
13141                 UINT32_C(0x200)
13142         /*
13143          * This bit must be '1' for the tx_lpi_timer field to be
13144          * configured.
13145          */
13146         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER \
13147                 UINT32_C(0x400)
13148         /* Port ID of port that is to be configured. */
13149         uint16_t        port_id;
13150         /*
13151          * This is the speed that will be used if the force
13152          * bit is '1'.  If unsupported speed is selected, an error
13153          * will be generated.
13154          */
13155         uint16_t        force_link_speed;
13156         /* 100Mb link speed */
13157         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
13158         /* 1Gb link speed */
13159         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
13160         /* 2Gb link speed */
13161         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
13162         /* 25Gb link speed */
13163         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
13164         /* 10Gb link speed */
13165         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
13166         /* 20Mb link speed */
13167         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
13168         /* 25Gb link speed */
13169         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
13170         /* 40Gb link speed */
13171         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
13172         /* 50Gb link speed */
13173         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
13174         /* 100Gb link speed */
13175         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
13176         /* 200Gb link speed */
13177         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_200GB UINT32_C(0x7d0)
13178         /* 10Mb link speed */
13179         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
13180         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST \
13181                 HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
13182         /*
13183          * This value is used to identify what autoneg mode is
13184          * used when the link speed is not being forced.
13185          */
13186         uint8_t auto_mode;
13187         /* Disable autoneg or autoneg disabled. No speeds are selected. */
13188         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE         UINT32_C(0x0)
13189         /* Select all possible speeds for autoneg mode. */
13190         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
13191         /*
13192          * Select only the auto_link_speed speed for autoneg mode. This mode has
13193          * been DEPRECATED. An HWRM client should not use this mode.
13194          */
13195         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
13196         /*
13197          * Select the auto_link_speed or any speed below that speed for autoneg.
13198          * This mode has been DEPRECATED. An HWRM client should not use this mode.
13199          */
13200         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
13201         /*
13202          * Select the speeds based on the corresponding link speed mask value
13203          * that is provided.
13204          */
13205         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
13206         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST \
13207                 HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
13208         /*
13209          * This is the duplex setting that will be used if the autoneg_mode
13210          * is "one_speed" or "one_or_below".
13211          */
13212         uint8_t auto_duplex;
13213         /* Half Duplex will be requested. */
13214         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
13215         /* Full duplex will be requested. */
13216         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
13217         /* Both Half and Full dupex will be requested. */
13218         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
13219         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST \
13220                 HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
13221         /*
13222          * This value is used to configure the pause that will be
13223          * used for autonegotiation.
13224          * Add text on the usage of auto_pause and force_pause.
13225          */
13226         uint8_t auto_pause;
13227         /*
13228          * When this bit is '1', Generation of tx pause messages
13229          * has been requested. Disabled otherwise.
13230          */
13231         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX \
13232                 UINT32_C(0x1)
13233         /*
13234          * When this bit is '1', Reception of rx pause messages
13235          * has been requested. Disabled otherwise.
13236          */
13237         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX \
13238                 UINT32_C(0x2)
13239         /*
13240          * When set to 1, the advertisement of pause is enabled.
13241          *
13242          * # When the auto_mode is not set to none and this flag is
13243          * set to 1, then the auto_pause bits on this port are being
13244          * advertised and autoneg pause results are being interpreted.
13245          * # When the auto_mode is not set to none and this
13246          * flag is set to 0, the pause is forced as indicated in
13247          * force_pause, and also advertised as auto_pause bits, but
13248          * the autoneg results are not interpreted since the pause
13249          * configuration is being forced.
13250          * # When the auto_mode is set to none and this flag is set to
13251          * 1, auto_pause bits should be ignored and should be set to 0.
13252          */
13253         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE \
13254                 UINT32_C(0x4)
13255         uint8_t unused_0;
13256         /*
13257          * This is the speed that will be used if the autoneg_mode
13258          * is "one_speed" or "one_or_below".  If an unsupported speed
13259          * is selected, an error will be generated.
13260          */
13261         uint16_t        auto_link_speed;
13262         /* 100Mb link speed */
13263         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
13264         /* 1Gb link speed */
13265         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
13266         /* 2Gb link speed */
13267         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
13268         /* 25Gb link speed */
13269         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
13270         /* 10Gb link speed */
13271         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
13272         /* 20Mb link speed */
13273         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
13274         /* 25Gb link speed */
13275         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
13276         /* 40Gb link speed */
13277         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
13278         /* 50Gb link speed */
13279         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
13280         /* 100Gb link speed */
13281         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
13282         /* 200Gb link speed */
13283         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_200GB UINT32_C(0x7d0)
13284         /* 10Mb link speed */
13285         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
13286         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST \
13287                 HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
13288         /*
13289          * This is a mask of link speeds that will be used if
13290          * autoneg_mode is "mask".  If unsupported speed is enabled
13291          * an error will be generated.
13292          */
13293         uint16_t        auto_link_speed_mask;
13294         /* 100Mb link speed (Half-duplex) */
13295         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
13296                 UINT32_C(0x1)
13297         /* 100Mb link speed (Full-duplex) */
13298         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
13299                 UINT32_C(0x2)
13300         /* 1Gb link speed (Half-duplex) */
13301         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
13302                 UINT32_C(0x4)
13303         /* 1Gb link speed (Full-duplex) */
13304         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
13305                 UINT32_C(0x8)
13306         /* 2Gb link speed */
13307         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
13308                 UINT32_C(0x10)
13309         /* 25Gb link speed */
13310         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
13311                 UINT32_C(0x20)
13312         /* 10Gb link speed */
13313         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
13314                 UINT32_C(0x40)
13315         /* 20Gb link speed */
13316         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
13317                 UINT32_C(0x80)
13318         /* 25Gb link speed */
13319         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
13320                 UINT32_C(0x100)
13321         /* 40Gb link speed */
13322         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
13323                 UINT32_C(0x200)
13324         /* 50Gb link speed */
13325         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
13326                 UINT32_C(0x400)
13327         /* 100Gb link speed */
13328         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
13329                 UINT32_C(0x800)
13330         /* 10Mb link speed (Half-duplex) */
13331         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
13332                 UINT32_C(0x1000)
13333         /* 10Mb link speed (Full-duplex) */
13334         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
13335                 UINT32_C(0x2000)
13336         /* 200Gb link speed */
13337         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_200GB \
13338                 UINT32_C(0x4000)
13339         /* This value controls the wirespeed feature. */
13340         uint8_t wirespeed;
13341         /* Wirespeed feature is disabled. */
13342         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
13343         /* Wirespeed feature is enabled. */
13344         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON  UINT32_C(0x1)
13345         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST \
13346                 HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
13347         /* This value controls the loopback setting for the PHY. */
13348         uint8_t lpbk;
13349         /* No loopback is selected.  Normal operation. */
13350         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE     UINT32_C(0x0)
13351         /*
13352          * The HW will be configured with local loopback such that
13353          * host data is sent back to the host without modification.
13354          */
13355         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL    UINT32_C(0x1)
13356         /*
13357          * The HW will be configured with remote loopback such that
13358          * port logic will send packets back out the transmitter that
13359          * are received.
13360          */
13361         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE   UINT32_C(0x2)
13362         /*
13363          * The HW will be configured with external loopback such that
13364          * host data is sent on the trasmitter and based on the external
13365          * loopback connection the data will be received without modification.
13366          */
13367         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
13368         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST \
13369                 HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
13370         /*
13371          * This value is used to configure the pause that will be
13372          * used for force mode.
13373          */
13374         uint8_t force_pause;
13375         /*
13376          * When this bit is '1', Generation of tx pause messages
13377          * is supported. Disabled otherwise.
13378          */
13379         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
13380         /*
13381          * When this bit is '1', Reception of rx pause messages
13382          * is supported. Disabled otherwise.
13383          */
13384         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
13385         uint8_t unused_1;
13386         /*
13387          * This value controls the pre-emphasis to be used for the
13388          * link.  Driver should not set this value (use
13389          * enable.preemphasis = 0) unless driver is sure of setting.
13390          * Normally HWRM FW will determine proper pre-emphasis.
13391          */
13392         uint32_t        preemphasis;
13393         /*
13394          * Setting for link speed mask that is used to
13395          * advertise speeds during autonegotiation when EEE is enabled.
13396          * This field is valid only when EEE is enabled.
13397          * The speeds specified in this field shall be a subset of
13398          * speeds specified in auto_link_speed_mask.
13399          * If EEE is enabled,then at least one speed shall be provided
13400          * in this mask.
13401          */
13402         uint16_t        eee_link_speed_mask;
13403         /* Reserved */
13404         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 \
13405                 UINT32_C(0x1)
13406         /* 100Mb link speed (Full-duplex) */
13407         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB \
13408                 UINT32_C(0x2)
13409         /* Reserved */
13410         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 \
13411                 UINT32_C(0x4)
13412         /* 1Gb link speed (Full-duplex) */
13413         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB \
13414                 UINT32_C(0x8)
13415         /* Reserved */
13416         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
13417                 UINT32_C(0x10)
13418         /* Reserved */
13419         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
13420                 UINT32_C(0x20)
13421         /* 10Gb link speed */
13422         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
13423                 UINT32_C(0x40)
13424         uint8_t unused_2[2];
13425         /*
13426          * Reuested setting of TX LPI timer in microseconds.
13427          * This field is valid only when EEE is enabled and TX LPI is
13428          * enabled.
13429          */
13430         uint32_t        tx_lpi_timer;
13431         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
13432         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
13433         uint32_t        unused_3;
13434 } __attribute__((packed));
13435
13436 /* hwrm_port_phy_cfg_output (size:128b/16B) */
13437 struct hwrm_port_phy_cfg_output {
13438         /* The specific error status for the command. */
13439         uint16_t        error_code;
13440         /* The HWRM command request type. */
13441         uint16_t        req_type;
13442         /* The sequence ID from the original command. */
13443         uint16_t        seq_id;
13444         /* The length of the response data in number of bytes. */
13445         uint16_t        resp_len;
13446         uint8_t unused_0[7];
13447         /*
13448          * This field is used in Output records to indicate that the output
13449          * is completely written to RAM.  This field should be read as '1'
13450          * to indicate that the output has been completely written.
13451          * When writing a command completion or response to an internal processor,
13452          * the order of writes has to be such that this field is written last.
13453          */
13454         uint8_t valid;
13455 } __attribute__((packed));
13456
13457 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
13458 struct hwrm_port_phy_cfg_cmd_err {
13459         /*
13460          * command specific error codes that goes to
13461          * the cmd_err field in Common HWRM Error Response.
13462          */
13463         uint8_t code;
13464         /* Unknown error */
13465         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
13466         /* Unable to complete operation due to invalid speed */
13467         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
13468         /*
13469          * retry the command since the phy is not ready.
13470          * retry count is returned in opaque_0.
13471          * This is only valid for the first command and
13472          * this value will not change for successive calls.
13473          * but if a 0 is returned at any time then this should
13474          * be treated as an un recoverable failure,
13475          *
13476          * retry interval in milli seconds is returned in opaque_1.
13477          * This specifies the time that user should wait before
13478          * issuing the next port_phy_cfg command.
13479          */
13480         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY         UINT32_C(0x2)
13481         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST \
13482                 HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
13483         uint8_t unused_0[7];
13484 } __attribute__((packed));
13485
13486 /**********************
13487  * hwrm_port_phy_qcfg *
13488  **********************/
13489
13490
13491 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
13492 struct hwrm_port_phy_qcfg_input {
13493         /* The HWRM command request type. */
13494         uint16_t        req_type;
13495         /*
13496          * The completion ring to send the completion event on. This should
13497          * be the NQ ID returned from the `nq_alloc` HWRM command.
13498          */
13499         uint16_t        cmpl_ring;
13500         /*
13501          * The sequence ID is used by the driver for tracking multiple
13502          * commands. This ID is treated as opaque data by the firmware and
13503          * the value is returned in the `hwrm_resp_hdr` upon completion.
13504          */
13505         uint16_t        seq_id;
13506         /*
13507          * The target ID of the command:
13508          * * 0x0-0xFFF8 - The function ID
13509          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13510          * * 0xFFFD - Reserved for user-space HWRM interface
13511          * * 0xFFFF - HWRM
13512          */
13513         uint16_t        target_id;
13514         /*
13515          * A physical address pointer pointing to a host buffer that the
13516          * command's response data will be written. This can be either a host
13517          * physical address (HPA) or a guest physical address (GPA) and must
13518          * point to a physically contiguous block of memory.
13519          */
13520         uint64_t        resp_addr;
13521         /* Port ID of port that is to be queried. */
13522         uint16_t        port_id;
13523         uint8_t unused_0[6];
13524 } __attribute__((packed));
13525
13526 /* hwrm_port_phy_qcfg_output (size:768b/96B) */
13527 struct hwrm_port_phy_qcfg_output {
13528         /* The specific error status for the command. */
13529         uint16_t        error_code;
13530         /* The HWRM command request type. */
13531         uint16_t        req_type;
13532         /* The sequence ID from the original command. */
13533         uint16_t        seq_id;
13534         /* The length of the response data in number of bytes. */
13535         uint16_t        resp_len;
13536         /* This value indicates the current link status. */
13537         uint8_t link;
13538         /* There is no link or cable detected. */
13539         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
13540         /* There is no link, but a cable has been detected. */
13541         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL  UINT32_C(0x1)
13542         /* There is a link. */
13543         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK    UINT32_C(0x2)
13544         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST \
13545                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
13546         uint8_t unused_0;
13547         /* This value indicates the current link speed of the connection. */
13548         uint16_t        link_speed;
13549         /* 100Mb link speed */
13550         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
13551         /* 1Gb link speed */
13552         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB   UINT32_C(0xa)
13553         /* 2Gb link speed */
13554         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB   UINT32_C(0x14)
13555         /* 25Gb link speed */
13556         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
13557         /* 10Gb link speed */
13558         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB  UINT32_C(0x64)
13559         /* 20Mb link speed */
13560         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB  UINT32_C(0xc8)
13561         /* 25Gb link speed */
13562         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB  UINT32_C(0xfa)
13563         /* 40Gb link speed */
13564         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB  UINT32_C(0x190)
13565         /* 50Gb link speed */
13566         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB  UINT32_C(0x1f4)
13567         /* 100Gb link speed */
13568         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
13569         /* 200Gb link speed */
13570         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB UINT32_C(0x7d0)
13571         /* 10Mb link speed */
13572         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB  UINT32_C(0xffff)
13573         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST \
13574                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
13575         /*
13576          * This value is indicates the duplex of the current
13577          * configuration.
13578          */
13579         uint8_t duplex_cfg;
13580         /* Half Duplex connection. */
13581         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
13582         /* Full duplex connection. */
13583         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
13584         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST \
13585                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
13586         /*
13587          * This value is used to indicate the current
13588          * pause configuration. When autoneg is enabled, this value
13589          * represents the autoneg results of pause configuration.
13590          */
13591         uint8_t pause;
13592         /*
13593          * When this bit is '1', Generation of tx pause messages
13594          * is supported. Disabled otherwise.
13595          */
13596         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX     UINT32_C(0x1)
13597         /*
13598          * When this bit is '1', Reception of rx pause messages
13599          * is supported. Disabled otherwise.
13600          */
13601         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX     UINT32_C(0x2)
13602         /*
13603          * The supported speeds for the port. This is a bit mask.
13604          * For each speed that is supported, the corrresponding
13605          * bit will be set to '1'.
13606          */
13607         uint16_t        support_speeds;
13608         /* 100Mb link speed (Half-duplex) */
13609         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD \
13610                 UINT32_C(0x1)
13611         /* 100Mb link speed (Full-duplex) */
13612         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB \
13613                 UINT32_C(0x2)
13614         /* 1Gb link speed (Half-duplex) */
13615         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD \
13616                 UINT32_C(0x4)
13617         /* 1Gb link speed (Full-duplex) */
13618         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB \
13619                 UINT32_C(0x8)
13620         /* 2Gb link speed */
13621         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB \
13622                 UINT32_C(0x10)
13623         /* 25Gb link speed */
13624         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB \
13625                 UINT32_C(0x20)
13626         /* 10Gb link speed */
13627         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB \
13628                 UINT32_C(0x40)
13629         /* 20Gb link speed */
13630         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB \
13631                 UINT32_C(0x80)
13632         /* 25Gb link speed */
13633         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB \
13634                 UINT32_C(0x100)
13635         /* 40Gb link speed */
13636         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB \
13637                 UINT32_C(0x200)
13638         /* 50Gb link speed */
13639         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB \
13640                 UINT32_C(0x400)
13641         /* 100Gb link speed */
13642         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB \
13643                 UINT32_C(0x800)
13644         /* 10Mb link speed (Half-duplex) */
13645         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD \
13646                 UINT32_C(0x1000)
13647         /* 10Mb link speed (Full-duplex) */
13648         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB \
13649                 UINT32_C(0x2000)
13650         /* 200Gb link speed */
13651         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_200GB \
13652                 UINT32_C(0x4000)
13653         /*
13654          * Current setting of forced link speed.
13655          * When the link speed is not being forced, this
13656          * value shall be set to 0.
13657          */
13658         uint16_t        force_link_speed;
13659         /* 100Mb link speed */
13660         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
13661         /* 1Gb link speed */
13662         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
13663         /* 2Gb link speed */
13664         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
13665         /* 25Gb link speed */
13666         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
13667         /* 10Gb link speed */
13668         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
13669         /* 20Mb link speed */
13670         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
13671         /* 25Gb link speed */
13672         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
13673         /* 40Gb link speed */
13674         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB \
13675                 UINT32_C(0x190)
13676         /* 50Gb link speed */
13677         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB \
13678                 UINT32_C(0x1f4)
13679         /* 100Gb link speed */
13680         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB \
13681                 UINT32_C(0x3e8)
13682         /* 200Gb link speed */
13683         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_200GB \
13684                 UINT32_C(0x7d0)
13685         /* 10Mb link speed */
13686         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB \
13687                 UINT32_C(0xffff)
13688         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST \
13689                 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
13690         /* Current setting of auto negotiation mode. */
13691         uint8_t auto_mode;
13692         /* Disable autoneg or autoneg disabled. No speeds are selected. */
13693         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE         UINT32_C(0x0)
13694         /* Select all possible speeds for autoneg mode. */
13695         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
13696         /*
13697          * Select only the auto_link_speed speed for autoneg mode. This mode has
13698          * been DEPRECATED. An HWRM client should not use this mode.
13699          */
13700         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
13701         /*
13702          * Select the auto_link_speed or any speed below that speed for autoneg.
13703          * This mode has been DEPRECATED. An HWRM client should not use this mode.
13704          */
13705         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
13706         /*
13707          * Select the speeds based on the corresponding link speed mask value
13708          * that is provided.
13709          */
13710         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
13711         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST \
13712                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
13713         /*
13714          * Current setting of pause autonegotiation.
13715          * Move autoneg_pause flag here.
13716          */
13717         uint8_t auto_pause;
13718         /*
13719          * When this bit is '1', Generation of tx pause messages
13720          * has been requested. Disabled otherwise.
13721          */
13722         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX \
13723                 UINT32_C(0x1)
13724         /*
13725          * When this bit is '1', Reception of rx pause messages
13726          * has been requested. Disabled otherwise.
13727          */
13728         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX \
13729                 UINT32_C(0x2)
13730         /*
13731          * When set to 1, the advertisement of pause is enabled.
13732          *
13733          * # When the auto_mode is not set to none and this flag is
13734          * set to 1, then the auto_pause bits on this port are being
13735          * advertised and autoneg pause results are being interpreted.
13736          * # When the auto_mode is not set to none and this
13737          * flag is set to 0, the pause is forced as indicated in
13738          * force_pause, and also advertised as auto_pause bits, but
13739          * the autoneg results are not interpreted since the pause
13740          * configuration is being forced.
13741          * # When the auto_mode is set to none and this flag is set to
13742          * 1, auto_pause bits should be ignored and should be set to 0.
13743          */
13744         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE \
13745                 UINT32_C(0x4)
13746         /*
13747          * Current setting for auto_link_speed. This field is only
13748          * valid when auto_mode is set to "one_speed" or "one_or_below".
13749          */
13750         uint16_t        auto_link_speed;
13751         /* 100Mb link speed */
13752         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
13753         /* 1Gb link speed */
13754         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
13755         /* 2Gb link speed */
13756         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
13757         /* 25Gb link speed */
13758         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
13759         /* 10Gb link speed */
13760         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
13761         /* 20Mb link speed */
13762         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
13763         /* 25Gb link speed */
13764         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
13765         /* 40Gb link speed */
13766         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
13767         /* 50Gb link speed */
13768         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
13769         /* 100Gb link speed */
13770         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
13771         /* 200Gb link speed */
13772         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_200GB UINT32_C(0x7d0)
13773         /* 10Mb link speed */
13774         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB \
13775                 UINT32_C(0xffff)
13776         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST \
13777                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
13778         /*
13779          * Current setting for auto_link_speed_mask that is used to
13780          * advertise speeds during autonegotiation.
13781          * This field is only valid when auto_mode is set to "mask".
13782          * The speeds specified in this field shall be a subset of
13783          * supported speeds on this port.
13784          */
13785         uint16_t        auto_link_speed_mask;
13786         /* 100Mb link speed (Half-duplex) */
13787         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
13788                 UINT32_C(0x1)
13789         /* 100Mb link speed (Full-duplex) */
13790         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
13791                 UINT32_C(0x2)
13792         /* 1Gb link speed (Half-duplex) */
13793         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
13794                 UINT32_C(0x4)
13795         /* 1Gb link speed (Full-duplex) */
13796         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB \
13797                 UINT32_C(0x8)
13798         /* 2Gb link speed */
13799         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
13800                 UINT32_C(0x10)
13801         /* 25Gb link speed */
13802         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
13803                 UINT32_C(0x20)
13804         /* 10Gb link speed */
13805         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
13806                 UINT32_C(0x40)
13807         /* 20Gb link speed */
13808         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
13809                 UINT32_C(0x80)
13810         /* 25Gb link speed */
13811         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
13812                 UINT32_C(0x100)
13813         /* 40Gb link speed */
13814         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
13815                 UINT32_C(0x200)
13816         /* 50Gb link speed */
13817         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
13818                 UINT32_C(0x400)
13819         /* 100Gb link speed */
13820         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
13821                 UINT32_C(0x800)
13822         /* 10Mb link speed (Half-duplex) */
13823         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
13824                 UINT32_C(0x1000)
13825         /* 10Mb link speed (Full-duplex) */
13826         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
13827                 UINT32_C(0x2000)
13828         /* 200Gb link speed */
13829         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_200GB \
13830                 UINT32_C(0x4000)
13831         /* Current setting for wirespeed. */
13832         uint8_t wirespeed;
13833         /* Wirespeed feature is disabled. */
13834         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
13835         /* Wirespeed feature is enabled. */
13836         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON  UINT32_C(0x1)
13837         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST \
13838                 HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
13839         /* Current setting for loopback. */
13840         uint8_t lpbk;
13841         /* No loopback is selected.  Normal operation. */
13842         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE     UINT32_C(0x0)
13843         /*
13844          * The HW will be configured with local loopback such that
13845          * host data is sent back to the host without modification.
13846          */
13847         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL    UINT32_C(0x1)
13848         /*
13849          * The HW will be configured with remote loopback such that
13850          * port logic will send packets back out the transmitter that
13851          * are received.
13852          */
13853         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE   UINT32_C(0x2)
13854         /*
13855          * The HW will be configured with external loopback such that
13856          * host data is sent on the trasmitter and based on the external
13857          * loopback connection the data will be received without modification.
13858          */
13859         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
13860         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST \
13861                 HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
13862         /*
13863          * Current setting of forced pause.
13864          * When the pause configuration is not being forced, then
13865          * this value shall be set to 0.
13866          */
13867         uint8_t force_pause;
13868         /*
13869          * When this bit is '1', Generation of tx pause messages
13870          * is supported. Disabled otherwise.
13871          */
13872         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
13873         /*
13874          * When this bit is '1', Reception of rx pause messages
13875          * is supported. Disabled otherwise.
13876          */
13877         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
13878         /*
13879          * This value indicates the current status of the optics module on
13880          * this port.
13881          */
13882         uint8_t module_status;
13883         /* Module is inserted and accepted */
13884         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE \
13885                 UINT32_C(0x0)
13886         /* Module is rejected and transmit side Laser is disabled. */
13887         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX \
13888                 UINT32_C(0x1)
13889         /* Module mismatch warning. */
13890         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG \
13891                 UINT32_C(0x2)
13892         /* Module is rejected and powered down. */
13893         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN \
13894                 UINT32_C(0x3)
13895         /* Module is not inserted. */
13896         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
13897                 UINT32_C(0x4)
13898         /* Module status is not applicable. */
13899         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
13900                 UINT32_C(0xff)
13901         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST \
13902                 HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
13903         /* Current setting for preemphasis. */
13904         uint32_t        preemphasis;
13905         /* This field represents the major version of the PHY. */
13906         uint8_t phy_maj;
13907         /* This field represents the minor version of the PHY. */
13908         uint8_t phy_min;
13909         /* This field represents the build version of the PHY. */
13910         uint8_t phy_bld;
13911         /* This value represents a PHY type. */
13912         uint8_t phy_type;
13913         /* Unknown */
13914         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN \
13915                 UINT32_C(0x0)
13916         /* BASE-CR */
13917         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR \
13918                 UINT32_C(0x1)
13919         /* BASE-KR4 (Deprecated) */
13920         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 \
13921                 UINT32_C(0x2)
13922         /* BASE-LR */
13923         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR \
13924                 UINT32_C(0x3)
13925         /* BASE-SR */
13926         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR \
13927                 UINT32_C(0x4)
13928         /* BASE-KR2 (Deprecated) */
13929         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 \
13930                 UINT32_C(0x5)
13931         /* BASE-KX */
13932         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX \
13933                 UINT32_C(0x6)
13934         /* BASE-KR */
13935         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR \
13936                 UINT32_C(0x7)
13937         /* BASE-T */
13938         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET \
13939                 UINT32_C(0x8)
13940         /* EEE capable BASE-T */
13941         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE \
13942                 UINT32_C(0x9)
13943         /* SGMII connected external PHY */
13944         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY \
13945                 UINT32_C(0xa)
13946         /* 25G_BASECR_CA_L */
13947         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L \
13948                 UINT32_C(0xb)
13949         /* 25G_BASECR_CA_S */
13950         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S \
13951                 UINT32_C(0xc)
13952         /* 25G_BASECR_CA_N */
13953         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N \
13954                 UINT32_C(0xd)
13955         /* 25G_BASESR */
13956         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR \
13957                 UINT32_C(0xe)
13958         /* 100G_BASECR4 */
13959         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 \
13960                 UINT32_C(0xf)
13961         /* 100G_BASESR4 */
13962         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 \
13963                 UINT32_C(0x10)
13964         /* 100G_BASELR4 */
13965         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 \
13966                 UINT32_C(0x11)
13967         /* 100G_BASEER4 */
13968         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 \
13969                 UINT32_C(0x12)
13970         /* 100G_BASESR10 */
13971         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 \
13972                 UINT32_C(0x13)
13973         /* 40G_BASECR4 */
13974         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 \
13975                 UINT32_C(0x14)
13976         /* 40G_BASESR4 */
13977         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 \
13978                 UINT32_C(0x15)
13979         /* 40G_BASELR4 */
13980         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 \
13981                 UINT32_C(0x16)
13982         /* 40G_BASEER4 */
13983         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 \
13984                 UINT32_C(0x17)
13985         /* 40G_ACTIVE_CABLE */
13986         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
13987                 UINT32_C(0x18)
13988         /* 1G_baseT */
13989         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET \
13990                 UINT32_C(0x19)
13991         /* 1G_baseSX */
13992         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX \
13993                 UINT32_C(0x1a)
13994         /* 1G_baseCX */
13995         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX \
13996                 UINT32_C(0x1b)
13997         /* 100G_BASECR4 */
13998         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4 \
13999                 UINT32_C(0x1c)
14000         /* 100G_BASESR4 */
14001         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4 \
14002                 UINT32_C(0x1d)
14003         /* 100G_BASELR4 */
14004         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4 \
14005                 UINT32_C(0x1e)
14006         /* 100G_BASEER4 */
14007         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4 \
14008                 UINT32_C(0x1f)
14009         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST \
14010                 HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4
14011         /* This value represents a media type. */
14012         uint8_t media_type;
14013         /* Unknown */
14014         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
14015         /* Twisted Pair */
14016         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP      UINT32_C(0x1)
14017         /* Direct Attached Copper */
14018         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC     UINT32_C(0x2)
14019         /* Fiber */
14020         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE   UINT32_C(0x3)
14021         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST \
14022                 HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
14023         /* This value represents a transceiver type. */
14024         uint8_t xcvr_pkg_type;
14025         /* PHY and MAC are in the same package */
14026         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
14027                 UINT32_C(0x1)
14028         /* PHY and MAC are in different packages */
14029         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
14030                 UINT32_C(0x2)
14031         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST \
14032                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
14033         uint8_t eee_config_phy_addr;
14034         /* This field represents PHY address. */
14035         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK \
14036                 UINT32_C(0x1f)
14037         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT               0
14038         /*
14039          * This field represents flags related to EEE configuration.
14040          * These EEE configuration flags are valid only when the
14041          * auto_mode is not set to none (in other words autonegotiation
14042          * is enabled).
14043          */
14044         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK \
14045                 UINT32_C(0xe0)
14046         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT             5
14047         /*
14048          * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
14049          * Speeds for autoneg with EEE mode enabled
14050          * are based on eee_link_speed_mask.
14051          */
14052         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED \
14053                 UINT32_C(0x20)
14054         /*
14055          * This flag is valid only when eee_enabled is set to 1.
14056          *
14057          * # If eee_enabled is set to 0, then EEE mode is disabled
14058          * and this flag shall be ignored.
14059          * # If eee_enabled is set to 1 and this flag is set to 1,
14060          * then Energy Efficient Ethernet (EEE) mode is enabled
14061          * and in use.
14062          * # If eee_enabled is set to 1 and this flag is set to 0,
14063          * then Energy Efficient Ethernet (EEE) mode is enabled
14064          * but is currently not in use.
14065          */
14066         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE \
14067                 UINT32_C(0x40)
14068         /*
14069          * This flag is valid only when eee_enabled is set to 1.
14070          *
14071          * # If eee_enabled is set to 0, then EEE mode is disabled
14072          * and this flag shall be ignored.
14073          * # If eee_enabled is set to 1 and this flag is set to 1,
14074          * then Energy Efficient Ethernet (EEE) mode is enabled
14075          * and TX LPI is enabled.
14076          * # If eee_enabled is set to 1 and this flag is set to 0,
14077          * then Energy Efficient Ethernet (EEE) mode is enabled
14078          * but TX LPI is disabled.
14079          */
14080         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI \
14081                 UINT32_C(0x80)
14082         /*
14083          * When set to 1, the parallel detection is used to determine
14084          * the speed of the link partner.
14085          *
14086          * Parallel detection is used when a autonegotiation capable
14087          * device is connected to a link parter that is not capable
14088          * of autonegotiation.
14089          */
14090         uint8_t parallel_detect;
14091         /*
14092          * When set to 1, the parallel detection is used to determine
14093          * the speed of the link partner.
14094          *
14095          * Parallel detection is used when a autonegotiation capable
14096          * device is connected to a link parter that is not capable
14097          * of autonegotiation.
14098          */
14099         #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT     UINT32_C(0x1)
14100         /*
14101          * The advertised speeds for the port by the link partner.
14102          * Each advertised speed will be set to '1'.
14103          */
14104         uint16_t        link_partner_adv_speeds;
14105         /* 100Mb link speed (Half-duplex) */
14106         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
14107                 UINT32_C(0x1)
14108         /* 100Mb link speed (Full-duplex) */
14109         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
14110                 UINT32_C(0x2)
14111         /* 1Gb link speed (Half-duplex) */
14112         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
14113                 UINT32_C(0x4)
14114         /* 1Gb link speed (Full-duplex) */
14115         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
14116                 UINT32_C(0x8)
14117         /* 2Gb link speed */
14118         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
14119                 UINT32_C(0x10)
14120         /* 25Gb link speed */
14121         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
14122                 UINT32_C(0x20)
14123         /* 10Gb link speed */
14124         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
14125                 UINT32_C(0x40)
14126         /* 20Gb link speed */
14127         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
14128                 UINT32_C(0x80)
14129         /* 25Gb link speed */
14130         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
14131                 UINT32_C(0x100)
14132         /* 40Gb link speed */
14133         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
14134                 UINT32_C(0x200)
14135         /* 50Gb link speed */
14136         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
14137                 UINT32_C(0x400)
14138         /* 100Gb link speed */
14139         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
14140                 UINT32_C(0x800)
14141         /* 10Mb link speed (Half-duplex) */
14142         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
14143                 UINT32_C(0x1000)
14144         /* 10Mb link speed (Full-duplex) */
14145         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
14146                 UINT32_C(0x2000)
14147         /*
14148          * The advertised autoneg for the port by the link partner.
14149          * This field is deprecated and should be set to 0.
14150          */
14151         uint8_t link_partner_adv_auto_mode;
14152         /* Disable autoneg or autoneg disabled. No speeds are selected. */
14153         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
14154                 UINT32_C(0x0)
14155         /* Select all possible speeds for autoneg mode. */
14156         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
14157                 UINT32_C(0x1)
14158         /*
14159          * Select only the auto_link_speed speed for autoneg mode. This mode has
14160          * been DEPRECATED. An HWRM client should not use this mode.
14161          */
14162         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
14163                 UINT32_C(0x2)
14164         /*
14165          * Select the auto_link_speed or any speed below that speed for autoneg.
14166          * This mode has been DEPRECATED. An HWRM client should not use this mode.
14167          */
14168         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
14169                 UINT32_C(0x3)
14170         /*
14171          * Select the speeds based on the corresponding link speed mask value
14172          * that is provided.
14173          */
14174         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
14175                 UINT32_C(0x4)
14176         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST \
14177                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
14178         /* The advertised pause settings on the port by the link partner. */
14179         uint8_t link_partner_adv_pause;
14180         /*
14181          * When this bit is '1', Generation of tx pause messages
14182          * is supported. Disabled otherwise.
14183          */
14184         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
14185                 UINT32_C(0x1)
14186         /*
14187          * When this bit is '1', Reception of rx pause messages
14188          * is supported. Disabled otherwise.
14189          */
14190         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
14191                 UINT32_C(0x2)
14192         /*
14193          * Current setting for link speed mask that is used to
14194          * advertise speeds during autonegotiation when EEE is enabled.
14195          * This field is valid only when eee_enabled flags is set to 1.
14196          * The speeds specified in this field shall be a subset of
14197          * speeds specified in auto_link_speed_mask.
14198          */
14199         uint16_t        adv_eee_link_speed_mask;
14200         /* Reserved */
14201         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
14202                 UINT32_C(0x1)
14203         /* 100Mb link speed (Full-duplex) */
14204         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
14205                 UINT32_C(0x2)
14206         /* Reserved */
14207         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
14208                 UINT32_C(0x4)
14209         /* 1Gb link speed (Full-duplex) */
14210         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
14211                 UINT32_C(0x8)
14212         /* Reserved */
14213         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
14214                 UINT32_C(0x10)
14215         /* Reserved */
14216         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
14217                 UINT32_C(0x20)
14218         /* 10Gb link speed */
14219         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
14220                 UINT32_C(0x40)
14221         /*
14222          * Current setting for link speed mask that is advertised by
14223          * the link partner when EEE is enabled.
14224          * This field is valid only when eee_enabled flags is set to 1.
14225          */
14226         uint16_t        link_partner_adv_eee_link_speed_mask;
14227         /* Reserved */
14228         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
14229                 UINT32_C(0x1)
14230         /* 100Mb link speed (Full-duplex) */
14231         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
14232                 UINT32_C(0x2)
14233         /* Reserved */
14234         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
14235                 UINT32_C(0x4)
14236         /* 1Gb link speed (Full-duplex) */
14237         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
14238                 UINT32_C(0x8)
14239         /* Reserved */
14240         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
14241                 UINT32_C(0x10)
14242         /* Reserved */
14243         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
14244                 UINT32_C(0x20)
14245         /* 10Gb link speed */
14246         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
14247                 UINT32_C(0x40)
14248         uint32_t        xcvr_identifier_type_tx_lpi_timer;
14249         /*
14250          * Current setting of TX LPI timer in microseconds.
14251          * This field is valid only when_eee_enabled flag is set to 1
14252          * and tx_lpi_enabled is set to 1.
14253          */
14254         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK \
14255                 UINT32_C(0xffffff)
14256         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT             0
14257         /* This value represents transceiver identifier type. */
14258         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
14259                 UINT32_C(0xff000000)
14260         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT     24
14261         /* Unknown */
14262         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
14263                 (UINT32_C(0x0) << 24)
14264         /* SFP/SFP+/SFP28 */
14265         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
14266                 (UINT32_C(0x3) << 24)
14267         /* QSFP+ */
14268         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
14269                 (UINT32_C(0xc) << 24)
14270         /* QSFP+ */
14271         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
14272                 (UINT32_C(0xd) << 24)
14273         /* QSFP28 */
14274         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
14275                 (UINT32_C(0x11) << 24)
14276         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST \
14277                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28
14278         /*
14279          * This value represents the current configuration of
14280          * Forward Error Correction (FEC) on the port.
14281          */
14282         uint16_t        fec_cfg;
14283         /*
14284          * When set to 1, then FEC is not supported on this port. If this flag
14285          * is set to 1, then all other FEC configuration flags shall be ignored.
14286          * When set to 0, then FEC is supported as indicated by other
14287          * configuration flags.
14288          * If no cable is attached and the HWRM does not yet know the FEC
14289          * capability, then the HWRM shall set this flag to 1 when reporting
14290          * FEC capability.
14291          */
14292         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
14293                 UINT32_C(0x1)
14294         /*
14295          * When set to 1, then FEC autonegotiation is supported on this port.
14296          * When set to 0, then FEC autonegotiation is not supported on this port.
14297          */
14298         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
14299                 UINT32_C(0x2)
14300         /*
14301          * When set to 1, then FEC autonegotiation is enabled on this port.
14302          * When set to 0, then FEC autonegotiation is disabled if supported.
14303          * This flag should be ignored if FEC autonegotiation is not supported on this port.
14304          */
14305         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
14306                 UINT32_C(0x4)
14307         /*
14308          * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port.
14309          * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port.
14310          */
14311         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
14312                 UINT32_C(0x8)
14313         /*
14314          * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this port.
14315          * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported.
14316          * This flag should be ignored if FEC CLAUSE 74 is not supported on this port.
14317          */
14318         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
14319                 UINT32_C(0x10)
14320         /*
14321          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported on this port.
14322          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is not supported on this port.
14323          */
14324         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
14325                 UINT32_C(0x20)
14326         /*
14327          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled on this port.
14328          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is disabled if supported.
14329          * This flag should be ignored if FEC CLAUSE 91 is not supported on this port.
14330          */
14331         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
14332                 UINT32_C(0x40)
14333         /*
14334          * This value is indicates the duplex of the current
14335          * connection state.
14336          */
14337         uint8_t duplex_state;
14338         /* Half Duplex connection. */
14339         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
14340         /* Full duplex connection. */
14341         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
14342         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST \
14343                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
14344         /* Option flags fields. */
14345         uint8_t option_flags;
14346         /* When this bit is '1', Media auto detect is enabled. */
14347         #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT \
14348                 UINT32_C(0x1)
14349         /*
14350          * Up to 16 bytes of null padded ASCII string representing
14351          * PHY vendor.
14352          * If the string is set to null, then the vendor name is not
14353          * available.
14354          */
14355         char    phy_vendor_name[16];
14356         /*
14357          * Up to 16 bytes of null padded ASCII string that
14358          * identifies vendor specific part number of the PHY.
14359          * If the string is set to null, then the vendor specific
14360          * part number is not available.
14361          */
14362         char    phy_vendor_partnumber[16];
14363         uint8_t unused_2[7];
14364         /*
14365          * This field is used in Output records to indicate that the output
14366          * is completely written to RAM.  This field should be read as '1'
14367          * to indicate that the output has been completely written.
14368          * When writing a command completion or response to an internal processor,
14369          * the order of writes has to be such that this field is written last.
14370          */
14371         uint8_t valid;
14372 } __attribute__((packed));
14373
14374 /*********************
14375  * hwrm_port_mac_cfg *
14376  *********************/
14377
14378
14379 /* hwrm_port_mac_cfg_input (size:384b/48B) */
14380 struct hwrm_port_mac_cfg_input {
14381         /* The HWRM command request type. */
14382         uint16_t        req_type;
14383         /*
14384          * The completion ring to send the completion event on. This should
14385          * be the NQ ID returned from the `nq_alloc` HWRM command.
14386          */
14387         uint16_t        cmpl_ring;
14388         /*
14389          * The sequence ID is used by the driver for tracking multiple
14390          * commands. This ID is treated as opaque data by the firmware and
14391          * the value is returned in the `hwrm_resp_hdr` upon completion.
14392          */
14393         uint16_t        seq_id;
14394         /*
14395          * The target ID of the command:
14396          * * 0x0-0xFFF8 - The function ID
14397          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14398          * * 0xFFFD - Reserved for user-space HWRM interface
14399          * * 0xFFFF - HWRM
14400          */
14401         uint16_t        target_id;
14402         /*
14403          * A physical address pointer pointing to a host buffer that the
14404          * command's response data will be written. This can be either a host
14405          * physical address (HPA) or a guest physical address (GPA) and must
14406          * point to a physically contiguous block of memory.
14407          */
14408         uint64_t        resp_addr;
14409         /*
14410          * In this field, there are a number of CoS mappings related flags
14411          * that are used to configure CoS mappings and their corresponding
14412          * priorities in the hardware.
14413          * For the priorities of CoS mappings, the HWRM uses the following
14414          * priority order (high to low) by default:
14415          * # vlan pri
14416          * # ip_dscp
14417          * # tunnel_vlan_pri
14418          * # default cos
14419          *
14420          * A subset of CoS mappings can be enabled.
14421          * If a priority is not specified for an enabled CoS mapping, the
14422          * priority will be assigned in the above order for the enabled CoS
14423          * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
14424          * enabled and their priorities are not specified, the following
14425          * priority order (high to low) will be used by the HWRM:
14426          * # vlan_pri
14427          * # ip_dscp
14428          * # default cos
14429          *
14430          * vlan_pri CoS mapping together with default CoS with lower priority
14431          * are enabled by default by the HWRM.
14432          */
14433         uint32_t        flags;
14434         /*
14435          * When this bit is '1', this command will configure
14436          * the MAC to match the current link state of the PHY.
14437          * If the link is not established on the PHY, then this
14438          * bit has no effect.
14439          */
14440         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK \
14441                 UINT32_C(0x1)
14442         /*
14443          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
14444          * is requested to be enabled.
14445          */
14446         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE \
14447                 UINT32_C(0x2)
14448         /*
14449          * When this bit is set to '1', tunnel VLAN PRI field to
14450          * CoS mapping is requested to be enabled.
14451          */
14452         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
14453                 UINT32_C(0x4)
14454         /*
14455          * When this bit is set to '1', the IP DSCP to CoS mapping is
14456          * requested to be enabled.
14457          */
14458         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE \
14459                 UINT32_C(0x8)
14460         /*
14461          * When this bit is '1', the HWRM is requested to
14462          * enable timestamp capture capability on the receive side
14463          * of this port.
14464          */
14465         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
14466                 UINT32_C(0x10)
14467         /*
14468          * When this bit is '1', the HWRM is requested to
14469          * disable timestamp capture capability on the receive side
14470          * of this port.
14471          */
14472         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE \
14473                 UINT32_C(0x20)
14474         /*
14475          * When this bit is '1', the HWRM is requested to
14476          * enable timestamp capture capability on the transmit side
14477          * of this port.
14478          */
14479         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
14480                 UINT32_C(0x40)
14481         /*
14482          * When this bit is '1', the HWRM is requested to
14483          * disable timestamp capture capability on the transmit side
14484          * of this port.
14485          */
14486         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE \
14487                 UINT32_C(0x80)
14488         /*
14489          * When this bit is '1', the Out-Of-Box WoL is requested to
14490          * be enabled on this port.
14491          */
14492         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE \
14493                 UINT32_C(0x100)
14494         /*
14495          * When this bit is '1', the the Out-Of-Box WoL is requested to
14496          * be disabled on this port.
14497          */
14498         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE \
14499                 UINT32_C(0x200)
14500         /*
14501          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
14502          * is requested to be disabled.
14503          */
14504         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE \
14505                 UINT32_C(0x400)
14506         /*
14507          * When this bit is set to '1', tunnel VLAN PRI field to
14508          * CoS mapping is requested to be disabled.
14509          */
14510         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE \
14511                 UINT32_C(0x800)
14512         /*
14513          * When this bit is set to '1', the IP DSCP to CoS mapping is
14514          * requested to be disabled.
14515          */
14516         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE \
14517                 UINT32_C(0x1000)
14518         /*
14519          * When this bit is set to '1', and the ptp_tx_ts_capture_enable
14520          * bit is set, then the device uses one step Tx timestamping.
14521          * This bit is temporary and used for experimental purposes.
14522          */
14523         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_ONE_STEP_TX_TS \
14524                 UINT32_C(0x2000)
14525         uint32_t        enables;
14526         /*
14527          * This bit must be '1' for the ipg field to be
14528          * configured.
14529          */
14530         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG \
14531                 UINT32_C(0x1)
14532         /*
14533          * This bit must be '1' for the lpbk field to be
14534          * configured.
14535          */
14536         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK \
14537                 UINT32_C(0x2)
14538         /*
14539          * This bit must be '1' for the vlan_pri2cos_map_pri field to be
14540          * configured.
14541          */
14542         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI \
14543                 UINT32_C(0x4)
14544         /*
14545          * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
14546          * configured.
14547          */
14548         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI \
14549                 UINT32_C(0x10)
14550         /*
14551          * This bit must be '1' for the dscp2cos_map_pri field to be
14552          * configured.
14553          */
14554         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI \
14555                 UINT32_C(0x20)
14556         /*
14557          * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
14558          * configured.
14559          */
14560         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE \
14561                 UINT32_C(0x40)
14562         /*
14563          * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
14564          * configured.
14565          */
14566         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE \
14567                 UINT32_C(0x80)
14568         /*
14569          * This bit must be '1' for the cos_field_cfg field to be
14570          * configured.
14571          */
14572         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG \
14573                 UINT32_C(0x100)
14574         /*
14575          * This bit must be '1' for the ptp_freq_adj_ppb field to be
14576          * configured.
14577          */
14578         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_PPB \
14579                 UINT32_C(0x200)
14580         /* Port ID of port that is to be configured. */
14581         uint16_t        port_id;
14582         /*
14583          * This value is used to configure the minimum IPG that will
14584          * be sent between packets by this port.
14585          */
14586         uint8_t ipg;
14587         /* This value controls the loopback setting for the MAC. */
14588         uint8_t lpbk;
14589         /* No loopback is selected.  Normal operation. */
14590         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE   UINT32_C(0x0)
14591         /*
14592          * The HW will be configured with local loopback such that
14593          * host data is sent back to the host without modification.
14594          */
14595         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL  UINT32_C(0x1)
14596         /*
14597          * The HW will be configured with remote loopback such that
14598          * port logic will send packets back out the transmitter that
14599          * are received.
14600          */
14601         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
14602         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST \
14603                 HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
14604         /*
14605          * This value controls the priority setting of VLAN PRI to CoS
14606          * mapping based on VLAN Tags of inner packet headers of
14607          * tunneled packets or packet headers of non-tunneled packets.
14608          *
14609          * # Each XXX_pri variable shall have a unique priority value
14610          * when it is being specified.
14611          * # When comparing priorities of mappings, higher value
14612          * indicates higher priority.
14613          * For example, a value of 0-3 is returned where 0 is being
14614          * the lowest priority and 3 is being the highest priority.
14615          */
14616         uint8_t vlan_pri2cos_map_pri;
14617         /* Reserved field. */
14618         uint8_t reserved1;
14619         /*
14620          * This value controls the priority setting of VLAN PRI to CoS
14621          * mapping based on VLAN Tags of tunneled header.
14622          * This mapping only applies when tunneled headers
14623          * are present.
14624          *
14625          * # Each XXX_pri variable shall have a unique priority value
14626          * when it is being specified.
14627          * # When comparing priorities of mappings, higher value
14628          * indicates higher priority.
14629          * For example, a value of 0-3 is returned where 0 is being
14630          * the lowest priority and 3 is being the highest priority.
14631          */
14632         uint8_t tunnel_pri2cos_map_pri;
14633         /*
14634          * This value controls the priority setting of IP DSCP to CoS
14635          * mapping based on inner IP header of tunneled packets or
14636          * IP header of non-tunneled packets.
14637          *
14638          * # Each XXX_pri variable shall have a unique priority value
14639          * when it is being specified.
14640          * # When comparing priorities of mappings, higher value
14641          * indicates higher priority.
14642          * For example, a value of 0-3 is returned where 0 is being
14643          * the lowest priority and 3 is being the highest priority.
14644          */
14645         uint8_t dscp2pri_map_pri;
14646         /*
14647          * This is a 16-bit bit mask that is used to request a
14648          * specific configuration of time stamp capture of PTP messages
14649          * on the receive side of this port.
14650          * This field shall be ignored if the ptp_rx_ts_capture_enable
14651          * flag is not set in this command.
14652          * Otherwise, if bit 'i' is set, then the HWRM is being
14653          * requested to configure the receive side of the port to
14654          * capture the time stamp of every received PTP message
14655          * with messageType field value set to i.
14656          */
14657         uint16_t        rx_ts_capture_ptp_msg_type;
14658         /*
14659          * This is a 16-bit bit mask that is used to request a
14660          * specific configuration of time stamp capture of PTP messages
14661          * on the transmit side of this port.
14662          * This field shall be ignored if the ptp_tx_ts_capture_enable
14663          * flag is not set in this command.
14664          * Otherwise, if bit 'i' is set, then the HWRM is being
14665          * requested to configure the transmit sied of the port to
14666          * capture the time stamp of every transmitted PTP message
14667          * with messageType field value set to i.
14668          */
14669         uint16_t        tx_ts_capture_ptp_msg_type;
14670         /* Configuration of CoS fields. */
14671         uint8_t cos_field_cfg;
14672         /* Reserved */
14673         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1 \
14674                 UINT32_C(0x1)
14675         /*
14676          * This field is used to specify selection of VLAN PRI value
14677          * based on whether one or two VLAN Tags are present in
14678          * the inner packet headers of tunneled packets or
14679          * non-tunneled packets.
14680          * This field is valid only if inner VLAN PRI to CoS mapping
14681          * is enabled.
14682          * If VLAN PRI to CoS mapping is not enabled, then this
14683          * field shall be ignored.
14684          */
14685         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
14686                 UINT32_C(0x6)
14687         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
14688                 1
14689         /*
14690          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
14691          * present in the inner packet headers
14692          */
14693         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
14694                 (UINT32_C(0x0) << 1)
14695         /*
14696          * Select outer VLAN Tag PRI when 2 VLAN Tags are
14697          * present in the inner packet headers.
14698          * No VLAN PRI shall be selected for this configuration
14699          * if only one VLAN Tag is present in the inner
14700          * packet headers.
14701          */
14702         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
14703                 (UINT32_C(0x1) << 1)
14704         /*
14705          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
14706          * are present in the inner packet headers
14707          */
14708         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
14709                 (UINT32_C(0x2) << 1)
14710         /* Unspecified */
14711         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
14712                 (UINT32_C(0x3) << 1)
14713         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
14714                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
14715         /*
14716          * This field is used to specify selection of tunnel VLAN
14717          * PRI value based on whether one or two VLAN Tags are
14718          * present in tunnel headers.
14719          * This field is valid only if tunnel VLAN PRI to CoS mapping
14720          * is enabled.
14721          * If tunnel VLAN PRI to CoS mapping is not enabled, then this
14722          * field shall be ignored.
14723          */
14724         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
14725                 UINT32_C(0x18)
14726         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
14727                 3
14728         /*
14729          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
14730          * present in the tunnel packet headers
14731          */
14732         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
14733                 (UINT32_C(0x0) << 3)
14734         /*
14735          * Select outer VLAN Tag PRI when 2 VLAN Tags are
14736          * present in the tunnel packet headers.
14737          * No tunnel VLAN PRI shall be selected for this
14738          * configuration if only one VLAN Tag is present in
14739          * the tunnel packet headers.
14740          */
14741         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
14742                 (UINT32_C(0x1) << 3)
14743         /*
14744          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
14745          * are present in the tunnel packet headers
14746          */
14747         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
14748                 (UINT32_C(0x2) << 3)
14749         /* Unspecified */
14750         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
14751                 (UINT32_C(0x3) << 3)
14752         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
14753                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
14754         /*
14755          * This field shall be used to provide default CoS value
14756          * that has been configured on this port.
14757          * This field is valid only if default CoS mapping
14758          * is enabled.
14759          * If default CoS mapping is not enabled, then this
14760          * field shall be ignored.
14761          */
14762         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
14763                 UINT32_C(0xe0)
14764         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
14765                 5
14766         uint8_t unused_0[3];
14767         /*
14768          * This signed field specifies by how much to adjust the frequency
14769          * of sync timer updates (measured in parts per billion).
14770          */
14771         int32_t ptp_freq_adj_ppb;
14772         uint8_t unused_1[4];
14773 } __attribute__((packed));
14774
14775 /* hwrm_port_mac_cfg_output (size:128b/16B) */
14776 struct hwrm_port_mac_cfg_output {
14777         /* The specific error status for the command. */
14778         uint16_t        error_code;
14779         /* The HWRM command request type. */
14780         uint16_t        req_type;
14781         /* The sequence ID from the original command. */
14782         uint16_t        seq_id;
14783         /* The length of the response data in number of bytes. */
14784         uint16_t        resp_len;
14785         /*
14786          * This is the configured maximum length of Ethernet packet
14787          * payload that is allowed to be received on the port.
14788          * This value does not include the number of bytes used by
14789          * Ethernet header and trailer (CRC).
14790          */
14791         uint16_t        mru;
14792         /*
14793          * This is the configured maximum length of Ethernet packet
14794          * payload that is allowed to be transmitted on the port.
14795          * This value does not include the number of bytes used by
14796          * Ethernet header and trailer (CRC).
14797          */
14798         uint16_t        mtu;
14799         /* Current configuration of the IPG value. */
14800         uint8_t ipg;
14801         /* Current value of the loopback value. */
14802         uint8_t lpbk;
14803         /* No loopback is selected.  Normal operation. */
14804         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
14805         /*
14806          * The HW will be configured with local loopback such that
14807          * host data is sent back to the host without modification.
14808          */
14809         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
14810         /*
14811          * The HW will be configured with remote loopback such that
14812          * port logic will send packets back out the transmitter that
14813          * are received.
14814          */
14815         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
14816         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST \
14817                 HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
14818         uint8_t unused_0;
14819         /*
14820          * This field is used in Output records to indicate that the output
14821          * is completely written to RAM.  This field should be read as '1'
14822          * to indicate that the output has been completely written.
14823          * When writing a command completion or response to an internal processor,
14824          * the order of writes has to be such that this field is written last.
14825          */
14826         uint8_t valid;
14827 } __attribute__((packed));
14828
14829 /**********************
14830  * hwrm_port_mac_qcfg *
14831  **********************/
14832
14833
14834 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
14835 struct hwrm_port_mac_qcfg_input {
14836         /* The HWRM command request type. */
14837         uint16_t        req_type;
14838         /*
14839          * The completion ring to send the completion event on. This should
14840          * be the NQ ID returned from the `nq_alloc` HWRM command.
14841          */
14842         uint16_t        cmpl_ring;
14843         /*
14844          * The sequence ID is used by the driver for tracking multiple
14845          * commands. This ID is treated as opaque data by the firmware and
14846          * the value is returned in the `hwrm_resp_hdr` upon completion.
14847          */
14848         uint16_t        seq_id;
14849         /*
14850          * The target ID of the command:
14851          * * 0x0-0xFFF8 - The function ID
14852          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14853          * * 0xFFFD - Reserved for user-space HWRM interface
14854          * * 0xFFFF - HWRM
14855          */
14856         uint16_t        target_id;
14857         /*
14858          * A physical address pointer pointing to a host buffer that the
14859          * command's response data will be written. This can be either a host
14860          * physical address (HPA) or a guest physical address (GPA) and must
14861          * point to a physically contiguous block of memory.
14862          */
14863         uint64_t        resp_addr;
14864         /* Port ID of port that is to be configured. */
14865         uint16_t        port_id;
14866         uint8_t unused_0[6];
14867 } __attribute__((packed));
14868
14869 /* hwrm_port_mac_qcfg_output (size:192b/24B) */
14870 struct hwrm_port_mac_qcfg_output {
14871         /* The specific error status for the command. */
14872         uint16_t        error_code;
14873         /* The HWRM command request type. */
14874         uint16_t        req_type;
14875         /* The sequence ID from the original command. */
14876         uint16_t        seq_id;
14877         /* The length of the response data in number of bytes. */
14878         uint16_t        resp_len;
14879         /*
14880          * This is the configured maximum length of Ethernet packet
14881          * payload that is allowed to be received on the port.
14882          * This value does not include the number of bytes used by the
14883          * Ethernet header and trailer (CRC).
14884          */
14885         uint16_t        mru;
14886         /*
14887          * This is the configured maximum length of Ethernet packet
14888          * payload that is allowed to be transmitted on the port.
14889          * This value does not include the number of bytes used by the
14890          * Ethernet header and trailer (CRC).
14891          */
14892         uint16_t        mtu;
14893         /*
14894          * The minimum IPG that will
14895          * be sent between packets by this port.
14896          */
14897         uint8_t ipg;
14898         /* The loopback setting for the MAC. */
14899         uint8_t lpbk;
14900         /* No loopback is selected.  Normal operation. */
14901         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
14902         /*
14903          * The HW will be configured with local loopback such that
14904          * host data is sent back to the host without modification.
14905          */
14906         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
14907         /*
14908          * The HW will be configured with remote loopback such that
14909          * port logic will send packets back out the transmitter that
14910          * are received.
14911          */
14912         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
14913         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST \
14914                 HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
14915         /*
14916          * Priority setting for VLAN PRI to CoS mapping.
14917          * # Each XXX_pri variable shall have a unique priority value
14918          * when it is being used.
14919          * # When comparing priorities of mappings, higher value
14920          * indicates higher priority.
14921          * For example, a value of 0-3 is returned where 0 is being
14922          * the lowest priority and 3 is being the highest priority.
14923          * # If the correspoding CoS mapping is not enabled, then this
14924          * field should be ignored.
14925          * # This value indicates the normalized priority value retained
14926          * in the HWRM.
14927          */
14928         uint8_t vlan_pri2cos_map_pri;
14929         /*
14930          * In this field, a number of CoS mappings related flags
14931          * are used to indicate configured CoS mappings.
14932          */
14933         uint8_t flags;
14934         /*
14935          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
14936          * is enabled.
14937          */
14938         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE \
14939                 UINT32_C(0x1)
14940         /*
14941          * When this bit is set to '1', tunnel VLAN PRI field to
14942          * CoS mapping is enabled.
14943          */
14944         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
14945                 UINT32_C(0x2)
14946         /*
14947          * When this bit is set to '1', the IP DSCP to CoS mapping is
14948          * enabled.
14949          */
14950         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE \
14951                 UINT32_C(0x4)
14952         /*
14953          * When this bit is '1', the Out-Of-Box WoL is enabled on this
14954          * port.
14955          */
14956         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE \
14957                 UINT32_C(0x8)
14958         /* When this bit is '1', PTP is enabled for RX on this port. */
14959         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
14960                 UINT32_C(0x10)
14961         /* When this bit is '1', PTP is enabled for TX on this port. */
14962         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
14963                 UINT32_C(0x20)
14964         /*
14965          * Priority setting for tunnel VLAN PRI to CoS mapping.
14966          * # Each XXX_pri variable shall have a unique priority value
14967          * when it is being used.
14968          * # When comparing priorities of mappings, higher value
14969          * indicates higher priority.
14970          * For example, a value of 0-3 is returned where 0 is being
14971          * the lowest priority and 3 is being the highest priority.
14972          * # If the correspoding CoS mapping is not enabled, then this
14973          * field should be ignored.
14974          * # This value indicates the normalized priority value retained
14975          * in the HWRM.
14976          */
14977         uint8_t tunnel_pri2cos_map_pri;
14978         /*
14979          * Priority setting for DSCP to PRI mapping.
14980          * # Each XXX_pri variable shall have a unique priority value
14981          * when it is being used.
14982          * # When comparing priorities of mappings, higher value
14983          * indicates higher priority.
14984          * For example, a value of 0-3 is returned where 0 is being
14985          * the lowest priority and 3 is being the highest priority.
14986          * # If the correspoding CoS mapping is not enabled, then this
14987          * field should be ignored.
14988          * # This value indicates the normalized priority value retained
14989          * in the HWRM.
14990          */
14991         uint8_t dscp2pri_map_pri;
14992         /*
14993          * This is a 16-bit bit mask that represents the
14994          * current configuration of time stamp capture of PTP messages
14995          * on the receive side of this port.
14996          * If bit 'i' is set, then the receive side of the port
14997          * is configured to capture the time stamp of every
14998          * received PTP message with messageType field value set
14999          * to i.
15000          * If all bits are set to 0 (i.e. field value set 0),
15001          * then the receive side of the port is not configured
15002          * to capture timestamp for PTP messages.
15003          * If all bits are set to 1, then the receive side of the
15004          * port is configured to capture timestamp for all PTP
15005          * messages.
15006          */
15007         uint16_t        rx_ts_capture_ptp_msg_type;
15008         /*
15009          * This is a 16-bit bit mask that represents the
15010          * current configuration of time stamp capture of PTP messages
15011          * on the transmit side of this port.
15012          * If bit 'i' is set, then the transmit side of the port
15013          * is configured to capture the time stamp of every
15014          * received PTP message with messageType field value set
15015          * to i.
15016          * If all bits are set to 0 (i.e. field value set 0),
15017          * then the transmit side of the port is not configured
15018          * to capture timestamp for PTP messages.
15019          * If all bits are set to 1, then the transmit side of the
15020          * port is configured to capture timestamp for all PTP
15021          * messages.
15022          */
15023         uint16_t        tx_ts_capture_ptp_msg_type;
15024         /* Configuration of CoS fields. */
15025         uint8_t cos_field_cfg;
15026         /* Reserved */
15027         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD \
15028                 UINT32_C(0x1)
15029         /*
15030          * This field is used for selecting VLAN PRI value
15031          * based on whether one or two VLAN Tags are present in
15032          * the inner packet headers of tunneled packets or
15033          * non-tunneled packets.
15034          */
15035         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
15036                 UINT32_C(0x6)
15037         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
15038                 1
15039         /*
15040          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
15041          * present in the inner packet headers
15042          */
15043         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
15044                 (UINT32_C(0x0) << 1)
15045         /*
15046          * Select outer VLAN Tag PRI when 2 VLAN Tags are
15047          * present in the inner packet headers.
15048          * No VLAN PRI is selected for this configuration
15049          * if only one VLAN Tag is present in the inner
15050          * packet headers.
15051          */
15052         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
15053                 (UINT32_C(0x1) << 1)
15054         /*
15055          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
15056          * are present in the inner packet headers
15057          */
15058         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
15059                 (UINT32_C(0x2) << 1)
15060         /* Unspecified */
15061         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
15062                 (UINT32_C(0x3) << 1)
15063         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
15064                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
15065         /*
15066          * This field is used for selecting tunnel VLAN PRI value
15067          * based on whether one or two VLAN Tags are present in
15068          * the tunnel headers of tunneled packets. This selection
15069          * does not apply to non-tunneled packets.
15070          */
15071         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
15072                 UINT32_C(0x18)
15073         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
15074                 3
15075         /*
15076          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
15077          * present in the tunnel packet headers
15078          */
15079         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
15080                 (UINT32_C(0x0) << 3)
15081         /*
15082          * Select outer VLAN Tag PRI when 2 VLAN Tags are
15083          * present in the tunnel packet headers.
15084          * No VLAN PRI is selected for this configuration
15085          * if only one VLAN Tag is present in the tunnel
15086          * packet headers.
15087          */
15088         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
15089                 (UINT32_C(0x1) << 3)
15090         /*
15091          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
15092          * are present in the tunnel packet headers
15093          */
15094         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
15095                 (UINT32_C(0x2) << 3)
15096         /* Unspecified */
15097         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
15098                 (UINT32_C(0x3) << 3)
15099         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
15100                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
15101         /*
15102          * This field is used to provide default CoS value that
15103          * has been configured on this port.
15104          */
15105         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
15106                 UINT32_C(0xe0)
15107         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
15108                 5
15109         /*
15110          * This field is used in Output records to indicate that the output
15111          * is completely written to RAM.  This field should be read as '1'
15112          * to indicate that the output has been completely written.
15113          * When writing a command completion or response to an internal processor,
15114          * the order of writes has to be such that this field is written last.
15115          */
15116         uint8_t valid;
15117 } __attribute__((packed));
15118
15119 /**************************
15120  * hwrm_port_mac_ptp_qcfg *
15121  **************************/
15122
15123
15124 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
15125 struct hwrm_port_mac_ptp_qcfg_input {
15126         /* The HWRM command request type. */
15127         uint16_t        req_type;
15128         /*
15129          * The completion ring to send the completion event on. This should
15130          * be the NQ ID returned from the `nq_alloc` HWRM command.
15131          */
15132         uint16_t        cmpl_ring;
15133         /*
15134          * The sequence ID is used by the driver for tracking multiple
15135          * commands. This ID is treated as opaque data by the firmware and
15136          * the value is returned in the `hwrm_resp_hdr` upon completion.
15137          */
15138         uint16_t        seq_id;
15139         /*
15140          * The target ID of the command:
15141          * * 0x0-0xFFF8 - The function ID
15142          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15143          * * 0xFFFD - Reserved for user-space HWRM interface
15144          * * 0xFFFF - HWRM
15145          */
15146         uint16_t        target_id;
15147         /*
15148          * A physical address pointer pointing to a host buffer that the
15149          * command's response data will be written. This can be either a host
15150          * physical address (HPA) or a guest physical address (GPA) and must
15151          * point to a physically contiguous block of memory.
15152          */
15153         uint64_t        resp_addr;
15154         /* Port ID of port that is being queried. */
15155         uint16_t        port_id;
15156         uint8_t unused_0[6];
15157 } __attribute__((packed));
15158
15159 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */
15160 struct hwrm_port_mac_ptp_qcfg_output {
15161         /* The specific error status for the command. */
15162         uint16_t        error_code;
15163         /* The HWRM command request type. */
15164         uint16_t        req_type;
15165         /* The sequence ID from the original command. */
15166         uint16_t        seq_id;
15167         /* The length of the response data in number of bytes. */
15168         uint16_t        resp_len;
15169         /*
15170          * In this field, a number of PTP related flags
15171          * are used to indicate configured PTP capabilities.
15172          */
15173         uint8_t flags;
15174         /*
15175          * When this bit is set to '1', the PTP related registers are
15176          * directly accessible by the host.
15177          */
15178         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS \
15179                 UINT32_C(0x1)
15180         /*
15181          * When this bit is set to '1', the PTP information is accessible
15182          * via HWRM commands.
15183          */
15184         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS \
15185                 UINT32_C(0x2)
15186         /*
15187          * When this bit is set to '1', the device supports one-step
15188          * Tx timestamping.
15189          */
15190         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS \
15191                 UINT32_C(0x4)
15192         uint8_t unused_0[3];
15193         /* Offset of the PTP register for the lower 32 bits of timestamp for RX. */
15194         uint32_t        rx_ts_reg_off_lower;
15195         /* Offset of the PTP register for the upper 32 bits of timestamp for RX. */
15196         uint32_t        rx_ts_reg_off_upper;
15197         /* Offset of the PTP register for the sequence ID for RX. */
15198         uint32_t        rx_ts_reg_off_seq_id;
15199         /* Offset of the first PTP source ID for RX. */
15200         uint32_t        rx_ts_reg_off_src_id_0;
15201         /* Offset of the second PTP source ID for RX. */
15202         uint32_t        rx_ts_reg_off_src_id_1;
15203         /* Offset of the third PTP source ID for RX. */
15204         uint32_t        rx_ts_reg_off_src_id_2;
15205         /* Offset of the domain ID for RX. */
15206         uint32_t        rx_ts_reg_off_domain_id;
15207         /* Offset of the PTP FIFO register for RX. */
15208         uint32_t        rx_ts_reg_off_fifo;
15209         /* Offset of the PTP advance FIFO register for RX. */
15210         uint32_t        rx_ts_reg_off_fifo_adv;
15211         /* PTP timestamp granularity for RX. */
15212         uint32_t        rx_ts_reg_off_granularity;
15213         /* Offset of the PTP register for the lower 32 bits of timestamp for TX. */
15214         uint32_t        tx_ts_reg_off_lower;
15215         /* Offset of the PTP register for the upper 32 bits of timestamp for TX. */
15216         uint32_t        tx_ts_reg_off_upper;
15217         /* Offset of the PTP register for the sequence ID for TX. */
15218         uint32_t        tx_ts_reg_off_seq_id;
15219         /* Offset of the PTP FIFO register for TX. */
15220         uint32_t        tx_ts_reg_off_fifo;
15221         /* PTP timestamp granularity for TX. */
15222         uint32_t        tx_ts_reg_off_granularity;
15223         uint8_t unused_1[7];
15224         /*
15225          * This field is used in Output records to indicate that the output
15226          * is completely written to RAM.  This field should be read as '1'
15227          * to indicate that the output has been completely written.
15228          * When writing a command completion or response to an internal processor,
15229          * the order of writes has to be such that this field is written last.
15230          */
15231         uint8_t valid;
15232 } __attribute__((packed));
15233
15234 /* Port Tx Statistics Formats */
15235 /* tx_port_stats (size:3264b/408B) */
15236 struct tx_port_stats {
15237         /* Total Number of 64 Bytes frames transmitted */
15238         uint64_t        tx_64b_frames;
15239         /* Total Number of 65-127 Bytes frames transmitted */
15240         uint64_t        tx_65b_127b_frames;
15241         /* Total Number of 128-255 Bytes frames transmitted */
15242         uint64_t        tx_128b_255b_frames;
15243         /* Total Number of 256-511 Bytes frames transmitted */
15244         uint64_t        tx_256b_511b_frames;
15245         /* Total Number of 512-1023 Bytes frames transmitted */
15246         uint64_t        tx_512b_1023b_frames;
15247         /* Total Number of 1024-1518 Bytes frames transmitted */
15248         uint64_t        tx_1024b_1518b_frames;
15249         /*
15250          * Total Number of each good VLAN (exludes FCS errors)
15251          * frame transmitted which is 1519 to 1522 bytes in length
15252          * inclusive (excluding framing bits but including FCS bytes).
15253          */
15254         uint64_t        tx_good_vlan_frames;
15255         /* Total Number of 1519-2047 Bytes frames transmitted */
15256         uint64_t        tx_1519b_2047b_frames;
15257         /* Total Number of 2048-4095 Bytes frames transmitted */
15258         uint64_t        tx_2048b_4095b_frames;
15259         /* Total Number of 4096-9216 Bytes frames transmitted */
15260         uint64_t        tx_4096b_9216b_frames;
15261         /* Total Number of 9217-16383 Bytes frames transmitted */
15262         uint64_t        tx_9217b_16383b_frames;
15263         /* Total Number of good frames transmitted */
15264         uint64_t        tx_good_frames;
15265         /* Total Number of frames transmitted */
15266         uint64_t        tx_total_frames;
15267         /* Total number of unicast frames transmitted */
15268         uint64_t        tx_ucast_frames;
15269         /* Total number of multicast frames transmitted */
15270         uint64_t        tx_mcast_frames;
15271         /* Total number of broadcast frames transmitted */
15272         uint64_t        tx_bcast_frames;
15273         /* Total number of PAUSE control frames transmitted */
15274         uint64_t        tx_pause_frames;
15275         /*
15276          * Total number of PFC/per-priority PAUSE
15277          * control frames transmitted
15278          */
15279         uint64_t        tx_pfc_frames;
15280         /* Total number of jabber frames transmitted */
15281         uint64_t        tx_jabber_frames;
15282         /* Total number of frames transmitted with FCS error */
15283         uint64_t        tx_fcs_err_frames;
15284         /* Total number of control frames transmitted */
15285         uint64_t        tx_control_frames;
15286         /* Total number of over-sized frames transmitted */
15287         uint64_t        tx_oversz_frames;
15288         /* Total number of frames with single deferral */
15289         uint64_t        tx_single_dfrl_frames;
15290         /* Total number of frames with multiple deferrals */
15291         uint64_t        tx_multi_dfrl_frames;
15292         /* Total number of frames with single collision */
15293         uint64_t        tx_single_coll_frames;
15294         /* Total number of frames with multiple collisions */
15295         uint64_t        tx_multi_coll_frames;
15296         /* Total number of frames with late collisions */
15297         uint64_t        tx_late_coll_frames;
15298         /* Total number of frames with excessive collisions */
15299         uint64_t        tx_excessive_coll_frames;
15300         /* Total number of fragmented frames transmitted */
15301         uint64_t        tx_frag_frames;
15302         /* Total number of transmit errors */
15303         uint64_t        tx_err;
15304         /* Total number of single VLAN tagged frames transmitted */
15305         uint64_t        tx_tagged_frames;
15306         /* Total number of double VLAN tagged frames transmitted */
15307         uint64_t        tx_dbl_tagged_frames;
15308         /* Total number of runt frames transmitted */
15309         uint64_t        tx_runt_frames;
15310         /* Total number of TX FIFO under runs */
15311         uint64_t        tx_fifo_underruns;
15312         /*
15313          * Total number of PFC frames with PFC enabled bit for
15314          * Pri 0 transmitted
15315          */
15316         uint64_t        tx_pfc_ena_frames_pri0;
15317         /*
15318          * Total number of PFC frames with PFC enabled bit for
15319          * Pri 1 transmitted
15320          */
15321         uint64_t        tx_pfc_ena_frames_pri1;
15322         /*
15323          * Total number of PFC frames with PFC enabled bit for
15324          * Pri 2 transmitted
15325          */
15326         uint64_t        tx_pfc_ena_frames_pri2;
15327         /*
15328          * Total number of PFC frames with PFC enabled bit for
15329          * Pri 3 transmitted
15330          */
15331         uint64_t        tx_pfc_ena_frames_pri3;
15332         /*
15333          * Total number of PFC frames with PFC enabled bit for
15334          * Pri 4 transmitted
15335          */
15336         uint64_t        tx_pfc_ena_frames_pri4;
15337         /*
15338          * Total number of PFC frames with PFC enabled bit for
15339          * Pri 5 transmitted
15340          */
15341         uint64_t        tx_pfc_ena_frames_pri5;
15342         /*
15343          * Total number of PFC frames with PFC enabled bit for
15344          * Pri 6 transmitted
15345          */
15346         uint64_t        tx_pfc_ena_frames_pri6;
15347         /*
15348          * Total number of PFC frames with PFC enabled bit for
15349          * Pri 7 transmitted
15350          */
15351         uint64_t        tx_pfc_ena_frames_pri7;
15352         /* Total number of EEE LPI Events on TX */
15353         uint64_t        tx_eee_lpi_events;
15354         /* EEE LPI Duration Counter on TX */
15355         uint64_t        tx_eee_lpi_duration;
15356         /*
15357          * Total number of Link Level Flow Control (LLFC) messages
15358          * transmitted
15359          */
15360         uint64_t        tx_llfc_logical_msgs;
15361         /* Total number of HCFC messages transmitted */
15362         uint64_t        tx_hcfc_msgs;
15363         /* Total number of TX collisions */
15364         uint64_t        tx_total_collisions;
15365         /* Total number of transmitted bytes */
15366         uint64_t        tx_bytes;
15367         /* Total number of end-to-end HOL frames */
15368         uint64_t        tx_xthol_frames;
15369         /* Total Tx Drops per Port reported by STATS block */
15370         uint64_t        tx_stat_discard;
15371         /* Total Tx Error Drops per Port reported by STATS block */
15372         uint64_t        tx_stat_error;
15373 } __attribute__((packed));
15374
15375 /* Port Rx Statistics Formats */
15376 /* rx_port_stats (size:4224b/528B) */
15377 struct rx_port_stats {
15378         /* Total Number of 64 Bytes frames received */
15379         uint64_t        rx_64b_frames;
15380         /* Total Number of 65-127 Bytes frames received */
15381         uint64_t        rx_65b_127b_frames;
15382         /* Total Number of 128-255 Bytes frames received */
15383         uint64_t        rx_128b_255b_frames;
15384         /* Total Number of 256-511 Bytes frames received */
15385         uint64_t        rx_256b_511b_frames;
15386         /* Total Number of 512-1023 Bytes frames received */
15387         uint64_t        rx_512b_1023b_frames;
15388         /* Total Number of 1024-1518 Bytes frames received */
15389         uint64_t        rx_1024b_1518b_frames;
15390         /*
15391          * Total Number of each good VLAN (exludes FCS errors)
15392          * frame received which is 1519 to 1522 bytes in length
15393          * inclusive (excluding framing bits but including FCS bytes).
15394          */
15395         uint64_t        rx_good_vlan_frames;
15396         /* Total Number of 1519-2047 Bytes frames received */
15397         uint64_t        rx_1519b_2047b_frames;
15398         /* Total Number of 2048-4095 Bytes frames received */
15399         uint64_t        rx_2048b_4095b_frames;
15400         /* Total Number of 4096-9216 Bytes frames received */
15401         uint64_t        rx_4096b_9216b_frames;
15402         /* Total Number of 9217-16383 Bytes frames received */
15403         uint64_t        rx_9217b_16383b_frames;
15404         /* Total number of frames received */
15405         uint64_t        rx_total_frames;
15406         /* Total number of unicast frames received */
15407         uint64_t        rx_ucast_frames;
15408         /* Total number of multicast frames received */
15409         uint64_t        rx_mcast_frames;
15410         /* Total number of broadcast frames received */
15411         uint64_t        rx_bcast_frames;
15412         /* Total number of received frames with FCS error */
15413         uint64_t        rx_fcs_err_frames;
15414         /* Total number of control frames received */
15415         uint64_t        rx_ctrl_frames;
15416         /* Total number of PAUSE frames received */
15417         uint64_t        rx_pause_frames;
15418         /* Total number of PFC frames received */
15419         uint64_t        rx_pfc_frames;
15420         /*
15421          * Total number of frames received with an unsupported
15422          * opcode
15423          */
15424         uint64_t        rx_unsupported_opcode_frames;
15425         /*
15426          * Total number of frames received with an unsupported
15427          * DA for pause and PFC
15428          */
15429         uint64_t        rx_unsupported_da_pausepfc_frames;
15430         /* Total number of frames received with an unsupported SA */
15431         uint64_t        rx_wrong_sa_frames;
15432         /* Total number of received packets with alignment error */
15433         uint64_t        rx_align_err_frames;
15434         /* Total number of received frames with out-of-range length */
15435         uint64_t        rx_oor_len_frames;
15436         /* Total number of received frames with error termination */
15437         uint64_t        rx_code_err_frames;
15438         /*
15439          * Total number of received frames with a false carrier is
15440          * detected during idle, as defined by RX_ER samples active
15441          * and RXD is 0xE. The event is reported along with the
15442          * statistics generated on the next received frame. Only
15443          * one false carrier condition can be detected and logged
15444          * between frames.
15445          *
15446          * Carrier event, valid for 10M/100M speed modes only.
15447          */
15448         uint64_t        rx_false_carrier_frames;
15449         /* Total number of over-sized frames received */
15450         uint64_t        rx_ovrsz_frames;
15451         /* Total number of jabber packets received */
15452         uint64_t        rx_jbr_frames;
15453         /* Total number of received frames with MTU error */
15454         uint64_t        rx_mtu_err_frames;
15455         /* Total number of received frames with CRC match */
15456         uint64_t        rx_match_crc_frames;
15457         /* Total number of frames received promiscuously */
15458         uint64_t        rx_promiscuous_frames;
15459         /*
15460          * Total number of received frames with one or two VLAN
15461          * tags
15462          */
15463         uint64_t        rx_tagged_frames;
15464         /* Total number of received frames with two VLAN tags */
15465         uint64_t        rx_double_tagged_frames;
15466         /* Total number of truncated frames received */
15467         uint64_t        rx_trunc_frames;
15468         /* Total number of good frames (without errors) received */
15469         uint64_t        rx_good_frames;
15470         /*
15471          * Total number of received PFC frames with transition from
15472          * XON to XOFF on Pri 0
15473          */
15474         uint64_t        rx_pfc_xon2xoff_frames_pri0;
15475         /*
15476          * Total number of received PFC frames with transition from
15477          * XON to XOFF on Pri 1
15478          */
15479         uint64_t        rx_pfc_xon2xoff_frames_pri1;
15480         /*
15481          * Total number of received PFC frames with transition from
15482          * XON to XOFF on Pri 2
15483          */
15484         uint64_t        rx_pfc_xon2xoff_frames_pri2;
15485         /*
15486          * Total number of received PFC frames with transition from
15487          * XON to XOFF on Pri 3
15488          */
15489         uint64_t        rx_pfc_xon2xoff_frames_pri3;
15490         /*
15491          * Total number of received PFC frames with transition from
15492          * XON to XOFF on Pri 4
15493          */
15494         uint64_t        rx_pfc_xon2xoff_frames_pri4;
15495         /*
15496          * Total number of received PFC frames with transition from
15497          * XON to XOFF on Pri 5
15498          */
15499         uint64_t        rx_pfc_xon2xoff_frames_pri5;
15500         /*
15501          * Total number of received PFC frames with transition from
15502          * XON to XOFF on Pri 6
15503          */
15504         uint64_t        rx_pfc_xon2xoff_frames_pri6;
15505         /*
15506          * Total number of received PFC frames with transition from
15507          * XON to XOFF on Pri 7
15508          */
15509         uint64_t        rx_pfc_xon2xoff_frames_pri7;
15510         /*
15511          * Total number of received PFC frames with PFC enabled
15512          * bit for Pri 0
15513          */
15514         uint64_t        rx_pfc_ena_frames_pri0;
15515         /*
15516          * Total number of received PFC frames with PFC enabled
15517          * bit for Pri 1
15518          */
15519         uint64_t        rx_pfc_ena_frames_pri1;
15520         /*
15521          * Total number of received PFC frames with PFC enabled
15522          * bit for Pri 2
15523          */
15524         uint64_t        rx_pfc_ena_frames_pri2;
15525         /*
15526          * Total number of received PFC frames with PFC enabled
15527          * bit for Pri 3
15528          */
15529         uint64_t        rx_pfc_ena_frames_pri3;
15530         /*
15531          * Total number of received PFC frames with PFC enabled
15532          * bit for Pri 4
15533          */
15534         uint64_t        rx_pfc_ena_frames_pri4;
15535         /*
15536          * Total number of received PFC frames with PFC enabled
15537          * bit for Pri 5
15538          */
15539         uint64_t        rx_pfc_ena_frames_pri5;
15540         /*
15541          * Total number of received PFC frames with PFC enabled
15542          * bit for Pri 6
15543          */
15544         uint64_t        rx_pfc_ena_frames_pri6;
15545         /*
15546          * Total number of received PFC frames with PFC enabled
15547          * bit for Pri 7
15548          */
15549         uint64_t        rx_pfc_ena_frames_pri7;
15550         /* Total Number of frames received with SCH CRC error */
15551         uint64_t        rx_sch_crc_err_frames;
15552         /* Total Number of under-sized frames received */
15553         uint64_t        rx_undrsz_frames;
15554         /* Total Number of fragmented frames received */
15555         uint64_t        rx_frag_frames;
15556         /* Total number of RX EEE LPI Events */
15557         uint64_t        rx_eee_lpi_events;
15558         /* EEE LPI Duration Counter on RX */
15559         uint64_t        rx_eee_lpi_duration;
15560         /*
15561          * Total number of physical type Link Level Flow Control
15562          * (LLFC) messages received
15563          */
15564         uint64_t        rx_llfc_physical_msgs;
15565         /*
15566          * Total number of logical type Link Level Flow Control
15567          * (LLFC) messages received
15568          */
15569         uint64_t        rx_llfc_logical_msgs;
15570         /*
15571          * Total number of logical type Link Level Flow Control
15572          * (LLFC) messages received with CRC error
15573          */
15574         uint64_t        rx_llfc_msgs_with_crc_err;
15575         /* Total number of HCFC messages received */
15576         uint64_t        rx_hcfc_msgs;
15577         /* Total number of HCFC messages received with CRC error */
15578         uint64_t        rx_hcfc_msgs_with_crc_err;
15579         /* Total number of received bytes */
15580         uint64_t        rx_bytes;
15581         /* Total number of bytes received in runt frames */
15582         uint64_t        rx_runt_bytes;
15583         /* Total number of runt frames received */
15584         uint64_t        rx_runt_frames;
15585         /* Total Rx Discards per Port reported by STATS block */
15586         uint64_t        rx_stat_discard;
15587         uint64_t        rx_stat_err;
15588 } __attribute__((packed));
15589
15590 /********************
15591  * hwrm_port_qstats *
15592  ********************/
15593
15594
15595 /* hwrm_port_qstats_input (size:320b/40B) */
15596 struct hwrm_port_qstats_input {
15597         /* The HWRM command request type. */
15598         uint16_t        req_type;
15599         /*
15600          * The completion ring to send the completion event on. This should
15601          * be the NQ ID returned from the `nq_alloc` HWRM command.
15602          */
15603         uint16_t        cmpl_ring;
15604         /*
15605          * The sequence ID is used by the driver for tracking multiple
15606          * commands. This ID is treated as opaque data by the firmware and
15607          * the value is returned in the `hwrm_resp_hdr` upon completion.
15608          */
15609         uint16_t        seq_id;
15610         /*
15611          * The target ID of the command:
15612          * * 0x0-0xFFF8 - The function ID
15613          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15614          * * 0xFFFD - Reserved for user-space HWRM interface
15615          * * 0xFFFF - HWRM
15616          */
15617         uint16_t        target_id;
15618         /*
15619          * A physical address pointer pointing to a host buffer that the
15620          * command's response data will be written. This can be either a host
15621          * physical address (HPA) or a guest physical address (GPA) and must
15622          * point to a physically contiguous block of memory.
15623          */
15624         uint64_t        resp_addr;
15625         /* Port ID of port that is being queried. */
15626         uint16_t        port_id;
15627         uint8_t unused_0[6];
15628         /*
15629          * This is the host address where
15630          * Tx port statistics will be stored
15631          */
15632         uint64_t        tx_stat_host_addr;
15633         /*
15634          * This is the host address where
15635          * Rx port statistics will be stored
15636          */
15637         uint64_t        rx_stat_host_addr;
15638 } __attribute__((packed));
15639
15640 /* hwrm_port_qstats_output (size:128b/16B) */
15641 struct hwrm_port_qstats_output {
15642         /* The specific error status for the command. */
15643         uint16_t        error_code;
15644         /* The HWRM command request type. */
15645         uint16_t        req_type;
15646         /* The sequence ID from the original command. */
15647         uint16_t        seq_id;
15648         /* The length of the response data in number of bytes. */
15649         uint16_t        resp_len;
15650         /* The size of TX port statistics block in bytes. */
15651         uint16_t        tx_stat_size;
15652         /* The size of RX port statistics block in bytes. */
15653         uint16_t        rx_stat_size;
15654         uint8_t unused_0[3];
15655         /*
15656          * This field is used in Output records to indicate that the output
15657          * is completely written to RAM.  This field should be read as '1'
15658          * to indicate that the output has been completely written.
15659          * When writing a command completion or response to an internal processor,
15660          * the order of writes has to be such that this field is written last.
15661          */
15662         uint8_t valid;
15663 } __attribute__((packed));
15664
15665 /* Port Tx Statistics extended Formats */
15666 /* tx_port_stats_ext (size:2048b/256B) */
15667 struct tx_port_stats_ext {
15668         /* Total number of tx bytes count on cos queue 0 */
15669         uint64_t        tx_bytes_cos0;
15670         /* Total number of tx bytes count on cos queue 1 */
15671         uint64_t        tx_bytes_cos1;
15672         /* Total number of tx bytes count on cos queue 2 */
15673         uint64_t        tx_bytes_cos2;
15674         /* Total number of tx bytes count on cos queue 3 */
15675         uint64_t        tx_bytes_cos3;
15676         /* Total number of tx bytes count on cos queue 4 */
15677         uint64_t        tx_bytes_cos4;
15678         /* Total number of tx bytes count on cos queue 5 */
15679         uint64_t        tx_bytes_cos5;
15680         /* Total number of tx bytes count on cos queue 6 */
15681         uint64_t        tx_bytes_cos6;
15682         /* Total number of tx bytes count on cos queue 7 */
15683         uint64_t        tx_bytes_cos7;
15684         /* Total number of tx packets count on cos queue 0 */
15685         uint64_t        tx_packets_cos0;
15686         /* Total number of tx packets count on cos queue 1 */
15687         uint64_t        tx_packets_cos1;
15688         /* Total number of tx packets count on cos queue 2 */
15689         uint64_t        tx_packets_cos2;
15690         /* Total number of tx packets count on cos queue 3 */
15691         uint64_t        tx_packets_cos3;
15692         /* Total number of tx packets count on cos queue 4 */
15693         uint64_t        tx_packets_cos4;
15694         /* Total number of tx packets count on cos queue 5 */
15695         uint64_t        tx_packets_cos5;
15696         /* Total number of tx packets count on cos queue 6 */
15697         uint64_t        tx_packets_cos6;
15698         /* Total number of tx packets count on cos queue 7 */
15699         uint64_t        tx_packets_cos7;
15700         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
15701         uint64_t        pfc_pri0_tx_duration_us;
15702         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
15703         uint64_t        pfc_pri0_tx_transitions;
15704         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
15705         uint64_t        pfc_pri1_tx_duration_us;
15706         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
15707         uint64_t        pfc_pri1_tx_transitions;
15708         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
15709         uint64_t        pfc_pri2_tx_duration_us;
15710         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
15711         uint64_t        pfc_pri2_tx_transitions;
15712         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
15713         uint64_t        pfc_pri3_tx_duration_us;
15714         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
15715         uint64_t        pfc_pri3_tx_transitions;
15716         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
15717         uint64_t        pfc_pri4_tx_duration_us;
15718         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
15719         uint64_t        pfc_pri4_tx_transitions;
15720         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
15721         uint64_t        pfc_pri5_tx_duration_us;
15722         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
15723         uint64_t        pfc_pri5_tx_transitions;
15724         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
15725         uint64_t        pfc_pri6_tx_duration_us;
15726         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
15727         uint64_t        pfc_pri6_tx_transitions;
15728         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
15729         uint64_t        pfc_pri7_tx_duration_us;
15730         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
15731         uint64_t        pfc_pri7_tx_transitions;
15732 } __attribute__((packed));
15733
15734 /* Port Rx Statistics extended Formats */
15735 /* rx_port_stats_ext (size:3648b/456B) */
15736 struct rx_port_stats_ext {
15737         /* Number of times link state changed to down */
15738         uint64_t        link_down_events;
15739         /* Number of times the idle rings with pause bit are found */
15740         uint64_t        continuous_pause_events;
15741         /* Number of times the active rings pause bit resumed back */
15742         uint64_t        resume_pause_events;
15743         /* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */
15744         uint64_t        continuous_roce_pause_events;
15745         /* Number of times, the ROCE cos queue PFC is enabled back */
15746         uint64_t        resume_roce_pause_events;
15747         /* Total number of rx bytes count on cos queue 0 */
15748         uint64_t        rx_bytes_cos0;
15749         /* Total number of rx bytes count on cos queue 1 */
15750         uint64_t        rx_bytes_cos1;
15751         /* Total number of rx bytes count on cos queue 2 */
15752         uint64_t        rx_bytes_cos2;
15753         /* Total number of rx bytes count on cos queue 3 */
15754         uint64_t        rx_bytes_cos3;
15755         /* Total number of rx bytes count on cos queue 4 */
15756         uint64_t        rx_bytes_cos4;
15757         /* Total number of rx bytes count on cos queue 5 */
15758         uint64_t        rx_bytes_cos5;
15759         /* Total number of rx bytes count on cos queue 6 */
15760         uint64_t        rx_bytes_cos6;
15761         /* Total number of rx bytes count on cos queue 7 */
15762         uint64_t        rx_bytes_cos7;
15763         /* Total number of rx packets count on cos queue 0 */
15764         uint64_t        rx_packets_cos0;
15765         /* Total number of rx packets count on cos queue 1 */
15766         uint64_t        rx_packets_cos1;
15767         /* Total number of rx packets count on cos queue 2 */
15768         uint64_t        rx_packets_cos2;
15769         /* Total number of rx packets count on cos queue 3 */
15770         uint64_t        rx_packets_cos3;
15771         /* Total number of rx packets count on cos queue 4 */
15772         uint64_t        rx_packets_cos4;
15773         /* Total number of rx packets count on cos queue 5 */
15774         uint64_t        rx_packets_cos5;
15775         /* Total number of rx packets count on cos queue 6 */
15776         uint64_t        rx_packets_cos6;
15777         /* Total number of rx packets count on cos queue 7 */
15778         uint64_t        rx_packets_cos7;
15779         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
15780         uint64_t        pfc_pri0_rx_duration_us;
15781         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
15782         uint64_t        pfc_pri0_rx_transitions;
15783         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
15784         uint64_t        pfc_pri1_rx_duration_us;
15785         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
15786         uint64_t        pfc_pri1_rx_transitions;
15787         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
15788         uint64_t        pfc_pri2_rx_duration_us;
15789         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
15790         uint64_t        pfc_pri2_rx_transitions;
15791         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
15792         uint64_t        pfc_pri3_rx_duration_us;
15793         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
15794         uint64_t        pfc_pri3_rx_transitions;
15795         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
15796         uint64_t        pfc_pri4_rx_duration_us;
15797         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
15798         uint64_t        pfc_pri4_rx_transitions;
15799         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
15800         uint64_t        pfc_pri5_rx_duration_us;
15801         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
15802         uint64_t        pfc_pri5_rx_transitions;
15803         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
15804         uint64_t        pfc_pri6_rx_duration_us;
15805         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
15806         uint64_t        pfc_pri6_rx_transitions;
15807         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
15808         uint64_t        pfc_pri7_rx_duration_us;
15809         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
15810         uint64_t        pfc_pri7_rx_transitions;
15811         /* Total number of received bits */
15812         uint64_t        rx_bits;
15813         /* The number of events where the port receive buffer was over 85% full */
15814         uint64_t        rx_buffer_passed_threshold;
15815         /*
15816          * The number of symbol errors that wasn't corrected by FEC correction
15817          * alogirithm
15818          */
15819         uint64_t        rx_pcs_symbol_err;
15820         /* The number of corrected bits on the port according to active FEC */
15821         uint64_t        rx_corrected_bits;
15822         /* Total number of rx discard bytes count on cos queue 0 */
15823         uint64_t        rx_discard_bytes_cos0;
15824         /* Total number of rx discard bytes count on cos queue 1 */
15825         uint64_t        rx_discard_bytes_cos1;
15826         /* Total number of rx discard bytes count on cos queue 2 */
15827         uint64_t        rx_discard_bytes_cos2;
15828         /* Total number of rx discard bytes count on cos queue 3 */
15829         uint64_t        rx_discard_bytes_cos3;
15830         /* Total number of rx discard bytes count on cos queue 4 */
15831         uint64_t        rx_discard_bytes_cos4;
15832         /* Total number of rx discard bytes count on cos queue 5 */
15833         uint64_t        rx_discard_bytes_cos5;
15834         /* Total number of rx discard bytes count on cos queue 6 */
15835         uint64_t        rx_discard_bytes_cos6;
15836         /* Total number of rx discard bytes count on cos queue 7 */
15837         uint64_t        rx_discard_bytes_cos7;
15838         /* Total number of rx discard packets count on cos queue 0 */
15839         uint64_t        rx_discard_packets_cos0;
15840         /* Total number of rx discard packets count on cos queue 1 */
15841         uint64_t        rx_discard_packets_cos1;
15842         /* Total number of rx discard packets count on cos queue 2 */
15843         uint64_t        rx_discard_packets_cos2;
15844         /* Total number of rx discard packets count on cos queue 3 */
15845         uint64_t        rx_discard_packets_cos3;
15846         /* Total number of rx discard packets count on cos queue 4 */
15847         uint64_t        rx_discard_packets_cos4;
15848         /* Total number of rx discard packets count on cos queue 5 */
15849         uint64_t        rx_discard_packets_cos5;
15850         /* Total number of rx discard packets count on cos queue 6 */
15851         uint64_t        rx_discard_packets_cos6;
15852         /* Total number of rx discard packets count on cos queue 7 */
15853         uint64_t        rx_discard_packets_cos7;
15854 } __attribute__((packed));
15855
15856 /************************
15857  * hwrm_port_qstats_ext *
15858  ************************/
15859
15860
15861 /* hwrm_port_qstats_ext_input (size:320b/40B) */
15862 struct hwrm_port_qstats_ext_input {
15863         /* The HWRM command request type. */
15864         uint16_t        req_type;
15865         /*
15866          * The completion ring to send the completion event on. This should
15867          * be the NQ ID returned from the `nq_alloc` HWRM command.
15868          */
15869         uint16_t        cmpl_ring;
15870         /*
15871          * The sequence ID is used by the driver for tracking multiple
15872          * commands. This ID is treated as opaque data by the firmware and
15873          * the value is returned in the `hwrm_resp_hdr` upon completion.
15874          */
15875         uint16_t        seq_id;
15876         /*
15877          * The target ID of the command:
15878          * * 0x0-0xFFF8 - The function ID
15879          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15880          * * 0xFFFD - Reserved for user-space HWRM interface
15881          * * 0xFFFF - HWRM
15882          */
15883         uint16_t        target_id;
15884         /*
15885          * A physical address pointer pointing to a host buffer that the
15886          * command's response data will be written. This can be either a host
15887          * physical address (HPA) or a guest physical address (GPA) and must
15888          * point to a physically contiguous block of memory.
15889          */
15890         uint64_t        resp_addr;
15891         /* Port ID of port that is being queried. */
15892         uint16_t        port_id;
15893         /*
15894          * The size of TX port extended
15895          * statistics block in bytes.
15896          */
15897         uint16_t        tx_stat_size;
15898         /*
15899          * The size of RX port extended
15900          * statistics block in bytes
15901          */
15902         uint16_t        rx_stat_size;
15903         uint8_t unused_0[2];
15904         /*
15905          * This is the host address where
15906          * Tx port statistics will be stored
15907          */
15908         uint64_t        tx_stat_host_addr;
15909         /*
15910          * This is the host address where
15911          * Rx port statistics will be stored
15912          */
15913         uint64_t        rx_stat_host_addr;
15914 } __attribute__((packed));
15915
15916 /* hwrm_port_qstats_ext_output (size:128b/16B) */
15917 struct hwrm_port_qstats_ext_output {
15918         /* The specific error status for the command. */
15919         uint16_t        error_code;
15920         /* The HWRM command request type. */
15921         uint16_t        req_type;
15922         /* The sequence ID from the original command. */
15923         uint16_t        seq_id;
15924         /* The length of the response data in number of bytes. */
15925         uint16_t        resp_len;
15926         /* The size of TX port statistics block in bytes. */
15927         uint16_t        tx_stat_size;
15928         /* The size of RX port statistics block in bytes. */
15929         uint16_t        rx_stat_size;
15930         /* Total number of active cos queues available. */
15931         uint16_t        total_active_cos_queues;
15932         uint8_t flags;
15933         /*
15934          * If set to 1, then this field indicates that clear
15935          * roce specific counters is supported.
15936          */
15937         #define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED \
15938                 UINT32_C(0x1)
15939         /*
15940          * This field is used in Output records to indicate that the output
15941          * is completely written to RAM.  This field should be read as '1'
15942          * to indicate that the output has been completely written.
15943          * When writing a command completion or response to an internal processor,
15944          * the order of writes has to be such that this field is written last.
15945          */
15946         uint8_t valid;
15947 } __attribute__((packed));
15948
15949 /*************************
15950  * hwrm_port_lpbk_qstats *
15951  *************************/
15952
15953
15954 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */
15955 struct hwrm_port_lpbk_qstats_input {
15956         /* The HWRM command request type. */
15957         uint16_t        req_type;
15958         /*
15959          * The completion ring to send the completion event on. This should
15960          * be the NQ ID returned from the `nq_alloc` HWRM command.
15961          */
15962         uint16_t        cmpl_ring;
15963         /*
15964          * The sequence ID is used by the driver for tracking multiple
15965          * commands. This ID is treated as opaque data by the firmware and
15966          * the value is returned in the `hwrm_resp_hdr` upon completion.
15967          */
15968         uint16_t        seq_id;
15969         /*
15970          * The target ID of the command:
15971          * * 0x0-0xFFF8 - The function ID
15972          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15973          * * 0xFFFD - Reserved for user-space HWRM interface
15974          * * 0xFFFF - HWRM
15975          */
15976         uint16_t        target_id;
15977         /*
15978          * A physical address pointer pointing to a host buffer that the
15979          * command's response data will be written. This can be either a host
15980          * physical address (HPA) or a guest physical address (GPA) and must
15981          * point to a physically contiguous block of memory.
15982          */
15983         uint64_t        resp_addr;
15984 } __attribute__((packed));
15985
15986 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
15987 struct hwrm_port_lpbk_qstats_output {
15988         /* The specific error status for the command. */
15989         uint16_t        error_code;
15990         /* The HWRM command request type. */
15991         uint16_t        req_type;
15992         /* The sequence ID from the original command. */
15993         uint16_t        seq_id;
15994         /* The length of the response data in number of bytes. */
15995         uint16_t        resp_len;
15996         /* Number of transmitted unicast frames */
15997         uint64_t        lpbk_ucast_frames;
15998         /* Number of transmitted multicast frames */
15999         uint64_t        lpbk_mcast_frames;
16000         /* Number of transmitted broadcast frames */
16001         uint64_t        lpbk_bcast_frames;
16002         /* Number of transmitted bytes for unicast traffic */
16003         uint64_t        lpbk_ucast_bytes;
16004         /* Number of transmitted bytes for multicast traffic */
16005         uint64_t        lpbk_mcast_bytes;
16006         /* Number of transmitted bytes for broadcast traffic */
16007         uint64_t        lpbk_bcast_bytes;
16008         /* Total Tx Drops for loopback traffic reported by STATS block */
16009         uint64_t        tx_stat_discard;
16010         /* Total Tx Error Drops for loopback traffic reported by STATS block */
16011         uint64_t        tx_stat_error;
16012         /* Total Rx Drops for loopback traffic reported by STATS block */
16013         uint64_t        rx_stat_discard;
16014         /* Total Rx Error Drops for loopback traffic reported by STATS block */
16015         uint64_t        rx_stat_error;
16016         uint8_t unused_0[7];
16017         /*
16018          * This field is used in Output records to indicate that the output
16019          * is completely written to RAM.  This field should be read as '1'
16020          * to indicate that the output has been completely written.
16021          * When writing a command completion or response to an internal processor,
16022          * the order of writes has to be such that this field is written last.
16023          */
16024         uint8_t valid;
16025 } __attribute__((packed));
16026
16027 /***********************
16028  * hwrm_port_clr_stats *
16029  ***********************/
16030
16031
16032 /* hwrm_port_clr_stats_input (size:192b/24B) */
16033 struct hwrm_port_clr_stats_input {
16034         /* The HWRM command request type. */
16035         uint16_t        req_type;
16036         /*
16037          * The completion ring to send the completion event on. This should
16038          * be the NQ ID returned from the `nq_alloc` HWRM command.
16039          */
16040         uint16_t        cmpl_ring;
16041         /*
16042          * The sequence ID is used by the driver for tracking multiple
16043          * commands. This ID is treated as opaque data by the firmware and
16044          * the value is returned in the `hwrm_resp_hdr` upon completion.
16045          */
16046         uint16_t        seq_id;
16047         /*
16048          * The target ID of the command:
16049          * * 0x0-0xFFF8 - The function ID
16050          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16051          * * 0xFFFD - Reserved for user-space HWRM interface
16052          * * 0xFFFF - HWRM
16053          */
16054         uint16_t        target_id;
16055         /*
16056          * A physical address pointer pointing to a host buffer that the
16057          * command's response data will be written. This can be either a host
16058          * physical address (HPA) or a guest physical address (GPA) and must
16059          * point to a physically contiguous block of memory.
16060          */
16061         uint64_t        resp_addr;
16062         /* Port ID of port that is being queried. */
16063         uint16_t        port_id;
16064         uint8_t flags;
16065         /*
16066          * If set to 1, then this field indicates clear the following RoCE
16067          * specific counters.
16068          * RoCE associated TX/RX cos counters
16069          * CNP associated TX/RX cos counters
16070          * RoCE/CNP specific TX/RX flow counters
16071          * Firmware will determine the RoCE/CNP cos queue based on qos profile.
16072          * This flag is honored only when RoCE is enabled on that port.
16073          */
16074         #define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS     UINT32_C(0x1)
16075         uint8_t unused_0[5];
16076 } __attribute__((packed));
16077
16078 /* hwrm_port_clr_stats_output (size:128b/16B) */
16079 struct hwrm_port_clr_stats_output {
16080         /* The specific error status for the command. */
16081         uint16_t        error_code;
16082         /* The HWRM command request type. */
16083         uint16_t        req_type;
16084         /* The sequence ID from the original command. */
16085         uint16_t        seq_id;
16086         /* The length of the response data in number of bytes. */
16087         uint16_t        resp_len;
16088         uint8_t unused_0[7];
16089         /*
16090          * This field is used in Output records to indicate that the output
16091          * is completely written to RAM.  This field should be read as '1'
16092          * to indicate that the output has been completely written.
16093          * When writing a command completion or response to an internal processor,
16094          * the order of writes has to be such that this field is written last.
16095          */
16096         uint8_t valid;
16097 } __attribute__((packed));
16098
16099 /***********************
16100  * hwrm_port_phy_qcaps *
16101  ***********************/
16102
16103
16104 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
16105 struct hwrm_port_phy_qcaps_input {
16106         /* The HWRM command request type. */
16107         uint16_t        req_type;
16108         /*
16109          * The completion ring to send the completion event on. This should
16110          * be the NQ ID returned from the `nq_alloc` HWRM command.
16111          */
16112         uint16_t        cmpl_ring;
16113         /*
16114          * The sequence ID is used by the driver for tracking multiple
16115          * commands. This ID is treated as opaque data by the firmware and
16116          * the value is returned in the `hwrm_resp_hdr` upon completion.
16117          */
16118         uint16_t        seq_id;
16119         /*
16120          * The target ID of the command:
16121          * * 0x0-0xFFF8 - The function ID
16122          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16123          * * 0xFFFD - Reserved for user-space HWRM interface
16124          * * 0xFFFF - HWRM
16125          */
16126         uint16_t        target_id;
16127         /*
16128          * A physical address pointer pointing to a host buffer that the
16129          * command's response data will be written. This can be either a host
16130          * physical address (HPA) or a guest physical address (GPA) and must
16131          * point to a physically contiguous block of memory.
16132          */
16133         uint64_t        resp_addr;
16134         /* Port ID of port that is being queried. */
16135         uint16_t        port_id;
16136         uint8_t unused_0[6];
16137 } __attribute__((packed));
16138
16139 /* hwrm_port_phy_qcaps_output (size:192b/24B) */
16140 struct hwrm_port_phy_qcaps_output {
16141         /* The specific error status for the command. */
16142         uint16_t        error_code;
16143         /* The HWRM command request type. */
16144         uint16_t        req_type;
16145         /* The sequence ID from the original command. */
16146         uint16_t        seq_id;
16147         /* The length of the response data in number of bytes. */
16148         uint16_t        resp_len;
16149         /* PHY capability flags */
16150         uint8_t flags;
16151         /*
16152          * If set to 1, then this field indicates that the
16153          * link is capable of supporting EEE.
16154          */
16155         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED \
16156                 UINT32_C(0x1)
16157         /*
16158          * If set to 1, then this field indicates that the
16159          * PHY is capable of supporting external loopback.
16160          */
16161         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED \
16162                 UINT32_C(0x2)
16163         /*
16164          * Reserved field. The HWRM shall set this field to 0.
16165          * An HWRM client shall ignore this field.
16166          */
16167         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_MASK \
16168                 UINT32_C(0xfc)
16169         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_SFT                   2
16170         /* Number of front panel ports for this device. */
16171         uint8_t port_cnt;
16172         /* Not supported or unknown */
16173         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
16174         /* single port device */
16175         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1       UINT32_C(0x1)
16176         /* 2-port device */
16177         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2       UINT32_C(0x2)
16178         /* 3-port device */
16179         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3       UINT32_C(0x3)
16180         /* 4-port device */
16181         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4       UINT32_C(0x4)
16182         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST \
16183                 HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4
16184         /*
16185          * This is a bit mask to indicate what speeds are supported
16186          * as forced speeds on this link.
16187          * For each speed that can be forced on this link, the
16188          * corresponding mask bit shall be set to '1'.
16189          */
16190         uint16_t        supported_speeds_force_mode;
16191         /* 100Mb link speed (Half-duplex) */
16192         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD \
16193                 UINT32_C(0x1)
16194         /* 100Mb link speed (Full-duplex) */
16195         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB \
16196                 UINT32_C(0x2)
16197         /* 1Gb link speed (Half-duplex) */
16198         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD \
16199                 UINT32_C(0x4)
16200         /* 1Gb link speed (Full-duplex) */
16201         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB \
16202                 UINT32_C(0x8)
16203         /* 2Gb link speed */
16204         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB \
16205                 UINT32_C(0x10)
16206         /* 25Gb link speed */
16207         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB \
16208                 UINT32_C(0x20)
16209         /* 10Gb link speed */
16210         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB \
16211                 UINT32_C(0x40)
16212         /* 20Gb link speed */
16213         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB \
16214                 UINT32_C(0x80)
16215         /* 25Gb link speed */
16216         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB \
16217                 UINT32_C(0x100)
16218         /* 40Gb link speed */
16219         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB \
16220                 UINT32_C(0x200)
16221         /* 50Gb link speed */
16222         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB \
16223                 UINT32_C(0x400)
16224         /* 100Gb link speed */
16225         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB \
16226                 UINT32_C(0x800)
16227         /* 10Mb link speed (Half-duplex) */
16228         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD \
16229                 UINT32_C(0x1000)
16230         /* 10Mb link speed (Full-duplex) */
16231         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB \
16232                 UINT32_C(0x2000)
16233         /* 200Gb link speed */
16234         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_200GB \
16235                 UINT32_C(0x4000)
16236         /*
16237          * This is a bit mask to indicate what speeds are supported
16238          * for autonegotiation on this link.
16239          * For each speed that can be autonegotiated on this link, the
16240          * corresponding mask bit shall be set to '1'.
16241          */
16242         uint16_t        supported_speeds_auto_mode;
16243         /* 100Mb link speed (Half-duplex) */
16244         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD \
16245                 UINT32_C(0x1)
16246         /* 100Mb link speed (Full-duplex) */
16247         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB \
16248                 UINT32_C(0x2)
16249         /* 1Gb link speed (Half-duplex) */
16250         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD \
16251                 UINT32_C(0x4)
16252         /* 1Gb link speed (Full-duplex) */
16253         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB \
16254                 UINT32_C(0x8)
16255         /* 2Gb link speed */
16256         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB \
16257                 UINT32_C(0x10)
16258         /* 25Gb link speed */
16259         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB \
16260                 UINT32_C(0x20)
16261         /* 10Gb link speed */
16262         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB \
16263                 UINT32_C(0x40)
16264         /* 20Gb link speed */
16265         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB \
16266                 UINT32_C(0x80)
16267         /* 25Gb link speed */
16268         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB \
16269                 UINT32_C(0x100)
16270         /* 40Gb link speed */
16271         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB \
16272                 UINT32_C(0x200)
16273         /* 50Gb link speed */
16274         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB \
16275                 UINT32_C(0x400)
16276         /* 100Gb link speed */
16277         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB \
16278                 UINT32_C(0x800)
16279         /* 10Mb link speed (Half-duplex) */
16280         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD \
16281                 UINT32_C(0x1000)
16282         /* 10Mb link speed (Full-duplex) */
16283         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB \
16284                 UINT32_C(0x2000)
16285         /* 200Gb link speed */
16286         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_200GB \
16287                 UINT32_C(0x4000)
16288         /*
16289          * This is a bit mask to indicate what speeds are supported
16290          * for EEE on this link.
16291          * For each speed that can be autonegotiated when EEE is enabled
16292          * on this link, the corresponding mask bit shall be set to '1'.
16293          * This field is only valid when the eee_suppotred is set to '1'.
16294          */
16295         uint16_t        supported_speeds_eee_mode;
16296         /* Reserved */
16297         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 \
16298                 UINT32_C(0x1)
16299         /* 100Mb link speed (Full-duplex) */
16300         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB \
16301                 UINT32_C(0x2)
16302         /* Reserved */
16303         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 \
16304                 UINT32_C(0x4)
16305         /* 1Gb link speed (Full-duplex) */
16306         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB \
16307                 UINT32_C(0x8)
16308         /* Reserved */
16309         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 \
16310                 UINT32_C(0x10)
16311         /* Reserved */
16312         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 \
16313                 UINT32_C(0x20)
16314         /* 10Gb link speed */
16315         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB \
16316                 UINT32_C(0x40)
16317         uint32_t        tx_lpi_timer_low;
16318         /*
16319          * The lowest value of TX LPI timer that can be set on this link
16320          * when EEE is enabled. This value is in microseconds.
16321          * This field is valid only when_eee_supported is set to '1'.
16322          */
16323         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK \
16324                 UINT32_C(0xffffff)
16325         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
16326         /*
16327          * Reserved field. The HWRM shall set this field to 0.
16328          * An HWRM client shall ignore this field.
16329          */
16330         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK \
16331                 UINT32_C(0xff000000)
16332         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT            24
16333         uint32_t        valid_tx_lpi_timer_high;
16334         /*
16335          * The highest value of TX LPI timer that can be set on this link
16336          * when EEE is enabled. This value is in microseconds.
16337          * This field is valid only when_eee_supported is set to '1'.
16338          */
16339         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK \
16340                 UINT32_C(0xffffff)
16341         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
16342         /*
16343          * This field is used in Output records to indicate that the output
16344          * is completely written to RAM.  This field should be read as '1'
16345          * to indicate that the output has been completely written.
16346          * When writing a command completion or response to an internal processor,
16347          * the order of writes has to be such that this field is written last.
16348          */
16349         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_MASK \
16350                 UINT32_C(0xff000000)
16351         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_SFT             24
16352 } __attribute__((packed));
16353
16354 /****************************
16355  * hwrm_port_phy_mdio_write *
16356  ****************************/
16357
16358
16359 /* hwrm_port_phy_mdio_write_input (size:320b/40B) */
16360 struct hwrm_port_phy_mdio_write_input {
16361         /* The HWRM command request type. */
16362         uint16_t        req_type;
16363         /*
16364          * The completion ring to send the completion event on. This should
16365          * be the NQ ID returned from the `nq_alloc` HWRM command.
16366          */
16367         uint16_t        cmpl_ring;
16368         /*
16369          * The sequence ID is used by the driver for tracking multiple
16370          * commands. This ID is treated as opaque data by the firmware and
16371          * the value is returned in the `hwrm_resp_hdr` upon completion.
16372          */
16373         uint16_t        seq_id;
16374         /*
16375          * The target ID of the command:
16376          * * 0x0-0xFFF8 - The function ID
16377          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16378          * * 0xFFFD - Reserved for user-space HWRM interface
16379          * * 0xFFFF - HWRM
16380          */
16381         uint16_t        target_id;
16382         /*
16383          * A physical address pointer pointing to a host buffer that the
16384          * command's response data will be written. This can be either a host
16385          * physical address (HPA) or a guest physical address (GPA) and must
16386          * point to a physically contiguous block of memory.
16387          */
16388         uint64_t        resp_addr;
16389         /* Reserved for future use. */
16390         uint32_t        unused_0[2];
16391         /* Port ID of port. */
16392         uint16_t        port_id;
16393         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
16394         uint8_t phy_addr;
16395         /* 8-bit device address. */
16396         uint8_t dev_addr;
16397         /* 16-bit register address. */
16398         uint16_t        reg_addr;
16399         /* 16-bit register data. */
16400         uint16_t        reg_data;
16401         /*
16402          * When this bit is set to 1 a Clause 45 mdio access is done.
16403          * when this bit is set to 0 a Clause 22 mdio access is done.
16404          */
16405         uint8_t cl45_mdio;
16406         /*  */
16407         uint8_t unused_1[7];
16408 } __attribute__((packed));
16409
16410 /* hwrm_port_phy_mdio_write_output (size:128b/16B) */
16411 struct hwrm_port_phy_mdio_write_output {
16412         /* The specific error status for the command. */
16413         uint16_t        error_code;
16414         /* The HWRM command request type. */
16415         uint16_t        req_type;
16416         /* The sequence ID from the original command. */
16417         uint16_t        seq_id;
16418         /* The length of the response data in number of bytes. */
16419         uint16_t        resp_len;
16420         uint8_t unused_0[7];
16421         /*
16422          * This field is used in Output records to indicate that the output
16423          * is completely written to RAM.  This field should be read as '1'
16424          * to indicate that the output has been completely written.
16425          * When writing a command completion or response to an internal processor,
16426          * the order of writes has to be such that this field is written last.
16427          */
16428         uint8_t valid;
16429 } __attribute__((packed));
16430
16431 /***************************
16432  * hwrm_port_phy_mdio_read *
16433  ***************************/
16434
16435
16436 /* hwrm_port_phy_mdio_read_input (size:256b/32B) */
16437 struct hwrm_port_phy_mdio_read_input {
16438         /* The HWRM command request type. */
16439         uint16_t        req_type;
16440         /*
16441          * The completion ring to send the completion event on. This should
16442          * be the NQ ID returned from the `nq_alloc` HWRM command.
16443          */
16444         uint16_t        cmpl_ring;
16445         /*
16446          * The sequence ID is used by the driver for tracking multiple
16447          * commands. This ID is treated as opaque data by the firmware and
16448          * the value is returned in the `hwrm_resp_hdr` upon completion.
16449          */
16450         uint16_t        seq_id;
16451         /*
16452          * The target ID of the command:
16453          * * 0x0-0xFFF8 - The function ID
16454          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16455          * * 0xFFFD - Reserved for user-space HWRM interface
16456          * * 0xFFFF - HWRM
16457          */
16458         uint16_t        target_id;
16459         /*
16460          * A physical address pointer pointing to a host buffer that the
16461          * command's response data will be written. This can be either a host
16462          * physical address (HPA) or a guest physical address (GPA) and must
16463          * point to a physically contiguous block of memory.
16464          */
16465         uint64_t        resp_addr;
16466         /* Reserved for future use. */
16467         uint32_t        unused_0[2];
16468         /* Port ID of port. */
16469         uint16_t        port_id;
16470         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
16471         uint8_t phy_addr;
16472         /* 8-bit device address. */
16473         uint8_t dev_addr;
16474         /* 16-bit register address. */
16475         uint16_t        reg_addr;
16476         /*
16477          * When this bit is set to 1 a Clause 45 mdio access is done.
16478          * when this bit is set to 0 a Clause 22 mdio access is done.
16479          */
16480         uint8_t cl45_mdio;
16481         /*  */
16482         uint8_t unused_1;
16483 } __attribute__((packed));
16484
16485 /* hwrm_port_phy_mdio_read_output (size:128b/16B) */
16486 struct hwrm_port_phy_mdio_read_output {
16487         /* The specific error status for the command. */
16488         uint16_t        error_code;
16489         /* The HWRM command request type. */
16490         uint16_t        req_type;
16491         /* The sequence ID from the original command. */
16492         uint16_t        seq_id;
16493         /* The length of the response data in number of bytes. */
16494         uint16_t        resp_len;
16495         /* 16-bit register data. */
16496         uint16_t        reg_data;
16497         uint8_t unused_0[5];
16498         /*
16499          * This field is used in Output records to indicate that the output
16500          * is completely written to RAM.  This field should be read as '1'
16501          * to indicate that the output has been completely written.
16502          * When writing a command completion or response to an internal processor,
16503          * the order of writes has to be such that this field is written last.
16504          */
16505         uint8_t valid;
16506 } __attribute__((packed));
16507
16508 /*********************
16509  * hwrm_port_led_cfg *
16510  *********************/
16511
16512
16513 /* hwrm_port_led_cfg_input (size:512b/64B) */
16514 struct hwrm_port_led_cfg_input {
16515         /* The HWRM command request type. */
16516         uint16_t        req_type;
16517         /*
16518          * The completion ring to send the completion event on. This should
16519          * be the NQ ID returned from the `nq_alloc` HWRM command.
16520          */
16521         uint16_t        cmpl_ring;
16522         /*
16523          * The sequence ID is used by the driver for tracking multiple
16524          * commands. This ID is treated as opaque data by the firmware and
16525          * the value is returned in the `hwrm_resp_hdr` upon completion.
16526          */
16527         uint16_t        seq_id;
16528         /*
16529          * The target ID of the command:
16530          * * 0x0-0xFFF8 - The function ID
16531          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16532          * * 0xFFFD - Reserved for user-space HWRM interface
16533          * * 0xFFFF - HWRM
16534          */
16535         uint16_t        target_id;
16536         /*
16537          * A physical address pointer pointing to a host buffer that the
16538          * command's response data will be written. This can be either a host
16539          * physical address (HPA) or a guest physical address (GPA) and must
16540          * point to a physically contiguous block of memory.
16541          */
16542         uint64_t        resp_addr;
16543         uint32_t        enables;
16544         /*
16545          * This bit must be '1' for the led0_id field to be
16546          * configured.
16547          */
16548         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID \
16549                 UINT32_C(0x1)
16550         /*
16551          * This bit must be '1' for the led0_state field to be
16552          * configured.
16553          */
16554         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE \
16555                 UINT32_C(0x2)
16556         /*
16557          * This bit must be '1' for the led0_color field to be
16558          * configured.
16559          */
16560         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR \
16561                 UINT32_C(0x4)
16562         /*
16563          * This bit must be '1' for the led0_blink_on field to be
16564          * configured.
16565          */
16566         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON \
16567                 UINT32_C(0x8)
16568         /*
16569          * This bit must be '1' for the led0_blink_off field to be
16570          * configured.
16571          */
16572         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF \
16573                 UINT32_C(0x10)
16574         /*
16575          * This bit must be '1' for the led0_group_id field to be
16576          * configured.
16577          */
16578         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID \
16579                 UINT32_C(0x20)
16580         /*
16581          * This bit must be '1' for the led1_id field to be
16582          * configured.
16583          */
16584         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID \
16585                 UINT32_C(0x40)
16586         /*
16587          * This bit must be '1' for the led1_state field to be
16588          * configured.
16589          */
16590         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE \
16591                 UINT32_C(0x80)
16592         /*
16593          * This bit must be '1' for the led1_color field to be
16594          * configured.
16595          */
16596         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR \
16597                 UINT32_C(0x100)
16598         /*
16599          * This bit must be '1' for the led1_blink_on field to be
16600          * configured.
16601          */
16602         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON \
16603                 UINT32_C(0x200)
16604         /*
16605          * This bit must be '1' for the led1_blink_off field to be
16606          * configured.
16607          */
16608         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF \
16609                 UINT32_C(0x400)
16610         /*
16611          * This bit must be '1' for the led1_group_id field to be
16612          * configured.
16613          */
16614         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID \
16615                 UINT32_C(0x800)
16616         /*
16617          * This bit must be '1' for the led2_id field to be
16618          * configured.
16619          */
16620         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID \
16621                 UINT32_C(0x1000)
16622         /*
16623          * This bit must be '1' for the led2_state field to be
16624          * configured.
16625          */
16626         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE \
16627                 UINT32_C(0x2000)
16628         /*
16629          * This bit must be '1' for the led2_color field to be
16630          * configured.
16631          */
16632         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR \
16633                 UINT32_C(0x4000)
16634         /*
16635          * This bit must be '1' for the led2_blink_on field to be
16636          * configured.
16637          */
16638         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON \
16639                 UINT32_C(0x8000)
16640         /*
16641          * This bit must be '1' for the led2_blink_off field to be
16642          * configured.
16643          */
16644         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF \
16645                 UINT32_C(0x10000)
16646         /*
16647          * This bit must be '1' for the led2_group_id field to be
16648          * configured.
16649          */
16650         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID \
16651                 UINT32_C(0x20000)
16652         /*
16653          * This bit must be '1' for the led3_id field to be
16654          * configured.
16655          */
16656         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID \
16657                 UINT32_C(0x40000)
16658         /*
16659          * This bit must be '1' for the led3_state field to be
16660          * configured.
16661          */
16662         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE \
16663                 UINT32_C(0x80000)
16664         /*
16665          * This bit must be '1' for the led3_color field to be
16666          * configured.
16667          */
16668         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR \
16669                 UINT32_C(0x100000)
16670         /*
16671          * This bit must be '1' for the led3_blink_on field to be
16672          * configured.
16673          */
16674         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON \
16675                 UINT32_C(0x200000)
16676         /*
16677          * This bit must be '1' for the led3_blink_off field to be
16678          * configured.
16679          */
16680         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \
16681                 UINT32_C(0x400000)
16682         /*
16683          * This bit must be '1' for the led3_group_id field to be
16684          * configured.
16685          */
16686         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID \
16687                 UINT32_C(0x800000)
16688         /* Port ID of port whose LEDs are configured. */
16689         uint16_t        port_id;
16690         /*
16691          * The number of LEDs that are being configured.
16692          * Up to 4 LEDs can be configured with this command.
16693          */
16694         uint8_t num_leds;
16695         /* Reserved field. */
16696         uint8_t rsvd;
16697         /* An identifier for the LED #0. */
16698         uint8_t led0_id;
16699         /* The requested state of the LED #0. */
16700         uint8_t led0_state;
16701         /* Default state of the LED */
16702         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
16703         /* Off */
16704         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF      UINT32_C(0x1)
16705         /* On */
16706         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON       UINT32_C(0x2)
16707         /* Blink */
16708         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK    UINT32_C(0x3)
16709         /* Blink Alternately */
16710         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
16711         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST \
16712                 HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
16713         /* The requested color of LED #0. */
16714         uint8_t led0_color;
16715         /* Default */
16716         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
16717         /* Amber */
16718         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
16719         /* Green */
16720         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
16721         /* Green or Amber */
16722         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
16723         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST \
16724                 HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
16725         uint8_t unused_0;
16726         /*
16727          * If the LED #0 state is "blink" or "blinkalt", then
16728          * this field represents the requested time in milliseconds
16729          * to keep LED on between cycles.
16730          */
16731         uint16_t        led0_blink_on;
16732         /*
16733          * If the LED #0 state is "blink" or "blinkalt", then
16734          * this field represents the requested time in milliseconds
16735          * to keep LED off between cycles.
16736          */
16737         uint16_t        led0_blink_off;
16738         /*
16739          * An identifier for the group of LEDs that LED #0 belongs
16740          * to.
16741          * If set to 0, then the LED #0 shall not be grouped and
16742          * shall be treated as an individual resource.
16743          * For all other non-zero values of this field, LED #0 shall
16744          * be grouped together with the LEDs with the same group ID
16745          * value.
16746          */
16747         uint8_t led0_group_id;
16748         /* Reserved field. */
16749         uint8_t rsvd0;
16750         /* An identifier for the LED #1. */
16751         uint8_t led1_id;
16752         /* The requested state of the LED #1. */
16753         uint8_t led1_state;
16754         /* Default state of the LED */
16755         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
16756         /* Off */
16757         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF      UINT32_C(0x1)
16758         /* On */
16759         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON       UINT32_C(0x2)
16760         /* Blink */
16761         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK    UINT32_C(0x3)
16762         /* Blink Alternately */
16763         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
16764         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST \
16765                 HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
16766         /* The requested color of LED #1. */
16767         uint8_t led1_color;
16768         /* Default */
16769         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
16770         /* Amber */
16771         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
16772         /* Green */
16773         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
16774         /* Green or Amber */
16775         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
16776         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST \
16777                 HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
16778         uint8_t unused_1;
16779         /*
16780          * If the LED #1 state is "blink" or "blinkalt", then
16781          * this field represents the requested time in milliseconds
16782          * to keep LED on between cycles.
16783          */
16784         uint16_t        led1_blink_on;
16785         /*
16786          * If the LED #1 state is "blink" or "blinkalt", then
16787          * this field represents the requested time in milliseconds
16788          * to keep LED off between cycles.
16789          */
16790         uint16_t        led1_blink_off;
16791         /*
16792          * An identifier for the group of LEDs that LED #1 belongs
16793          * to.
16794          * If set to 0, then the LED #1 shall not be grouped and
16795          * shall be treated as an individual resource.
16796          * For all other non-zero values of this field, LED #1 shall
16797          * be grouped together with the LEDs with the same group ID
16798          * value.
16799          */
16800         uint8_t led1_group_id;
16801         /* Reserved field. */
16802         uint8_t rsvd1;
16803         /* An identifier for the LED #2. */
16804         uint8_t led2_id;
16805         /* The requested state of the LED #2. */
16806         uint8_t led2_state;
16807         /* Default state of the LED */
16808         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
16809         /* Off */
16810         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF      UINT32_C(0x1)
16811         /* On */
16812         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON       UINT32_C(0x2)
16813         /* Blink */
16814         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK    UINT32_C(0x3)
16815         /* Blink Alternately */
16816         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
16817         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST \
16818                 HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
16819         /* The requested color of LED #2. */
16820         uint8_t led2_color;
16821         /* Default */
16822         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
16823         /* Amber */
16824         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
16825         /* Green */
16826         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
16827         /* Green or Amber */
16828         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
16829         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST \
16830                 HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
16831         uint8_t unused_2;
16832         /*
16833          * If the LED #2 state is "blink" or "blinkalt", then
16834          * this field represents the requested time in milliseconds
16835          * to keep LED on between cycles.
16836          */
16837         uint16_t        led2_blink_on;
16838         /*
16839          * If the LED #2 state is "blink" or "blinkalt", then
16840          * this field represents the requested time in milliseconds
16841          * to keep LED off between cycles.
16842          */
16843         uint16_t        led2_blink_off;
16844         /*
16845          * An identifier for the group of LEDs that LED #2 belongs
16846          * to.
16847          * If set to 0, then the LED #2 shall not be grouped and
16848          * shall be treated as an individual resource.
16849          * For all other non-zero values of this field, LED #2 shall
16850          * be grouped together with the LEDs with the same group ID
16851          * value.
16852          */
16853         uint8_t led2_group_id;
16854         /* Reserved field. */
16855         uint8_t rsvd2;
16856         /* An identifier for the LED #3. */
16857         uint8_t led3_id;
16858         /* The requested state of the LED #3. */
16859         uint8_t led3_state;
16860         /* Default state of the LED */
16861         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
16862         /* Off */
16863         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF      UINT32_C(0x1)
16864         /* On */
16865         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON       UINT32_C(0x2)
16866         /* Blink */
16867         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK    UINT32_C(0x3)
16868         /* Blink Alternately */
16869         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
16870         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST \
16871                 HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
16872         /* The requested color of LED #3. */
16873         uint8_t led3_color;
16874         /* Default */
16875         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
16876         /* Amber */
16877         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
16878         /* Green */
16879         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
16880         /* Green or Amber */
16881         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
16882         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST \
16883                 HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
16884         uint8_t unused_3;
16885         /*
16886          * If the LED #3 state is "blink" or "blinkalt", then
16887          * this field represents the requested time in milliseconds
16888          * to keep LED on between cycles.
16889          */
16890         uint16_t        led3_blink_on;
16891         /*
16892          * If the LED #3 state is "blink" or "blinkalt", then
16893          * this field represents the requested time in milliseconds
16894          * to keep LED off between cycles.
16895          */
16896         uint16_t        led3_blink_off;
16897         /*
16898          * An identifier for the group of LEDs that LED #3 belongs
16899          * to.
16900          * If set to 0, then the LED #3 shall not be grouped and
16901          * shall be treated as an individual resource.
16902          * For all other non-zero values of this field, LED #3 shall
16903          * be grouped together with the LEDs with the same group ID
16904          * value.
16905          */
16906         uint8_t led3_group_id;
16907         /* Reserved field. */
16908         uint8_t rsvd3;
16909 } __attribute__((packed));
16910
16911 /* hwrm_port_led_cfg_output (size:128b/16B) */
16912 struct hwrm_port_led_cfg_output {
16913         /* The specific error status for the command. */
16914         uint16_t        error_code;
16915         /* The HWRM command request type. */
16916         uint16_t        req_type;
16917         /* The sequence ID from the original command. */
16918         uint16_t        seq_id;
16919         /* The length of the response data in number of bytes. */
16920         uint16_t        resp_len;
16921         uint8_t unused_0[7];
16922         /*
16923          * This field is used in Output records to indicate that the output
16924          * is completely written to RAM.  This field should be read as '1'
16925          * to indicate that the output has been completely written.
16926          * When writing a command completion or response to an internal processor,
16927          * the order of writes has to be such that this field is written last.
16928          */
16929         uint8_t valid;
16930 } __attribute__((packed));
16931
16932 /**********************
16933  * hwrm_port_led_qcfg *
16934  **********************/
16935
16936
16937 /* hwrm_port_led_qcfg_input (size:192b/24B) */
16938 struct hwrm_port_led_qcfg_input {
16939         /* The HWRM command request type. */
16940         uint16_t        req_type;
16941         /*
16942          * The completion ring to send the completion event on. This should
16943          * be the NQ ID returned from the `nq_alloc` HWRM command.
16944          */
16945         uint16_t        cmpl_ring;
16946         /*
16947          * The sequence ID is used by the driver for tracking multiple
16948          * commands. This ID is treated as opaque data by the firmware and
16949          * the value is returned in the `hwrm_resp_hdr` upon completion.
16950          */
16951         uint16_t        seq_id;
16952         /*
16953          * The target ID of the command:
16954          * * 0x0-0xFFF8 - The function ID
16955          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16956          * * 0xFFFD - Reserved for user-space HWRM interface
16957          * * 0xFFFF - HWRM
16958          */
16959         uint16_t        target_id;
16960         /*
16961          * A physical address pointer pointing to a host buffer that the
16962          * command's response data will be written. This can be either a host
16963          * physical address (HPA) or a guest physical address (GPA) and must
16964          * point to a physically contiguous block of memory.
16965          */
16966         uint64_t        resp_addr;
16967         /* Port ID of port whose LED configuration is being queried. */
16968         uint16_t        port_id;
16969         uint8_t unused_0[6];
16970 } __attribute__((packed));
16971
16972 /* hwrm_port_led_qcfg_output (size:448b/56B) */
16973 struct hwrm_port_led_qcfg_output {
16974         /* The specific error status for the command. */
16975         uint16_t        error_code;
16976         /* The HWRM command request type. */
16977         uint16_t        req_type;
16978         /* The sequence ID from the original command. */
16979         uint16_t        seq_id;
16980         /* The length of the response data in number of bytes. */
16981         uint16_t        resp_len;
16982         /*
16983          * The number of LEDs that are configured on this port.
16984          * Up to 4 LEDs can be returned in the response.
16985          */
16986         uint8_t num_leds;
16987         /* An identifier for the LED #0. */
16988         uint8_t led0_id;
16989         /* The type of LED #0. */
16990         uint8_t led0_type;
16991         /* Speed LED */
16992         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
16993         /* Activity LED */
16994         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
16995         /* Invalid */
16996         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
16997         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST \
16998                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
16999         /* The current state of the LED #0. */
17000         uint8_t led0_state;
17001         /* Default state of the LED */
17002         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
17003         /* Off */
17004         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF      UINT32_C(0x1)
17005         /* On */
17006         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON       UINT32_C(0x2)
17007         /* Blink */
17008         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK    UINT32_C(0x3)
17009         /* Blink Alternately */
17010         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
17011         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST \
17012                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
17013         /* The color of LED #0. */
17014         uint8_t led0_color;
17015         /* Default */
17016         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
17017         /* Amber */
17018         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
17019         /* Green */
17020         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
17021         /* Green or Amber */
17022         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
17023         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST \
17024                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
17025         uint8_t unused_0;
17026         /*
17027          * If the LED #0 state is "blink" or "blinkalt", then
17028          * this field represents the requested time in milliseconds
17029          * to keep LED on between cycles.
17030          */
17031         uint16_t        led0_blink_on;
17032         /*
17033          * If the LED #0 state is "blink" or "blinkalt", then
17034          * this field represents the requested time in milliseconds
17035          * to keep LED off between cycles.
17036          */
17037         uint16_t        led0_blink_off;
17038         /*
17039          * An identifier for the group of LEDs that LED #0 belongs
17040          * to.
17041          * If set to 0, then the LED #0 is not grouped.
17042          * For all other non-zero values of this field, LED #0 is
17043          * grouped together with the LEDs with the same group ID
17044          * value.
17045          */
17046         uint8_t led0_group_id;
17047         /* An identifier for the LED #1. */
17048         uint8_t led1_id;
17049         /* The type of LED #1. */
17050         uint8_t led1_type;
17051         /* Speed LED */
17052         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
17053         /* Activity LED */
17054         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
17055         /* Invalid */
17056         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
17057         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST \
17058                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
17059         /* The current state of the LED #1. */
17060         uint8_t led1_state;
17061         /* Default state of the LED */
17062         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
17063         /* Off */
17064         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF      UINT32_C(0x1)
17065         /* On */
17066         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON       UINT32_C(0x2)
17067         /* Blink */
17068         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK    UINT32_C(0x3)
17069         /* Blink Alternately */
17070         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
17071         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST \
17072                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
17073         /* The color of LED #1. */
17074         uint8_t led1_color;
17075         /* Default */
17076         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
17077         /* Amber */
17078         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
17079         /* Green */
17080         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
17081         /* Green or Amber */
17082         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
17083         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST \
17084                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
17085         uint8_t unused_1;
17086         /*
17087          * If the LED #1 state is "blink" or "blinkalt", then
17088          * this field represents the requested time in milliseconds
17089          * to keep LED on between cycles.
17090          */
17091         uint16_t        led1_blink_on;
17092         /*
17093          * If the LED #1 state is "blink" or "blinkalt", then
17094          * this field represents the requested time in milliseconds
17095          * to keep LED off between cycles.
17096          */
17097         uint16_t        led1_blink_off;
17098         /*
17099          * An identifier for the group of LEDs that LED #1 belongs
17100          * to.
17101          * If set to 0, then the LED #1 is not grouped.
17102          * For all other non-zero values of this field, LED #1 is
17103          * grouped together with the LEDs with the same group ID
17104          * value.
17105          */
17106         uint8_t led1_group_id;
17107         /* An identifier for the LED #2. */
17108         uint8_t led2_id;
17109         /* The type of LED #2. */
17110         uint8_t led2_type;
17111         /* Speed LED */
17112         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
17113         /* Activity LED */
17114         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
17115         /* Invalid */
17116         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
17117         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST \
17118                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
17119         /* The current state of the LED #2. */
17120         uint8_t led2_state;
17121         /* Default state of the LED */
17122         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
17123         /* Off */
17124         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF      UINT32_C(0x1)
17125         /* On */
17126         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON       UINT32_C(0x2)
17127         /* Blink */
17128         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK    UINT32_C(0x3)
17129         /* Blink Alternately */
17130         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
17131         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST \
17132                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
17133         /* The color of LED #2. */
17134         uint8_t led2_color;
17135         /* Default */
17136         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
17137         /* Amber */
17138         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
17139         /* Green */
17140         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
17141         /* Green or Amber */
17142         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
17143         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST \
17144                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
17145         uint8_t unused_2;
17146         /*
17147          * If the LED #2 state is "blink" or "blinkalt", then
17148          * this field represents the requested time in milliseconds
17149          * to keep LED on between cycles.
17150          */
17151         uint16_t        led2_blink_on;
17152         /*
17153          * If the LED #2 state is "blink" or "blinkalt", then
17154          * this field represents the requested time in milliseconds
17155          * to keep LED off between cycles.
17156          */
17157         uint16_t        led2_blink_off;
17158         /*
17159          * An identifier for the group of LEDs that LED #2 belongs
17160          * to.
17161          * If set to 0, then the LED #2 is not grouped.
17162          * For all other non-zero values of this field, LED #2 is
17163          * grouped together with the LEDs with the same group ID
17164          * value.
17165          */
17166         uint8_t led2_group_id;
17167         /* An identifier for the LED #3. */
17168         uint8_t led3_id;
17169         /* The type of LED #3. */
17170         uint8_t led3_type;
17171         /* Speed LED */
17172         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
17173         /* Activity LED */
17174         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
17175         /* Invalid */
17176         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
17177         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST \
17178                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
17179         /* The current state of the LED #3. */
17180         uint8_t led3_state;
17181         /* Default state of the LED */
17182         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
17183         /* Off */
17184         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF      UINT32_C(0x1)
17185         /* On */
17186         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON       UINT32_C(0x2)
17187         /* Blink */
17188         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK    UINT32_C(0x3)
17189         /* Blink Alternately */
17190         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
17191         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST \
17192                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
17193         /* The color of LED #3. */
17194         uint8_t led3_color;
17195         /* Default */
17196         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
17197         /* Amber */
17198         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
17199         /* Green */
17200         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
17201         /* Green or Amber */
17202         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
17203         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST \
17204                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
17205         uint8_t unused_3;
17206         /*
17207          * If the LED #3 state is "blink" or "blinkalt", then
17208          * this field represents the requested time in milliseconds
17209          * to keep LED on between cycles.
17210          */
17211         uint16_t        led3_blink_on;
17212         /*
17213          * If the LED #3 state is "blink" or "blinkalt", then
17214          * this field represents the requested time in milliseconds
17215          * to keep LED off between cycles.
17216          */
17217         uint16_t        led3_blink_off;
17218         /*
17219          * An identifier for the group of LEDs that LED #3 belongs
17220          * to.
17221          * If set to 0, then the LED #3 is not grouped.
17222          * For all other non-zero values of this field, LED #3 is
17223          * grouped together with the LEDs with the same group ID
17224          * value.
17225          */
17226         uint8_t led3_group_id;
17227         uint8_t unused_4[6];
17228         /*
17229          * This field is used in Output records to indicate that the output
17230          * is completely written to RAM.  This field should be read as '1'
17231          * to indicate that the output has been completely written.
17232          * When writing a command completion or response to an internal processor,
17233          * the order of writes has to be such that this field is written last.
17234          */
17235         uint8_t valid;
17236 } __attribute__((packed));
17237
17238 /***********************
17239  * hwrm_port_led_qcaps *
17240  ***********************/
17241
17242
17243 /* hwrm_port_led_qcaps_input (size:192b/24B) */
17244 struct hwrm_port_led_qcaps_input {
17245         /* The HWRM command request type. */
17246         uint16_t        req_type;
17247         /*
17248          * The completion ring to send the completion event on. This should
17249          * be the NQ ID returned from the `nq_alloc` HWRM command.
17250          */
17251         uint16_t        cmpl_ring;
17252         /*
17253          * The sequence ID is used by the driver for tracking multiple
17254          * commands. This ID is treated as opaque data by the firmware and
17255          * the value is returned in the `hwrm_resp_hdr` upon completion.
17256          */
17257         uint16_t        seq_id;
17258         /*
17259          * The target ID of the command:
17260          * * 0x0-0xFFF8 - The function ID
17261          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17262          * * 0xFFFD - Reserved for user-space HWRM interface
17263          * * 0xFFFF - HWRM
17264          */
17265         uint16_t        target_id;
17266         /*
17267          * A physical address pointer pointing to a host buffer that the
17268          * command's response data will be written. This can be either a host
17269          * physical address (HPA) or a guest physical address (GPA) and must
17270          * point to a physically contiguous block of memory.
17271          */
17272         uint64_t        resp_addr;
17273         /* Port ID of port whose LED configuration is being queried. */
17274         uint16_t        port_id;
17275         uint8_t unused_0[6];
17276 } __attribute__((packed));
17277
17278 /* hwrm_port_led_qcaps_output (size:384b/48B) */
17279 struct hwrm_port_led_qcaps_output {
17280         /* The specific error status for the command. */
17281         uint16_t        error_code;
17282         /* The HWRM command request type. */
17283         uint16_t        req_type;
17284         /* The sequence ID from the original command. */
17285         uint16_t        seq_id;
17286         /* The length of the response data in number of bytes. */
17287         uint16_t        resp_len;
17288         /*
17289          * The number of LEDs that are configured on this port.
17290          * Up to 4 LEDs can be returned in the response.
17291          */
17292         uint8_t num_leds;
17293         /* Reserved for future use. */
17294         uint8_t unused[3];
17295         /* An identifier for the LED #0. */
17296         uint8_t led0_id;
17297         /* The type of LED #0. */
17298         uint8_t led0_type;
17299         /* Speed LED */
17300         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
17301         /* Activity LED */
17302         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
17303         /* Invalid */
17304         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
17305         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST \
17306                 HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
17307         /*
17308          * An identifier for the group of LEDs that LED #0 belongs
17309          * to.
17310          * If set to 0, then the LED #0 cannot be grouped.
17311          * For all other non-zero values of this field, LED #0 is
17312          * grouped together with the LEDs with the same group ID
17313          * value.
17314          */
17315         uint8_t led0_group_id;
17316         uint8_t unused_0;
17317         /* The states supported by LED #0. */
17318         uint16_t        led0_state_caps;
17319         /*
17320          * If set to 1, this LED is enabled.
17321          * If set to 0, this LED is disabled.
17322          */
17323         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED \
17324                 UINT32_C(0x1)
17325         /*
17326          * If set to 1, off state is supported on this LED.
17327          * If set to 0, off state is not supported on this LED.
17328          */
17329         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \
17330                 UINT32_C(0x2)
17331         /*
17332          * If set to 1, on state is supported on this LED.
17333          * If set to 0, on state is not supported on this LED.
17334          */
17335         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \
17336                 UINT32_C(0x4)
17337         /*
17338          * If set to 1, blink state is supported on this LED.
17339          * If set to 0, blink state is not supported on this LED.
17340          */
17341         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \
17342                 UINT32_C(0x8)
17343         /*
17344          * If set to 1, blink_alt state is supported on this LED.
17345          * If set to 0, blink_alt state is not supported on this LED.
17346          */
17347         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \
17348                 UINT32_C(0x10)
17349         /* The colors supported by LED #0. */
17350         uint16_t        led0_color_caps;
17351         /* reserved. */
17352         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD \
17353                 UINT32_C(0x1)
17354         /*
17355          * If set to 1, Amber color is supported on this LED.
17356          * If set to 0, Amber color is not supported on this LED.
17357          */
17358         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \
17359                 UINT32_C(0x2)
17360         /*
17361          * If set to 1, Green color is supported on this LED.
17362          * If set to 0, Green color is not supported on this LED.
17363          */
17364         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \
17365                 UINT32_C(0x4)
17366         /* An identifier for the LED #1. */
17367         uint8_t led1_id;
17368         /* The type of LED #1. */
17369         uint8_t led1_type;
17370         /* Speed LED */
17371         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
17372         /* Activity LED */
17373         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
17374         /* Invalid */
17375         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
17376         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST \
17377                 HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
17378         /*
17379          * An identifier for the group of LEDs that LED #1 belongs
17380          * to.
17381          * If set to 0, then the LED #0 cannot be grouped.
17382          * For all other non-zero values of this field, LED #0 is
17383          * grouped together with the LEDs with the same group ID
17384          * value.
17385          */
17386         uint8_t led1_group_id;
17387         uint8_t unused_1;
17388         /* The states supported by LED #1. */
17389         uint16_t        led1_state_caps;
17390         /*
17391          * If set to 1, this LED is enabled.
17392          * If set to 0, this LED is disabled.
17393          */
17394         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED \
17395                 UINT32_C(0x1)
17396         /*
17397          * If set to 1, off state is supported on this LED.
17398          * If set to 0, off state is not supported on this LED.
17399          */
17400         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \
17401                 UINT32_C(0x2)
17402         /*
17403          * If set to 1, on state is supported on this LED.
17404          * If set to 0, on state is not supported on this LED.
17405          */
17406         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \
17407                 UINT32_C(0x4)
17408         /*
17409          * If set to 1, blink state is supported on this LED.
17410          * If set to 0, blink state is not supported on this LED.
17411          */
17412         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \
17413                 UINT32_C(0x8)
17414         /*
17415          * If set to 1, blink_alt state is supported on this LED.
17416          * If set to 0, blink_alt state is not supported on this LED.
17417          */
17418         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \
17419                 UINT32_C(0x10)
17420         /* The colors supported by LED #1. */
17421         uint16_t        led1_color_caps;
17422         /* reserved. */
17423         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD \
17424                 UINT32_C(0x1)
17425         /*
17426          * If set to 1, Amber color is supported on this LED.
17427          * If set to 0, Amber color is not supported on this LED.
17428          */
17429         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \
17430                 UINT32_C(0x2)
17431         /*
17432          * If set to 1, Green color is supported on this LED.
17433          * If set to 0, Green color is not supported on this LED.
17434          */
17435         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \
17436                 UINT32_C(0x4)
17437         /* An identifier for the LED #2. */
17438         uint8_t led2_id;
17439         /* The type of LED #2. */
17440         uint8_t led2_type;
17441         /* Speed LED */
17442         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
17443         /* Activity LED */
17444         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
17445         /* Invalid */
17446         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
17447         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST \
17448                 HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
17449         /*
17450          * An identifier for the group of LEDs that LED #0 belongs
17451          * to.
17452          * If set to 0, then the LED #0 cannot be grouped.
17453          * For all other non-zero values of this field, LED #0 is
17454          * grouped together with the LEDs with the same group ID
17455          * value.
17456          */
17457         uint8_t led2_group_id;
17458         uint8_t unused_2;
17459         /* The states supported by LED #2. */
17460         uint16_t        led2_state_caps;
17461         /*
17462          * If set to 1, this LED is enabled.
17463          * If set to 0, this LED is disabled.
17464          */
17465         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED \
17466                 UINT32_C(0x1)
17467         /*
17468          * If set to 1, off state is supported on this LED.
17469          * If set to 0, off state is not supported on this LED.
17470          */
17471         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \
17472                 UINT32_C(0x2)
17473         /*
17474          * If set to 1, on state is supported on this LED.
17475          * If set to 0, on state is not supported on this LED.
17476          */
17477         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \
17478                 UINT32_C(0x4)
17479         /*
17480          * If set to 1, blink state is supported on this LED.
17481          * If set to 0, blink state is not supported on this LED.
17482          */
17483         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \
17484                 UINT32_C(0x8)
17485         /*
17486          * If set to 1, blink_alt state is supported on this LED.
17487          * If set to 0, blink_alt state is not supported on this LED.
17488          */
17489         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \
17490                 UINT32_C(0x10)
17491         /* The colors supported by LED #2. */
17492         uint16_t        led2_color_caps;
17493         /* reserved. */
17494         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD \
17495                 UINT32_C(0x1)
17496         /*
17497          * If set to 1, Amber color is supported on this LED.
17498          * If set to 0, Amber color is not supported on this LED.
17499          */
17500         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \
17501                 UINT32_C(0x2)
17502         /*
17503          * If set to 1, Green color is supported on this LED.
17504          * If set to 0, Green color is not supported on this LED.
17505          */
17506         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \
17507                 UINT32_C(0x4)
17508         /* An identifier for the LED #3. */
17509         uint8_t led3_id;
17510         /* The type of LED #3. */
17511         uint8_t led3_type;
17512         /* Speed LED */
17513         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
17514         /* Activity LED */
17515         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
17516         /* Invalid */
17517         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
17518         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST \
17519                 HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
17520         /*
17521          * An identifier for the group of LEDs that LED #3 belongs
17522          * to.
17523          * If set to 0, then the LED #0 cannot be grouped.
17524          * For all other non-zero values of this field, LED #0 is
17525          * grouped together with the LEDs with the same group ID
17526          * value.
17527          */
17528         uint8_t led3_group_id;
17529         uint8_t unused_3;
17530         /* The states supported by LED #3. */
17531         uint16_t        led3_state_caps;
17532         /*
17533          * If set to 1, this LED is enabled.
17534          * If set to 0, this LED is disabled.
17535          */
17536         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED \
17537                 UINT32_C(0x1)
17538         /*
17539          * If set to 1, off state is supported on this LED.
17540          * If set to 0, off state is not supported on this LED.
17541          */
17542         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \
17543                 UINT32_C(0x2)
17544         /*
17545          * If set to 1, on state is supported on this LED.
17546          * If set to 0, on state is not supported on this LED.
17547          */
17548         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \
17549                 UINT32_C(0x4)
17550         /*
17551          * If set to 1, blink state is supported on this LED.
17552          * If set to 0, blink state is not supported on this LED.
17553          */
17554         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \
17555                 UINT32_C(0x8)
17556         /*
17557          * If set to 1, blink_alt state is supported on this LED.
17558          * If set to 0, blink_alt state is not supported on this LED.
17559          */
17560         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \
17561                 UINT32_C(0x10)
17562         /* The colors supported by LED #3. */
17563         uint16_t        led3_color_caps;
17564         /* reserved. */
17565         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD \
17566                 UINT32_C(0x1)
17567         /*
17568          * If set to 1, Amber color is supported on this LED.
17569          * If set to 0, Amber color is not supported on this LED.
17570          */
17571         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \
17572                 UINT32_C(0x2)
17573         /*
17574          * If set to 1, Green color is supported on this LED.
17575          * If set to 0, Green color is not supported on this LED.
17576          */
17577         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \
17578                 UINT32_C(0x4)
17579         uint8_t unused_4[3];
17580         /*
17581          * This field is used in Output records to indicate that the output
17582          * is completely written to RAM.  This field should be read as '1'
17583          * to indicate that the output has been completely written.
17584          * When writing a command completion or response to an internal processor,
17585          * the order of writes has to be such that this field is written last.
17586          */
17587         uint8_t valid;
17588 } __attribute__((packed));
17589
17590 /***********************
17591  * hwrm_port_prbs_test *
17592  ***********************/
17593
17594
17595 /* hwrm_port_prbs_test_input (size:384b/48B) */
17596 struct hwrm_port_prbs_test_input {
17597         /* The HWRM command request type. */
17598         uint16_t        req_type;
17599         /*
17600          * The completion ring to send the completion event on. This should
17601          * be the NQ ID returned from the `nq_alloc` HWRM command.
17602          */
17603         uint16_t        cmpl_ring;
17604         /*
17605          * The sequence ID is used by the driver for tracking multiple
17606          * commands. This ID is treated as opaque data by the firmware and
17607          * the value is returned in the `hwrm_resp_hdr` upon completion.
17608          */
17609         uint16_t        seq_id;
17610         /*
17611          * The target ID of the command:
17612          * * 0x0-0xFFF8 - The function ID
17613          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17614          * * 0xFFFD - Reserved for user-space HWRM interface
17615          * * 0xFFFF - HWRM
17616          */
17617         uint16_t        target_id;
17618         /*
17619          * A physical address pointer pointing to a host buffer that the
17620          * command's response data will be written. This can be either a host
17621          * physical address (HPA) or a guest physical address (GPA) and must
17622          * point to a physically contiguous block of memory.
17623          */
17624         uint64_t        resp_addr;
17625         /* Host address data is to DMA'd to. */
17626         uint64_t        resp_data_addr;
17627         /*
17628          * Size of the buffer pointed to by resp_data_addr. The firmware may
17629          * use this entire buffer or less than the entire buffer, but never more.
17630          */
17631         uint16_t        data_len;
17632         uint16_t        unused_0;
17633         uint32_t        unused_1;
17634         /* Port ID of port where PRBS test to be run. */
17635         uint16_t        port_id;
17636         /* Polynomial selection for PRBS test. */
17637         uint16_t        poly;
17638         /* PRBS7 */
17639         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS7   UINT32_C(0x0)
17640         /* PRBS9 */
17641         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS9   UINT32_C(0x1)
17642         /* PRBS11 */
17643         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS11  UINT32_C(0x2)
17644         /* PRBS15 */
17645         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS15  UINT32_C(0x3)
17646         /* PRBS23 */
17647         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS23  UINT32_C(0x4)
17648         /* PRBS31 */
17649         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS31  UINT32_C(0x5)
17650         /* PRBS58 */
17651         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS58  UINT32_C(0x6)
17652         /* Invalid */
17653         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID UINT32_C(0xff)
17654         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_LAST \
17655                 HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID
17656         /*
17657          * Configuration bits for PRBS test.
17658          * Use enable bit to start/stop test.
17659          * Use tx/rx lane map bits to run test on specific lanes,
17660          * if set to 0 test will be run on all lanes.
17661          */
17662         uint16_t        prbs_config;
17663         /*
17664          * Set 0 to stop test currently in progress
17665          * Set 1 to start test with configuration provided.
17666          */
17667         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_START_STOP \
17668                 UINT32_C(0x1)
17669         /*
17670          * If set to 1, tx_lane_map bitmap should have lane bits set.
17671          * If set to 0, test will be run on all lanes for this port.
17672          */
17673         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_TX_LANE_MAP_VALID \
17674                 UINT32_C(0x2)
17675         /*
17676          * If set to 1, rx_lane_map bitmap should have lane bits set.
17677          * If set to 0, test will be run on all lanes for this port.
17678          */
17679         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_RX_LANE_MAP_VALID \
17680                 UINT32_C(0x4)
17681         /* Duration in seconds to run the PRBS test. */
17682         uint16_t        timeout;
17683         /*
17684          * If tx_lane_map_valid is set to 1, this field is a bitmap
17685          * of tx lanes to run PRBS test. bit0 = lane0,
17686          * bit1 = lane1 ..bit31 = lane31
17687          */
17688         uint32_t        tx_lane_map;
17689         /*
17690          * If rx_lane_map_valid is set to 1, this field is a bitmap
17691          * of rx lanes to run PRBS test. bit0 = lane0,
17692          * bit1 = lane1 ..bit31 = lane31
17693          */
17694         uint32_t        rx_lane_map;
17695 } __attribute__((packed));
17696
17697 /* hwrm_port_prbs_test_output (size:128b/16B) */
17698 struct hwrm_port_prbs_test_output {
17699         /* The specific error status for the command. */
17700         uint16_t        error_code;
17701         /* The HWRM command request type. */
17702         uint16_t        req_type;
17703         /* The sequence ID from the original command. */
17704         uint16_t        seq_id;
17705         /* The length of the response data in number of bytes. */
17706         uint16_t        resp_len;
17707         /* Total length of stored data. */
17708         uint16_t        total_data_len;
17709         uint16_t        unused_0;
17710         uint8_t unused_1[3];
17711         /*
17712          * This field is used in Output records to indicate that the output
17713          * is completely written to RAM.  This field should be read as '1'
17714          * to indicate that the output has been completely written.
17715          * When writing a command completion or response to an internal processor,
17716          * the order of writes has to be such that this field is written last.
17717          */
17718         uint8_t valid;
17719 } __attribute__((packed));
17720
17721 /***********************
17722  * hwrm_queue_qportcfg *
17723  ***********************/
17724
17725
17726 /* hwrm_queue_qportcfg_input (size:192b/24B) */
17727 struct hwrm_queue_qportcfg_input {
17728         /* The HWRM command request type. */
17729         uint16_t        req_type;
17730         /*
17731          * The completion ring to send the completion event on. This should
17732          * be the NQ ID returned from the `nq_alloc` HWRM command.
17733          */
17734         uint16_t        cmpl_ring;
17735         /*
17736          * The sequence ID is used by the driver for tracking multiple
17737          * commands. This ID is treated as opaque data by the firmware and
17738          * the value is returned in the `hwrm_resp_hdr` upon completion.
17739          */
17740         uint16_t        seq_id;
17741         /*
17742          * The target ID of the command:
17743          * * 0x0-0xFFF8 - The function ID
17744          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17745          * * 0xFFFD - Reserved for user-space HWRM interface
17746          * * 0xFFFF - HWRM
17747          */
17748         uint16_t        target_id;
17749         /*
17750          * A physical address pointer pointing to a host buffer that the
17751          * command's response data will be written. This can be either a host
17752          * physical address (HPA) or a guest physical address (GPA) and must
17753          * point to a physically contiguous block of memory.
17754          */
17755         uint64_t        resp_addr;
17756         uint32_t        flags;
17757         /*
17758          * Enumeration denoting the RX, TX type of the resource.
17759          * This enumeration is used for resources that are similar for both
17760          * TX and RX paths of the chip.
17761          */
17762         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
17763         /* tx path */
17764         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
17765         /* rx path */
17766         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
17767         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
17768                 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
17769         /*
17770          * Port ID of port for which the queue configuration is being
17771          * queried.  This field is only required when sent by IPC.
17772          */
17773         uint16_t        port_id;
17774         /*
17775          * Drivers will set this capability when it can use
17776          * queue_idx_service_profile to map the queues to application.
17777          */
17778         uint8_t drv_qmap_cap;
17779         /* disabled */
17780         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
17781         /* enabled */
17782         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
17783         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
17784                 HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
17785         uint8_t unused_0;
17786 } __attribute__((packed));
17787
17788 /* hwrm_queue_qportcfg_output (size:256b/32B) */
17789 struct hwrm_queue_qportcfg_output {
17790         /* The specific error status for the command. */
17791         uint16_t        error_code;
17792         /* The HWRM command request type. */
17793         uint16_t        req_type;
17794         /* The sequence ID from the original command. */
17795         uint16_t        seq_id;
17796         /* The length of the response data in number of bytes. */
17797         uint16_t        resp_len;
17798         /*
17799          * The maximum number of queues that can be configured on this
17800          * port.
17801          * Valid values range from 1 through 8.
17802          */
17803         uint8_t max_configurable_queues;
17804         /*
17805          * The maximum number of lossless queues that can be configured
17806          * on this port.
17807          * Valid values range from 0 through 8.
17808          */
17809         uint8_t max_configurable_lossless_queues;
17810         /*
17811          * Bitmask indicating which queues can be configured by the
17812          * hwrm_queue_cfg command.
17813          *
17814          * Each bit represents a specific queue where bit 0 represents
17815          * queue 0 and bit 7 represents queue 7.
17816          * # A value of 0 indicates that the queue is not configurable
17817          * by the hwrm_queue_cfg command.
17818          * # A value of 1 indicates that the queue is configurable.
17819          * # A hwrm_queue_cfg command shall return error when trying to
17820          * configure a queue not configurable.
17821          */
17822         uint8_t queue_cfg_allowed;
17823         /* Information about queue configuration. */
17824         uint8_t queue_cfg_info;
17825         /*
17826          * If this flag is set to '1', then the queues are
17827          * configured asymmetrically on TX and RX sides.
17828          * If this flag is set to '0', then the queues are
17829          * configured symmetrically on TX and RX sides. For
17830          * symmetric configuration, the queue configuration
17831          * including queue ids and service profiles on the
17832          * TX side is the same as the corresponding queue
17833          * configuration on the RX side.
17834          */
17835         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
17836                 UINT32_C(0x1)
17837         /*
17838          * Bitmask indicating which queues can be configured by the
17839          * hwrm_queue_pfcenable_cfg command.
17840          *
17841          * Each bit represents a specific priority where bit 0 represents
17842          * priority 0 and bit 7 represents priority 7.
17843          * # A value of 0 indicates that the priority is not configurable by
17844          * the hwrm_queue_pfcenable_cfg command.
17845          * # A value of 1 indicates that the priority is configurable.
17846          * # A hwrm_queue_pfcenable_cfg command shall return error when
17847          * trying to configure a priority that is not configurable.
17848          */
17849         uint8_t queue_pfcenable_cfg_allowed;
17850         /*
17851          * Bitmask indicating which queues can be configured by the
17852          * hwrm_queue_pri2cos_cfg command.
17853          *
17854          * Each bit represents a specific queue where bit 0 represents
17855          * queue 0 and bit 7 represents queue 7.
17856          * # A value of 0 indicates that the queue is not configurable
17857          * by the hwrm_queue_pri2cos_cfg command.
17858          * # A value of 1 indicates that the queue is configurable.
17859          * # A hwrm_queue_pri2cos_cfg command shall return error when
17860          * trying to configure a queue that is not configurable.
17861          */
17862         uint8_t queue_pri2cos_cfg_allowed;
17863         /*
17864          * Bitmask indicating which queues can be configured by the
17865          * hwrm_queue_pri2cos_cfg command.
17866          *
17867          * Each bit represents a specific queue where bit 0 represents
17868          * queue 0 and bit 7 represents queue 7.
17869          * # A value of 0 indicates that the queue is not configurable
17870          * by the hwrm_queue_pri2cos_cfg command.
17871          * # A value of 1 indicates that the queue is configurable.
17872          * # A hwrm_queue_pri2cos_cfg command shall return error when
17873          * trying to configure a queue not configurable.
17874          */
17875         uint8_t queue_cos2bw_cfg_allowed;
17876         /*
17877          * ID of CoS Queue 0.
17878          * FF - Invalid id
17879          *
17880          * # This ID can be used on any subsequent call to an hwrm command
17881          * that takes a queue id.
17882          * # IDs must always be queried by this command before any use
17883          * by the driver or software.
17884          * # Any driver or software should not make any assumptions about
17885          * queue IDs.
17886          * # A value of 0xff indicates that the queue is not available.
17887          * # Available queues may not be in sequential order.
17888          */
17889         uint8_t queue_id0;
17890         /* This value is applicable to CoS queues only. */
17891         uint8_t queue_id0_service_profile;
17892         /* Lossy (best-effort) */
17893         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
17894                 UINT32_C(0x0)
17895         /* Lossless (legacy) */
17896         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
17897                 UINT32_C(0x1)
17898         /* Lossless RoCE */
17899         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \
17900                 UINT32_C(0x1)
17901         /* Lossy RoCE CNP */
17902         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \
17903                 UINT32_C(0x2)
17904         /* Lossless NIC */
17905         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \
17906                 UINT32_C(0x3)
17907         /* Set to 0xFF... (All Fs) if there is no service profile specified */
17908         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
17909                 UINT32_C(0xff)
17910         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \
17911                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
17912         /*
17913          * ID of CoS Queue 1.
17914          * FF - Invalid id
17915          *
17916          * # This ID can be used on any subsequent call to an hwrm command
17917          * that takes a queue id.
17918          * # IDs must always be queried by this command before any use
17919          * by the driver or software.
17920          * # Any driver or software should not make any assumptions about
17921          * queue IDs.
17922          * # A value of 0xff indicates that the queue is not available.
17923          * # Available queues may not be in sequential order.
17924          */
17925         uint8_t queue_id1;
17926         /* This value is applicable to CoS queues only. */
17927         uint8_t queue_id1_service_profile;
17928         /* Lossy (best-effort) */
17929         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
17930                 UINT32_C(0x0)
17931         /* Lossless (legacy) */
17932         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
17933                 UINT32_C(0x1)
17934         /* Lossless RoCE */
17935         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \
17936                 UINT32_C(0x1)
17937         /* Lossy RoCE CNP */
17938         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \
17939                 UINT32_C(0x2)
17940         /* Lossless NIC */
17941         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \
17942                 UINT32_C(0x3)
17943         /* Set to 0xFF... (All Fs) if there is no service profile specified */
17944         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
17945                 UINT32_C(0xff)
17946         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \
17947                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
17948         /*
17949          * ID of CoS Queue 2.
17950          * FF - Invalid id
17951          *
17952          * # This ID can be used on any subsequent call to an hwrm command
17953          * that takes a queue id.
17954          * # IDs must always be queried by this command before any use
17955          * by the driver or software.
17956          * # Any driver or software should not make any assumptions about
17957          * queue IDs.
17958          * # A value of 0xff indicates that the queue is not available.
17959          * # Available queues may not be in sequential order.
17960          */
17961         uint8_t queue_id2;
17962         /* This value is applicable to CoS queues only. */
17963         uint8_t queue_id2_service_profile;
17964         /* Lossy (best-effort) */
17965         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
17966                 UINT32_C(0x0)
17967         /* Lossless (legacy) */
17968         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
17969                 UINT32_C(0x1)
17970         /* Lossless RoCE */
17971         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \
17972                 UINT32_C(0x1)
17973         /* Lossy RoCE CNP */
17974         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \
17975                 UINT32_C(0x2)
17976         /* Lossless NIC */
17977         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \
17978                 UINT32_C(0x3)
17979         /* Set to 0xFF... (All Fs) if there is no service profile specified */
17980         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
17981                 UINT32_C(0xff)
17982         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \
17983                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
17984         /*
17985          * ID of CoS Queue 3.
17986          * FF - Invalid id
17987          *
17988          * # This ID can be used on any subsequent call to an hwrm command
17989          * that takes a queue id.
17990          * # IDs must always be queried by this command before any use
17991          * by the driver or software.
17992          * # Any driver or software should not make any assumptions about
17993          * queue IDs.
17994          * # A value of 0xff indicates that the queue is not available.
17995          * # Available queues may not be in sequential order.
17996          */
17997         uint8_t queue_id3;
17998         /* This value is applicable to CoS queues only. */
17999         uint8_t queue_id3_service_profile;
18000         /* Lossy (best-effort) */
18001         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
18002                 UINT32_C(0x0)
18003         /* Lossless (legacy) */
18004         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
18005                 UINT32_C(0x1)
18006         /* Lossless RoCE */
18007         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \
18008                 UINT32_C(0x1)
18009         /* Lossy RoCE CNP */
18010         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18011                 UINT32_C(0x2)
18012         /* Lossless NIC */
18013         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \
18014                 UINT32_C(0x3)
18015         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18016         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
18017                 UINT32_C(0xff)
18018         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \
18019                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
18020         /*
18021          * ID of CoS Queue 4.
18022          * FF - Invalid id
18023          *
18024          * # This ID can be used on any subsequent call to an hwrm command
18025          * that takes a queue id.
18026          * # IDs must always be queried by this command before any use
18027          * by the driver or software.
18028          * # Any driver or software should not make any assumptions about
18029          * queue IDs.
18030          * # A value of 0xff indicates that the queue is not available.
18031          * # Available queues may not be in sequential order.
18032          */
18033         uint8_t queue_id4;
18034         /* This value is applicable to CoS queues only. */
18035         uint8_t queue_id4_service_profile;
18036         /* Lossy (best-effort) */
18037         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
18038                 UINT32_C(0x0)
18039         /* Lossless (legacy) */
18040         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
18041                 UINT32_C(0x1)
18042         /* Lossless RoCE */
18043         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \
18044                 UINT32_C(0x1)
18045         /* Lossy RoCE CNP */
18046         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18047                 UINT32_C(0x2)
18048         /* Lossless NIC */
18049         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \
18050                 UINT32_C(0x3)
18051         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18052         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
18053                 UINT32_C(0xff)
18054         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \
18055                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
18056         /*
18057          * ID of CoS Queue 5.
18058          * FF - Invalid id
18059          *
18060          * # This ID can be used on any subsequent call to an hwrm command
18061          * that takes a queue id.
18062          * # IDs must always be queried by this command before any use
18063          * by the driver or software.
18064          * # Any driver or software should not make any assumptions about
18065          * queue IDs.
18066          * # A value of 0xff indicates that the queue is not available.
18067          * # Available queues may not be in sequential order.
18068          */
18069         uint8_t queue_id5;
18070         /* This value is applicable to CoS queues only. */
18071         uint8_t queue_id5_service_profile;
18072         /* Lossy (best-effort) */
18073         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
18074                 UINT32_C(0x0)
18075         /* Lossless (legacy) */
18076         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
18077                 UINT32_C(0x1)
18078         /* Lossless RoCE */
18079         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \
18080                 UINT32_C(0x1)
18081         /* Lossy RoCE CNP */
18082         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18083                 UINT32_C(0x2)
18084         /* Lossless NIC */
18085         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \
18086                 UINT32_C(0x3)
18087         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18088         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
18089                 UINT32_C(0xff)
18090         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \
18091                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
18092         /*
18093          * ID of CoS Queue 6.
18094          * FF - Invalid id
18095          *
18096          * # This ID can be used on any subsequent call to an hwrm command
18097          * that takes a queue id.
18098          * # IDs must always be queried by this command before any use
18099          * by the driver or software.
18100          * # Any driver or software should not make any assumptions about
18101          * queue IDs.
18102          * # A value of 0xff indicates that the queue is not available.
18103          * # Available queues may not be in sequential order.
18104          */
18105         uint8_t queue_id6;
18106         /* This value is applicable to CoS queues only. */
18107         uint8_t queue_id6_service_profile;
18108         /* Lossy (best-effort) */
18109         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
18110                 UINT32_C(0x0)
18111         /* Lossless (legacy) */
18112         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
18113                 UINT32_C(0x1)
18114         /* Lossless RoCE */
18115         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \
18116                 UINT32_C(0x1)
18117         /* Lossy RoCE CNP */
18118         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18119                 UINT32_C(0x2)
18120         /* Lossless NIC */
18121         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \
18122                 UINT32_C(0x3)
18123         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18124         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
18125                 UINT32_C(0xff)
18126         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \
18127                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
18128         /*
18129          * ID of CoS Queue 7.
18130          * FF - Invalid id
18131          *
18132          * # This ID can be used on any subsequent call to an hwrm command
18133          * that takes a queue id.
18134          * # IDs must always be queried by this command before any use
18135          * by the driver or software.
18136          * # Any driver or software should not make any assumptions about
18137          * queue IDs.
18138          * # A value of 0xff indicates that the queue is not available.
18139          * # Available queues may not be in sequential order.
18140          */
18141         uint8_t queue_id7;
18142         /* This value is applicable to CoS queues only. */
18143         uint8_t queue_id7_service_profile;
18144         /* Lossy (best-effort) */
18145         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
18146                 UINT32_C(0x0)
18147         /* Lossless (legacy) */
18148         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
18149                 UINT32_C(0x1)
18150         /* Lossless RoCE */
18151         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \
18152                 UINT32_C(0x1)
18153         /* Lossy RoCE CNP */
18154         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18155                 UINT32_C(0x2)
18156         /* Lossless NIC */
18157         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \
18158                 UINT32_C(0x3)
18159         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18160         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
18161                 UINT32_C(0xff)
18162         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \
18163                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
18164         /*
18165          * This field is used in Output records to indicate that the output
18166          * is completely written to RAM.  This field should be read as '1'
18167          * to indicate that the output has been completely written.
18168          * When writing a command completion or response to an internal processor,
18169          * the order of writes has to be such that this field is written last.
18170          */
18171         uint8_t valid;
18172 } __attribute__((packed));
18173
18174 /*******************
18175  * hwrm_queue_qcfg *
18176  *******************/
18177
18178
18179 /* hwrm_queue_qcfg_input (size:192b/24B) */
18180 struct hwrm_queue_qcfg_input {
18181         /* The HWRM command request type. */
18182         uint16_t        req_type;
18183         /*
18184          * The completion ring to send the completion event on. This should
18185          * be the NQ ID returned from the `nq_alloc` HWRM command.
18186          */
18187         uint16_t        cmpl_ring;
18188         /*
18189          * The sequence ID is used by the driver for tracking multiple
18190          * commands. This ID is treated as opaque data by the firmware and
18191          * the value is returned in the `hwrm_resp_hdr` upon completion.
18192          */
18193         uint16_t        seq_id;
18194         /*
18195          * The target ID of the command:
18196          * * 0x0-0xFFF8 - The function ID
18197          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18198          * * 0xFFFD - Reserved for user-space HWRM interface
18199          * * 0xFFFF - HWRM
18200          */
18201         uint16_t        target_id;
18202         /*
18203          * A physical address pointer pointing to a host buffer that the
18204          * command's response data will be written. This can be either a host
18205          * physical address (HPA) or a guest physical address (GPA) and must
18206          * point to a physically contiguous block of memory.
18207          */
18208         uint64_t        resp_addr;
18209         uint32_t        flags;
18210         /*
18211          * Enumeration denoting the RX, TX type of the resource.
18212          * This enumeration is used for resources that are similar for both
18213          * TX and RX paths of the chip.
18214          */
18215         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
18216         /* tx path */
18217         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
18218         /* rx path */
18219         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
18220         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST \
18221                 HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
18222         /* Queue ID of the queue. */
18223         uint32_t        queue_id;
18224 } __attribute__((packed));
18225
18226 /* hwrm_queue_qcfg_output (size:128b/16B) */
18227 struct hwrm_queue_qcfg_output {
18228         /* The specific error status for the command. */
18229         uint16_t        error_code;
18230         /* The HWRM command request type. */
18231         uint16_t        req_type;
18232         /* The sequence ID from the original command. */
18233         uint16_t        seq_id;
18234         /* The length of the response data in number of bytes. */
18235         uint16_t        resp_len;
18236         /*
18237          * This value is a the estimate packet length used in the
18238          * TX arbiter.
18239          */
18240         uint32_t        queue_len;
18241         /* This value is applicable to CoS queues only. */
18242         uint8_t service_profile;
18243         /* Lossy (best-effort) */
18244         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
18245         /* Lossless */
18246         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
18247         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18248         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
18249         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST \
18250                 HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
18251         /* Information about queue configuration. */
18252         uint8_t queue_cfg_info;
18253         /*
18254          * If this flag is set to '1', then the queue is
18255          * configured asymmetrically on TX and RX sides.
18256          * If this flag is set to '0', then this queue is
18257          * configured symmetrically on TX and RX sides.
18258          */
18259         #define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
18260                 UINT32_C(0x1)
18261         uint8_t unused_0;
18262         /*
18263          * This field is used in Output records to indicate that the output
18264          * is completely written to RAM.  This field should be read as '1'
18265          * to indicate that the output has been completely written.
18266          * When writing a command completion or response to an internal processor,
18267          * the order of writes has to be such that this field is written last.
18268          */
18269         uint8_t valid;
18270 } __attribute__((packed));
18271
18272 /******************
18273  * hwrm_queue_cfg *
18274  ******************/
18275
18276
18277 /* hwrm_queue_cfg_input (size:320b/40B) */
18278 struct hwrm_queue_cfg_input {
18279         /* The HWRM command request type. */
18280         uint16_t        req_type;
18281         /*
18282          * The completion ring to send the completion event on. This should
18283          * be the NQ ID returned from the `nq_alloc` HWRM command.
18284          */
18285         uint16_t        cmpl_ring;
18286         /*
18287          * The sequence ID is used by the driver for tracking multiple
18288          * commands. This ID is treated as opaque data by the firmware and
18289          * the value is returned in the `hwrm_resp_hdr` upon completion.
18290          */
18291         uint16_t        seq_id;
18292         /*
18293          * The target ID of the command:
18294          * * 0x0-0xFFF8 - The function ID
18295          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18296          * * 0xFFFD - Reserved for user-space HWRM interface
18297          * * 0xFFFF - HWRM
18298          */
18299         uint16_t        target_id;
18300         /*
18301          * A physical address pointer pointing to a host buffer that the
18302          * command's response data will be written. This can be either a host
18303          * physical address (HPA) or a guest physical address (GPA) and must
18304          * point to a physically contiguous block of memory.
18305          */
18306         uint64_t        resp_addr;
18307         uint32_t        flags;
18308         /*
18309          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
18310          * This enumeration is used for resources that are similar for both
18311          * TX and RX paths of the chip.
18312          */
18313         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
18314         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT  0
18315         /* tx path */
18316         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
18317         /* rx path */
18318         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
18319         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
18320         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
18321         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST \
18322                 HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
18323         uint32_t        enables;
18324         /*
18325          * This bit must be '1' for the dflt_len field to be
18326          * configured.
18327          */
18328         #define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN            UINT32_C(0x1)
18329         /*
18330          * This bit must be '1' for the service_profile field to be
18331          * configured.
18332          */
18333         #define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE     UINT32_C(0x2)
18334         /* Queue ID of queue that is to be configured by this function. */
18335         uint32_t        queue_id;
18336         /*
18337          * This value is a the estimate packet length used in the
18338          * TX arbiter.
18339          * Set to 0xFF... (All Fs) to not adjust this value.
18340          */
18341         uint32_t        dflt_len;
18342         /* This value is applicable to CoS queues only. */
18343         uint8_t service_profile;
18344         /* Lossy (best-effort) */
18345         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
18346         /* Lossless */
18347         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
18348         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18349         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
18350         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST \
18351                 HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
18352         uint8_t unused_0[7];
18353 } __attribute__((packed));
18354
18355 /* hwrm_queue_cfg_output (size:128b/16B) */
18356 struct hwrm_queue_cfg_output {
18357         /* The specific error status for the command. */
18358         uint16_t        error_code;
18359         /* The HWRM command request type. */
18360         uint16_t        req_type;
18361         /* The sequence ID from the original command. */
18362         uint16_t        seq_id;
18363         /* The length of the response data in number of bytes. */
18364         uint16_t        resp_len;
18365         uint8_t unused_0[7];
18366         /*
18367          * This field is used in Output records to indicate that the output
18368          * is completely written to RAM.  This field should be read as '1'
18369          * to indicate that the output has been completely written.
18370          * When writing a command completion or response to an internal processor,
18371          * the order of writes has to be such that this field is written last.
18372          */
18373         uint8_t valid;
18374 } __attribute__((packed));
18375
18376 /*****************************
18377  * hwrm_queue_pfcenable_qcfg *
18378  *****************************/
18379
18380
18381 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
18382 struct hwrm_queue_pfcenable_qcfg_input {
18383         /* The HWRM command request type. */
18384         uint16_t        req_type;
18385         /*
18386          * The completion ring to send the completion event on. This should
18387          * be the NQ ID returned from the `nq_alloc` HWRM command.
18388          */
18389         uint16_t        cmpl_ring;
18390         /*
18391          * The sequence ID is used by the driver for tracking multiple
18392          * commands. This ID is treated as opaque data by the firmware and
18393          * the value is returned in the `hwrm_resp_hdr` upon completion.
18394          */
18395         uint16_t        seq_id;
18396         /*
18397          * The target ID of the command:
18398          * * 0x0-0xFFF8 - The function ID
18399          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18400          * * 0xFFFD - Reserved for user-space HWRM interface
18401          * * 0xFFFF - HWRM
18402          */
18403         uint16_t        target_id;
18404         /*
18405          * A physical address pointer pointing to a host buffer that the
18406          * command's response data will be written. This can be either a host
18407          * physical address (HPA) or a guest physical address (GPA) and must
18408          * point to a physically contiguous block of memory.
18409          */
18410         uint64_t        resp_addr;
18411         /*
18412          * Port ID of port for which the table is being configured.
18413          * The HWRM needs to check whether this function is allowed
18414          * to configure pri2cos mapping on this port.
18415          */
18416         uint16_t        port_id;
18417         uint8_t unused_0[6];
18418 } __attribute__((packed));
18419
18420 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
18421 struct hwrm_queue_pfcenable_qcfg_output {
18422         /* The specific error status for the command. */
18423         uint16_t        error_code;
18424         /* The HWRM command request type. */
18425         uint16_t        req_type;
18426         /* The sequence ID from the original command. */
18427         uint16_t        seq_id;
18428         /* The length of the response data in number of bytes. */
18429         uint16_t        resp_len;
18430         uint32_t        flags;
18431         /* If set to 1, then PFC is enabled on PRI 0. */
18432         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED \
18433                 UINT32_C(0x1)
18434         /* If set to 1, then PFC is enabled on PRI 1. */
18435         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED \
18436                 UINT32_C(0x2)
18437         /* If set to 1, then PFC is enabled on PRI 2. */
18438         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED \
18439                 UINT32_C(0x4)
18440         /* If set to 1, then PFC is enabled on PRI 3. */
18441         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED \
18442                 UINT32_C(0x8)
18443         /* If set to 1, then PFC is enabled on PRI 4. */
18444         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED \
18445                 UINT32_C(0x10)
18446         /* If set to 1, then PFC is enabled on PRI 5. */
18447         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED \
18448                 UINT32_C(0x20)
18449         /* If set to 1, then PFC is enabled on PRI 6. */
18450         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED \
18451                 UINT32_C(0x40)
18452         /* If set to 1, then PFC is enabled on PRI 7. */
18453         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED \
18454                 UINT32_C(0x80)
18455         uint8_t unused_0[3];
18456         /*
18457          * This field is used in Output records to indicate that the output
18458          * is completely written to RAM.  This field should be read as '1'
18459          * to indicate that the output has been completely written.
18460          * When writing a command completion or response to an internal processor,
18461          * the order of writes has to be such that this field is written last.
18462          */
18463         uint8_t valid;
18464 } __attribute__((packed));
18465
18466 /****************************
18467  * hwrm_queue_pfcenable_cfg *
18468  ****************************/
18469
18470
18471 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
18472 struct hwrm_queue_pfcenable_cfg_input {
18473         /* The HWRM command request type. */
18474         uint16_t        req_type;
18475         /*
18476          * The completion ring to send the completion event on. This should
18477          * be the NQ ID returned from the `nq_alloc` HWRM command.
18478          */
18479         uint16_t        cmpl_ring;
18480         /*
18481          * The sequence ID is used by the driver for tracking multiple
18482          * commands. This ID is treated as opaque data by the firmware and
18483          * the value is returned in the `hwrm_resp_hdr` upon completion.
18484          */
18485         uint16_t        seq_id;
18486         /*
18487          * The target ID of the command:
18488          * * 0x0-0xFFF8 - The function ID
18489          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18490          * * 0xFFFD - Reserved for user-space HWRM interface
18491          * * 0xFFFF - HWRM
18492          */
18493         uint16_t        target_id;
18494         /*
18495          * A physical address pointer pointing to a host buffer that the
18496          * command's response data will be written. This can be either a host
18497          * physical address (HPA) or a guest physical address (GPA) and must
18498          * point to a physically contiguous block of memory.
18499          */
18500         uint64_t        resp_addr;
18501         uint32_t        flags;
18502         /* If set to 1, then PFC is requested to be enabled on PRI 0. */
18503         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED \
18504                 UINT32_C(0x1)
18505         /* If set to 1, then PFC is requested to be enabled on PRI 1. */
18506         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED \
18507                 UINT32_C(0x2)
18508         /* If set to 1, then PFC is requested to  be enabled on PRI 2. */
18509         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED \
18510                 UINT32_C(0x4)
18511         /* If set to 1, then PFC is requested to  be enabled on PRI 3. */
18512         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED \
18513                 UINT32_C(0x8)
18514         /* If set to 1, then PFC is requested to  be enabled on PRI 4. */
18515         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED \
18516                 UINT32_C(0x10)
18517         /* If set to 1, then PFC is requested to  be enabled on PRI 5. */
18518         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED \
18519                 UINT32_C(0x20)
18520         /* If set to 1, then PFC is requested to  be enabled on PRI 6. */
18521         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED \
18522                 UINT32_C(0x40)
18523         /* If set to 1, then PFC is requested to  be enabled on PRI 7. */
18524         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED \
18525                 UINT32_C(0x80)
18526         /*
18527          * Port ID of port for which the table is being configured.
18528          * The HWRM needs to check whether this function is allowed
18529          * to configure pri2cos mapping on this port.
18530          */
18531         uint16_t        port_id;
18532         uint8_t unused_0[2];
18533 } __attribute__((packed));
18534
18535 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
18536 struct hwrm_queue_pfcenable_cfg_output {
18537         /* The specific error status for the command. */
18538         uint16_t        error_code;
18539         /* The HWRM command request type. */
18540         uint16_t        req_type;
18541         /* The sequence ID from the original command. */
18542         uint16_t        seq_id;
18543         /* The length of the response data in number of bytes. */
18544         uint16_t        resp_len;
18545         uint8_t unused_0[7];
18546         /*
18547          * This field is used in Output records to indicate that the output
18548          * is completely written to RAM.  This field should be read as '1'
18549          * to indicate that the output has been completely written.
18550          * When writing a command completion or response to an internal processor,
18551          * the order of writes has to be such that this field is written last.
18552          */
18553         uint8_t valid;
18554 } __attribute__((packed));
18555
18556 /***************************
18557  * hwrm_queue_pri2cos_qcfg *
18558  ***************************/
18559
18560
18561 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
18562 struct hwrm_queue_pri2cos_qcfg_input {
18563         /* The HWRM command request type. */
18564         uint16_t        req_type;
18565         /*
18566          * The completion ring to send the completion event on. This should
18567          * be the NQ ID returned from the `nq_alloc` HWRM command.
18568          */
18569         uint16_t        cmpl_ring;
18570         /*
18571          * The sequence ID is used by the driver for tracking multiple
18572          * commands. This ID is treated as opaque data by the firmware and
18573          * the value is returned in the `hwrm_resp_hdr` upon completion.
18574          */
18575         uint16_t        seq_id;
18576         /*
18577          * The target ID of the command:
18578          * * 0x0-0xFFF8 - The function ID
18579          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18580          * * 0xFFFD - Reserved for user-space HWRM interface
18581          * * 0xFFFF - HWRM
18582          */
18583         uint16_t        target_id;
18584         /*
18585          * A physical address pointer pointing to a host buffer that the
18586          * command's response data will be written. This can be either a host
18587          * physical address (HPA) or a guest physical address (GPA) and must
18588          * point to a physically contiguous block of memory.
18589          */
18590         uint64_t        resp_addr;
18591         uint32_t        flags;
18592         /*
18593          * Enumeration denoting the RX, TX type of the resource.
18594          * This enumeration is used for resources that are similar for both
18595          * TX and RX paths of the chip.
18596          */
18597         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH      UINT32_C(0x1)
18598         /* tx path */
18599         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
18600         /* rx path */
18601         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
18602         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST \
18603                 HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
18604         /*
18605          * When this bit is set to '0', the query is
18606          * for VLAN PRI field in tunnel headers.
18607          * When this bit is set to '1', the query is
18608          * for VLAN PRI field in inner packet headers.
18609          */
18610         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN     UINT32_C(0x2)
18611         /*
18612          * Port ID of port for which the table is being configured.
18613          * The HWRM needs to check whether this function is allowed
18614          * to configure pri2cos mapping on this port.
18615          */
18616         uint8_t port_id;
18617         uint8_t unused_0[3];
18618 } __attribute__((packed));
18619
18620 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
18621 struct hwrm_queue_pri2cos_qcfg_output {
18622         /* The specific error status for the command. */
18623         uint16_t        error_code;
18624         /* The HWRM command request type. */
18625         uint16_t        req_type;
18626         /* The sequence ID from the original command. */
18627         uint16_t        seq_id;
18628         /* The length of the response data in number of bytes. */
18629         uint16_t        resp_len;
18630         /*
18631          * CoS Queue assigned to priority 0.  This value can only
18632          * be changed before traffic has started.
18633          * A value of 0xff indicates that no CoS queue is assigned to the
18634          * specified priority.
18635          */
18636         uint8_t pri0_cos_queue_id;
18637         /*
18638          * CoS Queue assigned to priority 1.  This value can only
18639          * be changed before traffic has started.
18640          * A value of 0xff indicates that no CoS queue is assigned to the
18641          * specified priority.
18642          */
18643         uint8_t pri1_cos_queue_id;
18644         /*
18645          * CoS Queue assigned to priority 2  This value can only
18646          * be changed before traffic has started.
18647          * A value of 0xff indicates that no CoS queue is assigned to the
18648          * specified priority.
18649          */
18650         uint8_t pri2_cos_queue_id;
18651         /*
18652          * CoS Queue assigned to priority 3.  This value can only
18653          * be changed before traffic has started.
18654          * A value of 0xff indicates that no CoS queue is assigned to the
18655          * specified priority.
18656          */
18657         uint8_t pri3_cos_queue_id;
18658         /*
18659          * CoS Queue assigned to priority 4.  This value can only
18660          * be changed before traffic has started.
18661          * A value of 0xff indicates that no CoS queue is assigned to the
18662          * specified priority.
18663          */
18664         uint8_t pri4_cos_queue_id;
18665         /*
18666          * CoS Queue assigned to priority 5.  This value can only
18667          * be changed before traffic has started.
18668          * A value of 0xff indicates that no CoS queue is assigned to the
18669          * specified priority.
18670          */
18671         uint8_t pri5_cos_queue_id;
18672         /*
18673          * CoS Queue assigned to priority 6.  This value can only
18674          * be changed before traffic has started.
18675          * A value of 0xff indicates that no CoS queue is assigned to the
18676          * specified priority.
18677          */
18678         uint8_t pri6_cos_queue_id;
18679         /*
18680          * CoS Queue assigned to priority 7.  This value can only
18681          * be changed before traffic has started.
18682          * A value of 0xff indicates that no CoS queue is assigned to the
18683          * specified priority.
18684          */
18685         uint8_t pri7_cos_queue_id;
18686         /* Information about queue configuration. */
18687         uint8_t queue_cfg_info;
18688         /*
18689          * If this flag is set to '1', then the PRI to CoS
18690          * configuration is asymmetric on TX and RX sides.
18691          * If this flag is set to '0', then PRI to CoS configuration
18692          * is symmetric on TX and RX sides.
18693          */
18694         #define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
18695                 UINT32_C(0x1)
18696         uint8_t unused_0[6];
18697         /*
18698          * This field is used in Output records to indicate that the output
18699          * is completely written to RAM.  This field should be read as '1'
18700          * to indicate that the output has been completely written.
18701          * When writing a command completion or response to an internal processor,
18702          * the order of writes has to be such that this field is written last.
18703          */
18704         uint8_t valid;
18705 } __attribute__((packed));
18706
18707 /**************************
18708  * hwrm_queue_pri2cos_cfg *
18709  **************************/
18710
18711
18712 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
18713 struct hwrm_queue_pri2cos_cfg_input {
18714         /* The HWRM command request type. */
18715         uint16_t        req_type;
18716         /*
18717          * The completion ring to send the completion event on. This should
18718          * be the NQ ID returned from the `nq_alloc` HWRM command.
18719          */
18720         uint16_t        cmpl_ring;
18721         /*
18722          * The sequence ID is used by the driver for tracking multiple
18723          * commands. This ID is treated as opaque data by the firmware and
18724          * the value is returned in the `hwrm_resp_hdr` upon completion.
18725          */
18726         uint16_t        seq_id;
18727         /*
18728          * The target ID of the command:
18729          * * 0x0-0xFFF8 - The function ID
18730          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18731          * * 0xFFFD - Reserved for user-space HWRM interface
18732          * * 0xFFFF - HWRM
18733          */
18734         uint16_t        target_id;
18735         /*
18736          * A physical address pointer pointing to a host buffer that the
18737          * command's response data will be written. This can be either a host
18738          * physical address (HPA) or a guest physical address (GPA) and must
18739          * point to a physically contiguous block of memory.
18740          */
18741         uint64_t        resp_addr;
18742         uint32_t        flags;
18743         /*
18744          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
18745          * This enumeration is used for resources that are similar for both
18746          * TX and RX paths of the chip.
18747          */
18748         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
18749         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT  0
18750         /* tx path */
18751         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
18752         /* rx path */
18753         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
18754         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
18755         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
18756         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST \
18757                 HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
18758         /*
18759          * When this bit is set to '0', the mapping is requested
18760          * for VLAN PRI field in tunnel headers.
18761          * When this bit is set to '1', the mapping is requested
18762          * for VLAN PRI field in inner packet headers.
18763          */
18764         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN     UINT32_C(0x4)
18765         uint32_t        enables;
18766         /*
18767          * This bit must be '1' for the pri0_cos_queue_id field to be
18768          * configured.
18769          */
18770         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID \
18771                 UINT32_C(0x1)
18772         /*
18773          * This bit must be '1' for the pri1_cos_queue_id field to be
18774          * configured.
18775          */
18776         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID \
18777                 UINT32_C(0x2)
18778         /*
18779          * This bit must be '1' for the pri2_cos_queue_id field to be
18780          * configured.
18781          */
18782         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID \
18783                 UINT32_C(0x4)
18784         /*
18785          * This bit must be '1' for the pri3_cos_queue_id field to be
18786          * configured.
18787          */
18788         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID \
18789                 UINT32_C(0x8)
18790         /*
18791          * This bit must be '1' for the pri4_cos_queue_id field to be
18792          * configured.
18793          */
18794         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID \
18795                 UINT32_C(0x10)
18796         /*
18797          * This bit must be '1' for the pri5_cos_queue_id field to be
18798          * configured.
18799          */
18800         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID \
18801                 UINT32_C(0x20)
18802         /*
18803          * This bit must be '1' for the pri6_cos_queue_id field to be
18804          * configured.
18805          */
18806         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID \
18807                 UINT32_C(0x40)
18808         /*
18809          * This bit must be '1' for the pri7_cos_queue_id field to be
18810          * configured.
18811          */
18812         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID \
18813                 UINT32_C(0x80)
18814         /*
18815          * Port ID of port for which the table is being configured.
18816          * The HWRM needs to check whether this function is allowed
18817          * to configure pri2cos mapping on this port.
18818          */
18819         uint8_t port_id;
18820         /*
18821          * CoS Queue assigned to priority 0.  This value can only
18822          * be changed before traffic has started.
18823          */
18824         uint8_t pri0_cos_queue_id;
18825         /*
18826          * CoS Queue assigned to priority 1.  This value can only
18827          * be changed before traffic has started.
18828          */
18829         uint8_t pri1_cos_queue_id;
18830         /*
18831          * CoS Queue assigned to priority 2  This value can only
18832          * be changed before traffic has started.
18833          */
18834         uint8_t pri2_cos_queue_id;
18835         /*
18836          * CoS Queue assigned to priority 3.  This value can only
18837          * be changed before traffic has started.
18838          */
18839         uint8_t pri3_cos_queue_id;
18840         /*
18841          * CoS Queue assigned to priority 4.  This value can only
18842          * be changed before traffic has started.
18843          */
18844         uint8_t pri4_cos_queue_id;
18845         /*
18846          * CoS Queue assigned to priority 5.  This value can only
18847          * be changed before traffic has started.
18848          */
18849         uint8_t pri5_cos_queue_id;
18850         /*
18851          * CoS Queue assigned to priority 6.  This value can only
18852          * be changed before traffic has started.
18853          */
18854         uint8_t pri6_cos_queue_id;
18855         /*
18856          * CoS Queue assigned to priority 7.  This value can only
18857          * be changed before traffic has started.
18858          */
18859         uint8_t pri7_cos_queue_id;
18860         uint8_t unused_0[7];
18861 } __attribute__((packed));
18862
18863 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
18864 struct hwrm_queue_pri2cos_cfg_output {
18865         /* The specific error status for the command. */
18866         uint16_t        error_code;
18867         /* The HWRM command request type. */
18868         uint16_t        req_type;
18869         /* The sequence ID from the original command. */
18870         uint16_t        seq_id;
18871         /* The length of the response data in number of bytes. */
18872         uint16_t        resp_len;
18873         uint8_t unused_0[7];
18874         /*
18875          * This field is used in Output records to indicate that the output
18876          * is completely written to RAM.  This field should be read as '1'
18877          * to indicate that the output has been completely written.
18878          * When writing a command completion or response to an internal processor,
18879          * the order of writes has to be such that this field is written last.
18880          */
18881         uint8_t valid;
18882 } __attribute__((packed));
18883
18884 /**************************
18885  * hwrm_queue_cos2bw_qcfg *
18886  **************************/
18887
18888
18889 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
18890 struct hwrm_queue_cos2bw_qcfg_input {
18891         /* The HWRM command request type. */
18892         uint16_t        req_type;
18893         /*
18894          * The completion ring to send the completion event on. This should
18895          * be the NQ ID returned from the `nq_alloc` HWRM command.
18896          */
18897         uint16_t        cmpl_ring;
18898         /*
18899          * The sequence ID is used by the driver for tracking multiple
18900          * commands. This ID is treated as opaque data by the firmware and
18901          * the value is returned in the `hwrm_resp_hdr` upon completion.
18902          */
18903         uint16_t        seq_id;
18904         /*
18905          * The target ID of the command:
18906          * * 0x0-0xFFF8 - The function ID
18907          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18908          * * 0xFFFD - Reserved for user-space HWRM interface
18909          * * 0xFFFF - HWRM
18910          */
18911         uint16_t        target_id;
18912         /*
18913          * A physical address pointer pointing to a host buffer that the
18914          * command's response data will be written. This can be either a host
18915          * physical address (HPA) or a guest physical address (GPA) and must
18916          * point to a physically contiguous block of memory.
18917          */
18918         uint64_t        resp_addr;
18919         /*
18920          * Port ID of port for which the table is being configured.
18921          * The HWRM needs to check whether this function is allowed
18922          * to configure TC BW assignment on this port.
18923          */
18924         uint16_t        port_id;
18925         uint8_t unused_0[6];
18926 } __attribute__((packed));
18927
18928 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
18929 struct hwrm_queue_cos2bw_qcfg_output {
18930         /* The specific error status for the command. */
18931         uint16_t        error_code;
18932         /* The HWRM command request type. */
18933         uint16_t        req_type;
18934         /* The sequence ID from the original command. */
18935         uint16_t        seq_id;
18936         /* The length of the response data in number of bytes. */
18937         uint16_t        resp_len;
18938         /* ID of CoS Queue 0. */
18939         uint8_t queue_id0;
18940         uint8_t unused_0;
18941         uint16_t        unused_1;
18942         /*
18943          * Minimum BW allocated to CoS Queue.
18944          * The HWRM will translate this value into byte counter and
18945          * time interval used for this COS inside the device.
18946          */
18947         uint32_t        queue_id0_min_bw;
18948         /* The bandwidth value. */
18949         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
18950                 UINT32_C(0xfffffff)
18951         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
18952                 0
18953         /* The granularity of the value (bits or bytes). */
18954         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE \
18955                 UINT32_C(0x10000000)
18956         /* Value is in bits. */
18957         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
18958                 (UINT32_C(0x0) << 28)
18959         /* Value is in bytes. */
18960         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
18961                 (UINT32_C(0x1) << 28)
18962         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
18963                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
18964         /* bw_value_unit is 3 b */
18965         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
18966                 UINT32_C(0xe0000000)
18967         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
18968                 29
18969         /* Value is in Mb or MB (base 10). */
18970         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
18971                 (UINT32_C(0x0) << 29)
18972         /* Value is in Kb or KB (base 10). */
18973         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
18974                 (UINT32_C(0x2) << 29)
18975         /* Value is in bits or bytes. */
18976         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
18977                 (UINT32_C(0x4) << 29)
18978         /* Value is in Gb or GB (base 10). */
18979         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
18980                 (UINT32_C(0x6) << 29)
18981         /* Value is in 1/100th of a percentage of total bandwidth. */
18982         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
18983                 (UINT32_C(0x1) << 29)
18984         /* Invalid unit */
18985         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
18986                 (UINT32_C(0x7) << 29)
18987         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
18988                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
18989         /*
18990          * Maximum BW allocated to CoS Queue.
18991          * The HWRM will translate this value into byte counter and
18992          * time interval used for this COS inside the device.
18993          */
18994         uint32_t        queue_id0_max_bw;
18995         /* The bandwidth value. */
18996         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
18997                 UINT32_C(0xfffffff)
18998         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
18999                 0
19000         /* The granularity of the value (bits or bytes). */
19001         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE \
19002                 UINT32_C(0x10000000)
19003         /* Value is in bits. */
19004         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
19005                 (UINT32_C(0x0) << 28)
19006         /* Value is in bytes. */
19007         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
19008                 (UINT32_C(0x1) << 28)
19009         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
19010                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
19011         /* bw_value_unit is 3 b */
19012         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
19013                 UINT32_C(0xe0000000)
19014         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
19015                 29
19016         /* Value is in Mb or MB (base 10). */
19017         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
19018                 (UINT32_C(0x0) << 29)
19019         /* Value is in Kb or KB (base 10). */
19020         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
19021                 (UINT32_C(0x2) << 29)
19022         /* Value is in bits or bytes. */
19023         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
19024                 (UINT32_C(0x4) << 29)
19025         /* Value is in Gb or GB (base 10). */
19026         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
19027                 (UINT32_C(0x6) << 29)
19028         /* Value is in 1/100th of a percentage of total bandwidth. */
19029         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19030                 (UINT32_C(0x1) << 29)
19031         /* Invalid unit */
19032         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
19033                 (UINT32_C(0x7) << 29)
19034         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
19035                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
19036         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19037         uint8_t queue_id0_tsa_assign;
19038         /* Strict Priority */
19039         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP \
19040                 UINT32_C(0x0)
19041         /* Enhanced Transmission Selection */
19042         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
19043                 UINT32_C(0x1)
19044         /* reserved. */
19045         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
19046                 UINT32_C(0x2)
19047         /* reserved. */
19048         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
19049                 UINT32_C(0xff)
19050         /*
19051          * Priority level for strict priority. Valid only when the
19052          * tsa_assign is 0 - Strict Priority (SP)
19053          * 0..7 - Valid values.
19054          * 8..255 - Reserved.
19055          */
19056         uint8_t queue_id0_pri_lvl;
19057         /*
19058          * Weight used to allocate remaining BW for this COS after
19059          * servicing guaranteed bandwidths for all COS.
19060          */
19061         uint8_t queue_id0_bw_weight;
19062         /* ID of CoS Queue 1. */
19063         uint8_t queue_id1;
19064         /*
19065          * Minimum BW allocated to CoS Queue.
19066          * The HWRM will translate this value into byte counter and
19067          * time interval used for this COS inside the device.
19068          */
19069         uint32_t        queue_id1_min_bw;
19070         /* The bandwidth value. */
19071         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
19072                 UINT32_C(0xfffffff)
19073         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
19074                 0
19075         /* The granularity of the value (bits or bytes). */
19076         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE \
19077                 UINT32_C(0x10000000)
19078         /* Value is in bits. */
19079         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
19080                 (UINT32_C(0x0) << 28)
19081         /* Value is in bytes. */
19082         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
19083                 (UINT32_C(0x1) << 28)
19084         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
19085                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
19086         /* bw_value_unit is 3 b */
19087         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
19088                 UINT32_C(0xe0000000)
19089         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
19090                 29
19091         /* Value is in Mb or MB (base 10). */
19092         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
19093                 (UINT32_C(0x0) << 29)
19094         /* Value is in Kb or KB (base 10). */
19095         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
19096                 (UINT32_C(0x2) << 29)
19097         /* Value is in bits or bytes. */
19098         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
19099                 (UINT32_C(0x4) << 29)
19100         /* Value is in Gb or GB (base 10). */
19101         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
19102                 (UINT32_C(0x6) << 29)
19103         /* Value is in 1/100th of a percentage of total bandwidth. */
19104         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19105                 (UINT32_C(0x1) << 29)
19106         /* Invalid unit */
19107         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
19108                 (UINT32_C(0x7) << 29)
19109         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
19110                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
19111         /*
19112          * Maximum BW allocated to CoS queue.
19113          * The HWRM will translate this value into byte counter and
19114          * time interval used for this COS inside the device.
19115          */
19116         uint32_t        queue_id1_max_bw;
19117         /* The bandwidth value. */
19118         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
19119                 UINT32_C(0xfffffff)
19120         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
19121                 0
19122         /* The granularity of the value (bits or bytes). */
19123         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE \
19124                 UINT32_C(0x10000000)
19125         /* Value is in bits. */
19126         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
19127                 (UINT32_C(0x0) << 28)
19128         /* Value is in bytes. */
19129         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
19130                 (UINT32_C(0x1) << 28)
19131         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
19132                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
19133         /* bw_value_unit is 3 b */
19134         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
19135                 UINT32_C(0xe0000000)
19136         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
19137                 29
19138         /* Value is in Mb or MB (base 10). */
19139         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
19140                 (UINT32_C(0x0) << 29)
19141         /* Value is in Kb or KB (base 10). */
19142         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
19143                 (UINT32_C(0x2) << 29)
19144         /* Value is in bits or bytes. */
19145         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
19146                 (UINT32_C(0x4) << 29)
19147         /* Value is in Gb or GB (base 10). */
19148         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
19149                 (UINT32_C(0x6) << 29)
19150         /* Value is in 1/100th of a percentage of total bandwidth. */
19151         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19152                 (UINT32_C(0x1) << 29)
19153         /* Invalid unit */
19154         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
19155                 (UINT32_C(0x7) << 29)
19156         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
19157                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
19158         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19159         uint8_t queue_id1_tsa_assign;
19160         /* Strict Priority */
19161         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP \
19162                 UINT32_C(0x0)
19163         /* Enhanced Transmission Selection */
19164         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
19165                 UINT32_C(0x1)
19166         /* reserved. */
19167         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
19168                 UINT32_C(0x2)
19169         /* reserved. */
19170         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
19171                 UINT32_C(0xff)
19172         /*
19173          * Priority level for strict priority. Valid only when the
19174          * tsa_assign is 0 - Strict Priority (SP)
19175          * 0..7 - Valid values.
19176          * 8..255 - Reserved.
19177          */
19178         uint8_t queue_id1_pri_lvl;
19179         /*
19180          * Weight used to allocate remaining BW for this COS after
19181          * servicing guaranteed bandwidths for all COS.
19182          */
19183         uint8_t queue_id1_bw_weight;
19184         /* ID of CoS Queue 2. */
19185         uint8_t queue_id2;
19186         /*
19187          * Minimum BW allocated to CoS Queue.
19188          * The HWRM will translate this value into byte counter and
19189          * time interval used for this COS inside the device.
19190          */
19191         uint32_t        queue_id2_min_bw;
19192         /* The bandwidth value. */
19193         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
19194                 UINT32_C(0xfffffff)
19195         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
19196                 0
19197         /* The granularity of the value (bits or bytes). */
19198         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE \
19199                 UINT32_C(0x10000000)
19200         /* Value is in bits. */
19201         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
19202                 (UINT32_C(0x0) << 28)
19203         /* Value is in bytes. */
19204         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
19205                 (UINT32_C(0x1) << 28)
19206         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
19207                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
19208         /* bw_value_unit is 3 b */
19209         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
19210                 UINT32_C(0xe0000000)
19211         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
19212                 29
19213         /* Value is in Mb or MB (base 10). */
19214         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
19215                 (UINT32_C(0x0) << 29)
19216         /* Value is in Kb or KB (base 10). */
19217         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
19218                 (UINT32_C(0x2) << 29)
19219         /* Value is in bits or bytes. */
19220         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
19221                 (UINT32_C(0x4) << 29)
19222         /* Value is in Gb or GB (base 10). */
19223         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
19224                 (UINT32_C(0x6) << 29)
19225         /* Value is in 1/100th of a percentage of total bandwidth. */
19226         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19227                 (UINT32_C(0x1) << 29)
19228         /* Invalid unit */
19229         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
19230                 (UINT32_C(0x7) << 29)
19231         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
19232                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
19233         /*
19234          * Maximum BW allocated to CoS queue.
19235          * The HWRM will translate this value into byte counter and
19236          * time interval used for this COS inside the device.
19237          */
19238         uint32_t        queue_id2_max_bw;
19239         /* The bandwidth value. */
19240         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
19241                 UINT32_C(0xfffffff)
19242         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
19243                 0
19244         /* The granularity of the value (bits or bytes). */
19245         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE \
19246                 UINT32_C(0x10000000)
19247         /* Value is in bits. */
19248         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
19249                 (UINT32_C(0x0) << 28)
19250         /* Value is in bytes. */
19251         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
19252                 (UINT32_C(0x1) << 28)
19253         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
19254                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
19255         /* bw_value_unit is 3 b */
19256         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
19257                 UINT32_C(0xe0000000)
19258         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
19259                 29
19260         /* Value is in Mb or MB (base 10). */
19261         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
19262                 (UINT32_C(0x0) << 29)
19263         /* Value is in Kb or KB (base 10). */
19264         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
19265                 (UINT32_C(0x2) << 29)
19266         /* Value is in bits or bytes. */
19267         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
19268                 (UINT32_C(0x4) << 29)
19269         /* Value is in Gb or GB (base 10). */
19270         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
19271                 (UINT32_C(0x6) << 29)
19272         /* Value is in 1/100th of a percentage of total bandwidth. */
19273         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19274                 (UINT32_C(0x1) << 29)
19275         /* Invalid unit */
19276         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
19277                 (UINT32_C(0x7) << 29)
19278         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
19279                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
19280         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19281         uint8_t queue_id2_tsa_assign;
19282         /* Strict Priority */
19283         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP \
19284                 UINT32_C(0x0)
19285         /* Enhanced Transmission Selection */
19286         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
19287                 UINT32_C(0x1)
19288         /* reserved. */
19289         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
19290                 UINT32_C(0x2)
19291         /* reserved. */
19292         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
19293                 UINT32_C(0xff)
19294         /*
19295          * Priority level for strict priority. Valid only when the
19296          * tsa_assign is 0 - Strict Priority (SP)
19297          * 0..7 - Valid values.
19298          * 8..255 - Reserved.
19299          */
19300         uint8_t queue_id2_pri_lvl;
19301         /*
19302          * Weight used to allocate remaining BW for this COS after
19303          * servicing guaranteed bandwidths for all COS.
19304          */
19305         uint8_t queue_id2_bw_weight;
19306         /* ID of CoS Queue 3. */
19307         uint8_t queue_id3;
19308         /*
19309          * Minimum BW allocated to CoS Queue.
19310          * The HWRM will translate this value into byte counter and
19311          * time interval used for this COS inside the device.
19312          */
19313         uint32_t        queue_id3_min_bw;
19314         /* The bandwidth value. */
19315         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
19316                 UINT32_C(0xfffffff)
19317         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
19318                 0
19319         /* The granularity of the value (bits or bytes). */
19320         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE \
19321                 UINT32_C(0x10000000)
19322         /* Value is in bits. */
19323         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
19324                 (UINT32_C(0x0) << 28)
19325         /* Value is in bytes. */
19326         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
19327                 (UINT32_C(0x1) << 28)
19328         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
19329                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
19330         /* bw_value_unit is 3 b */
19331         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
19332                 UINT32_C(0xe0000000)
19333         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
19334                 29
19335         /* Value is in Mb or MB (base 10). */
19336         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
19337                 (UINT32_C(0x0) << 29)
19338         /* Value is in Kb or KB (base 10). */
19339         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
19340                 (UINT32_C(0x2) << 29)
19341         /* Value is in bits or bytes. */
19342         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
19343                 (UINT32_C(0x4) << 29)
19344         /* Value is in Gb or GB (base 10). */
19345         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
19346                 (UINT32_C(0x6) << 29)
19347         /* Value is in 1/100th of a percentage of total bandwidth. */
19348         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19349                 (UINT32_C(0x1) << 29)
19350         /* Invalid unit */
19351         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
19352                 (UINT32_C(0x7) << 29)
19353         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
19354                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
19355         /*
19356          * Maximum BW allocated to CoS queue.
19357          * The HWRM will translate this value into byte counter and
19358          * time interval used for this COS inside the device.
19359          */
19360         uint32_t        queue_id3_max_bw;
19361         /* The bandwidth value. */
19362         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
19363                 UINT32_C(0xfffffff)
19364         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
19365                 0
19366         /* The granularity of the value (bits or bytes). */
19367         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE \
19368                 UINT32_C(0x10000000)
19369         /* Value is in bits. */
19370         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
19371                 (UINT32_C(0x0) << 28)
19372         /* Value is in bytes. */
19373         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
19374                 (UINT32_C(0x1) << 28)
19375         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
19376                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
19377         /* bw_value_unit is 3 b */
19378         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
19379                 UINT32_C(0xe0000000)
19380         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
19381                 29
19382         /* Value is in Mb or MB (base 10). */
19383         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
19384                 (UINT32_C(0x0) << 29)
19385         /* Value is in Kb or KB (base 10). */
19386         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
19387                 (UINT32_C(0x2) << 29)
19388         /* Value is in bits or bytes. */
19389         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
19390                 (UINT32_C(0x4) << 29)
19391         /* Value is in Gb or GB (base 10). */
19392         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
19393                 (UINT32_C(0x6) << 29)
19394         /* Value is in 1/100th of a percentage of total bandwidth. */
19395         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19396                 (UINT32_C(0x1) << 29)
19397         /* Invalid unit */
19398         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
19399                 (UINT32_C(0x7) << 29)
19400         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
19401                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
19402         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19403         uint8_t queue_id3_tsa_assign;
19404         /* Strict Priority */
19405         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP \
19406                 UINT32_C(0x0)
19407         /* Enhanced Transmission Selection */
19408         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
19409                 UINT32_C(0x1)
19410         /* reserved. */
19411         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
19412                 UINT32_C(0x2)
19413         /* reserved. */
19414         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
19415                 UINT32_C(0xff)
19416         /*
19417          * Priority level for strict priority. Valid only when the
19418          * tsa_assign is 0 - Strict Priority (SP)
19419          * 0..7 - Valid values.
19420          * 8..255 - Reserved.
19421          */
19422         uint8_t queue_id3_pri_lvl;
19423         /*
19424          * Weight used to allocate remaining BW for this COS after
19425          * servicing guaranteed bandwidths for all COS.
19426          */
19427         uint8_t queue_id3_bw_weight;
19428         /* ID of CoS Queue 4. */
19429         uint8_t queue_id4;
19430         /*
19431          * Minimum BW allocated to CoS Queue.
19432          * The HWRM will translate this value into byte counter and
19433          * time interval used for this COS inside the device.
19434          */
19435         uint32_t        queue_id4_min_bw;
19436         /* The bandwidth value. */
19437         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
19438                 UINT32_C(0xfffffff)
19439         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
19440                 0
19441         /* The granularity of the value (bits or bytes). */
19442         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE \
19443                 UINT32_C(0x10000000)
19444         /* Value is in bits. */
19445         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
19446                 (UINT32_C(0x0) << 28)
19447         /* Value is in bytes. */
19448         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
19449                 (UINT32_C(0x1) << 28)
19450         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
19451                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
19452         /* bw_value_unit is 3 b */
19453         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
19454                 UINT32_C(0xe0000000)
19455         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
19456                 29
19457         /* Value is in Mb or MB (base 10). */
19458         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
19459                 (UINT32_C(0x0) << 29)
19460         /* Value is in Kb or KB (base 10). */
19461         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
19462                 (UINT32_C(0x2) << 29)
19463         /* Value is in bits or bytes. */
19464         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
19465                 (UINT32_C(0x4) << 29)
19466         /* Value is in Gb or GB (base 10). */
19467         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
19468                 (UINT32_C(0x6) << 29)
19469         /* Value is in 1/100th of a percentage of total bandwidth. */
19470         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19471                 (UINT32_C(0x1) << 29)
19472         /* Invalid unit */
19473         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
19474                 (UINT32_C(0x7) << 29)
19475         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
19476                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
19477         /*
19478          * Maximum BW allocated to CoS queue.
19479          * The HWRM will translate this value into byte counter and
19480          * time interval used for this COS inside the device.
19481          */
19482         uint32_t        queue_id4_max_bw;
19483         /* The bandwidth value. */
19484         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
19485                 UINT32_C(0xfffffff)
19486         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
19487                 0
19488         /* The granularity of the value (bits or bytes). */
19489         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE \
19490                 UINT32_C(0x10000000)
19491         /* Value is in bits. */
19492         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
19493                 (UINT32_C(0x0) << 28)
19494         /* Value is in bytes. */
19495         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
19496                 (UINT32_C(0x1) << 28)
19497         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
19498                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
19499         /* bw_value_unit is 3 b */
19500         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
19501                 UINT32_C(0xe0000000)
19502         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
19503                 29
19504         /* Value is in Mb or MB (base 10). */
19505         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
19506                 (UINT32_C(0x0) << 29)
19507         /* Value is in Kb or KB (base 10). */
19508         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
19509                 (UINT32_C(0x2) << 29)
19510         /* Value is in bits or bytes. */
19511         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
19512                 (UINT32_C(0x4) << 29)
19513         /* Value is in Gb or GB (base 10). */
19514         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
19515                 (UINT32_C(0x6) << 29)
19516         /* Value is in 1/100th of a percentage of total bandwidth. */
19517         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19518                 (UINT32_C(0x1) << 29)
19519         /* Invalid unit */
19520         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
19521                 (UINT32_C(0x7) << 29)
19522         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
19523                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
19524         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19525         uint8_t queue_id4_tsa_assign;
19526         /* Strict Priority */
19527         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP \
19528                 UINT32_C(0x0)
19529         /* Enhanced Transmission Selection */
19530         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
19531                 UINT32_C(0x1)
19532         /* reserved. */
19533         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
19534                 UINT32_C(0x2)
19535         /* reserved. */
19536         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
19537                 UINT32_C(0xff)
19538         /*
19539          * Priority level for strict priority. Valid only when the
19540          * tsa_assign is 0 - Strict Priority (SP)
19541          * 0..7 - Valid values.
19542          * 8..255 - Reserved.
19543          */
19544         uint8_t queue_id4_pri_lvl;
19545         /*
19546          * Weight used to allocate remaining BW for this COS after
19547          * servicing guaranteed bandwidths for all COS.
19548          */
19549         uint8_t queue_id4_bw_weight;
19550         /* ID of CoS Queue 5. */
19551         uint8_t queue_id5;
19552         /*
19553          * Minimum BW allocated to CoS Queue.
19554          * The HWRM will translate this value into byte counter and
19555          * time interval used for this COS inside the device.
19556          */
19557         uint32_t        queue_id5_min_bw;
19558         /* The bandwidth value. */
19559         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
19560                 UINT32_C(0xfffffff)
19561         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
19562                 0
19563         /* The granularity of the value (bits or bytes). */
19564         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE \
19565                 UINT32_C(0x10000000)
19566         /* Value is in bits. */
19567         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
19568                 (UINT32_C(0x0) << 28)
19569         /* Value is in bytes. */
19570         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
19571                 (UINT32_C(0x1) << 28)
19572         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
19573                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
19574         /* bw_value_unit is 3 b */
19575         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
19576                 UINT32_C(0xe0000000)
19577         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
19578                 29
19579         /* Value is in Mb or MB (base 10). */
19580         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
19581                 (UINT32_C(0x0) << 29)
19582         /* Value is in Kb or KB (base 10). */
19583         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
19584                 (UINT32_C(0x2) << 29)
19585         /* Value is in bits or bytes. */
19586         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
19587                 (UINT32_C(0x4) << 29)
19588         /* Value is in Gb or GB (base 10). */
19589         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
19590                 (UINT32_C(0x6) << 29)
19591         /* Value is in 1/100th of a percentage of total bandwidth. */
19592         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19593                 (UINT32_C(0x1) << 29)
19594         /* Invalid unit */
19595         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
19596                 (UINT32_C(0x7) << 29)
19597         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
19598                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
19599         /*
19600          * Maximum BW allocated to CoS queue.
19601          * The HWRM will translate this value into byte counter and
19602          * time interval used for this COS inside the device.
19603          */
19604         uint32_t        queue_id5_max_bw;
19605         /* The bandwidth value. */
19606         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
19607                 UINT32_C(0xfffffff)
19608         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
19609                 0
19610         /* The granularity of the value (bits or bytes). */
19611         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE \
19612                 UINT32_C(0x10000000)
19613         /* Value is in bits. */
19614         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
19615                 (UINT32_C(0x0) << 28)
19616         /* Value is in bytes. */
19617         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
19618                 (UINT32_C(0x1) << 28)
19619         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
19620                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
19621         /* bw_value_unit is 3 b */
19622         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
19623                 UINT32_C(0xe0000000)
19624         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
19625                 29
19626         /* Value is in Mb or MB (base 10). */
19627         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
19628                 (UINT32_C(0x0) << 29)
19629         /* Value is in Kb or KB (base 10). */
19630         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
19631                 (UINT32_C(0x2) << 29)
19632         /* Value is in bits or bytes. */
19633         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
19634                 (UINT32_C(0x4) << 29)
19635         /* Value is in Gb or GB (base 10). */
19636         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
19637                 (UINT32_C(0x6) << 29)
19638         /* Value is in 1/100th of a percentage of total bandwidth. */
19639         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19640                 (UINT32_C(0x1) << 29)
19641         /* Invalid unit */
19642         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
19643                 (UINT32_C(0x7) << 29)
19644         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
19645                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
19646         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19647         uint8_t queue_id5_tsa_assign;
19648         /* Strict Priority */
19649         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP \
19650                 UINT32_C(0x0)
19651         /* Enhanced Transmission Selection */
19652         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
19653                 UINT32_C(0x1)
19654         /* reserved. */
19655         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
19656                 UINT32_C(0x2)
19657         /* reserved. */
19658         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
19659                 UINT32_C(0xff)
19660         /*
19661          * Priority level for strict priority. Valid only when the
19662          * tsa_assign is 0 - Strict Priority (SP)
19663          * 0..7 - Valid values.
19664          * 8..255 - Reserved.
19665          */
19666         uint8_t queue_id5_pri_lvl;
19667         /*
19668          * Weight used to allocate remaining BW for this COS after
19669          * servicing guaranteed bandwidths for all COS.
19670          */
19671         uint8_t queue_id5_bw_weight;
19672         /* ID of CoS Queue 6. */
19673         uint8_t queue_id6;
19674         /*
19675          * Minimum BW allocated to CoS Queue.
19676          * The HWRM will translate this value into byte counter and
19677          * time interval used for this COS inside the device.
19678          */
19679         uint32_t        queue_id6_min_bw;
19680         /* The bandwidth value. */
19681         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
19682                 UINT32_C(0xfffffff)
19683         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
19684                 0
19685         /* The granularity of the value (bits or bytes). */
19686         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE \
19687                 UINT32_C(0x10000000)
19688         /* Value is in bits. */
19689         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
19690                 (UINT32_C(0x0) << 28)
19691         /* Value is in bytes. */
19692         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
19693                 (UINT32_C(0x1) << 28)
19694         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
19695                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
19696         /* bw_value_unit is 3 b */
19697         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
19698                 UINT32_C(0xe0000000)
19699         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
19700                 29
19701         /* Value is in Mb or MB (base 10). */
19702         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
19703                 (UINT32_C(0x0) << 29)
19704         /* Value is in Kb or KB (base 10). */
19705         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
19706                 (UINT32_C(0x2) << 29)
19707         /* Value is in bits or bytes. */
19708         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
19709                 (UINT32_C(0x4) << 29)
19710         /* Value is in Gb or GB (base 10). */
19711         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
19712                 (UINT32_C(0x6) << 29)
19713         /* Value is in 1/100th of a percentage of total bandwidth. */
19714         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19715                 (UINT32_C(0x1) << 29)
19716         /* Invalid unit */
19717         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
19718                 (UINT32_C(0x7) << 29)
19719         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
19720                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
19721         /*
19722          * Maximum BW allocated to CoS queue.
19723          * The HWRM will translate this value into byte counter and
19724          * time interval used for this COS inside the device.
19725          */
19726         uint32_t        queue_id6_max_bw;
19727         /* The bandwidth value. */
19728         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
19729                 UINT32_C(0xfffffff)
19730         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
19731                 0
19732         /* The granularity of the value (bits or bytes). */
19733         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE \
19734                 UINT32_C(0x10000000)
19735         /* Value is in bits. */
19736         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
19737                 (UINT32_C(0x0) << 28)
19738         /* Value is in bytes. */
19739         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
19740                 (UINT32_C(0x1) << 28)
19741         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
19742                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
19743         /* bw_value_unit is 3 b */
19744         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
19745                 UINT32_C(0xe0000000)
19746         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
19747                 29
19748         /* Value is in Mb or MB (base 10). */
19749         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
19750                 (UINT32_C(0x0) << 29)
19751         /* Value is in Kb or KB (base 10). */
19752         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
19753                 (UINT32_C(0x2) << 29)
19754         /* Value is in bits or bytes. */
19755         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
19756                 (UINT32_C(0x4) << 29)
19757         /* Value is in Gb or GB (base 10). */
19758         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
19759                 (UINT32_C(0x6) << 29)
19760         /* Value is in 1/100th of a percentage of total bandwidth. */
19761         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19762                 (UINT32_C(0x1) << 29)
19763         /* Invalid unit */
19764         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
19765                 (UINT32_C(0x7) << 29)
19766         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
19767                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
19768         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19769         uint8_t queue_id6_tsa_assign;
19770         /* Strict Priority */
19771         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP \
19772                 UINT32_C(0x0)
19773         /* Enhanced Transmission Selection */
19774         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
19775                 UINT32_C(0x1)
19776         /* reserved. */
19777         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
19778                 UINT32_C(0x2)
19779         /* reserved. */
19780         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
19781                 UINT32_C(0xff)
19782         /*
19783          * Priority level for strict priority. Valid only when the
19784          * tsa_assign is 0 - Strict Priority (SP)
19785          * 0..7 - Valid values.
19786          * 8..255 - Reserved.
19787          */
19788         uint8_t queue_id6_pri_lvl;
19789         /*
19790          * Weight used to allocate remaining BW for this COS after
19791          * servicing guaranteed bandwidths for all COS.
19792          */
19793         uint8_t queue_id6_bw_weight;
19794         /* ID of CoS Queue 7. */
19795         uint8_t queue_id7;
19796         /*
19797          * Minimum BW allocated to CoS Queue.
19798          * The HWRM will translate this value into byte counter and
19799          * time interval used for this COS inside the device.
19800          */
19801         uint32_t        queue_id7_min_bw;
19802         /* The bandwidth value. */
19803         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
19804                 UINT32_C(0xfffffff)
19805         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
19806                 0
19807         /* The granularity of the value (bits or bytes). */
19808         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE \
19809                 UINT32_C(0x10000000)
19810         /* Value is in bits. */
19811         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
19812                 (UINT32_C(0x0) << 28)
19813         /* Value is in bytes. */
19814         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
19815                 (UINT32_C(0x1) << 28)
19816         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
19817                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
19818         /* bw_value_unit is 3 b */
19819         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
19820                 UINT32_C(0xe0000000)
19821         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
19822                 29
19823         /* Value is in Mb or MB (base 10). */
19824         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
19825                 (UINT32_C(0x0) << 29)
19826         /* Value is in Kb or KB (base 10). */
19827         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
19828                 (UINT32_C(0x2) << 29)
19829         /* Value is in bits or bytes. */
19830         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
19831                 (UINT32_C(0x4) << 29)
19832         /* Value is in Gb or GB (base 10). */
19833         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
19834                 (UINT32_C(0x6) << 29)
19835         /* Value is in 1/100th of a percentage of total bandwidth. */
19836         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19837                 (UINT32_C(0x1) << 29)
19838         /* Invalid unit */
19839         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
19840                 (UINT32_C(0x7) << 29)
19841         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
19842                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
19843         /*
19844          * Maximum BW allocated to CoS queue.
19845          * The HWRM will translate this value into byte counter and
19846          * time interval used for this COS inside the device.
19847          */
19848         uint32_t        queue_id7_max_bw;
19849         /* The bandwidth value. */
19850         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
19851                 UINT32_C(0xfffffff)
19852         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
19853                 0
19854         /* The granularity of the value (bits or bytes). */
19855         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE \
19856                 UINT32_C(0x10000000)
19857         /* Value is in bits. */
19858         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
19859                 (UINT32_C(0x0) << 28)
19860         /* Value is in bytes. */
19861         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
19862                 (UINT32_C(0x1) << 28)
19863         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
19864                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
19865         /* bw_value_unit is 3 b */
19866         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
19867                 UINT32_C(0xe0000000)
19868         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
19869                 29
19870         /* Value is in Mb or MB (base 10). */
19871         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
19872                 (UINT32_C(0x0) << 29)
19873         /* Value is in Kb or KB (base 10). */
19874         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
19875                 (UINT32_C(0x2) << 29)
19876         /* Value is in bits or bytes. */
19877         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
19878                 (UINT32_C(0x4) << 29)
19879         /* Value is in Gb or GB (base 10). */
19880         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
19881                 (UINT32_C(0x6) << 29)
19882         /* Value is in 1/100th of a percentage of total bandwidth. */
19883         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19884                 (UINT32_C(0x1) << 29)
19885         /* Invalid unit */
19886         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
19887                 (UINT32_C(0x7) << 29)
19888         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
19889                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
19890         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19891         uint8_t queue_id7_tsa_assign;
19892         /* Strict Priority */
19893         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP \
19894                 UINT32_C(0x0)
19895         /* Enhanced Transmission Selection */
19896         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
19897                 UINT32_C(0x1)
19898         /* reserved. */
19899         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
19900                 UINT32_C(0x2)
19901         /* reserved. */
19902         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
19903                 UINT32_C(0xff)
19904         /*
19905          * Priority level for strict priority. Valid only when the
19906          * tsa_assign is 0 - Strict Priority (SP)
19907          * 0..7 - Valid values.
19908          * 8..255 - Reserved.
19909          */
19910         uint8_t queue_id7_pri_lvl;
19911         /*
19912          * Weight used to allocate remaining BW for this COS after
19913          * servicing guaranteed bandwidths for all COS.
19914          */
19915         uint8_t queue_id7_bw_weight;
19916         uint8_t unused_2[4];
19917         /*
19918          * This field is used in Output records to indicate that the output
19919          * is completely written to RAM.  This field should be read as '1'
19920          * to indicate that the output has been completely written.
19921          * When writing a command completion or response to an internal processor,
19922          * the order of writes has to be such that this field is written last.
19923          */
19924         uint8_t valid;
19925 } __attribute__((packed));
19926
19927 /*************************
19928  * hwrm_queue_cos2bw_cfg *
19929  *************************/
19930
19931
19932 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
19933 struct hwrm_queue_cos2bw_cfg_input {
19934         /* The HWRM command request type. */
19935         uint16_t        req_type;
19936         /*
19937          * The completion ring to send the completion event on. This should
19938          * be the NQ ID returned from the `nq_alloc` HWRM command.
19939          */
19940         uint16_t        cmpl_ring;
19941         /*
19942          * The sequence ID is used by the driver for tracking multiple
19943          * commands. This ID is treated as opaque data by the firmware and
19944          * the value is returned in the `hwrm_resp_hdr` upon completion.
19945          */
19946         uint16_t        seq_id;
19947         /*
19948          * The target ID of the command:
19949          * * 0x0-0xFFF8 - The function ID
19950          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19951          * * 0xFFFD - Reserved for user-space HWRM interface
19952          * * 0xFFFF - HWRM
19953          */
19954         uint16_t        target_id;
19955         /*
19956          * A physical address pointer pointing to a host buffer that the
19957          * command's response data will be written. This can be either a host
19958          * physical address (HPA) or a guest physical address (GPA) and must
19959          * point to a physically contiguous block of memory.
19960          */
19961         uint64_t        resp_addr;
19962         uint32_t        flags;
19963         uint32_t        enables;
19964         /*
19965          * If this bit is set to 1, then all queue_id0 related
19966          * parameters in this command are valid.
19967          */
19968         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID \
19969                 UINT32_C(0x1)
19970         /*
19971          * If this bit is set to 1, then all queue_id1 related
19972          * parameters in this command are valid.
19973          */
19974         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID \
19975                 UINT32_C(0x2)
19976         /*
19977          * If this bit is set to 1, then all queue_id2 related
19978          * parameters in this command are valid.
19979          */
19980         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID \
19981                 UINT32_C(0x4)
19982         /*
19983          * If this bit is set to 1, then all queue_id3 related
19984          * parameters in this command are valid.
19985          */
19986         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID \
19987                 UINT32_C(0x8)
19988         /*
19989          * If this bit is set to 1, then all queue_id4 related
19990          * parameters in this command are valid.
19991          */
19992         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID \
19993                 UINT32_C(0x10)
19994         /*
19995          * If this bit is set to 1, then all queue_id5 related
19996          * parameters in this command are valid.
19997          */
19998         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID \
19999                 UINT32_C(0x20)
20000         /*
20001          * If this bit is set to 1, then all queue_id6 related
20002          * parameters in this command are valid.
20003          */
20004         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID \
20005                 UINT32_C(0x40)
20006         /*
20007          * If this bit is set to 1, then all queue_id7 related
20008          * parameters in this command are valid.
20009          */
20010         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID \
20011                 UINT32_C(0x80)
20012         /*
20013          * Port ID of port for which the table is being configured.
20014          * The HWRM needs to check whether this function is allowed
20015          * to configure TC BW assignment on this port.
20016          */
20017         uint16_t        port_id;
20018         /* ID of CoS Queue 0. */
20019         uint8_t queue_id0;
20020         uint8_t unused_0;
20021         /*
20022          * Minimum BW allocated to CoS Queue.
20023          * The HWRM will translate this value into byte counter and
20024          * time interval used for this COS inside the device.
20025          */
20026         uint32_t        queue_id0_min_bw;
20027         /* The bandwidth value. */
20028         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
20029                 UINT32_C(0xfffffff)
20030         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
20031                 0
20032         /* The granularity of the value (bits or bytes). */
20033         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE \
20034                 UINT32_C(0x10000000)
20035         /* Value is in bits. */
20036         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
20037                 (UINT32_C(0x0) << 28)
20038         /* Value is in bytes. */
20039         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
20040                 (UINT32_C(0x1) << 28)
20041         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
20042                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
20043         /* bw_value_unit is 3 b */
20044         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
20045                 UINT32_C(0xe0000000)
20046         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
20047                 29
20048         /* Value is in Mb or MB (base 10). */
20049         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
20050                 (UINT32_C(0x0) << 29)
20051         /* Value is in Kb or KB (base 10). */
20052         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
20053                 (UINT32_C(0x2) << 29)
20054         /* Value is in bits or bytes. */
20055         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
20056                 (UINT32_C(0x4) << 29)
20057         /* Value is in Gb or GB (base 10). */
20058         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
20059                 (UINT32_C(0x6) << 29)
20060         /* Value is in 1/100th of a percentage of total bandwidth. */
20061         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20062                 (UINT32_C(0x1) << 29)
20063         /* Invalid unit */
20064         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
20065                 (UINT32_C(0x7) << 29)
20066         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
20067                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
20068         /*
20069          * Maximum BW allocated to CoS Queue.
20070          * The HWRM will translate this value into byte counter and
20071          * time interval used for this COS inside the device.
20072          */
20073         uint32_t        queue_id0_max_bw;
20074         /* The bandwidth value. */
20075         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
20076                 UINT32_C(0xfffffff)
20077         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
20078                 0
20079         /* The granularity of the value (bits or bytes). */
20080         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE \
20081                 UINT32_C(0x10000000)
20082         /* Value is in bits. */
20083         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
20084                 (UINT32_C(0x0) << 28)
20085         /* Value is in bytes. */
20086         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
20087                 (UINT32_C(0x1) << 28)
20088         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
20089                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
20090         /* bw_value_unit is 3 b */
20091         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
20092                 UINT32_C(0xe0000000)
20093         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
20094                 29
20095         /* Value is in Mb or MB (base 10). */
20096         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
20097                 (UINT32_C(0x0) << 29)
20098         /* Value is in Kb or KB (base 10). */
20099         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
20100                 (UINT32_C(0x2) << 29)
20101         /* Value is in bits or bytes. */
20102         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
20103                 (UINT32_C(0x4) << 29)
20104         /* Value is in Gb or GB (base 10). */
20105         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
20106                 (UINT32_C(0x6) << 29)
20107         /* Value is in 1/100th of a percentage of total bandwidth. */
20108         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20109                 (UINT32_C(0x1) << 29)
20110         /* Invalid unit */
20111         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
20112                 (UINT32_C(0x7) << 29)
20113         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
20114                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
20115         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20116         uint8_t queue_id0_tsa_assign;
20117         /* Strict Priority */
20118         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP \
20119                 UINT32_C(0x0)
20120         /* Enhanced Transmission Selection */
20121         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
20122                 UINT32_C(0x1)
20123         /* reserved. */
20124         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
20125                 UINT32_C(0x2)
20126         /* reserved. */
20127         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
20128                 UINT32_C(0xff)
20129         /*
20130          * Priority level for strict priority. Valid only when the
20131          * tsa_assign is 0 - Strict Priority (SP)
20132          * 0..7 - Valid values.
20133          * 8..255 - Reserved.
20134          */
20135         uint8_t queue_id0_pri_lvl;
20136         /*
20137          * Weight used to allocate remaining BW for this COS after
20138          * servicing guaranteed bandwidths for all COS.
20139          */
20140         uint8_t queue_id0_bw_weight;
20141         /* ID of CoS Queue 1. */
20142         uint8_t queue_id1;
20143         /*
20144          * Minimum BW allocated to CoS Queue.
20145          * The HWRM will translate this value into byte counter and
20146          * time interval used for this COS inside the device.
20147          */
20148         uint32_t        queue_id1_min_bw;
20149         /* The bandwidth value. */
20150         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
20151                 UINT32_C(0xfffffff)
20152         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
20153                 0
20154         /* The granularity of the value (bits or bytes). */
20155         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE \
20156                 UINT32_C(0x10000000)
20157         /* Value is in bits. */
20158         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
20159                 (UINT32_C(0x0) << 28)
20160         /* Value is in bytes. */
20161         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
20162                 (UINT32_C(0x1) << 28)
20163         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
20164                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
20165         /* bw_value_unit is 3 b */
20166         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
20167                 UINT32_C(0xe0000000)
20168         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
20169                 29
20170         /* Value is in Mb or MB (base 10). */
20171         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
20172                 (UINT32_C(0x0) << 29)
20173         /* Value is in Kb or KB (base 10). */
20174         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
20175                 (UINT32_C(0x2) << 29)
20176         /* Value is in bits or bytes. */
20177         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
20178                 (UINT32_C(0x4) << 29)
20179         /* Value is in Gb or GB (base 10). */
20180         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
20181                 (UINT32_C(0x6) << 29)
20182         /* Value is in 1/100th of a percentage of total bandwidth. */
20183         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20184                 (UINT32_C(0x1) << 29)
20185         /* Invalid unit */
20186         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
20187                 (UINT32_C(0x7) << 29)
20188         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
20189                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
20190         /*
20191          * Maximum BW allocated to CoS queue.
20192          * The HWRM will translate this value into byte counter and
20193          * time interval used for this COS inside the device.
20194          */
20195         uint32_t        queue_id1_max_bw;
20196         /* The bandwidth value. */
20197         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
20198                 UINT32_C(0xfffffff)
20199         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
20200                 0
20201         /* The granularity of the value (bits or bytes). */
20202         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE \
20203                 UINT32_C(0x10000000)
20204         /* Value is in bits. */
20205         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
20206                 (UINT32_C(0x0) << 28)
20207         /* Value is in bytes. */
20208         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
20209                 (UINT32_C(0x1) << 28)
20210         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
20211                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
20212         /* bw_value_unit is 3 b */
20213         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
20214                 UINT32_C(0xe0000000)
20215         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
20216                 29
20217         /* Value is in Mb or MB (base 10). */
20218         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
20219                 (UINT32_C(0x0) << 29)
20220         /* Value is in Kb or KB (base 10). */
20221         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
20222                 (UINT32_C(0x2) << 29)
20223         /* Value is in bits or bytes. */
20224         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
20225                 (UINT32_C(0x4) << 29)
20226         /* Value is in Gb or GB (base 10). */
20227         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
20228                 (UINT32_C(0x6) << 29)
20229         /* Value is in 1/100th of a percentage of total bandwidth. */
20230         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20231                 (UINT32_C(0x1) << 29)
20232         /* Invalid unit */
20233         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
20234                 (UINT32_C(0x7) << 29)
20235         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
20236                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
20237         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20238         uint8_t queue_id1_tsa_assign;
20239         /* Strict Priority */
20240         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP \
20241                 UINT32_C(0x0)
20242         /* Enhanced Transmission Selection */
20243         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
20244                 UINT32_C(0x1)
20245         /* reserved. */
20246         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
20247                 UINT32_C(0x2)
20248         /* reserved. */
20249         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
20250                 UINT32_C(0xff)
20251         /*
20252          * Priority level for strict priority. Valid only when the
20253          * tsa_assign is 0 - Strict Priority (SP)
20254          * 0..7 - Valid values.
20255          * 8..255 - Reserved.
20256          */
20257         uint8_t queue_id1_pri_lvl;
20258         /*
20259          * Weight used to allocate remaining BW for this COS after
20260          * servicing guaranteed bandwidths for all COS.
20261          */
20262         uint8_t queue_id1_bw_weight;
20263         /* ID of CoS Queue 2. */
20264         uint8_t queue_id2;
20265         /*
20266          * Minimum BW allocated to CoS Queue.
20267          * The HWRM will translate this value into byte counter and
20268          * time interval used for this COS inside the device.
20269          */
20270         uint32_t        queue_id2_min_bw;
20271         /* The bandwidth value. */
20272         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
20273                 UINT32_C(0xfffffff)
20274         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
20275                 0
20276         /* The granularity of the value (bits or bytes). */
20277         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE \
20278                 UINT32_C(0x10000000)
20279         /* Value is in bits. */
20280         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
20281                 (UINT32_C(0x0) << 28)
20282         /* Value is in bytes. */
20283         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
20284                 (UINT32_C(0x1) << 28)
20285         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
20286                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
20287         /* bw_value_unit is 3 b */
20288         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
20289                 UINT32_C(0xe0000000)
20290         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
20291                 29
20292         /* Value is in Mb or MB (base 10). */
20293         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
20294                 (UINT32_C(0x0) << 29)
20295         /* Value is in Kb or KB (base 10). */
20296         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
20297                 (UINT32_C(0x2) << 29)
20298         /* Value is in bits or bytes. */
20299         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
20300                 (UINT32_C(0x4) << 29)
20301         /* Value is in Gb or GB (base 10). */
20302         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
20303                 (UINT32_C(0x6) << 29)
20304         /* Value is in 1/100th of a percentage of total bandwidth. */
20305         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20306                 (UINT32_C(0x1) << 29)
20307         /* Invalid unit */
20308         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
20309                 (UINT32_C(0x7) << 29)
20310         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
20311                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
20312         /*
20313          * Maximum BW allocated to CoS queue.
20314          * The HWRM will translate this value into byte counter and
20315          * time interval used for this COS inside the device.
20316          */
20317         uint32_t        queue_id2_max_bw;
20318         /* The bandwidth value. */
20319         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
20320                 UINT32_C(0xfffffff)
20321         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
20322                 0
20323         /* The granularity of the value (bits or bytes). */
20324         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE \
20325                 UINT32_C(0x10000000)
20326         /* Value is in bits. */
20327         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
20328                 (UINT32_C(0x0) << 28)
20329         /* Value is in bytes. */
20330         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
20331                 (UINT32_C(0x1) << 28)
20332         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
20333                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
20334         /* bw_value_unit is 3 b */
20335         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
20336                 UINT32_C(0xe0000000)
20337         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
20338                 29
20339         /* Value is in Mb or MB (base 10). */
20340         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
20341                 (UINT32_C(0x0) << 29)
20342         /* Value is in Kb or KB (base 10). */
20343         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
20344                 (UINT32_C(0x2) << 29)
20345         /* Value is in bits or bytes. */
20346         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
20347                 (UINT32_C(0x4) << 29)
20348         /* Value is in Gb or GB (base 10). */
20349         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
20350                 (UINT32_C(0x6) << 29)
20351         /* Value is in 1/100th of a percentage of total bandwidth. */
20352         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20353                 (UINT32_C(0x1) << 29)
20354         /* Invalid unit */
20355         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
20356                 (UINT32_C(0x7) << 29)
20357         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
20358                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
20359         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20360         uint8_t queue_id2_tsa_assign;
20361         /* Strict Priority */
20362         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP \
20363                 UINT32_C(0x0)
20364         /* Enhanced Transmission Selection */
20365         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
20366                 UINT32_C(0x1)
20367         /* reserved. */
20368         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
20369                 UINT32_C(0x2)
20370         /* reserved. */
20371         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
20372                 UINT32_C(0xff)
20373         /*
20374          * Priority level for strict priority. Valid only when the
20375          * tsa_assign is 0 - Strict Priority (SP)
20376          * 0..7 - Valid values.
20377          * 8..255 - Reserved.
20378          */
20379         uint8_t queue_id2_pri_lvl;
20380         /*
20381          * Weight used to allocate remaining BW for this COS after
20382          * servicing guaranteed bandwidths for all COS.
20383          */
20384         uint8_t queue_id2_bw_weight;
20385         /* ID of CoS Queue 3. */
20386         uint8_t queue_id3;
20387         /*
20388          * Minimum BW allocated to CoS Queue.
20389          * The HWRM will translate this value into byte counter and
20390          * time interval used for this COS inside the device.
20391          */
20392         uint32_t        queue_id3_min_bw;
20393         /* The bandwidth value. */
20394         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
20395                 UINT32_C(0xfffffff)
20396         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
20397                 0
20398         /* The granularity of the value (bits or bytes). */
20399         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE \
20400                 UINT32_C(0x10000000)
20401         /* Value is in bits. */
20402         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
20403                 (UINT32_C(0x0) << 28)
20404         /* Value is in bytes. */
20405         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
20406                 (UINT32_C(0x1) << 28)
20407         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
20408                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
20409         /* bw_value_unit is 3 b */
20410         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
20411                 UINT32_C(0xe0000000)
20412         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
20413                 29
20414         /* Value is in Mb or MB (base 10). */
20415         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
20416                 (UINT32_C(0x0) << 29)
20417         /* Value is in Kb or KB (base 10). */
20418         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
20419                 (UINT32_C(0x2) << 29)
20420         /* Value is in bits or bytes. */
20421         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
20422                 (UINT32_C(0x4) << 29)
20423         /* Value is in Gb or GB (base 10). */
20424         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
20425                 (UINT32_C(0x6) << 29)
20426         /* Value is in 1/100th of a percentage of total bandwidth. */
20427         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20428                 (UINT32_C(0x1) << 29)
20429         /* Invalid unit */
20430         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
20431                 (UINT32_C(0x7) << 29)
20432         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
20433                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
20434         /*
20435          * Maximum BW allocated to CoS queue.
20436          * The HWRM will translate this value into byte counter and
20437          * time interval used for this COS inside the device.
20438          */
20439         uint32_t        queue_id3_max_bw;
20440         /* The bandwidth value. */
20441         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
20442                 UINT32_C(0xfffffff)
20443         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
20444                 0
20445         /* The granularity of the value (bits or bytes). */
20446         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE \
20447                 UINT32_C(0x10000000)
20448         /* Value is in bits. */
20449         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
20450                 (UINT32_C(0x0) << 28)
20451         /* Value is in bytes. */
20452         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
20453                 (UINT32_C(0x1) << 28)
20454         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
20455                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
20456         /* bw_value_unit is 3 b */
20457         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
20458                 UINT32_C(0xe0000000)
20459         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
20460                 29
20461         /* Value is in Mb or MB (base 10). */
20462         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
20463                 (UINT32_C(0x0) << 29)
20464         /* Value is in Kb or KB (base 10). */
20465         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
20466                 (UINT32_C(0x2) << 29)
20467         /* Value is in bits or bytes. */
20468         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
20469                 (UINT32_C(0x4) << 29)
20470         /* Value is in Gb or GB (base 10). */
20471         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
20472                 (UINT32_C(0x6) << 29)
20473         /* Value is in 1/100th of a percentage of total bandwidth. */
20474         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20475                 (UINT32_C(0x1) << 29)
20476         /* Invalid unit */
20477         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
20478                 (UINT32_C(0x7) << 29)
20479         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
20480                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
20481         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20482         uint8_t queue_id3_tsa_assign;
20483         /* Strict Priority */
20484         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP \
20485                 UINT32_C(0x0)
20486         /* Enhanced Transmission Selection */
20487         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
20488                 UINT32_C(0x1)
20489         /* reserved. */
20490         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
20491                 UINT32_C(0x2)
20492         /* reserved. */
20493         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
20494                 UINT32_C(0xff)
20495         /*
20496          * Priority level for strict priority. Valid only when the
20497          * tsa_assign is 0 - Strict Priority (SP)
20498          * 0..7 - Valid values.
20499          * 8..255 - Reserved.
20500          */
20501         uint8_t queue_id3_pri_lvl;
20502         /*
20503          * Weight used to allocate remaining BW for this COS after
20504          * servicing guaranteed bandwidths for all COS.
20505          */
20506         uint8_t queue_id3_bw_weight;
20507         /* ID of CoS Queue 4. */
20508         uint8_t queue_id4;
20509         /*
20510          * Minimum BW allocated to CoS Queue.
20511          * The HWRM will translate this value into byte counter and
20512          * time interval used for this COS inside the device.
20513          */
20514         uint32_t        queue_id4_min_bw;
20515         /* The bandwidth value. */
20516         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
20517                 UINT32_C(0xfffffff)
20518         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
20519                 0
20520         /* The granularity of the value (bits or bytes). */
20521         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE \
20522                 UINT32_C(0x10000000)
20523         /* Value is in bits. */
20524         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
20525                 (UINT32_C(0x0) << 28)
20526         /* Value is in bytes. */
20527         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
20528                 (UINT32_C(0x1) << 28)
20529         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
20530                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
20531         /* bw_value_unit is 3 b */
20532         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
20533                 UINT32_C(0xe0000000)
20534         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
20535                 29
20536         /* Value is in Mb or MB (base 10). */
20537         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
20538                 (UINT32_C(0x0) << 29)
20539         /* Value is in Kb or KB (base 10). */
20540         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
20541                 (UINT32_C(0x2) << 29)
20542         /* Value is in bits or bytes. */
20543         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
20544                 (UINT32_C(0x4) << 29)
20545         /* Value is in Gb or GB (base 10). */
20546         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
20547                 (UINT32_C(0x6) << 29)
20548         /* Value is in 1/100th of a percentage of total bandwidth. */
20549         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20550                 (UINT32_C(0x1) << 29)
20551         /* Invalid unit */
20552         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
20553                 (UINT32_C(0x7) << 29)
20554         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
20555                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
20556         /*
20557          * Maximum BW allocated to CoS queue.
20558          * The HWRM will translate this value into byte counter and
20559          * time interval used for this COS inside the device.
20560          */
20561         uint32_t        queue_id4_max_bw;
20562         /* The bandwidth value. */
20563         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
20564                 UINT32_C(0xfffffff)
20565         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
20566                 0
20567         /* The granularity of the value (bits or bytes). */
20568         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE \
20569                 UINT32_C(0x10000000)
20570         /* Value is in bits. */
20571         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
20572                 (UINT32_C(0x0) << 28)
20573         /* Value is in bytes. */
20574         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
20575                 (UINT32_C(0x1) << 28)
20576         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
20577                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
20578         /* bw_value_unit is 3 b */
20579         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
20580                 UINT32_C(0xe0000000)
20581         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
20582                 29
20583         /* Value is in Mb or MB (base 10). */
20584         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
20585                 (UINT32_C(0x0) << 29)
20586         /* Value is in Kb or KB (base 10). */
20587         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
20588                 (UINT32_C(0x2) << 29)
20589         /* Value is in bits or bytes. */
20590         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
20591                 (UINT32_C(0x4) << 29)
20592         /* Value is in Gb or GB (base 10). */
20593         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
20594                 (UINT32_C(0x6) << 29)
20595         /* Value is in 1/100th of a percentage of total bandwidth. */
20596         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20597                 (UINT32_C(0x1) << 29)
20598         /* Invalid unit */
20599         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
20600                 (UINT32_C(0x7) << 29)
20601         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
20602                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
20603         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20604         uint8_t queue_id4_tsa_assign;
20605         /* Strict Priority */
20606         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP \
20607                 UINT32_C(0x0)
20608         /* Enhanced Transmission Selection */
20609         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
20610                 UINT32_C(0x1)
20611         /* reserved. */
20612         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
20613                 UINT32_C(0x2)
20614         /* reserved. */
20615         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
20616                 UINT32_C(0xff)
20617         /*
20618          * Priority level for strict priority. Valid only when the
20619          * tsa_assign is 0 - Strict Priority (SP)
20620          * 0..7 - Valid values.
20621          * 8..255 - Reserved.
20622          */
20623         uint8_t queue_id4_pri_lvl;
20624         /*
20625          * Weight used to allocate remaining BW for this COS after
20626          * servicing guaranteed bandwidths for all COS.
20627          */
20628         uint8_t queue_id4_bw_weight;
20629         /* ID of CoS Queue 5. */
20630         uint8_t queue_id5;
20631         /*
20632          * Minimum BW allocated to CoS Queue.
20633          * The HWRM will translate this value into byte counter and
20634          * time interval used for this COS inside the device.
20635          */
20636         uint32_t        queue_id5_min_bw;
20637         /* The bandwidth value. */
20638         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
20639                 UINT32_C(0xfffffff)
20640         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
20641                 0
20642         /* The granularity of the value (bits or bytes). */
20643         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE \
20644                 UINT32_C(0x10000000)
20645         /* Value is in bits. */
20646         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
20647                 (UINT32_C(0x0) << 28)
20648         /* Value is in bytes. */
20649         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
20650                 (UINT32_C(0x1) << 28)
20651         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
20652                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
20653         /* bw_value_unit is 3 b */
20654         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
20655                 UINT32_C(0xe0000000)
20656         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
20657                 29
20658         /* Value is in Mb or MB (base 10). */
20659         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
20660                 (UINT32_C(0x0) << 29)
20661         /* Value is in Kb or KB (base 10). */
20662         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
20663                 (UINT32_C(0x2) << 29)
20664         /* Value is in bits or bytes. */
20665         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
20666                 (UINT32_C(0x4) << 29)
20667         /* Value is in Gb or GB (base 10). */
20668         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
20669                 (UINT32_C(0x6) << 29)
20670         /* Value is in 1/100th of a percentage of total bandwidth. */
20671         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20672                 (UINT32_C(0x1) << 29)
20673         /* Invalid unit */
20674         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
20675                 (UINT32_C(0x7) << 29)
20676         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
20677                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
20678         /*
20679          * Maximum BW allocated to CoS queue.
20680          * The HWRM will translate this value into byte counter and
20681          * time interval used for this COS inside the device.
20682          */
20683         uint32_t        queue_id5_max_bw;
20684         /* The bandwidth value. */
20685         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
20686                 UINT32_C(0xfffffff)
20687         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
20688                 0
20689         /* The granularity of the value (bits or bytes). */
20690         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE \
20691                 UINT32_C(0x10000000)
20692         /* Value is in bits. */
20693         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
20694                 (UINT32_C(0x0) << 28)
20695         /* Value is in bytes. */
20696         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
20697                 (UINT32_C(0x1) << 28)
20698         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
20699                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
20700         /* bw_value_unit is 3 b */
20701         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
20702                 UINT32_C(0xe0000000)
20703         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
20704                 29
20705         /* Value is in Mb or MB (base 10). */
20706         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
20707                 (UINT32_C(0x0) << 29)
20708         /* Value is in Kb or KB (base 10). */
20709         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
20710                 (UINT32_C(0x2) << 29)
20711         /* Value is in bits or bytes. */
20712         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
20713                 (UINT32_C(0x4) << 29)
20714         /* Value is in Gb or GB (base 10). */
20715         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
20716                 (UINT32_C(0x6) << 29)
20717         /* Value is in 1/100th of a percentage of total bandwidth. */
20718         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20719                 (UINT32_C(0x1) << 29)
20720         /* Invalid unit */
20721         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
20722                 (UINT32_C(0x7) << 29)
20723         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
20724                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
20725         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20726         uint8_t queue_id5_tsa_assign;
20727         /* Strict Priority */
20728         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP \
20729                 UINT32_C(0x0)
20730         /* Enhanced Transmission Selection */
20731         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
20732                 UINT32_C(0x1)
20733         /* reserved. */
20734         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
20735                 UINT32_C(0x2)
20736         /* reserved. */
20737         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
20738                 UINT32_C(0xff)
20739         /*
20740          * Priority level for strict priority. Valid only when the
20741          * tsa_assign is 0 - Strict Priority (SP)
20742          * 0..7 - Valid values.
20743          * 8..255 - Reserved.
20744          */
20745         uint8_t queue_id5_pri_lvl;
20746         /*
20747          * Weight used to allocate remaining BW for this COS after
20748          * servicing guaranteed bandwidths for all COS.
20749          */
20750         uint8_t queue_id5_bw_weight;
20751         /* ID of CoS Queue 6. */
20752         uint8_t queue_id6;
20753         /*
20754          * Minimum BW allocated to CoS Queue.
20755          * The HWRM will translate this value into byte counter and
20756          * time interval used for this COS inside the device.
20757          */
20758         uint32_t        queue_id6_min_bw;
20759         /* The bandwidth value. */
20760         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
20761                 UINT32_C(0xfffffff)
20762         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
20763                 0
20764         /* The granularity of the value (bits or bytes). */
20765         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE \
20766                 UINT32_C(0x10000000)
20767         /* Value is in bits. */
20768         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
20769                 (UINT32_C(0x0) << 28)
20770         /* Value is in bytes. */
20771         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
20772                 (UINT32_C(0x1) << 28)
20773         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
20774                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
20775         /* bw_value_unit is 3 b */
20776         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
20777                 UINT32_C(0xe0000000)
20778         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
20779                 29
20780         /* Value is in Mb or MB (base 10). */
20781         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
20782                 (UINT32_C(0x0) << 29)
20783         /* Value is in Kb or KB (base 10). */
20784         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
20785                 (UINT32_C(0x2) << 29)
20786         /* Value is in bits or bytes. */
20787         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
20788                 (UINT32_C(0x4) << 29)
20789         /* Value is in Gb or GB (base 10). */
20790         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
20791                 (UINT32_C(0x6) << 29)
20792         /* Value is in 1/100th of a percentage of total bandwidth. */
20793         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20794                 (UINT32_C(0x1) << 29)
20795         /* Invalid unit */
20796         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
20797                 (UINT32_C(0x7) << 29)
20798         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
20799                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
20800         /*
20801          * Maximum BW allocated to CoS queue.
20802          * The HWRM will translate this value into byte counter and
20803          * time interval used for this COS inside the device.
20804          */
20805         uint32_t        queue_id6_max_bw;
20806         /* The bandwidth value. */
20807         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
20808                 UINT32_C(0xfffffff)
20809         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
20810                 0
20811         /* The granularity of the value (bits or bytes). */
20812         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE \
20813                 UINT32_C(0x10000000)
20814         /* Value is in bits. */
20815         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
20816                 (UINT32_C(0x0) << 28)
20817         /* Value is in bytes. */
20818         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
20819                 (UINT32_C(0x1) << 28)
20820         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
20821                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
20822         /* bw_value_unit is 3 b */
20823         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
20824                 UINT32_C(0xe0000000)
20825         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
20826                 29
20827         /* Value is in Mb or MB (base 10). */
20828         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
20829                 (UINT32_C(0x0) << 29)
20830         /* Value is in Kb or KB (base 10). */
20831         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
20832                 (UINT32_C(0x2) << 29)
20833         /* Value is in bits or bytes. */
20834         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
20835                 (UINT32_C(0x4) << 29)
20836         /* Value is in Gb or GB (base 10). */
20837         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
20838                 (UINT32_C(0x6) << 29)
20839         /* Value is in 1/100th of a percentage of total bandwidth. */
20840         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20841                 (UINT32_C(0x1) << 29)
20842         /* Invalid unit */
20843         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
20844                 (UINT32_C(0x7) << 29)
20845         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
20846                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
20847         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20848         uint8_t queue_id6_tsa_assign;
20849         /* Strict Priority */
20850         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP \
20851                 UINT32_C(0x0)
20852         /* Enhanced Transmission Selection */
20853         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
20854                 UINT32_C(0x1)
20855         /* reserved. */
20856         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
20857                 UINT32_C(0x2)
20858         /* reserved. */
20859         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
20860                 UINT32_C(0xff)
20861         /*
20862          * Priority level for strict priority. Valid only when the
20863          * tsa_assign is 0 - Strict Priority (SP)
20864          * 0..7 - Valid values.
20865          * 8..255 - Reserved.
20866          */
20867         uint8_t queue_id6_pri_lvl;
20868         /*
20869          * Weight used to allocate remaining BW for this COS after
20870          * servicing guaranteed bandwidths for all COS.
20871          */
20872         uint8_t queue_id6_bw_weight;
20873         /* ID of CoS Queue 7. */
20874         uint8_t queue_id7;
20875         /*
20876          * Minimum BW allocated to CoS Queue.
20877          * The HWRM will translate this value into byte counter and
20878          * time interval used for this COS inside the device.
20879          */
20880         uint32_t        queue_id7_min_bw;
20881         /* The bandwidth value. */
20882         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
20883                 UINT32_C(0xfffffff)
20884         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
20885                 0
20886         /* The granularity of the value (bits or bytes). */
20887         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE \
20888                 UINT32_C(0x10000000)
20889         /* Value is in bits. */
20890         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
20891                 (UINT32_C(0x0) << 28)
20892         /* Value is in bytes. */
20893         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
20894                 (UINT32_C(0x1) << 28)
20895         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
20896                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
20897         /* bw_value_unit is 3 b */
20898         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
20899                 UINT32_C(0xe0000000)
20900         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
20901                 29
20902         /* Value is in Mb or MB (base 10). */
20903         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
20904                 (UINT32_C(0x0) << 29)
20905         /* Value is in Kb or KB (base 10). */
20906         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
20907                 (UINT32_C(0x2) << 29)
20908         /* Value is in bits or bytes. */
20909         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
20910                 (UINT32_C(0x4) << 29)
20911         /* Value is in Gb or GB (base 10). */
20912         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
20913                 (UINT32_C(0x6) << 29)
20914         /* Value is in 1/100th of a percentage of total bandwidth. */
20915         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20916                 (UINT32_C(0x1) << 29)
20917         /* Invalid unit */
20918         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
20919                 (UINT32_C(0x7) << 29)
20920         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
20921                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
20922         /*
20923          * Maximum BW allocated to CoS queue.
20924          * The HWRM will translate this value into byte counter and
20925          * time interval used for this COS inside the device.
20926          */
20927         uint32_t        queue_id7_max_bw;
20928         /* The bandwidth value. */
20929         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
20930                 UINT32_C(0xfffffff)
20931         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
20932                 0
20933         /* The granularity of the value (bits or bytes). */
20934         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE \
20935                 UINT32_C(0x10000000)
20936         /* Value is in bits. */
20937         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
20938                 (UINT32_C(0x0) << 28)
20939         /* Value is in bytes. */
20940         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
20941                 (UINT32_C(0x1) << 28)
20942         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
20943                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
20944         /* bw_value_unit is 3 b */
20945         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
20946                 UINT32_C(0xe0000000)
20947         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
20948                 29
20949         /* Value is in Mb or MB (base 10). */
20950         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
20951                 (UINT32_C(0x0) << 29)
20952         /* Value is in Kb or KB (base 10). */
20953         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
20954                 (UINT32_C(0x2) << 29)
20955         /* Value is in bits or bytes. */
20956         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
20957                 (UINT32_C(0x4) << 29)
20958         /* Value is in Gb or GB (base 10). */
20959         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
20960                 (UINT32_C(0x6) << 29)
20961         /* Value is in 1/100th of a percentage of total bandwidth. */
20962         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20963                 (UINT32_C(0x1) << 29)
20964         /* Invalid unit */
20965         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
20966                 (UINT32_C(0x7) << 29)
20967         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
20968                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
20969         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20970         uint8_t queue_id7_tsa_assign;
20971         /* Strict Priority */
20972         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP \
20973                 UINT32_C(0x0)
20974         /* Enhanced Transmission Selection */
20975         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
20976                 UINT32_C(0x1)
20977         /* reserved. */
20978         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
20979                 UINT32_C(0x2)
20980         /* reserved. */
20981         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
20982                 UINT32_C(0xff)
20983         /*
20984          * Priority level for strict priority. Valid only when the
20985          * tsa_assign is 0 - Strict Priority (SP)
20986          * 0..7 - Valid values.
20987          * 8..255 - Reserved.
20988          */
20989         uint8_t queue_id7_pri_lvl;
20990         /*
20991          * Weight used to allocate remaining BW for this COS after
20992          * servicing guaranteed bandwidths for all COS.
20993          */
20994         uint8_t queue_id7_bw_weight;
20995         uint8_t unused_1[5];
20996 } __attribute__((packed));
20997
20998 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
20999 struct hwrm_queue_cos2bw_cfg_output {
21000         /* The specific error status for the command. */
21001         uint16_t        error_code;
21002         /* The HWRM command request type. */
21003         uint16_t        req_type;
21004         /* The sequence ID from the original command. */
21005         uint16_t        seq_id;
21006         /* The length of the response data in number of bytes. */
21007         uint16_t        resp_len;
21008         uint8_t unused_0[7];
21009         /*
21010          * This field is used in Output records to indicate that the output
21011          * is completely written to RAM.  This field should be read as '1'
21012          * to indicate that the output has been completely written.
21013          * When writing a command completion or response to an internal processor,
21014          * the order of writes has to be such that this field is written last.
21015          */
21016         uint8_t valid;
21017 } __attribute__((packed));
21018
21019 /*******************
21020  * hwrm_vnic_alloc *
21021  *******************/
21022
21023
21024 /* hwrm_vnic_alloc_input (size:192b/24B) */
21025 struct hwrm_vnic_alloc_input {
21026         /* The HWRM command request type. */
21027         uint16_t        req_type;
21028         /*
21029          * The completion ring to send the completion event on. This should
21030          * be the NQ ID returned from the `nq_alloc` HWRM command.
21031          */
21032         uint16_t        cmpl_ring;
21033         /*
21034          * The sequence ID is used by the driver for tracking multiple
21035          * commands. This ID is treated as opaque data by the firmware and
21036          * the value is returned in the `hwrm_resp_hdr` upon completion.
21037          */
21038         uint16_t        seq_id;
21039         /*
21040          * The target ID of the command:
21041          * * 0x0-0xFFF8 - The function ID
21042          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21043          * * 0xFFFD - Reserved for user-space HWRM interface
21044          * * 0xFFFF - HWRM
21045          */
21046         uint16_t        target_id;
21047         /*
21048          * A physical address pointer pointing to a host buffer that the
21049          * command's response data will be written. This can be either a host
21050          * physical address (HPA) or a guest physical address (GPA) and must
21051          * point to a physically contiguous block of memory.
21052          */
21053         uint64_t        resp_addr;
21054         uint32_t        flags;
21055         /*
21056          * When this bit is '1', this VNIC is requested to
21057          * be the default VNIC for this function.
21058          */
21059         #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT     UINT32_C(0x1)
21060         uint8_t unused_0[4];
21061 } __attribute__((packed));
21062
21063 /* hwrm_vnic_alloc_output (size:128b/16B) */
21064 struct hwrm_vnic_alloc_output {
21065         /* The specific error status for the command. */
21066         uint16_t        error_code;
21067         /* The HWRM command request type. */
21068         uint16_t        req_type;
21069         /* The sequence ID from the original command. */
21070         uint16_t        seq_id;
21071         /* The length of the response data in number of bytes. */
21072         uint16_t        resp_len;
21073         /* Logical vnic ID */
21074         uint32_t        vnic_id;
21075         uint8_t unused_0[3];
21076         /*
21077          * This field is used in Output records to indicate that the output
21078          * is completely written to RAM.  This field should be read as '1'
21079          * to indicate that the output has been completely written.
21080          * When writing a command completion or response to an internal processor,
21081          * the order of writes has to be such that this field is written last.
21082          */
21083         uint8_t valid;
21084 } __attribute__((packed));
21085
21086 /******************
21087  * hwrm_vnic_free *
21088  ******************/
21089
21090
21091 /* hwrm_vnic_free_input (size:192b/24B) */
21092 struct hwrm_vnic_free_input {
21093         /* The HWRM command request type. */
21094         uint16_t        req_type;
21095         /*
21096          * The completion ring to send the completion event on. This should
21097          * be the NQ ID returned from the `nq_alloc` HWRM command.
21098          */
21099         uint16_t        cmpl_ring;
21100         /*
21101          * The sequence ID is used by the driver for tracking multiple
21102          * commands. This ID is treated as opaque data by the firmware and
21103          * the value is returned in the `hwrm_resp_hdr` upon completion.
21104          */
21105         uint16_t        seq_id;
21106         /*
21107          * The target ID of the command:
21108          * * 0x0-0xFFF8 - The function ID
21109          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21110          * * 0xFFFD - Reserved for user-space HWRM interface
21111          * * 0xFFFF - HWRM
21112          */
21113         uint16_t        target_id;
21114         /*
21115          * A physical address pointer pointing to a host buffer that the
21116          * command's response data will be written. This can be either a host
21117          * physical address (HPA) or a guest physical address (GPA) and must
21118          * point to a physically contiguous block of memory.
21119          */
21120         uint64_t        resp_addr;
21121         /* Logical vnic ID */
21122         uint32_t        vnic_id;
21123         uint8_t unused_0[4];
21124 } __attribute__((packed));
21125
21126 /* hwrm_vnic_free_output (size:128b/16B) */
21127 struct hwrm_vnic_free_output {
21128         /* The specific error status for the command. */
21129         uint16_t        error_code;
21130         /* The HWRM command request type. */
21131         uint16_t        req_type;
21132         /* The sequence ID from the original command. */
21133         uint16_t        seq_id;
21134         /* The length of the response data in number of bytes. */
21135         uint16_t        resp_len;
21136         uint8_t unused_0[7];
21137         /*
21138          * This field is used in Output records to indicate that the output
21139          * is completely written to RAM.  This field should be read as '1'
21140          * to indicate that the output has been completely written.
21141          * When writing a command completion or response to an internal processor,
21142          * the order of writes has to be such that this field is written last.
21143          */
21144         uint8_t valid;
21145 } __attribute__((packed));
21146
21147 /*****************
21148  * hwrm_vnic_cfg *
21149  *****************/
21150
21151
21152 /* hwrm_vnic_cfg_input (size:320b/40B) */
21153 struct hwrm_vnic_cfg_input {
21154         /* The HWRM command request type. */
21155         uint16_t        req_type;
21156         /*
21157          * The completion ring to send the completion event on. This should
21158          * be the NQ ID returned from the `nq_alloc` HWRM command.
21159          */
21160         uint16_t        cmpl_ring;
21161         /*
21162          * The sequence ID is used by the driver for tracking multiple
21163          * commands. This ID is treated as opaque data by the firmware and
21164          * the value is returned in the `hwrm_resp_hdr` upon completion.
21165          */
21166         uint16_t        seq_id;
21167         /*
21168          * The target ID of the command:
21169          * * 0x0-0xFFF8 - The function ID
21170          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21171          * * 0xFFFD - Reserved for user-space HWRM interface
21172          * * 0xFFFF - HWRM
21173          */
21174         uint16_t        target_id;
21175         /*
21176          * A physical address pointer pointing to a host buffer that the
21177          * command's response data will be written. This can be either a host
21178          * physical address (HPA) or a guest physical address (GPA) and must
21179          * point to a physically contiguous block of memory.
21180          */
21181         uint64_t        resp_addr;
21182         uint32_t        flags;
21183         /*
21184          * When this bit is '1', the VNIC is requested to
21185          * be the default VNIC for the function.
21186          */
21187         #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT \
21188                 UINT32_C(0x1)
21189         /*
21190          * When this bit is '1', the VNIC is being configured to
21191          * strip VLAN in the RX path.
21192          * If set to '0', then VLAN stripping is disabled on
21193          * this VNIC.
21194          */
21195         #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE \
21196                 UINT32_C(0x2)
21197         /*
21198          * When this bit is '1', the VNIC is being configured to
21199          * buffer receive packets in the hardware until the host
21200          * posts new receive buffers.
21201          * If set to '0', then bd_stall is being configured to be
21202          * disabled on this VNIC.
21203          */
21204         #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE \
21205                 UINT32_C(0x4)
21206         /*
21207          * When this bit is '1', the VNIC is being configured to
21208          * receive both RoCE and non-RoCE traffic.
21209          * If set to '0', then this VNIC is not configured to be
21210          * operating in dual VNIC mode.
21211          */
21212         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
21213                 UINT32_C(0x8)
21214         /*
21215          * When this flag is set to '1', the VNIC is requested to
21216          * be configured to receive only RoCE traffic.
21217          * If this flag is set to '0', then this flag shall be
21218          * ignored by the HWRM.
21219          * If roce_dual_vnic_mode flag is set to '1'
21220          * or roce_mirroring_capable_vnic_mode flag to 1,
21221          * then the HWRM client shall not set this flag to '1'.
21222          */
21223         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
21224                 UINT32_C(0x10)
21225         /*
21226          * When a VNIC uses one destination ring group for certain
21227          * application (e.g. Receive Flow Steering) where
21228          * exact match is used to direct packets to a VNIC with one
21229          * destination ring group only, there is no need to configure
21230          * RSS indirection table for that VNIC as only one destination
21231          * ring group is used.
21232          *
21233          * This flag is used to enable a mode where
21234          * RSS is enabled in the VNIC using a RSS context
21235          * for computing RSS hash but the RSS indirection table is
21236          * not configured using hwrm_vnic_rss_cfg.
21237          *
21238          * If this mode is enabled, then the driver should not program
21239          * RSS indirection table for the RSS context that is used for
21240          * computing RSS hash only.
21241          */
21242         #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE \
21243                 UINT32_C(0x20)
21244         /*
21245          * When this bit is '1', the VNIC is being configured to
21246          * receive both RoCE and non-RoCE traffic, but forward only the
21247          * RoCE traffic further. Also, RoCE traffic can be mirrored to
21248          * L2 driver.
21249          */
21250         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
21251                 UINT32_C(0x40)
21252         uint32_t        enables;
21253         /*
21254          * This bit must be '1' for the dflt_ring_grp field to be
21255          * configured.
21256          */
21257         #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP \
21258                 UINT32_C(0x1)
21259         /*
21260          * This bit must be '1' for the rss_rule field to be
21261          * configured.
21262          */
21263         #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE \
21264                 UINT32_C(0x2)
21265         /*
21266          * This bit must be '1' for the cos_rule field to be
21267          * configured.
21268          */
21269         #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE \
21270                 UINT32_C(0x4)
21271         /*
21272          * This bit must be '1' for the lb_rule field to be
21273          * configured.
21274          */
21275         #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE \
21276                 UINT32_C(0x8)
21277         /*
21278          * This bit must be '1' for the mru field to be
21279          * configured.
21280          */
21281         #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU \
21282                 UINT32_C(0x10)
21283         /*
21284          * This bit must be '1' for the default_rx_ring_id field to be
21285          * configured.
21286          */
21287         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID \
21288                 UINT32_C(0x20)
21289         /*
21290          * This bit must be '1' for the default_cmpl_ring_id field to be
21291          * configured.
21292          */
21293         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID \
21294                 UINT32_C(0x40)
21295         /* Logical vnic ID */
21296         uint16_t        vnic_id;
21297         /*
21298          * Default Completion ring for the VNIC.  This ring will
21299          * be chosen if packet does not match any RSS rules and if
21300          * there is no COS rule.
21301          */
21302         uint16_t        dflt_ring_grp;
21303         /*
21304          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
21305          * there is no RSS rule.
21306          */
21307         uint16_t        rss_rule;
21308         /*
21309          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
21310          * there is no COS rule.
21311          */
21312         uint16_t        cos_rule;
21313         /*
21314          * RSS ID for load balancing rule/table structure.
21315          * 0xFF... (All Fs) if there is no LB rule.
21316          */
21317         uint16_t        lb_rule;
21318         /*
21319          * The maximum receive unit of the vnic.
21320          * Each vnic is associated with a function.
21321          * The vnic mru value overwrites the mru setting of the
21322          * associated function.
21323          * The HWRM shall make sure that vnic mru does not exceed
21324          * the mru of the port the function is associated with.
21325          */
21326         uint16_t        mru;
21327         /*
21328          * Default Rx ring for the VNIC.  This ring will
21329          * be chosen if packet does not match any RSS rules.
21330          * The aggregation ring associated with the Rx ring is
21331          * implied based on the Rx ring specified when the
21332          * aggregation ring was allocated.
21333          */
21334         uint16_t        default_rx_ring_id;
21335         /*
21336          * Default completion ring for the VNIC.  This ring will
21337          * be chosen if packet does not match any RSS rules.
21338          */
21339         uint16_t        default_cmpl_ring_id;
21340 } __attribute__((packed));
21341
21342 /* hwrm_vnic_cfg_output (size:128b/16B) */
21343 struct hwrm_vnic_cfg_output {
21344         /* The specific error status for the command. */
21345         uint16_t        error_code;
21346         /* The HWRM command request type. */
21347         uint16_t        req_type;
21348         /* The sequence ID from the original command. */
21349         uint16_t        seq_id;
21350         /* The length of the response data in number of bytes. */
21351         uint16_t        resp_len;
21352         uint8_t unused_0[7];
21353         /*
21354          * This field is used in Output records to indicate that the output
21355          * is completely written to RAM.  This field should be read as '1'
21356          * to indicate that the output has been completely written.
21357          * When writing a command completion or response to an internal processor,
21358          * the order of writes has to be such that this field is written last.
21359          */
21360         uint8_t valid;
21361 } __attribute__((packed));
21362
21363 /******************
21364  * hwrm_vnic_qcfg *
21365  ******************/
21366
21367
21368 /* hwrm_vnic_qcfg_input (size:256b/32B) */
21369 struct hwrm_vnic_qcfg_input {
21370         /* The HWRM command request type. */
21371         uint16_t        req_type;
21372         /*
21373          * The completion ring to send the completion event on. This should
21374          * be the NQ ID returned from the `nq_alloc` HWRM command.
21375          */
21376         uint16_t        cmpl_ring;
21377         /*
21378          * The sequence ID is used by the driver for tracking multiple
21379          * commands. This ID is treated as opaque data by the firmware and
21380          * the value is returned in the `hwrm_resp_hdr` upon completion.
21381          */
21382         uint16_t        seq_id;
21383         /*
21384          * The target ID of the command:
21385          * * 0x0-0xFFF8 - The function ID
21386          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21387          * * 0xFFFD - Reserved for user-space HWRM interface
21388          * * 0xFFFF - HWRM
21389          */
21390         uint16_t        target_id;
21391         /*
21392          * A physical address pointer pointing to a host buffer that the
21393          * command's response data will be written. This can be either a host
21394          * physical address (HPA) or a guest physical address (GPA) and must
21395          * point to a physically contiguous block of memory.
21396          */
21397         uint64_t        resp_addr;
21398         uint32_t        enables;
21399         /*
21400          * This bit must be '1' for the vf_id_valid field to be
21401          * configured.
21402          */
21403         #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
21404         /* Logical vnic ID */
21405         uint32_t        vnic_id;
21406         /* ID of Virtual Function whose VNIC resource is being queried. */
21407         uint16_t        vf_id;
21408         uint8_t unused_0[6];
21409 } __attribute__((packed));
21410
21411 /* hwrm_vnic_qcfg_output (size:256b/32B) */
21412 struct hwrm_vnic_qcfg_output {
21413         /* The specific error status for the command. */
21414         uint16_t        error_code;
21415         /* The HWRM command request type. */
21416         uint16_t        req_type;
21417         /* The sequence ID from the original command. */
21418         uint16_t        seq_id;
21419         /* The length of the response data in number of bytes. */
21420         uint16_t        resp_len;
21421         /* Default Completion ring for the VNIC. */
21422         uint16_t        dflt_ring_grp;
21423         /*
21424          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
21425          * there is no RSS rule.
21426          */
21427         uint16_t        rss_rule;
21428         /*
21429          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
21430          * there is no COS rule.
21431          */
21432         uint16_t        cos_rule;
21433         /*
21434          * RSS ID for load balancing rule/table structure.
21435          * 0xFF... (All Fs) if there is no LB rule.
21436          */
21437         uint16_t        lb_rule;
21438         /* The maximum receive unit of the vnic. */
21439         uint16_t        mru;
21440         uint8_t unused_0[2];
21441         uint32_t        flags;
21442         /*
21443          * When this bit is '1', the VNIC is the default VNIC for
21444          * the function.
21445          */
21446         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT \
21447                 UINT32_C(0x1)
21448         /*
21449          * When this bit is '1', the VNIC is configured to
21450          * strip VLAN in the RX path.
21451          * If set to '0', then VLAN stripping is disabled on
21452          * this VNIC.
21453          */
21454         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE \
21455                 UINT32_C(0x2)
21456         /*
21457          * When this bit is '1', the VNIC is configured to
21458          * buffer receive packets in the hardware until the host
21459          * posts new receive buffers.
21460          * If set to '0', then bd_stall is disabled on
21461          * this VNIC.
21462          */
21463         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE \
21464                 UINT32_C(0x4)
21465         /*
21466          * When this bit is '1', the VNIC is configured to
21467          * receive both RoCE and non-RoCE traffic.
21468          * If set to '0', then this VNIC is not configured to
21469          * operate in dual VNIC mode.
21470          */
21471         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
21472                 UINT32_C(0x8)
21473         /*
21474          * When this flag is set to '1', the VNIC is configured to
21475          * receive only RoCE traffic.
21476          * When this flag is set to '0', the VNIC is not configured
21477          * to receive only RoCE traffic.
21478          * If roce_dual_vnic_mode flag and this flag both are set
21479          * to '1', then it is an invalid configuration of the
21480          * VNIC. The HWRM should not allow that type of
21481          * mis-configuration by HWRM clients.
21482          */
21483         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
21484                 UINT32_C(0x10)
21485         /*
21486          * When a VNIC uses one destination ring group for certain
21487          * application (e.g. Receive Flow Steering) where
21488          * exact match is used to direct packets to a VNIC with one
21489          * destination ring group only, there is no need to configure
21490          * RSS indirection table for that VNIC as only one destination
21491          * ring group is used.
21492          *
21493          * When this bit is set to '1', then the VNIC is enabled in a
21494          * mode where RSS is enabled in the VNIC using a RSS context
21495          * for computing RSS hash but the RSS indirection table is
21496          * not configured.
21497          */
21498         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE \
21499                 UINT32_C(0x20)
21500         /*
21501          * When this bit is '1', the VNIC is configured to
21502          * receive both RoCE and non-RoCE traffic, but forward only
21503          * RoCE traffic further. Also RoCE traffic can be mirrored to
21504          * L2 driver.
21505          */
21506         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
21507                 UINT32_C(0x40)
21508         uint8_t unused_1[7];
21509         /*
21510          * This field is used in Output records to indicate that the output
21511          * is completely written to RAM.  This field should be read as '1'
21512          * to indicate that the output has been completely written.
21513          * When writing a command completion or response to an internal processor,
21514          * the order of writes has to be such that this field is written last.
21515          */
21516         uint8_t valid;
21517 } __attribute__((packed));
21518
21519 /*******************
21520  * hwrm_vnic_qcaps *
21521  *******************/
21522
21523
21524 /* hwrm_vnic_qcaps_input (size:192b/24B) */
21525 struct hwrm_vnic_qcaps_input {
21526         /* The HWRM command request type. */
21527         uint16_t        req_type;
21528         /*
21529          * The completion ring to send the completion event on. This should
21530          * be the NQ ID returned from the `nq_alloc` HWRM command.
21531          */
21532         uint16_t        cmpl_ring;
21533         /*
21534          * The sequence ID is used by the driver for tracking multiple
21535          * commands. This ID is treated as opaque data by the firmware and
21536          * the value is returned in the `hwrm_resp_hdr` upon completion.
21537          */
21538         uint16_t        seq_id;
21539         /*
21540          * The target ID of the command:
21541          * * 0x0-0xFFF8 - The function ID
21542          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21543          * * 0xFFFD - Reserved for user-space HWRM interface
21544          * * 0xFFFF - HWRM
21545          */
21546         uint16_t        target_id;
21547         /*
21548          * A physical address pointer pointing to a host buffer that the
21549          * command's response data will be written. This can be either a host
21550          * physical address (HPA) or a guest physical address (GPA) and must
21551          * point to a physically contiguous block of memory.
21552          */
21553         uint64_t        resp_addr;
21554         uint32_t        enables;
21555         uint8_t unused_0[4];
21556 } __attribute__((packed));
21557
21558 /* hwrm_vnic_qcaps_output (size:192b/24B) */
21559 struct hwrm_vnic_qcaps_output {
21560         /* The specific error status for the command. */
21561         uint16_t        error_code;
21562         /* The HWRM command request type. */
21563         uint16_t        req_type;
21564         /* The sequence ID from the original command. */
21565         uint16_t        seq_id;
21566         /* The length of the response data in number of bytes. */
21567         uint16_t        resp_len;
21568         /* The maximum receive unit that is settable on a vnic. */
21569         uint16_t        mru;
21570         uint8_t unused_0[2];
21571         uint32_t        flags;
21572         /* Unused. */
21573         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED \
21574                 UINT32_C(0x1)
21575         /*
21576          * When this bit is '1', the capability of stripping VLAN in
21577          * the RX path is supported on VNIC(s).
21578          * If set to '0', then VLAN stripping capability is
21579          * not supported on VNIC(s).
21580          */
21581         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP \
21582                 UINT32_C(0x2)
21583         /*
21584          * When this bit is '1', the capability to buffer receive
21585          * packets in the hardware until the host posts new receive buffers
21586          * is supported on VNIC(s).
21587          * If set to '0', then bd_stall capability is not supported
21588          * on VNIC(s).
21589          */
21590         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP \
21591                 UINT32_C(0x4)
21592         /*
21593          * When this bit is '1', the capability to
21594          * receive both RoCE and non-RoCE traffic on VNIC(s) is
21595          * supported.
21596          * If set to '0', then the capability to receive
21597          * both RoCE and non-RoCE traffic on VNIC(s) is
21598          * not supported.
21599          */
21600         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP \
21601                 UINT32_C(0x8)
21602         /*
21603          * When this bit is set to '1', the capability to configure
21604          * a VNIC to receive only RoCE traffic is supported.
21605          * When this flag is set to '0', the VNIC capability to
21606          * configure to receive only RoCE traffic is not supported.
21607          */
21608         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP \
21609                 UINT32_C(0x10)
21610         /*
21611          * When this bit is set to '1', then the capability to enable
21612          * a VNIC in a mode where RSS context without configuring
21613          * RSS indirection table is supported (for RSS hash computation).
21614          * When this bit is set to '0', then a VNIC can not be configured
21615          * with a mode to enable RSS context without configuring RSS
21616          * indirection table.
21617          */
21618         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP \
21619                 UINT32_C(0x20)
21620         /*
21621          * When this bit is '1', the capability to
21622          * mirror the the RoCE traffic is supported.
21623          * If set to '0', then the capability to mirror the
21624          * RoCE traffic is not supported.
21625          */
21626         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP \
21627                 UINT32_C(0x40)
21628         /*
21629          * When this bit is '1', the outermost RSS hashing capability
21630          * is supported. If set to '0', then the outermost RSS hashing
21631          * capability is not supported.
21632          */
21633         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP \
21634                 UINT32_C(0x80)
21635         /*
21636          * This field advertises the maximum concurrent TPA aggregations
21637          * supported by the VNIC on new devices that support TPA v2.
21638          * '0' means that TPA v2 is not supported.
21639          */
21640         uint16_t        max_aggs_supported;
21641         uint8_t unused_1[5];
21642         /*
21643          * This field is used in Output records to indicate that the output
21644          * is completely written to RAM.  This field should be read as '1'
21645          * to indicate that the output has been completely written.
21646          * When writing a command completion or response to an internal processor,
21647          * the order of writes has to be such that this field is written last.
21648          */
21649         uint8_t valid;
21650 } __attribute__((packed));
21651
21652 /*********************
21653  * hwrm_vnic_tpa_cfg *
21654  *********************/
21655
21656
21657 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */
21658 struct hwrm_vnic_tpa_cfg_input {
21659         /* The HWRM command request type. */
21660         uint16_t        req_type;
21661         /*
21662          * The completion ring to send the completion event on. This should
21663          * be the NQ ID returned from the `nq_alloc` HWRM command.
21664          */
21665         uint16_t        cmpl_ring;
21666         /*
21667          * The sequence ID is used by the driver for tracking multiple
21668          * commands. This ID is treated as opaque data by the firmware and
21669          * the value is returned in the `hwrm_resp_hdr` upon completion.
21670          */
21671         uint16_t        seq_id;
21672         /*
21673          * The target ID of the command:
21674          * * 0x0-0xFFF8 - The function ID
21675          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21676          * * 0xFFFD - Reserved for user-space HWRM interface
21677          * * 0xFFFF - HWRM
21678          */
21679         uint16_t        target_id;
21680         /*
21681          * A physical address pointer pointing to a host buffer that the
21682          * command's response data will be written. This can be either a host
21683          * physical address (HPA) or a guest physical address (GPA) and must
21684          * point to a physically contiguous block of memory.
21685          */
21686         uint64_t        resp_addr;
21687         uint32_t        flags;
21688         /*
21689          * When this bit is '1', the VNIC shall be configured to
21690          * perform transparent packet aggregation (TPA) of
21691          * non-tunneled TCP packets.
21692          */
21693         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA \
21694                 UINT32_C(0x1)
21695         /*
21696          * When this bit is '1', the VNIC shall be configured to
21697          * perform transparent packet aggregation (TPA) of
21698          * tunneled TCP packets.
21699          */
21700         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA \
21701                 UINT32_C(0x2)
21702         /*
21703          * When this bit is '1', the VNIC shall be configured to
21704          * perform transparent packet aggregation (TPA) according
21705          * to Windows Receive Segment Coalescing (RSC) rules.
21706          */
21707         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE \
21708                 UINT32_C(0x4)
21709         /*
21710          * When this bit is '1', the VNIC shall be configured to
21711          * perform transparent packet aggregation (TPA) according
21712          * to Linux Generic Receive Offload (GRO) rules.
21713          */
21714         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO \
21715                 UINT32_C(0x8)
21716         /*
21717          * When this bit is '1', the VNIC shall be configured to
21718          * perform transparent packet aggregation (TPA) for TCP
21719          * packets with IP ECN set to non-zero.
21720          */
21721         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN \
21722                 UINT32_C(0x10)
21723         /*
21724          * When this bit is '1', the VNIC shall be configured to
21725          * perform transparent packet aggregation (TPA) for
21726          * GRE tunneled TCP packets only if all packets have the
21727          * same GRE sequence.
21728          */
21729         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
21730                 UINT32_C(0x20)
21731         /*
21732          * When this bit is '1' and the GRO mode is enabled,
21733          * the VNIC shall be configured to
21734          * perform transparent packet aggregation (TPA) for
21735          * TCP/IPv4 packets with consecutively increasing IPIDs.
21736          * In other words, the last packet that is being
21737          * aggregated to an already existing aggregation context
21738          * shall have IPID 1 more than the IPID of the last packet
21739          * that was aggregated in that aggregation context.
21740          */
21741         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK \
21742                 UINT32_C(0x40)
21743         /*
21744          * When this bit is '1' and the GRO mode is enabled,
21745          * the VNIC shall be configured to
21746          * perform transparent packet aggregation (TPA) for
21747          * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
21748          * value.
21749          */
21750         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK \
21751                 UINT32_C(0x80)
21752         /*
21753          * When this bit is '1' and the GRO mode is enabled,
21754          * the VNIC shall DMA payload data using GRO rules.
21755          * When this bit is '0', the VNIC shall DMA payload data
21756          * using the more efficient LRO rules of filling all
21757          * aggregation buffers.
21758          */
21759         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_PACK_AS_GRO \
21760                 UINT32_C(0x100)
21761         uint32_t        enables;
21762         /*
21763          * This bit must be '1' for the max_agg_segs field to be
21764          * configured.
21765          */
21766         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS      UINT32_C(0x1)
21767         /*
21768          * This bit must be '1' for the max_aggs field to be
21769          * configured.
21770          */
21771         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS          UINT32_C(0x2)
21772         /*
21773          * This bit must be '1' for the max_agg_timer field to be
21774          * configured.
21775          */
21776         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER     UINT32_C(0x4)
21777         /* deprecated bit.  Do not use!!! */
21778         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN       UINT32_C(0x8)
21779         /* Logical vnic ID */
21780         uint16_t        vnic_id;
21781         /*
21782          * This is the maximum number of TCP segments that can
21783          * be aggregated (unit is Log2). Max value is 31. On new
21784          * devices supporting TPA v2, the unit is multiples of 4 and
21785          * valid values are > 0 and <= 63.
21786          */
21787         uint16_t        max_agg_segs;
21788         /* 1 segment */
21789         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
21790         /* 2 segments */
21791         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
21792         /* 4 segments */
21793         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
21794         /* 8 segments */
21795         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
21796         /* Any segment size larger than this is not valid */
21797         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
21798         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST \
21799                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
21800         /*
21801          * This is the maximum number of aggregations this VNIC is
21802          * allowed (unit is Log2). Max value is 7. On new devices
21803          * supporting TPA v2, this is in unit of 1 and must be > 0
21804          * and <= max_aggs_supported in the hwrm_vnic_qcaps response
21805          * to enable TPA v2.
21806          */
21807         uint16_t        max_aggs;
21808         /* 1 aggregation */
21809         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1   UINT32_C(0x0)
21810         /* 2 aggregations */
21811         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2   UINT32_C(0x1)
21812         /* 4 aggregations */
21813         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4   UINT32_C(0x2)
21814         /* 8 aggregations */
21815         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8   UINT32_C(0x3)
21816         /* 16 aggregations */
21817         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16  UINT32_C(0x4)
21818         /* Any aggregation size larger than this is not valid */
21819         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
21820         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST \
21821                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
21822         uint8_t unused_0[2];
21823         /*
21824          * This is the maximum amount of time allowed for
21825          * an aggregation context to complete after it was initiated.
21826          */
21827         uint32_t        max_agg_timer;
21828         /*
21829          * This is the minimum amount of payload length required to
21830          * start an aggregation context. This field is deprecated and
21831          * should be set to 0.  The minimum length is set by firmware
21832          * and can be queried using hwrm_vnic_tpa_qcfg.
21833          */
21834         uint32_t        min_agg_len;
21835 } __attribute__((packed));
21836
21837 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
21838 struct hwrm_vnic_tpa_cfg_output {
21839         /* The specific error status for the command. */
21840         uint16_t        error_code;
21841         /* The HWRM command request type. */
21842         uint16_t        req_type;
21843         /* The sequence ID from the original command. */
21844         uint16_t        seq_id;
21845         /* The length of the response data in number of bytes. */
21846         uint16_t        resp_len;
21847         uint8_t unused_0[7];
21848         /*
21849          * This field is used in Output records to indicate that the output
21850          * is completely written to RAM.  This field should be read as '1'
21851          * to indicate that the output has been completely written.
21852          * When writing a command completion or response to an internal processor,
21853          * the order of writes has to be such that this field is written last.
21854          */
21855         uint8_t valid;
21856 } __attribute__((packed));
21857
21858 /*********************
21859  * hwrm_vnic_rss_cfg *
21860  *********************/
21861
21862
21863 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
21864 struct hwrm_vnic_rss_cfg_input {
21865         /* The HWRM command request type. */
21866         uint16_t        req_type;
21867         /*
21868          * The completion ring to send the completion event on. This should
21869          * be the NQ ID returned from the `nq_alloc` HWRM command.
21870          */
21871         uint16_t        cmpl_ring;
21872         /*
21873          * The sequence ID is used by the driver for tracking multiple
21874          * commands. This ID is treated as opaque data by the firmware and
21875          * the value is returned in the `hwrm_resp_hdr` upon completion.
21876          */
21877         uint16_t        seq_id;
21878         /*
21879          * The target ID of the command:
21880          * * 0x0-0xFFF8 - The function ID
21881          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21882          * * 0xFFFD - Reserved for user-space HWRM interface
21883          * * 0xFFFF - HWRM
21884          */
21885         uint16_t        target_id;
21886         /*
21887          * A physical address pointer pointing to a host buffer that the
21888          * command's response data will be written. This can be either a host
21889          * physical address (HPA) or a guest physical address (GPA) and must
21890          * point to a physically contiguous block of memory.
21891          */
21892         uint64_t        resp_addr;
21893         uint32_t        hash_type;
21894         /*
21895          * When this bit is '1', the RSS hash shall be computed
21896          * over source and destination IPv4 addresses of IPv4
21897          * packets.
21898          */
21899         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
21900         /*
21901          * When this bit is '1', the RSS hash shall be computed
21902          * over source/destination IPv4 addresses and
21903          * source/destination ports of TCP/IPv4 packets.
21904          */
21905         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
21906         /*
21907          * When this bit is '1', the RSS hash shall be computed
21908          * over source/destination IPv4 addresses and
21909          * source/destination ports of UDP/IPv4 packets.
21910          */
21911         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
21912         /*
21913          * When this bit is '1', the RSS hash shall be computed
21914          * over source and destination IPv4 addresses of IPv6
21915          * packets.
21916          */
21917         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
21918         /*
21919          * When this bit is '1', the RSS hash shall be computed
21920          * over source/destination IPv6 addresses and
21921          * source/destination ports of TCP/IPv6 packets.
21922          */
21923         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
21924         /*
21925          * When this bit is '1', the RSS hash shall be computed
21926          * over source/destination IPv6 addresses and
21927          * source/destination ports of UDP/IPv6 packets.
21928          */
21929         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
21930         /* VNIC ID of VNIC associated with RSS table being configured. */
21931         uint16_t        vnic_id;
21932         /*
21933          * Specifies which VNIC ring table pair to configure.
21934          * Valid values range from 0 to 7.
21935          */
21936         uint8_t ring_table_pair_index;
21937         /* Flags to specify different RSS hash modes. */
21938         uint8_t hash_mode_flags;
21939         /*
21940          * When this bit is '1', it indicates using current RSS
21941          * hash mode setting configured in the device.
21942          */
21943         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \
21944                 UINT32_C(0x1)
21945         /*
21946          * When this bit is '1', it indicates requesting support of
21947          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
21948          * l4.src, l4.dest} for tunnel packets. For none-tunnel
21949          * packets, the RSS hash is computed over the normal
21950          * src/dest l3 and src/dest l4 headers.
21951          */
21952         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \
21953                 UINT32_C(0x2)
21954         /*
21955          * When this bit is '1', it indicates requesting support of
21956          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
21957          * tunnel packets. For none-tunnel packets, the RSS hash is
21958          * computed over the normal src/dest l3 headers.
21959          */
21960         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \
21961                 UINT32_C(0x4)
21962         /*
21963          * When this bit is '1', it indicates requesting support of
21964          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
21965          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
21966          * packets, the RSS hash is computed over the normal
21967          * src/dest l3 and src/dest l4 headers.
21968          */
21969         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
21970                 UINT32_C(0x8)
21971         /*
21972          * When this bit is '1', it indicates requesting support of
21973          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
21974          * tunnel packets. For none-tunnel packets, the RSS hash is
21975          * computed over the normal src/dest l3 headers.
21976          */
21977         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
21978                 UINT32_C(0x10)
21979         /* This is the address for rss ring group table */
21980         uint64_t        ring_grp_tbl_addr;
21981         /* This is the address for rss hash key table */
21982         uint64_t        hash_key_tbl_addr;
21983         /* Index to the rss indirection table. */
21984         uint16_t        rss_ctx_idx;
21985         uint8_t unused_1[6];
21986 } __attribute__((packed));
21987
21988 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
21989 struct hwrm_vnic_rss_cfg_output {
21990         /* The specific error status for the command. */
21991         uint16_t        error_code;
21992         /* The HWRM command request type. */
21993         uint16_t        req_type;
21994         /* The sequence ID from the original command. */
21995         uint16_t        seq_id;
21996         /* The length of the response data in number of bytes. */
21997         uint16_t        resp_len;
21998         uint8_t unused_0[7];
21999         /*
22000          * This field is used in Output records to indicate that the output
22001          * is completely written to RAM.  This field should be read as '1'
22002          * to indicate that the output has been completely written.
22003          * When writing a command completion or response to an internal processor,
22004          * the order of writes has to be such that this field is written last.
22005          */
22006         uint8_t valid;
22007 } __attribute__((packed));
22008
22009 /**********************
22010  * hwrm_vnic_rss_qcfg *
22011  **********************/
22012
22013
22014 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
22015 struct hwrm_vnic_rss_qcfg_input {
22016         /* The HWRM command request type. */
22017         uint16_t        req_type;
22018         /*
22019          * The completion ring to send the completion event on. This should
22020          * be the NQ ID returned from the `nq_alloc` HWRM command.
22021          */
22022         uint16_t        cmpl_ring;
22023         /*
22024          * The sequence ID is used by the driver for tracking multiple
22025          * commands. This ID is treated as opaque data by the firmware and
22026          * the value is returned in the `hwrm_resp_hdr` upon completion.
22027          */
22028         uint16_t        seq_id;
22029         /*
22030          * The target ID of the command:
22031          * * 0x0-0xFFF8 - The function ID
22032          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22033          * * 0xFFFD - Reserved for user-space HWRM interface
22034          * * 0xFFFF - HWRM
22035          */
22036         uint16_t        target_id;
22037         /*
22038          * A physical address pointer pointing to a host buffer that the
22039          * command's response data will be written. This can be either a host
22040          * physical address (HPA) or a guest physical address (GPA) and must
22041          * point to a physically contiguous block of memory.
22042          */
22043         uint64_t        resp_addr;
22044         /* Index to the rss indirection table. */
22045         uint16_t        rss_ctx_idx;
22046         uint8_t unused_0[6];
22047 } __attribute__((packed));
22048
22049 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
22050 struct hwrm_vnic_rss_qcfg_output {
22051         /* The specific error status for the command. */
22052         uint16_t        error_code;
22053         /* The HWRM command request type. */
22054         uint16_t        req_type;
22055         /* The sequence ID from the original command. */
22056         uint16_t        seq_id;
22057         /* The length of the response data in number of bytes. */
22058         uint16_t        resp_len;
22059         uint32_t        hash_type;
22060         /*
22061          * When this bit is '1', the RSS hash shall be computed
22062          * over source and destination IPv4 addresses of IPv4
22063          * packets.
22064          */
22065         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
22066         /*
22067          * When this bit is '1', the RSS hash shall be computed
22068          * over source/destination IPv4 addresses and
22069          * source/destination ports of TCP/IPv4 packets.
22070          */
22071         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
22072         /*
22073          * When this bit is '1', the RSS hash shall be computed
22074          * over source/destination IPv4 addresses and
22075          * source/destination ports of UDP/IPv4 packets.
22076          */
22077         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
22078         /*
22079          * When this bit is '1', the RSS hash shall be computed
22080          * over source and destination IPv4 addresses of IPv6
22081          * packets.
22082          */
22083         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
22084         /*
22085          * When this bit is '1', the RSS hash shall be computed
22086          * over source/destination IPv6 addresses and
22087          * source/destination ports of TCP/IPv6 packets.
22088          */
22089         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
22090         /*
22091          * When this bit is '1', the RSS hash shall be computed
22092          * over source/destination IPv6 addresses and
22093          * source/destination ports of UDP/IPv6 packets.
22094          */
22095         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
22096         uint8_t unused_0[4];
22097         /* This is the value of rss hash key */
22098         uint32_t        hash_key[10];
22099         /* Flags to specify different RSS hash modes. */
22100         uint8_t hash_mode_flags;
22101         /*
22102          * When this bit is '1', it indicates using current RSS
22103          * hash mode setting configured in the device.
22104          */
22105         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \
22106                 UINT32_C(0x1)
22107         /*
22108          * When this bit is '1', it indicates requesting support of
22109          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
22110          * l4.src, l4.dest} for tunnel packets. For none-tunnel
22111          * packets, the RSS hash is computed over the normal
22112          * src/dest l3 and src/dest l4 headers.
22113          */
22114         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \
22115                 UINT32_C(0x2)
22116         /*
22117          * When this bit is '1', it indicates requesting support of
22118          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
22119          * tunnel packets. For none-tunnel packets, the RSS hash is
22120          * computed over the normal src/dest l3 headers.
22121          */
22122         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \
22123                 UINT32_C(0x4)
22124         /*
22125          * When this bit is '1', it indicates requesting support of
22126          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
22127          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
22128          * packets, the RSS hash is computed over the normal
22129          * src/dest l3 and src/dest l4 headers.
22130          */
22131         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
22132                 UINT32_C(0x8)
22133         /*
22134          * When this bit is '1', it indicates requesting support of
22135          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
22136          * tunnel packets. For none-tunnel packets, the RSS hash is
22137          * computed over the normal src/dest l3 headers.
22138          */
22139         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
22140                 UINT32_C(0x10)
22141         uint8_t unused_1[6];
22142         /*
22143          * This field is used in Output records to indicate that the output
22144          * is completely written to RAM.  This field should be read as '1'
22145          * to indicate that the output has been completely written.
22146          * When writing a command completion or response to an internal processor,
22147          * the order of writes has to be such that this field is written last.
22148          */
22149         uint8_t valid;
22150 } __attribute__((packed));
22151
22152 /**************************
22153  * hwrm_vnic_plcmodes_cfg *
22154  **************************/
22155
22156
22157 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
22158 struct hwrm_vnic_plcmodes_cfg_input {
22159         /* The HWRM command request type. */
22160         uint16_t        req_type;
22161         /*
22162          * The completion ring to send the completion event on. This should
22163          * be the NQ ID returned from the `nq_alloc` HWRM command.
22164          */
22165         uint16_t        cmpl_ring;
22166         /*
22167          * The sequence ID is used by the driver for tracking multiple
22168          * commands. This ID is treated as opaque data by the firmware and
22169          * the value is returned in the `hwrm_resp_hdr` upon completion.
22170          */
22171         uint16_t        seq_id;
22172         /*
22173          * The target ID of the command:
22174          * * 0x0-0xFFF8 - The function ID
22175          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22176          * * 0xFFFD - Reserved for user-space HWRM interface
22177          * * 0xFFFF - HWRM
22178          */
22179         uint16_t        target_id;
22180         /*
22181          * A physical address pointer pointing to a host buffer that the
22182          * command's response data will be written. This can be either a host
22183          * physical address (HPA) or a guest physical address (GPA) and must
22184          * point to a physically contiguous block of memory.
22185          */
22186         uint64_t        resp_addr;
22187         uint32_t        flags;
22188         /*
22189          * When this bit is '1', the VNIC shall be configured to
22190          * use regular placement algorithm.
22191          * By default, the regular placement algorithm shall be
22192          * enabled on the VNIC.
22193          */
22194         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
22195                 UINT32_C(0x1)
22196         /*
22197          * When this bit is '1', the VNIC shall be configured
22198          * use the jumbo placement algorithm.
22199          */
22200         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
22201                 UINT32_C(0x2)
22202         /*
22203          * When this bit is '1', the VNIC shall be configured
22204          * to enable Header-Data split for IPv4 packets according
22205          * to the following rules:
22206          * # If the packet is identified as TCP/IPv4, then the
22207          * packet is split at the beginning of the TCP payload.
22208          * # If the packet is identified as UDP/IPv4, then the
22209          * packet is split at the beginning of UDP payload.
22210          * # If the packet is identified as non-TCP and non-UDP
22211          * IPv4 packet, then the packet is split at the beginning
22212          * of the upper layer protocol header carried in the IPv4
22213          * packet.
22214          */
22215         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 \
22216                 UINT32_C(0x4)
22217         /*
22218          * When this bit is '1', the VNIC shall be configured
22219          * to enable Header-Data split for IPv6 packets according
22220          * to the following rules:
22221          * # If the packet is identified as TCP/IPv6, then the
22222          * packet is split at the beginning of the TCP payload.
22223          * # If the packet is identified as UDP/IPv6, then the
22224          * packet is split at the beginning of UDP payload.
22225          * # If the packet is identified as non-TCP and non-UDP
22226          * IPv6 packet, then the packet is split at the beginning
22227          * of the upper layer protocol header carried in the IPv6
22228          * packet.
22229          */
22230         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 \
22231                 UINT32_C(0x8)
22232         /*
22233          * When this bit is '1', the VNIC shall be configured
22234          * to enable Header-Data split for FCoE packets at the
22235          * beginning of FC payload.
22236          */
22237         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE \
22238                 UINT32_C(0x10)
22239         /*
22240          * When this bit is '1', the VNIC shall be configured
22241          * to enable Header-Data split for RoCE packets at the
22242          * beginning of RoCE payload (after BTH/GRH headers).
22243          */
22244         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE \
22245                 UINT32_C(0x20)
22246         uint32_t        enables;
22247         /*
22248          * This bit must be '1' for the jumbo_thresh_valid field to be
22249          * configured.
22250          */
22251         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
22252                 UINT32_C(0x1)
22253         /*
22254          * This bit must be '1' for the hds_offset_valid field to be
22255          * configured.
22256          */
22257         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
22258                 UINT32_C(0x2)
22259         /*
22260          * This bit must be '1' for the hds_threshold_valid field to be
22261          * configured.
22262          */
22263         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
22264                 UINT32_C(0x4)
22265         /* Logical vnic ID */
22266         uint32_t        vnic_id;
22267         /*
22268          * When jumbo placement algorithm is enabled, this value
22269          * is used to determine the threshold for jumbo placement.
22270          * Packets with length larger than this value will be
22271          * placed according to the jumbo placement algorithm.
22272          */
22273         uint16_t        jumbo_thresh;
22274         /*
22275          * This value is used to determine the offset into
22276          * packet buffer where the split data (payload) will be
22277          * placed according to one of of HDS placement algorithm.
22278          *
22279          * The lengths of packet buffers provided for split data
22280          * shall be larger than this value.
22281          */
22282         uint16_t        hds_offset;
22283         /*
22284          * When one of the HDS placement algorithm is enabled, this
22285          * value is used to determine the threshold for HDS
22286          * placement.
22287          * Packets with length larger than this value will be
22288          * placed according to the HDS placement algorithm.
22289          * This value shall be in multiple of 4 bytes.
22290          */
22291         uint16_t        hds_threshold;
22292         uint8_t unused_0[6];
22293 } __attribute__((packed));
22294
22295 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
22296 struct hwrm_vnic_plcmodes_cfg_output {
22297         /* The specific error status for the command. */
22298         uint16_t        error_code;
22299         /* The HWRM command request type. */
22300         uint16_t        req_type;
22301         /* The sequence ID from the original command. */
22302         uint16_t        seq_id;
22303         /* The length of the response data in number of bytes. */
22304         uint16_t        resp_len;
22305         uint8_t unused_0[7];
22306         /*
22307          * This field is used in Output records to indicate that the output
22308          * is completely written to RAM.  This field should be read as '1'
22309          * to indicate that the output has been completely written.
22310          * When writing a command completion or response to an internal processor,
22311          * the order of writes has to be such that this field is written last.
22312          */
22313         uint8_t valid;
22314 } __attribute__((packed));
22315
22316 /***************************
22317  * hwrm_vnic_plcmodes_qcfg *
22318  ***************************/
22319
22320
22321 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
22322 struct hwrm_vnic_plcmodes_qcfg_input {
22323         /* The HWRM command request type. */
22324         uint16_t        req_type;
22325         /*
22326          * The completion ring to send the completion event on. This should
22327          * be the NQ ID returned from the `nq_alloc` HWRM command.
22328          */
22329         uint16_t        cmpl_ring;
22330         /*
22331          * The sequence ID is used by the driver for tracking multiple
22332          * commands. This ID is treated as opaque data by the firmware and
22333          * the value is returned in the `hwrm_resp_hdr` upon completion.
22334          */
22335         uint16_t        seq_id;
22336         /*
22337          * The target ID of the command:
22338          * * 0x0-0xFFF8 - The function ID
22339          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22340          * * 0xFFFD - Reserved for user-space HWRM interface
22341          * * 0xFFFF - HWRM
22342          */
22343         uint16_t        target_id;
22344         /*
22345          * A physical address pointer pointing to a host buffer that the
22346          * command's response data will be written. This can be either a host
22347          * physical address (HPA) or a guest physical address (GPA) and must
22348          * point to a physically contiguous block of memory.
22349          */
22350         uint64_t        resp_addr;
22351         /* Logical vnic ID */
22352         uint32_t        vnic_id;
22353         uint8_t unused_0[4];
22354 } __attribute__((packed));
22355
22356 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
22357 struct hwrm_vnic_plcmodes_qcfg_output {
22358         /* The specific error status for the command. */
22359         uint16_t        error_code;
22360         /* The HWRM command request type. */
22361         uint16_t        req_type;
22362         /* The sequence ID from the original command. */
22363         uint16_t        seq_id;
22364         /* The length of the response data in number of bytes. */
22365         uint16_t        resp_len;
22366         uint32_t        flags;
22367         /*
22368          * When this bit is '1', the VNIC is configured to
22369          * use regular placement algorithm.
22370          */
22371         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
22372                 UINT32_C(0x1)
22373         /*
22374          * When this bit is '1', the VNIC is configured to
22375          * use the jumbo placement algorithm.
22376          */
22377         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
22378                 UINT32_C(0x2)
22379         /*
22380          * When this bit is '1', the VNIC is configured
22381          * to enable Header-Data split for IPv4 packets.
22382          */
22383         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 \
22384                 UINT32_C(0x4)
22385         /*
22386          * When this bit is '1', the VNIC is configured
22387          * to enable Header-Data split for IPv6 packets.
22388          */
22389         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 \
22390                 UINT32_C(0x8)
22391         /*
22392          * When this bit is '1', the VNIC is configured
22393          * to enable Header-Data split for FCoE packets.
22394          */
22395         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE \
22396                 UINT32_C(0x10)
22397         /*
22398          * When this bit is '1', the VNIC is configured
22399          * to enable Header-Data split for RoCE packets.
22400          */
22401         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE \
22402                 UINT32_C(0x20)
22403         /*
22404          * When this bit is '1', the VNIC is configured
22405          * to be the default VNIC of the requesting function.
22406          */
22407         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC \
22408                 UINT32_C(0x40)
22409         /*
22410          * When jumbo placement algorithm is enabled, this value
22411          * is used to determine the threshold for jumbo placement.
22412          * Packets with length larger than this value will be
22413          * placed according to the jumbo placement algorithm.
22414          */
22415         uint16_t        jumbo_thresh;
22416         /*
22417          * This value is used to determine the offset into
22418          * packet buffer where the split data (payload) will be
22419          * placed according to one of of HDS placement algorithm.
22420          *
22421          * The lengths of packet buffers provided for split data
22422          * shall be larger than this value.
22423          */
22424         uint16_t        hds_offset;
22425         /*
22426          * When one of the HDS placement algorithm is enabled, this
22427          * value is used to determine the threshold for HDS
22428          * placement.
22429          * Packets with length larger than this value will be
22430          * placed according to the HDS placement algorithm.
22431          * This value shall be in multiple of 4 bytes.
22432          */
22433         uint16_t        hds_threshold;
22434         uint8_t unused_0[5];
22435         /*
22436          * This field is used in Output records to indicate that the output
22437          * is completely written to RAM.  This field should be read as '1'
22438          * to indicate that the output has been completely written.
22439          * When writing a command completion or response to an internal processor,
22440          * the order of writes has to be such that this field is written last.
22441          */
22442         uint8_t valid;
22443 } __attribute__((packed));
22444
22445 /**********************************
22446  * hwrm_vnic_rss_cos_lb_ctx_alloc *
22447  **********************************/
22448
22449
22450 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
22451 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
22452         /* The HWRM command request type. */
22453         uint16_t        req_type;
22454         /*
22455          * The completion ring to send the completion event on. This should
22456          * be the NQ ID returned from the `nq_alloc` HWRM command.
22457          */
22458         uint16_t        cmpl_ring;
22459         /*
22460          * The sequence ID is used by the driver for tracking multiple
22461          * commands. This ID is treated as opaque data by the firmware and
22462          * the value is returned in the `hwrm_resp_hdr` upon completion.
22463          */
22464         uint16_t        seq_id;
22465         /*
22466          * The target ID of the command:
22467          * * 0x0-0xFFF8 - The function ID
22468          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22469          * * 0xFFFD - Reserved for user-space HWRM interface
22470          * * 0xFFFF - HWRM
22471          */
22472         uint16_t        target_id;
22473         /*
22474          * A physical address pointer pointing to a host buffer that the
22475          * command's response data will be written. This can be either a host
22476          * physical address (HPA) or a guest physical address (GPA) and must
22477          * point to a physically contiguous block of memory.
22478          */
22479         uint64_t        resp_addr;
22480 } __attribute__((packed));
22481
22482 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
22483 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
22484         /* The specific error status for the command. */
22485         uint16_t        error_code;
22486         /* The HWRM command request type. */
22487         uint16_t        req_type;
22488         /* The sequence ID from the original command. */
22489         uint16_t        seq_id;
22490         /* The length of the response data in number of bytes. */
22491         uint16_t        resp_len;
22492         /* rss_cos_lb_ctx_id is 16 b */
22493         uint16_t        rss_cos_lb_ctx_id;
22494         uint8_t unused_0[5];
22495         /*
22496          * This field is used in Output records to indicate that the output
22497          * is completely written to RAM.  This field should be read as '1'
22498          * to indicate that the output has been completely written.
22499          * When writing a command completion or response to an internal processor,
22500          * the order of writes has to be such that this field is written last.
22501          */
22502         uint8_t valid;
22503 } __attribute__((packed));
22504
22505 /*********************************
22506  * hwrm_vnic_rss_cos_lb_ctx_free *
22507  *********************************/
22508
22509
22510 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
22511 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
22512         /* The HWRM command request type. */
22513         uint16_t        req_type;
22514         /*
22515          * The completion ring to send the completion event on. This should
22516          * be the NQ ID returned from the `nq_alloc` HWRM command.
22517          */
22518         uint16_t        cmpl_ring;
22519         /*
22520          * The sequence ID is used by the driver for tracking multiple
22521          * commands. This ID is treated as opaque data by the firmware and
22522          * the value is returned in the `hwrm_resp_hdr` upon completion.
22523          */
22524         uint16_t        seq_id;
22525         /*
22526          * The target ID of the command:
22527          * * 0x0-0xFFF8 - The function ID
22528          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22529          * * 0xFFFD - Reserved for user-space HWRM interface
22530          * * 0xFFFF - HWRM
22531          */
22532         uint16_t        target_id;
22533         /*
22534          * A physical address pointer pointing to a host buffer that the
22535          * command's response data will be written. This can be either a host
22536          * physical address (HPA) or a guest physical address (GPA) and must
22537          * point to a physically contiguous block of memory.
22538          */
22539         uint64_t        resp_addr;
22540         /* rss_cos_lb_ctx_id is 16 b */
22541         uint16_t        rss_cos_lb_ctx_id;
22542         uint8_t unused_0[6];
22543 } __attribute__((packed));
22544
22545 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
22546 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
22547         /* The specific error status for the command. */
22548         uint16_t        error_code;
22549         /* The HWRM command request type. */
22550         uint16_t        req_type;
22551         /* The sequence ID from the original command. */
22552         uint16_t        seq_id;
22553         /* The length of the response data in number of bytes. */
22554         uint16_t        resp_len;
22555         uint8_t unused_0[7];
22556         /*
22557          * This field is used in Output records to indicate that the output
22558          * is completely written to RAM.  This field should be read as '1'
22559          * to indicate that the output has been completely written.
22560          * When writing a command completion or response to an internal processor,
22561          * the order of writes has to be such that this field is written last.
22562          */
22563         uint8_t valid;
22564 } __attribute__((packed));
22565
22566 /*******************
22567  * hwrm_ring_alloc *
22568  *******************/
22569
22570
22571 /* hwrm_ring_alloc_input (size:704b/88B) */
22572 struct hwrm_ring_alloc_input {
22573         /* The HWRM command request type. */
22574         uint16_t        req_type;
22575         /*
22576          * The completion ring to send the completion event on. This should
22577          * be the NQ ID returned from the `nq_alloc` HWRM command.
22578          */
22579         uint16_t        cmpl_ring;
22580         /*
22581          * The sequence ID is used by the driver for tracking multiple
22582          * commands. This ID is treated as opaque data by the firmware and
22583          * the value is returned in the `hwrm_resp_hdr` upon completion.
22584          */
22585         uint16_t        seq_id;
22586         /*
22587          * The target ID of the command:
22588          * * 0x0-0xFFF8 - The function ID
22589          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22590          * * 0xFFFD - Reserved for user-space HWRM interface
22591          * * 0xFFFF - HWRM
22592          */
22593         uint16_t        target_id;
22594         /*
22595          * A physical address pointer pointing to a host buffer that the
22596          * command's response data will be written. This can be either a host
22597          * physical address (HPA) or a guest physical address (GPA) and must
22598          * point to a physically contiguous block of memory.
22599          */
22600         uint64_t        resp_addr;
22601         uint32_t        enables;
22602         /*
22603          * This bit must be '1' for the ring_arb_cfg field to be
22604          * configured.
22605          */
22606         #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG \
22607                 UINT32_C(0x2)
22608         /*
22609          * This bit must be '1' for the stat_ctx_id_valid field to be
22610          * configured.
22611          */
22612         #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID \
22613                 UINT32_C(0x8)
22614         /*
22615          * This bit must be '1' for the max_bw_valid field to be
22616          * configured.
22617          */
22618         #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID \
22619                 UINT32_C(0x20)
22620         /*
22621          * This bit must be '1' for the rx_ring_id field to be
22622          * configured.
22623          */
22624         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID \
22625                 UINT32_C(0x40)
22626         /*
22627          * This bit must be '1' for the nq_ring_id field to be
22628          * configured.
22629          */
22630         #define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID \
22631                 UINT32_C(0x80)
22632         /*
22633          * This bit must be '1' for the rx_buf_size field to be
22634          * configured.
22635          */
22636         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID \
22637                 UINT32_C(0x100)
22638         /* Ring Type. */
22639         uint8_t ring_type;
22640         /* L2 Completion Ring (CR) */
22641         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
22642         /* TX Ring (TR) */
22643         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX        UINT32_C(0x1)
22644         /* RX Ring (RR) */
22645         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX        UINT32_C(0x2)
22646         /* RoCE Notification Completion Ring (ROCE_CR) */
22647         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
22648         /* RX Aggregation Ring */
22649         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
22650         /* Notification Queue */
22651         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
22652         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST \
22653                 HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
22654         uint8_t unused_0;
22655         /* Ring allocation flags. */
22656         uint16_t        flags;
22657         /*
22658          * For Rx rings, the incoming packet data can be placed at either
22659          * a 0B or 2B offset from the start of the Rx packet buffer. When
22660          * '1', the received packet will be padded with 2B of zeros at the
22661          * front of the packet. Note that this flag is only used for
22662          * Rx rings and is ignored for all other rings included Rx
22663          * Aggregation rings.
22664          */
22665         #define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD     UINT32_C(0x1)
22666         /*
22667          * This value is a pointer to the page table for the
22668          * Ring.
22669          */
22670         uint64_t        page_tbl_addr;
22671         /* First Byte Offset of the first entry in the first page. */
22672         uint32_t        fbo;
22673         /*
22674          * Actual page size in 2^page_size. The supported range is increments
22675          * in powers of 2 from 16 bytes to 1GB.
22676          * - 4 = 16 B
22677          *     Page size is 16 B.
22678          * - 12 = 4 KB
22679          *     Page size is 4 KB.
22680          * - 13 = 8 KB
22681          *     Page size is 8 KB.
22682          * - 16 = 64 KB
22683          *     Page size is 64 KB.
22684          * - 21 = 2 MB
22685          *     Page size is 2 MB.
22686          * - 22 = 4 MB
22687          *     Page size is 4 MB.
22688          * - 30 = 1 GB
22689          *     Page size is 1 GB.
22690          */
22691         uint8_t page_size;
22692         /*
22693          * This value indicates the depth of page table.
22694          * For this version of the specification, value other than 0 or
22695          * 1 shall be considered as an invalid value.
22696          * When the page_tbl_depth = 0, then it is treated as a
22697          * special case with the following.
22698          * 1. FBO and page size fields are not valid.
22699          * 2. page_tbl_addr is the physical address of the first
22700          *    element of the ring.
22701          */
22702         uint8_t page_tbl_depth;
22703         uint8_t unused_1[2];
22704         /*
22705          * Number of 16B units in the ring.  Minimum size for
22706          * a ring is 16 16B entries.
22707          */
22708         uint32_t        length;
22709         /*
22710          * Logical ring number for the ring to be allocated.
22711          * This value determines the position in the doorbell
22712          * area where the update to the ring will be made.
22713          *
22714          * For completion rings, this value is also the MSI-X
22715          * vector number for the function the completion ring is
22716          * associated with.
22717          */
22718         uint16_t        logical_id;
22719         /*
22720          * This field is used only when ring_type is a TX ring.
22721          * This value indicates what completion ring the TX ring
22722          * is associated with.
22723          */
22724         uint16_t        cmpl_ring_id;
22725         /*
22726          * This field is used only when ring_type is a TX ring.
22727          * This value indicates what CoS queue the TX ring
22728          * is associated with.
22729          */
22730         uint16_t        queue_id;
22731         /*
22732          * When allocating a Rx ring or Rx aggregation ring, this field
22733          * specifies the size of the buffer descriptors posted to the ring.
22734          */
22735         uint16_t        rx_buf_size;
22736         /*
22737          * When allocating an Rx aggregation ring, this field
22738          * specifies the associated Rx ring ID.
22739          */
22740         uint16_t        rx_ring_id;
22741         /*
22742          * When allocating a completion ring, this field
22743          * specifies the associated NQ ring ID.
22744          */
22745         uint16_t        nq_ring_id;
22746         /*
22747          * This field is used only when ring_type is a TX ring.
22748          * This field is used to configure arbitration related
22749          * parameters for a TX ring.
22750          */
22751         uint16_t        ring_arb_cfg;
22752         /* Arbitration policy used for the ring. */
22753         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK \
22754                 UINT32_C(0xf)
22755         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT       0
22756         /*
22757          * Use strict priority for the TX ring.
22758          * Priority value is specified in arb_policy_param
22759          */
22760         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
22761                 UINT32_C(0x1)
22762         /*
22763          * Use weighted fair queue arbitration for the TX ring.
22764          * Weight is specified in arb_policy_param
22765          */
22766         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
22767                 UINT32_C(0x2)
22768         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
22769                 HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
22770         /* Reserved field. */
22771         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK \
22772                 UINT32_C(0xf0)
22773         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT             4
22774         /*
22775          * Arbitration policy specific parameter.
22776          * # For strict priority arbitration policy, this field
22777          * represents a priority value. If set to 0, then the priority
22778          * is not specified and the HWRM is allowed to select
22779          * any priority for this TX ring.
22780          * # For weighted fair queue arbitration policy, this field
22781          * represents a weight value. If set to 0, then the weight
22782          * is not specified and the HWRM is allowed to select
22783          * any weight for this TX ring.
22784          */
22785         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
22786                 UINT32_C(0xff00)
22787         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
22788         uint16_t        unused_3;
22789         /*
22790          * This field is reserved for the future use.
22791          * It shall be set to 0.
22792          */
22793         uint32_t        reserved3;
22794         /*
22795          * This field is used only when ring_type is a TX ring.
22796          * This input indicates what statistics context this ring
22797          * should be associated with.
22798          */
22799         uint32_t        stat_ctx_id;
22800         /*
22801          * This field is reserved for the future use.
22802          * It shall be set to 0.
22803          */
22804         uint32_t        reserved4;
22805         /*
22806          * This field is used only when ring_type is a TX ring
22807          * to specify maximum BW allocated to the TX ring.
22808          * The HWRM will translate this value into byte counter and
22809          * time interval used for this ring inside the device.
22810          */
22811         uint32_t        max_bw;
22812         /* The bandwidth value. */
22813         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK \
22814                 UINT32_C(0xfffffff)
22815         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT              0
22816         /* The granularity of the value (bits or bytes). */
22817         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE \
22818                 UINT32_C(0x10000000)
22819         /* Value is in bits. */
22820         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS \
22821                 (UINT32_C(0x0) << 28)
22822         /* Value is in bytes. */
22823         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES \
22824                 (UINT32_C(0x1) << 28)
22825         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
22826                 HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
22827         /* bw_value_unit is 3 b */
22828         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
22829                 UINT32_C(0xe0000000)
22830         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
22831         /* Value is in Mb or MB (base 10). */
22832         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
22833                 (UINT32_C(0x0) << 29)
22834         /* Value is in Kb or KB (base 10). */
22835         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
22836                 (UINT32_C(0x2) << 29)
22837         /* Value is in bits or bytes. */
22838         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
22839                 (UINT32_C(0x4) << 29)
22840         /* Value is in Gb or GB (base 10). */
22841         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
22842                 (UINT32_C(0x6) << 29)
22843         /* Value is in 1/100th of a percentage of total bandwidth. */
22844         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
22845                 (UINT32_C(0x1) << 29)
22846         /* Invalid unit */
22847         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
22848                 (UINT32_C(0x7) << 29)
22849         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
22850                 HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
22851         /*
22852          * This field is used only when ring_type is a Completion ring.
22853          * This value indicates what interrupt mode should be used
22854          * on this completion ring.
22855          * Note: In the legacy interrupt mode, no more than 16
22856          * completion rings are allowed.
22857          */
22858         uint8_t int_mode;
22859         /* Legacy INTA */
22860         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
22861         /* Reserved */
22862         #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD   UINT32_C(0x1)
22863         /* MSI-X */
22864         #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX   UINT32_C(0x2)
22865         /* No Interrupt - Polled mode */
22866         #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL   UINT32_C(0x3)
22867         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST \
22868                 HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
22869         uint8_t unused_4[3];
22870         /*
22871          * The cq_handle is specified when allocating a completion ring. For
22872          * devices that support NQs, this cq_handle will be included in the
22873          * NQE to specify which CQ should be read to retrieve the completion
22874          * record.
22875          */
22876         uint64_t        cq_handle;
22877 } __attribute__((packed));
22878
22879 /* hwrm_ring_alloc_output (size:128b/16B) */
22880 struct hwrm_ring_alloc_output {
22881         /* The specific error status for the command. */
22882         uint16_t        error_code;
22883         /* The HWRM command request type. */
22884         uint16_t        req_type;
22885         /* The sequence ID from the original command. */
22886         uint16_t        seq_id;
22887         /* The length of the response data in number of bytes. */
22888         uint16_t        resp_len;
22889         /*
22890          * Physical number of ring allocated.
22891          * This value shall be unique for a ring type.
22892          */
22893         uint16_t        ring_id;
22894         /* Logical number of ring allocated. */
22895         uint16_t        logical_ring_id;
22896         uint8_t unused_0[3];
22897         /*
22898          * This field is used in Output records to indicate that the output
22899          * is completely written to RAM.  This field should be read as '1'
22900          * to indicate that the output has been completely written.
22901          * When writing a command completion or response to an internal processor,
22902          * the order of writes has to be such that this field is written last.
22903          */
22904         uint8_t valid;
22905 } __attribute__((packed));
22906
22907 /******************
22908  * hwrm_ring_free *
22909  ******************/
22910
22911
22912 /* hwrm_ring_free_input (size:192b/24B) */
22913 struct hwrm_ring_free_input {
22914         /* The HWRM command request type. */
22915         uint16_t        req_type;
22916         /*
22917          * The completion ring to send the completion event on. This should
22918          * be the NQ ID returned from the `nq_alloc` HWRM command.
22919          */
22920         uint16_t        cmpl_ring;
22921         /*
22922          * The sequence ID is used by the driver for tracking multiple
22923          * commands. This ID is treated as opaque data by the firmware and
22924          * the value is returned in the `hwrm_resp_hdr` upon completion.
22925          */
22926         uint16_t        seq_id;
22927         /*
22928          * The target ID of the command:
22929          * * 0x0-0xFFF8 - The function ID
22930          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22931          * * 0xFFFD - Reserved for user-space HWRM interface
22932          * * 0xFFFF - HWRM
22933          */
22934         uint16_t        target_id;
22935         /*
22936          * A physical address pointer pointing to a host buffer that the
22937          * command's response data will be written. This can be either a host
22938          * physical address (HPA) or a guest physical address (GPA) and must
22939          * point to a physically contiguous block of memory.
22940          */
22941         uint64_t        resp_addr;
22942         /* Ring Type. */
22943         uint8_t ring_type;
22944         /* L2 Completion Ring (CR) */
22945         #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
22946         /* TX Ring (TR) */
22947         #define HWRM_RING_FREE_INPUT_RING_TYPE_TX        UINT32_C(0x1)
22948         /* RX Ring (RR) */
22949         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX        UINT32_C(0x2)
22950         /* RoCE Notification Completion Ring (ROCE_CR) */
22951         #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
22952         /* RX Aggregation Ring */
22953         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
22954         /* Notification Queue */
22955         #define HWRM_RING_FREE_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
22956         #define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \
22957                 HWRM_RING_FREE_INPUT_RING_TYPE_NQ
22958         uint8_t unused_0;
22959         /* Physical number of ring allocated. */
22960         uint16_t        ring_id;
22961         uint8_t unused_1[4];
22962 } __attribute__((packed));
22963
22964 /* hwrm_ring_free_output (size:128b/16B) */
22965 struct hwrm_ring_free_output {
22966         /* The specific error status for the command. */
22967         uint16_t        error_code;
22968         /* The HWRM command request type. */
22969         uint16_t        req_type;
22970         /* The sequence ID from the original command. */
22971         uint16_t        seq_id;
22972         /* The length of the response data in number of bytes. */
22973         uint16_t        resp_len;
22974         uint8_t unused_0[7];
22975         /*
22976          * This field is used in Output records to indicate that the output
22977          * is completely written to RAM.  This field should be read as '1'
22978          * to indicate that the output has been completely written.
22979          * When writing a command completion or response to an internal processor,
22980          * the order of writes has to be such that this field is written last.
22981          */
22982         uint8_t valid;
22983 } __attribute__((packed));
22984
22985 /*******************
22986  * hwrm_ring_reset *
22987  *******************/
22988
22989
22990 /* hwrm_ring_reset_input (size:192b/24B) */
22991 struct hwrm_ring_reset_input {
22992         /* The HWRM command request type. */
22993         uint16_t        req_type;
22994         /*
22995          * The completion ring to send the completion event on. This should
22996          * be the NQ ID returned from the `nq_alloc` HWRM command.
22997          */
22998         uint16_t        cmpl_ring;
22999         /*
23000          * The sequence ID is used by the driver for tracking multiple
23001          * commands. This ID is treated as opaque data by the firmware and
23002          * the value is returned in the `hwrm_resp_hdr` upon completion.
23003          */
23004         uint16_t        seq_id;
23005         /*
23006          * The target ID of the command:
23007          * * 0x0-0xFFF8 - The function ID
23008          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23009          * * 0xFFFD - Reserved for user-space HWRM interface
23010          * * 0xFFFF - HWRM
23011          */
23012         uint16_t        target_id;
23013         /*
23014          * A physical address pointer pointing to a host buffer that the
23015          * command's response data will be written. This can be either a host
23016          * physical address (HPA) or a guest physical address (GPA) and must
23017          * point to a physically contiguous block of memory.
23018          */
23019         uint64_t        resp_addr;
23020         /* Ring Type. */
23021         uint8_t ring_type;
23022         /* L2 Completion Ring (CR) */
23023         #define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
23024         /* TX Ring (TR) */
23025         #define HWRM_RING_RESET_INPUT_RING_TYPE_TX        UINT32_C(0x1)
23026         /* RX Ring (RR) */
23027         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX        UINT32_C(0x2)
23028         /* RoCE Notification Completion Ring (ROCE_CR) */
23029         #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
23030         #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \
23031                 HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL
23032         uint8_t unused_0;
23033         /* Physical number of the ring. */
23034         uint16_t        ring_id;
23035         uint8_t unused_1[4];
23036 } __attribute__((packed));
23037
23038 /* hwrm_ring_reset_output (size:128b/16B) */
23039 struct hwrm_ring_reset_output {
23040         /* The specific error status for the command. */
23041         uint16_t        error_code;
23042         /* The HWRM command request type. */
23043         uint16_t        req_type;
23044         /* The sequence ID from the original command. */
23045         uint16_t        seq_id;
23046         /* The length of the response data in number of bytes. */
23047         uint16_t        resp_len;
23048         uint8_t unused_0[4];
23049         /* Position of consumer index after ring reset completes. */
23050         uint8_t consumer_idx[3];
23051         /*
23052          * This field is used in Output records to indicate that the output
23053          * is completely written to RAM.  This field should be read as '1'
23054          * to indicate that the output has been completely written.
23055          * When writing a command completion or response to an internal processor,
23056          * the order of writes has to be such that this field is written last.
23057          */
23058         uint8_t valid;
23059 } __attribute__((packed));
23060
23061 /**************************
23062  * hwrm_ring_aggint_qcaps *
23063  **************************/
23064
23065
23066 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */
23067 struct hwrm_ring_aggint_qcaps_input {
23068         /* The HWRM command request type. */
23069         uint16_t        req_type;
23070         /*
23071          * The completion ring to send the completion event on. This should
23072          * be the NQ ID returned from the `nq_alloc` HWRM command.
23073          */
23074         uint16_t        cmpl_ring;
23075         /*
23076          * The sequence ID is used by the driver for tracking multiple
23077          * commands. This ID is treated as opaque data by the firmware and
23078          * the value is returned in the `hwrm_resp_hdr` upon completion.
23079          */
23080         uint16_t        seq_id;
23081         /*
23082          * The target ID of the command:
23083          * * 0x0-0xFFF8 - The function ID
23084          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23085          * * 0xFFFD - Reserved for user-space HWRM interface
23086          * * 0xFFFF - HWRM
23087          */
23088         uint16_t        target_id;
23089         /*
23090          * A physical address pointer pointing to a host buffer that the
23091          * command's response data will be written. This can be either a host
23092          * physical address (HPA) or a guest physical address (GPA) and must
23093          * point to a physically contiguous block of memory.
23094          */
23095         uint64_t        resp_addr;
23096 } __attribute__((packed));
23097
23098 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
23099 struct hwrm_ring_aggint_qcaps_output {
23100         /* The specific error status for the command. */
23101         uint16_t        error_code;
23102         /* The HWRM command request type. */
23103         uint16_t        req_type;
23104         /* The sequence ID from the original command. */
23105         uint16_t        seq_id;
23106         /* The length of the response data in number of bytes. */
23107         uint16_t        resp_len;
23108         uint32_t        cmpl_params;
23109         /*
23110          * When this bit is set to '1', int_lat_tmr_min can be configured
23111          * on completion rings.
23112          */
23113         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN \
23114                 UINT32_C(0x1)
23115         /*
23116          * When this bit is set to '1', int_lat_tmr_max can be configured
23117          * on completion rings.
23118          */
23119         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX \
23120                 UINT32_C(0x2)
23121         /*
23122          * When this bit is set to '1', timer_reset can be enabled
23123          * on completion rings.
23124          */
23125         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET \
23126                 UINT32_C(0x4)
23127         /*
23128          * When this bit is set to '1', ring_idle can be enabled
23129          * on completion rings.
23130          */
23131         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE \
23132                 UINT32_C(0x8)
23133         /*
23134          * When this bit is set to '1', num_cmpl_dma_aggr can be configured
23135          * on completion rings.
23136          */
23137         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR \
23138                 UINT32_C(0x10)
23139         /*
23140          * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be configured
23141          * on completion rings.
23142          */
23143         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT \
23144                 UINT32_C(0x20)
23145         /*
23146          * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured
23147          * on completion rings.
23148          */
23149         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR \
23150                 UINT32_C(0x40)
23151         /*
23152          * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be configured
23153          * on completion rings.
23154          */
23155         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT \
23156                 UINT32_C(0x80)
23157         /*
23158          * When this bit is set to '1', num_cmpl_aggr_int can be configured
23159          * on completion rings.
23160          */
23161         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT \
23162                 UINT32_C(0x100)
23163         uint32_t        nq_params;
23164         /*
23165          * When this bit is set to '1', int_lat_tmr_min can be configured
23166          * on notification queues.
23167          */
23168         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN \
23169                 UINT32_C(0x1)
23170         /* Minimum value for num_cmpl_dma_aggr */
23171         uint16_t        num_cmpl_dma_aggr_min;
23172         /* Maximum value for num_cmpl_dma_aggr */
23173         uint16_t        num_cmpl_dma_aggr_max;
23174         /* Minimum value for num_cmpl_dma_aggr_during_int */
23175         uint16_t        num_cmpl_dma_aggr_during_int_min;
23176         /* Maximum value for num_cmpl_dma_aggr_during_int */
23177         uint16_t        num_cmpl_dma_aggr_during_int_max;
23178         /* Minimum value for cmpl_aggr_dma_tmr */
23179         uint16_t        cmpl_aggr_dma_tmr_min;
23180         /* Maximum value for cmpl_aggr_dma_tmr */
23181         uint16_t        cmpl_aggr_dma_tmr_max;
23182         /* Minimum value for cmpl_aggr_dma_tmr_during_int */
23183         uint16_t        cmpl_aggr_dma_tmr_during_int_min;
23184         /* Maximum value for cmpl_aggr_dma_tmr_during_int */
23185         uint16_t        cmpl_aggr_dma_tmr_during_int_max;
23186         /* Minimum value for int_lat_tmr_min */
23187         uint16_t        int_lat_tmr_min_min;
23188         /* Maximum value for int_lat_tmr_min */
23189         uint16_t        int_lat_tmr_min_max;
23190         /* Minimum value for int_lat_tmr_max */
23191         uint16_t        int_lat_tmr_max_min;
23192         /* Maximum value for int_lat_tmr_max */
23193         uint16_t        int_lat_tmr_max_max;
23194         /* Minimum value for num_cmpl_aggr_int */
23195         uint16_t        num_cmpl_aggr_int_min;
23196         /* Maximum value for num_cmpl_aggr_int */
23197         uint16_t        num_cmpl_aggr_int_max;
23198         /* The units for timer parameters, in nanoseconds. */
23199         uint16_t        timer_units;
23200         uint8_t unused_0[1];
23201         /*
23202          * This field is used in Output records to indicate that the output
23203          * is completely written to RAM.  This field should be read as '1'
23204          * to indicate that the output has been completely written.
23205          * When writing a command completion or response to an internal processor,
23206          * the order of writes has to be such that this field is written last.
23207          */
23208         uint8_t valid;
23209 } __attribute__((packed));
23210
23211 /**************************************
23212  * hwrm_ring_cmpl_ring_qaggint_params *
23213  **************************************/
23214
23215
23216 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
23217 struct hwrm_ring_cmpl_ring_qaggint_params_input {
23218         /* The HWRM command request type. */
23219         uint16_t        req_type;
23220         /*
23221          * The completion ring to send the completion event on. This should
23222          * be the NQ ID returned from the `nq_alloc` HWRM command.
23223          */
23224         uint16_t        cmpl_ring;
23225         /*
23226          * The sequence ID is used by the driver for tracking multiple
23227          * commands. This ID is treated as opaque data by the firmware and
23228          * the value is returned in the `hwrm_resp_hdr` upon completion.
23229          */
23230         uint16_t        seq_id;
23231         /*
23232          * The target ID of the command:
23233          * * 0x0-0xFFF8 - The function ID
23234          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23235          * * 0xFFFD - Reserved for user-space HWRM interface
23236          * * 0xFFFF - HWRM
23237          */
23238         uint16_t        target_id;
23239         /*
23240          * A physical address pointer pointing to a host buffer that the
23241          * command's response data will be written. This can be either a host
23242          * physical address (HPA) or a guest physical address (GPA) and must
23243          * point to a physically contiguous block of memory.
23244          */
23245         uint64_t        resp_addr;
23246         /* Physical number of completion ring. */
23247         uint16_t        ring_id;
23248         uint8_t unused_0[6];
23249 } __attribute__((packed));
23250
23251 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
23252 struct hwrm_ring_cmpl_ring_qaggint_params_output {
23253         /* The specific error status for the command. */
23254         uint16_t        error_code;
23255         /* The HWRM command request type. */
23256         uint16_t        req_type;
23257         /* The sequence ID from the original command. */
23258         uint16_t        seq_id;
23259         /* The length of the response data in number of bytes. */
23260         uint16_t        resp_len;
23261         uint16_t        flags;
23262         /*
23263          * When this bit is set to '1', interrupt max
23264          * timer is reset whenever a completion is received.
23265          */
23266         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET \
23267                 UINT32_C(0x1)
23268         /*
23269          * When this bit is set to '1', ring idle mode
23270          * aggregation will be enabled.
23271          */
23272         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE \
23273                 UINT32_C(0x2)
23274         /*
23275          * Number of completions to aggregate before DMA
23276          * during the normal mode.
23277          */
23278         uint16_t        num_cmpl_dma_aggr;
23279         /*
23280          * Number of completions to aggregate before DMA
23281          * during the interrupt mode.
23282          */
23283         uint16_t        num_cmpl_dma_aggr_during_int;
23284         /*
23285          * Timer in unit of 80-nsec used to aggregate completions before
23286          * DMA during the normal mode (not in interrupt mode).
23287          */
23288         uint16_t        cmpl_aggr_dma_tmr;
23289         /*
23290          * Timer in unit of 80-nsec used to aggregate completions before
23291          * DMA during the interrupt mode.
23292          */
23293         uint16_t        cmpl_aggr_dma_tmr_during_int;
23294         /* Minimum time (in unit of 80-nsec) between two interrupts. */
23295         uint16_t        int_lat_tmr_min;
23296         /*
23297          * Maximum wait time (in unit of 80-nsec) spent aggregating
23298          * completions before signaling the interrupt after the
23299          * interrupt is enabled.
23300          */
23301         uint16_t        int_lat_tmr_max;
23302         /*
23303          * Minimum number of completions aggregated before signaling
23304          * an interrupt.
23305          */
23306         uint16_t        num_cmpl_aggr_int;
23307         uint8_t unused_0[7];
23308         /*
23309          * This field is used in Output records to indicate that the output
23310          * is completely written to RAM.  This field should be read as '1'
23311          * to indicate that the output has been completely written.
23312          * When writing a command completion or response to an internal processor,
23313          * the order of writes has to be such that this field is written last.
23314          */
23315         uint8_t valid;
23316 } __attribute__((packed));
23317
23318 /*****************************************
23319  * hwrm_ring_cmpl_ring_cfg_aggint_params *
23320  *****************************************/
23321
23322
23323 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
23324 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
23325         /* The HWRM command request type. */
23326         uint16_t        req_type;
23327         /*
23328          * The completion ring to send the completion event on. This should
23329          * be the NQ ID returned from the `nq_alloc` HWRM command.
23330          */
23331         uint16_t        cmpl_ring;
23332         /*
23333          * The sequence ID is used by the driver for tracking multiple
23334          * commands. This ID is treated as opaque data by the firmware and
23335          * the value is returned in the `hwrm_resp_hdr` upon completion.
23336          */
23337         uint16_t        seq_id;
23338         /*
23339          * The target ID of the command:
23340          * * 0x0-0xFFF8 - The function ID
23341          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23342          * * 0xFFFD - Reserved for user-space HWRM interface
23343          * * 0xFFFF - HWRM
23344          */
23345         uint16_t        target_id;
23346         /*
23347          * A physical address pointer pointing to a host buffer that the
23348          * command's response data will be written. This can be either a host
23349          * physical address (HPA) or a guest physical address (GPA) and must
23350          * point to a physically contiguous block of memory.
23351          */
23352         uint64_t        resp_addr;
23353         /* Physical number of completion ring. */
23354         uint16_t        ring_id;
23355         uint16_t        flags;
23356         /*
23357          * When this bit is set to '1', interrupt latency max
23358          * timer is reset whenever a completion is received.
23359          */
23360         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET \
23361                 UINT32_C(0x1)
23362         /*
23363          * When this bit is set to '1', ring idle mode
23364          * aggregation will be enabled.
23365          */
23366         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE \
23367                 UINT32_C(0x2)
23368         /*
23369          * Set this flag to 1 when configuring parameters on a
23370          * notification queue. Set this flag to 0 when configuring
23371          * parameters on a completion queue.
23372          */
23373         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
23374                 UINT32_C(0x4)
23375         /*
23376          * Number of completions to aggregate before DMA
23377          * during the normal mode.
23378          */
23379         uint16_t        num_cmpl_dma_aggr;
23380         /*
23381          * Number of completions to aggregate before DMA
23382          * during the interrupt mode.
23383          */
23384         uint16_t        num_cmpl_dma_aggr_during_int;
23385         /*
23386          * Timer in unit of 80-nsec used to aggregate completions before
23387          * DMA during the normal mode (not in interrupt mode).
23388          */
23389         uint16_t        cmpl_aggr_dma_tmr;
23390         /*
23391          * Timer in unit of 80-nsec used to aggregate completions before
23392          * DMA during the interrupt mode.
23393          */
23394         uint16_t        cmpl_aggr_dma_tmr_during_int;
23395         /* Minimum time (in unit of 80-nsec) between two interrupts. */
23396         uint16_t        int_lat_tmr_min;
23397         /*
23398          * Maximum wait time (in unit of 80-nsec) spent aggregating
23399          * cmpls before signaling the interrupt after the
23400          * interrupt is enabled.
23401          */
23402         uint16_t        int_lat_tmr_max;
23403         /*
23404          * Minimum number of completions aggregated before signaling
23405          * an interrupt.
23406          */
23407         uint16_t        num_cmpl_aggr_int;
23408         /*
23409          * Bitfield that indicates which parameters are to be applied. Only
23410          * required when configuring devices with notification queues, and
23411          * used in that case to set certain parameters on completion queues
23412          * and others on notification queues.
23413          */
23414         uint16_t        enables;
23415         /*
23416          * This bit must be '1' for the num_cmpl_dma_aggr field to be
23417          * configured.
23418          */
23419         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR \
23420                 UINT32_C(0x1)
23421         /*
23422          * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be
23423          * configured.
23424          */
23425         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT \
23426                 UINT32_C(0x2)
23427         /*
23428          * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
23429          * configured.
23430          */
23431         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR \
23432                 UINT32_C(0x4)
23433         /*
23434          * This bit must be '1' for the int_lat_tmr_min field to be
23435          * configured.
23436          */
23437         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN \
23438                 UINT32_C(0x8)
23439         /*
23440          * This bit must be '1' for the int_lat_tmr_max field to be
23441          * configured.
23442          */
23443         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX \
23444                 UINT32_C(0x10)
23445         /*
23446          * This bit must be '1' for the num_cmpl_aggr_int field to be
23447          * configured.
23448          */
23449         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT \
23450                 UINT32_C(0x20)
23451         uint8_t unused_0[4];
23452 } __attribute__((packed));
23453
23454 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
23455 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
23456         /* The specific error status for the command. */
23457         uint16_t        error_code;
23458         /* The HWRM command request type. */
23459         uint16_t        req_type;
23460         /* The sequence ID from the original command. */
23461         uint16_t        seq_id;
23462         /* The length of the response data in number of bytes. */
23463         uint16_t        resp_len;
23464         uint8_t unused_0[7];
23465         /*
23466          * This field is used in Output records to indicate that the output
23467          * is completely written to RAM.  This field should be read as '1'
23468          * to indicate that the output has been completely written.
23469          * When writing a command completion or response to an internal processor,
23470          * the order of writes has to be such that this field is written last.
23471          */
23472         uint8_t valid;
23473 } __attribute__((packed));
23474
23475 /***********************
23476  * hwrm_ring_grp_alloc *
23477  ***********************/
23478
23479
23480 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
23481 struct hwrm_ring_grp_alloc_input {
23482         /* The HWRM command request type. */
23483         uint16_t        req_type;
23484         /*
23485          * The completion ring to send the completion event on. This should
23486          * be the NQ ID returned from the `nq_alloc` HWRM command.
23487          */
23488         uint16_t        cmpl_ring;
23489         /*
23490          * The sequence ID is used by the driver for tracking multiple
23491          * commands. This ID is treated as opaque data by the firmware and
23492          * the value is returned in the `hwrm_resp_hdr` upon completion.
23493          */
23494         uint16_t        seq_id;
23495         /*
23496          * The target ID of the command:
23497          * * 0x0-0xFFF8 - The function ID
23498          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23499          * * 0xFFFD - Reserved for user-space HWRM interface
23500          * * 0xFFFF - HWRM
23501          */
23502         uint16_t        target_id;
23503         /*
23504          * A physical address pointer pointing to a host buffer that the
23505          * command's response data will be written. This can be either a host
23506          * physical address (HPA) or a guest physical address (GPA) and must
23507          * point to a physically contiguous block of memory.
23508          */
23509         uint64_t        resp_addr;
23510         /*
23511          * This value identifies the CR associated with the ring
23512          * group.
23513          */
23514         uint16_t        cr;
23515         /*
23516          * This value identifies the main RR associated with the ring
23517          * group.
23518          */
23519         uint16_t        rr;
23520         /*
23521          * This value identifies the aggregation RR associated with
23522          * the ring group.  If this value is 0xFF... (All Fs), then no
23523          * Aggregation ring will be set.
23524          */
23525         uint16_t        ar;
23526         /*
23527          * This value identifies the statistics context associated
23528          * with the ring group.
23529          */
23530         uint16_t        sc;
23531 } __attribute__((packed));
23532
23533 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
23534 struct hwrm_ring_grp_alloc_output {
23535         /* The specific error status for the command. */
23536         uint16_t        error_code;
23537         /* The HWRM command request type. */
23538         uint16_t        req_type;
23539         /* The sequence ID from the original command. */
23540         uint16_t        seq_id;
23541         /* The length of the response data in number of bytes. */
23542         uint16_t        resp_len;
23543         /*
23544          * This is the ring group ID value.  Use this value to program
23545          * the default ring group for the VNIC or as table entries
23546          * in an RSS/COS context.
23547          */
23548         uint32_t        ring_group_id;
23549         uint8_t unused_0[3];
23550         /*
23551          * This field is used in Output records to indicate that the output
23552          * is completely written to RAM.  This field should be read as '1'
23553          * to indicate that the output has been completely written.
23554          * When writing a command completion or response to an internal processor,
23555          * the order of writes has to be such that this field is written last.
23556          */
23557         uint8_t valid;
23558 } __attribute__((packed));
23559
23560 /**********************
23561  * hwrm_ring_grp_free *
23562  **********************/
23563
23564
23565 /* hwrm_ring_grp_free_input (size:192b/24B) */
23566 struct hwrm_ring_grp_free_input {
23567         /* The HWRM command request type. */
23568         uint16_t        req_type;
23569         /*
23570          * The completion ring to send the completion event on. This should
23571          * be the NQ ID returned from the `nq_alloc` HWRM command.
23572          */
23573         uint16_t        cmpl_ring;
23574         /*
23575          * The sequence ID is used by the driver for tracking multiple
23576          * commands. This ID is treated as opaque data by the firmware and
23577          * the value is returned in the `hwrm_resp_hdr` upon completion.
23578          */
23579         uint16_t        seq_id;
23580         /*
23581          * The target ID of the command:
23582          * * 0x0-0xFFF8 - The function ID
23583          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23584          * * 0xFFFD - Reserved for user-space HWRM interface
23585          * * 0xFFFF - HWRM
23586          */
23587         uint16_t        target_id;
23588         /*
23589          * A physical address pointer pointing to a host buffer that the
23590          * command's response data will be written. This can be either a host
23591          * physical address (HPA) or a guest physical address (GPA) and must
23592          * point to a physically contiguous block of memory.
23593          */
23594         uint64_t        resp_addr;
23595         /* This is the ring group ID value. */
23596         uint32_t        ring_group_id;
23597         uint8_t unused_0[4];
23598 } __attribute__((packed));
23599
23600 /* hwrm_ring_grp_free_output (size:128b/16B) */
23601 struct hwrm_ring_grp_free_output {
23602         /* The specific error status for the command. */
23603         uint16_t        error_code;
23604         /* The HWRM command request type. */
23605         uint16_t        req_type;
23606         /* The sequence ID from the original command. */
23607         uint16_t        seq_id;
23608         /* The length of the response data in number of bytes. */
23609         uint16_t        resp_len;
23610         uint8_t unused_0[7];
23611         /*
23612          * This field is used in Output records to indicate that the output
23613          * is completely written to RAM.  This field should be read as '1'
23614          * to indicate that the output has been completely written.
23615          * When writing a command completion or response to an internal processor,
23616          * the order of writes has to be such that this field is written last.
23617          */
23618         uint8_t valid;
23619 } __attribute__((packed));
23620 /*
23621  * special reserved flow ID to identify per function default
23622  * flows for vSwitch offload
23623  */
23624 #define DEFAULT_FLOW_ID 0xFFFFFFFFUL
23625 /*
23626  * special reserved flow ID to identify per function RoCEv1
23627  * flows
23628  */
23629 #define ROCEV1_FLOW_ID 0xFFFFFFFEUL
23630 /*
23631  * special reserved flow ID to identify per function RoCEv2
23632  * flows
23633  */
23634 #define ROCEV2_FLOW_ID 0xFFFFFFFDUL
23635 /*
23636  * special reserved flow ID to identify per function RoCEv2
23637  * CNP flows
23638  */
23639 #define ROCEV2_CNP_FLOW_ID 0xFFFFFFFCUL
23640
23641 /****************************
23642  * hwrm_cfa_l2_filter_alloc *
23643  ****************************/
23644
23645
23646 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
23647 struct hwrm_cfa_l2_filter_alloc_input {
23648         /* The HWRM command request type. */
23649         uint16_t        req_type;
23650         /*
23651          * The completion ring to send the completion event on. This should
23652          * be the NQ ID returned from the `nq_alloc` HWRM command.
23653          */
23654         uint16_t        cmpl_ring;
23655         /*
23656          * The sequence ID is used by the driver for tracking multiple
23657          * commands. This ID is treated as opaque data by the firmware and
23658          * the value is returned in the `hwrm_resp_hdr` upon completion.
23659          */
23660         uint16_t        seq_id;
23661         /*
23662          * The target ID of the command:
23663          * * 0x0-0xFFF8 - The function ID
23664          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23665          * * 0xFFFD - Reserved for user-space HWRM interface
23666          * * 0xFFFF - HWRM
23667          */
23668         uint16_t        target_id;
23669         /*
23670          * A physical address pointer pointing to a host buffer that the
23671          * command's response data will be written. This can be either a host
23672          * physical address (HPA) or a guest physical address (GPA) and must
23673          * point to a physically contiguous block of memory.
23674          */
23675         uint64_t        resp_addr;
23676         uint32_t        flags;
23677         /*
23678          * Enumeration denoting the RX, TX type of the resource.
23679          * This enumeration is used for resources that are similar for both
23680          * TX and RX paths of the chip.
23681          */
23682         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
23683                 UINT32_C(0x1)
23684         /* tx path */
23685         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
23686                 UINT32_C(0x0)
23687         /* rx path */
23688         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
23689                 UINT32_C(0x1)
23690         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
23691                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
23692         /* Setting of this flag indicates the applicability to the loopback path. */
23693         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
23694                 UINT32_C(0x2)
23695         /*
23696          * Setting of this flag indicates drop action. If this flag is not set,
23697          * then it should be considered accept action.
23698          */
23699         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
23700                 UINT32_C(0x4)
23701         /*
23702          * If this flag is set, all t_l2_* fields are invalid
23703          * and they should not be specified.
23704          * If this flag is set, then l2_* fields refer to
23705          * fields of outermost L2 header.
23706          */
23707         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
23708                 UINT32_C(0x8)
23709         /*
23710          * Enumeration denoting NO_ROCE_L2 to support old drivers.
23711          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
23712          */
23713         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK \
23714                 UINT32_C(0x30)
23715         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT       4
23716         /* To support old drivers */
23717         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
23718                 (UINT32_C(0x0) << 4)
23719         /* Only L2 traffic */
23720         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2 \
23721                 (UINT32_C(0x1) << 4)
23722         /* Roce & L2 traffic */
23723         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE \
23724                 (UINT32_C(0x2) << 4)
23725         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST \
23726                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE
23727         /*
23728          * Setting of this flag indicates that no XDP filter is created with
23729          * L2 filter.
23730          * 0 - legacy behavior, XDP filter is created with L2 filter
23731          * 1 - XDP filter won't be created with L2 filter
23732          */
23733         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_XDP_DISABLE \
23734                 UINT32_C(0x40)
23735         /*
23736          * Setting this flag to 1 indicate the L2 fields in this command
23737          * pertain to source fields.  Setting this flag to 0 indicate the
23738          * L2 fields in this command pertain to the destination fields
23739          * and this is the default/legacy behavior.
23740          */
23741         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_SOURCE_VALID \
23742                 UINT32_C(0x80)
23743         uint32_t        enables;
23744         /*
23745          * This bit must be '1' for the l2_addr field to be
23746          * configured.
23747          */
23748         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
23749                 UINT32_C(0x1)
23750         /*
23751          * This bit must be '1' for the l2_addr_mask field to be
23752          * configured.
23753          */
23754         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
23755                 UINT32_C(0x2)
23756         /*
23757          * This bit must be '1' for the l2_ovlan field to be
23758          * configured.
23759          */
23760         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
23761                 UINT32_C(0x4)
23762         /*
23763          * This bit must be '1' for the l2_ovlan_mask field to be
23764          * configured.
23765          */
23766         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
23767                 UINT32_C(0x8)
23768         /*
23769          * This bit must be '1' for the l2_ivlan field to be
23770          * configured.
23771          */
23772         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
23773                 UINT32_C(0x10)
23774         /*
23775          * This bit must be '1' for the l2_ivlan_mask field to be
23776          * configured.
23777          */
23778         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
23779                 UINT32_C(0x20)
23780         /*
23781          * This bit must be '1' for the t_l2_addr field to be
23782          * configured.
23783          */
23784         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
23785                 UINT32_C(0x40)
23786         /*
23787          * This bit must be '1' for the t_l2_addr_mask field to be
23788          * configured.
23789          */
23790         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
23791                 UINT32_C(0x80)
23792         /*
23793          * This bit must be '1' for the t_l2_ovlan field to be
23794          * configured.
23795          */
23796         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
23797                 UINT32_C(0x100)
23798         /*
23799          * This bit must be '1' for the t_l2_ovlan_mask field to be
23800          * configured.
23801          */
23802         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
23803                 UINT32_C(0x200)
23804         /*
23805          * This bit must be '1' for the t_l2_ivlan field to be
23806          * configured.
23807          */
23808         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
23809                 UINT32_C(0x400)
23810         /*
23811          * This bit must be '1' for the t_l2_ivlan_mask field to be
23812          * configured.
23813          */
23814         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
23815                 UINT32_C(0x800)
23816         /*
23817          * This bit must be '1' for the src_type field to be
23818          * configured.
23819          */
23820         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
23821                 UINT32_C(0x1000)
23822         /*
23823          * This bit must be '1' for the src_id field to be
23824          * configured.
23825          */
23826         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
23827                 UINT32_C(0x2000)
23828         /*
23829          * This bit must be '1' for the tunnel_type field to be
23830          * configured.
23831          */
23832         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
23833                 UINT32_C(0x4000)
23834         /*
23835          * This bit must be '1' for the dst_id field to be
23836          * configured.
23837          */
23838         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
23839                 UINT32_C(0x8000)
23840         /*
23841          * This bit must be '1' for the mirror_vnic_id field to be
23842          * configured.
23843          */
23844         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
23845                 UINT32_C(0x10000)
23846         /*
23847          * This bit must be '1' for the num_vlans field to be
23848          * configured.
23849          */
23850         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_NUM_VLANS \
23851                 UINT32_C(0x20000)
23852         /*
23853          * This bit must be '1' for the t_num_vlans field to be
23854          * configured.
23855          */
23856         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_NUM_VLANS \
23857                 UINT32_C(0x40000)
23858         /*
23859          * This value sets the match value for the L2 MAC address.
23860          * Destination MAC address for RX path.
23861          * Source MAC address for TX path.
23862          */
23863         uint8_t l2_addr[6];
23864         /* This value sets the match value for the number of VLANs. */
23865         uint8_t num_vlans;
23866         /*
23867          * This value sets the match value for the number of VLANs
23868          * in the tunnel headers.
23869          */
23870         uint8_t t_num_vlans;
23871         /*
23872          * This value sets the mask value for the L2 address.
23873          * A value of 0 will mask the corresponding bit from
23874          * compare.
23875          */
23876         uint8_t l2_addr_mask[6];
23877         /* This value sets VLAN ID value for outer VLAN. */
23878         uint16_t        l2_ovlan;
23879         /*
23880          * This value sets the mask value for the ovlan id.
23881          * A value of 0 will mask the corresponding bit from
23882          * compare.
23883          */
23884         uint16_t        l2_ovlan_mask;
23885         /* This value sets VLAN ID value for inner VLAN. */
23886         uint16_t        l2_ivlan;
23887         /*
23888          * This value sets the mask value for the ivlan id.
23889          * A value of 0 will mask the corresponding bit from
23890          * compare.
23891          */
23892         uint16_t        l2_ivlan_mask;
23893         uint8_t unused_1[2];
23894         /*
23895          * This value sets the match value for the tunnel
23896          * L2 MAC address.
23897          * Destination MAC address for RX path.
23898          * Source MAC address for TX path.
23899          */
23900         uint8_t t_l2_addr[6];
23901         uint8_t unused_2[2];
23902         /*
23903          * This value sets the mask value for the tunnel L2
23904          * address.
23905          * A value of 0 will mask the corresponding bit from
23906          * compare.
23907          */
23908         uint8_t t_l2_addr_mask[6];
23909         /* This value sets VLAN ID value for tunnel outer VLAN. */
23910         uint16_t        t_l2_ovlan;
23911         /*
23912          * This value sets the mask value for the tunnel ovlan id.
23913          * A value of 0 will mask the corresponding bit from
23914          * compare.
23915          */
23916         uint16_t        t_l2_ovlan_mask;
23917         /* This value sets VLAN ID value for tunnel inner VLAN. */
23918         uint16_t        t_l2_ivlan;
23919         /*
23920          * This value sets the mask value for the tunnel ivlan id.
23921          * A value of 0 will mask the corresponding bit from
23922          * compare.
23923          */
23924         uint16_t        t_l2_ivlan_mask;
23925         /* This value identifies the type of source of the packet. */
23926         uint8_t src_type;
23927         /* Network port */
23928         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
23929         /* Physical function */
23930         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF    UINT32_C(0x1)
23931         /* Virtual function */
23932         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF    UINT32_C(0x2)
23933         /* Virtual NIC of a function */
23934         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC  UINT32_C(0x3)
23935         /* Embedded processor for CFA management */
23936         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG  UINT32_C(0x4)
23937         /* Embedded processor for OOB management */
23938         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE   UINT32_C(0x5)
23939         /* Embedded processor for RoCE */
23940         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO  UINT32_C(0x6)
23941         /* Embedded processor for network proxy functions */
23942         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG  UINT32_C(0x7)
23943         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST \
23944                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
23945         uint8_t unused_3;
23946         /*
23947          * This value is the id of the source.
23948          * For a network port, it represents port_id.
23949          * For a physical function, it represents fid.
23950          * For a virtual function, it represents vf_id.
23951          * For a vnic, it represents vnic_id.
23952          * For embedded processors, this id is not valid.
23953          *
23954          * Notes:
23955          * 1. The function ID is implied if it src_id is
23956          *    not provided for a src_type that is either
23957          */
23958         uint32_t        src_id;
23959         /* Tunnel Type. */
23960         uint8_t tunnel_type;
23961         /* Non-tunnel */
23962         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
23963                 UINT32_C(0x0)
23964         /* Virtual eXtensible Local Area Network (VXLAN) */
23965         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
23966                 UINT32_C(0x1)
23967         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
23968         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
23969                 UINT32_C(0x2)
23970         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
23971         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
23972                 UINT32_C(0x3)
23973         /* IP in IP */
23974         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
23975                 UINT32_C(0x4)
23976         /* Generic Network Virtualization Encapsulation (Geneve) */
23977         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
23978                 UINT32_C(0x5)
23979         /* Multi-Protocol Lable Switching (MPLS) */
23980         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
23981                 UINT32_C(0x6)
23982         /* Stateless Transport Tunnel (STT) */
23983         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
23984                 UINT32_C(0x7)
23985         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
23986         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
23987                 UINT32_C(0x8)
23988         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
23989         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
23990                 UINT32_C(0x9)
23991         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
23992         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
23993                 UINT32_C(0xa)
23994         /* Use fixed layer 2 ether type of 0xFFFF */
23995         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
23996                 UINT32_C(0xb)
23997         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
23998         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
23999                 UINT32_C(0xc)
24000         /* Any tunneled traffic */
24001         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
24002                 UINT32_C(0xff)
24003         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
24004                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
24005         uint8_t unused_4;
24006         /*
24007          * If set, this value shall represent the
24008          * Logical VNIC ID of the destination VNIC for the RX
24009          * path and network port id of the destination port for
24010          * the TX path.
24011          */
24012         uint16_t        dst_id;
24013         /*
24014          * Logical VNIC ID of the VNIC where traffic is
24015          * mirrored.
24016          */
24017         uint16_t        mirror_vnic_id;
24018         /*
24019          * This hint is provided to help in placing
24020          * the filter in the filter table.
24021          */
24022         uint8_t pri_hint;
24023         /* No preference */
24024         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
24025                 UINT32_C(0x0)
24026         /* Above the given filter */
24027         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
24028                 UINT32_C(0x1)
24029         /* Below the given filter */
24030         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
24031                 UINT32_C(0x2)
24032         /* As high as possible */
24033         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
24034                 UINT32_C(0x3)
24035         /* As low as possible */
24036         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
24037                 UINT32_C(0x4)
24038         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
24039                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
24040         uint8_t unused_5;
24041         uint32_t        unused_6;
24042         /*
24043          * This is the ID of the filter that goes along with
24044          * the pri_hint.
24045          *
24046          * This field is valid only for the following values.
24047          * 1 - Above the given filter
24048          * 2 - Below the given filter
24049          */
24050         uint64_t        l2_filter_id_hint;
24051 } __attribute__((packed));
24052
24053 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
24054 struct hwrm_cfa_l2_filter_alloc_output {
24055         /* The specific error status for the command. */
24056         uint16_t        error_code;
24057         /* The HWRM command request type. */
24058         uint16_t        req_type;
24059         /* The sequence ID from the original command. */
24060         uint16_t        seq_id;
24061         /* The length of the response data in number of bytes. */
24062         uint16_t        resp_len;
24063         /*
24064          * This value identifies a set of CFA data structures used for an L2
24065          * context.
24066          */
24067         uint64_t        l2_filter_id;
24068         /*
24069          * The flow id value in bit 0-29 is the actual ID of the flow
24070          * associated with this filter and it shall be used to match
24071          * and associate the flow identifier returned in completion
24072          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
24073          * shall indicate no valid flow id.
24074          */
24075         uint32_t        flow_id;
24076         /* Indicate the flow id value. */
24077         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
24078                 UINT32_C(0x3fffffff)
24079         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
24080         /* Indicate type of the flow. */
24081         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
24082                 UINT32_C(0x40000000)
24083         /*
24084          * If this bit set to 0, then it indicates that the flow is
24085          * internal flow.
24086          */
24087         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
24088                 (UINT32_C(0x0) << 30)
24089         /*
24090          * If this bit is set to 1, then it indicates that the flow is
24091          * external flow.
24092          */
24093         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
24094                 (UINT32_C(0x1) << 30)
24095         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
24096                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
24097         /* Indicate the flow direction. */
24098         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
24099                 UINT32_C(0x80000000)
24100         /* If this bit set to 0, then it indicates rx flow. */
24101         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
24102                 (UINT32_C(0x0) << 31)
24103         /* If this bit is set to 1, then it indicates that tx flow. */
24104         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
24105                 (UINT32_C(0x1) << 31)
24106         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
24107                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
24108         uint8_t unused_0[3];
24109         /*
24110          * This field is used in Output records to indicate that the output
24111          * is completely written to RAM.  This field should be read as '1'
24112          * to indicate that the output has been completely written.
24113          * When writing a command completion or response to an internal processor,
24114          * the order of writes has to be such that this field is written last.
24115          */
24116         uint8_t valid;
24117 } __attribute__((packed));
24118
24119 /***************************
24120  * hwrm_cfa_l2_filter_free *
24121  ***************************/
24122
24123
24124 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
24125 struct hwrm_cfa_l2_filter_free_input {
24126         /* The HWRM command request type. */
24127         uint16_t        req_type;
24128         /*
24129          * The completion ring to send the completion event on. This should
24130          * be the NQ ID returned from the `nq_alloc` HWRM command.
24131          */
24132         uint16_t        cmpl_ring;
24133         /*
24134          * The sequence ID is used by the driver for tracking multiple
24135          * commands. This ID is treated as opaque data by the firmware and
24136          * the value is returned in the `hwrm_resp_hdr` upon completion.
24137          */
24138         uint16_t        seq_id;
24139         /*
24140          * The target ID of the command:
24141          * * 0x0-0xFFF8 - The function ID
24142          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24143          * * 0xFFFD - Reserved for user-space HWRM interface
24144          * * 0xFFFF - HWRM
24145          */
24146         uint16_t        target_id;
24147         /*
24148          * A physical address pointer pointing to a host buffer that the
24149          * command's response data will be written. This can be either a host
24150          * physical address (HPA) or a guest physical address (GPA) and must
24151          * point to a physically contiguous block of memory.
24152          */
24153         uint64_t        resp_addr;
24154         /*
24155          * This value identifies a set of CFA data structures used for an L2
24156          * context.
24157          */
24158         uint64_t        l2_filter_id;
24159 } __attribute__((packed));
24160
24161 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
24162 struct hwrm_cfa_l2_filter_free_output {
24163         /* The specific error status for the command. */
24164         uint16_t        error_code;
24165         /* The HWRM command request type. */
24166         uint16_t        req_type;
24167         /* The sequence ID from the original command. */
24168         uint16_t        seq_id;
24169         /* The length of the response data in number of bytes. */
24170         uint16_t        resp_len;
24171         uint8_t unused_0[7];
24172         /*
24173          * This field is used in Output records to indicate that the output
24174          * is completely written to RAM.  This field should be read as '1'
24175          * to indicate that the output has been completely written.
24176          * When writing a command completion or response to an internal processor,
24177          * the order of writes has to be such that this field is written last.
24178          */
24179         uint8_t valid;
24180 } __attribute__((packed));
24181
24182 /**************************
24183  * hwrm_cfa_l2_filter_cfg *
24184  **************************/
24185
24186
24187 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
24188 struct hwrm_cfa_l2_filter_cfg_input {
24189         /* The HWRM command request type. */
24190         uint16_t        req_type;
24191         /*
24192          * The completion ring to send the completion event on. This should
24193          * be the NQ ID returned from the `nq_alloc` HWRM command.
24194          */
24195         uint16_t        cmpl_ring;
24196         /*
24197          * The sequence ID is used by the driver for tracking multiple
24198          * commands. This ID is treated as opaque data by the firmware and
24199          * the value is returned in the `hwrm_resp_hdr` upon completion.
24200          */
24201         uint16_t        seq_id;
24202         /*
24203          * The target ID of the command:
24204          * * 0x0-0xFFF8 - The function ID
24205          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24206          * * 0xFFFD - Reserved for user-space HWRM interface
24207          * * 0xFFFF - HWRM
24208          */
24209         uint16_t        target_id;
24210         /*
24211          * A physical address pointer pointing to a host buffer that the
24212          * command's response data will be written. This can be either a host
24213          * physical address (HPA) or a guest physical address (GPA) and must
24214          * point to a physically contiguous block of memory.
24215          */
24216         uint64_t        resp_addr;
24217         uint32_t        flags;
24218         /*
24219          * Enumeration denoting the RX, TX type of the resource.
24220          * This enumeration is used for resources that are similar for both
24221          * TX and RX paths of the chip.
24222          */
24223         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH \
24224                 UINT32_C(0x1)
24225         /* tx path */
24226         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \
24227                 UINT32_C(0x0)
24228         /* rx path */
24229         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \
24230                 UINT32_C(0x1)
24231         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
24232                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
24233         /*
24234          * Setting of this flag indicates drop action. If this flag is not set,
24235          * then it should be considered accept action.
24236          */
24237         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP \
24238                 UINT32_C(0x2)
24239         /*
24240          * Enumeration denoting NO_ROCE_L2 to support old drivers.
24241          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
24242          */
24243         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK \
24244                 UINT32_C(0xc)
24245         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT       2
24246         /* To support old drivers */
24247         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
24248                 (UINT32_C(0x0) << 2)
24249         /* Only L2 traffic */
24250         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2 \
24251                 (UINT32_C(0x1) << 2)
24252         /* Roce & L2 traffic */
24253         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE \
24254                 (UINT32_C(0x2) << 2)
24255         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST \
24256                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE
24257         uint32_t        enables;
24258         /*
24259          * This bit must be '1' for the dst_id field to be
24260          * configured.
24261          */
24262         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID \
24263                 UINT32_C(0x1)
24264         /*
24265          * This bit must be '1' for the new_mirror_vnic_id field to be
24266          * configured.
24267          */
24268         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
24269                 UINT32_C(0x2)
24270         /*
24271          * This value identifies a set of CFA data structures used for an L2
24272          * context.
24273          */
24274         uint64_t        l2_filter_id;
24275         /*
24276          * If set, this value shall represent the
24277          * Logical VNIC ID of the destination VNIC for the RX
24278          * path and network port id of the destination port for
24279          * the TX path.
24280          */
24281         uint32_t        dst_id;
24282         /*
24283          * New Logical VNIC ID of the VNIC where traffic is
24284          * mirrored.
24285          */
24286         uint32_t        new_mirror_vnic_id;
24287 } __attribute__((packed));
24288
24289 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
24290 struct hwrm_cfa_l2_filter_cfg_output {
24291         /* The specific error status for the command. */
24292         uint16_t        error_code;
24293         /* The HWRM command request type. */
24294         uint16_t        req_type;
24295         /* The sequence ID from the original command. */
24296         uint16_t        seq_id;
24297         /* The length of the response data in number of bytes. */
24298         uint16_t        resp_len;
24299         uint8_t unused_0[7];
24300         /*
24301          * This field is used in Output records to indicate that the output
24302          * is completely written to RAM.  This field should be read as '1'
24303          * to indicate that the output has been completely written.
24304          * When writing a command completion or response to an internal processor,
24305          * the order of writes has to be such that this field is written last.
24306          */
24307         uint8_t valid;
24308 } __attribute__((packed));
24309
24310 /***************************
24311  * hwrm_cfa_l2_set_rx_mask *
24312  ***************************/
24313
24314
24315 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
24316 struct hwrm_cfa_l2_set_rx_mask_input {
24317         /* The HWRM command request type. */
24318         uint16_t        req_type;
24319         /*
24320          * The completion ring to send the completion event on. This should
24321          * be the NQ ID returned from the `nq_alloc` HWRM command.
24322          */
24323         uint16_t        cmpl_ring;
24324         /*
24325          * The sequence ID is used by the driver for tracking multiple
24326          * commands. This ID is treated as opaque data by the firmware and
24327          * the value is returned in the `hwrm_resp_hdr` upon completion.
24328          */
24329         uint16_t        seq_id;
24330         /*
24331          * The target ID of the command:
24332          * * 0x0-0xFFF8 - The function ID
24333          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24334          * * 0xFFFD - Reserved for user-space HWRM interface
24335          * * 0xFFFF - HWRM
24336          */
24337         uint16_t        target_id;
24338         /*
24339          * A physical address pointer pointing to a host buffer that the
24340          * command's response data will be written. This can be either a host
24341          * physical address (HPA) or a guest physical address (GPA) and must
24342          * point to a physically contiguous block of memory.
24343          */
24344         uint64_t        resp_addr;
24345         /* VNIC ID */
24346         uint32_t        vnic_id;
24347         uint32_t        mask;
24348         /*
24349          * When this bit is '1', the function is requested to accept
24350          * multi-cast packets specified by the multicast addr table.
24351          */
24352         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST \
24353                 UINT32_C(0x2)
24354         /*
24355          * When this bit is '1', the function is requested to accept
24356          * all multi-cast packets.
24357          */
24358         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST \
24359                 UINT32_C(0x4)
24360         /*
24361          * When this bit is '1', the function is requested to accept
24362          * broadcast packets.
24363          */
24364         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST \
24365                 UINT32_C(0x8)
24366         /*
24367          * When this bit is '1', the function is requested to be
24368          * put in the promiscuous mode.
24369          *
24370          * The HWRM should accept any function to set up
24371          * promiscuous mode.
24372          *
24373          * The HWRM shall follow the semantics below for the
24374          * promiscuous mode support.
24375          * # When partitioning is not enabled on a port
24376          * (i.e. single PF on the port), then the PF shall
24377          * be allowed to be in the promiscuous mode. When the
24378          * PF is in the promiscuous mode, then it shall
24379          * receive all host bound traffic on that port.
24380          * # When partitioning is enabled on a port
24381          * (i.e. multiple PFs per port) and a PF on that
24382          * port is in the promiscuous mode, then the PF
24383          * receives all traffic within that partition as
24384          * identified by a unique identifier for the
24385          * PF (e.g. S-Tag). If a unique outer VLAN
24386          * for the PF is specified, then the setting of
24387          * promiscuous mode on that PF shall result in the
24388          * PF receiving all host bound traffic with matching
24389          * outer VLAN.
24390          * # A VF shall can be set in the promiscuous mode.
24391          * In the promiscuous mode, the VF does not receive any
24392          * traffic unless a unique outer VLAN for the
24393          * VF is specified. If a unique outer VLAN
24394          * for the VF is specified, then the setting of
24395          * promiscuous mode on that VF shall result in the
24396          * VF receiving all host bound traffic with the
24397          * matching outer VLAN.
24398          * # The HWRM shall allow the setting of promiscuous
24399          * mode on a function independently from the
24400          * promiscuous mode settings on other functions.
24401          */
24402         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS \
24403                 UINT32_C(0x10)
24404         /*
24405          * If this flag is set, the corresponding RX
24406          * filters shall be set up to cover multicast/broadcast
24407          * filters for the outermost Layer 2 destination MAC
24408          * address field.
24409          */
24410         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST \
24411                 UINT32_C(0x20)
24412         /*
24413          * If this flag is set, the corresponding RX
24414          * filters shall be set up to cover multicast/broadcast
24415          * filters for the VLAN-tagged packets that match the
24416          * TPID and VID fields of VLAN tags in the VLAN tag
24417          * table specified in this command.
24418          */
24419         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY \
24420                 UINT32_C(0x40)
24421         /*
24422          * If this flag is set, the corresponding RX
24423          * filters shall be set up to cover multicast/broadcast
24424          * filters for non-VLAN tagged packets and VLAN-tagged
24425          * packets that match the TPID and VID fields of VLAN
24426          * tags in the VLAN tag table specified in this command.
24427          */
24428         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN \
24429                 UINT32_C(0x80)
24430         /*
24431          * If this flag is set, the corresponding RX
24432          * filters shall be set up to cover multicast/broadcast
24433          * filters for non-VLAN tagged packets and VLAN-tagged
24434          * packets matching any VLAN tag.
24435          *
24436          * If this flag is set, then the HWRM shall ignore
24437          * VLAN tags specified in vlan_tag_tbl.
24438          *
24439          * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
24440          * flags is set, then the HWRM shall ignore
24441          * VLAN tags specified in vlan_tag_tbl.
24442          *
24443          * The HWRM client shall set at most one flag out of
24444          * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
24445          */
24446         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
24447                 UINT32_C(0x100)
24448         /* This is the address for mcast address tbl. */
24449         uint64_t        mc_tbl_addr;
24450         /*
24451          * This value indicates how many entries in mc_tbl are valid.
24452          * Each entry is 6 bytes.
24453          */
24454         uint32_t        num_mc_entries;
24455         uint8_t unused_0[4];
24456         /*
24457          * This is the address for VLAN tag table.
24458          * Each VLAN entry in the table is 4 bytes of a VLAN tag
24459          * including TPID, PCP, DEI, and VID fields in network byte
24460          * order.
24461          */
24462         uint64_t        vlan_tag_tbl_addr;
24463         /*
24464          * This value indicates how many entries in vlan_tag_tbl are
24465          * valid. Each entry is 4 bytes.
24466          */
24467         uint32_t        num_vlan_tags;
24468         uint8_t unused_1[4];
24469 } __attribute__((packed));
24470
24471 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
24472 struct hwrm_cfa_l2_set_rx_mask_output {
24473         /* The specific error status for the command. */
24474         uint16_t        error_code;
24475         /* The HWRM command request type. */
24476         uint16_t        req_type;
24477         /* The sequence ID from the original command. */
24478         uint16_t        seq_id;
24479         /* The length of the response data in number of bytes. */
24480         uint16_t        resp_len;
24481         uint8_t unused_0[7];
24482         /*
24483          * This field is used in Output records to indicate that the output
24484          * is completely written to RAM.  This field should be read as '1'
24485          * to indicate that the output has been completely written.
24486          * When writing a command completion or response to an internal processor,
24487          * the order of writes has to be such that this field is written last.
24488          */
24489         uint8_t valid;
24490 } __attribute__((packed));
24491
24492 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
24493 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
24494         /*
24495          * command specific error codes that goes to
24496          * the cmd_err field in Common HWRM Error Response.
24497          */
24498         uint8_t code;
24499         /* Unknown error */
24500         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN \
24501                 UINT32_C(0x0)
24502         /* Unable to complete operation due to conflict with Ntuple Filter */
24503         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR \
24504                 UINT32_C(0x1)
24505         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST \
24506                 HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
24507         uint8_t unused_0[7];
24508 } __attribute__((packed));
24509
24510 /*******************************
24511  * hwrm_cfa_vlan_antispoof_cfg *
24512  *******************************/
24513
24514
24515 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
24516 struct hwrm_cfa_vlan_antispoof_cfg_input {
24517         /* The HWRM command request type. */
24518         uint16_t        req_type;
24519         /*
24520          * The completion ring to send the completion event on. This should
24521          * be the NQ ID returned from the `nq_alloc` HWRM command.
24522          */
24523         uint16_t        cmpl_ring;
24524         /*
24525          * The sequence ID is used by the driver for tracking multiple
24526          * commands. This ID is treated as opaque data by the firmware and
24527          * the value is returned in the `hwrm_resp_hdr` upon completion.
24528          */
24529         uint16_t        seq_id;
24530         /*
24531          * The target ID of the command:
24532          * * 0x0-0xFFF8 - The function ID
24533          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24534          * * 0xFFFD - Reserved for user-space HWRM interface
24535          * * 0xFFFF - HWRM
24536          */
24537         uint16_t        target_id;
24538         /*
24539          * A physical address pointer pointing to a host buffer that the
24540          * command's response data will be written. This can be either a host
24541          * physical address (HPA) or a guest physical address (GPA) and must
24542          * point to a physically contiguous block of memory.
24543          */
24544         uint64_t        resp_addr;
24545         /*
24546          * Function ID of the function that is being configured.
24547          * Only valid for a VF FID configured by the PF.
24548          */
24549         uint16_t        fid;
24550         uint8_t unused_0[2];
24551         /* Number of VLAN entries in the vlan_tag_mask_tbl. */
24552         uint32_t        num_vlan_entries;
24553         /*
24554          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
24555          * antispoof table. Each table entry contains the 16-bit TPID
24556          * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
24557          * all in network order to match hwrm_cfa_l2_set_rx_mask.
24558          * For an individual VLAN entry, the mask value should be 0xfff
24559          * for the 12-bit VLAN ID.
24560          */
24561         uint64_t        vlan_tag_mask_tbl_addr;
24562 } __attribute__((packed));
24563
24564 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
24565 struct hwrm_cfa_vlan_antispoof_cfg_output {
24566         /* The specific error status for the command. */
24567         uint16_t        error_code;
24568         /* The HWRM command request type. */
24569         uint16_t        req_type;
24570         /* The sequence ID from the original command. */
24571         uint16_t        seq_id;
24572         /* The length of the response data in number of bytes. */
24573         uint16_t        resp_len;
24574         uint8_t unused_0[7];
24575         /*
24576          * This field is used in Output records to indicate that the output
24577          * is completely written to RAM.  This field should be read as '1'
24578          * to indicate that the output has been completely written.
24579          * When writing a command completion or response to an internal processor,
24580          * the order of writes has to be such that this field is written last.
24581          */
24582         uint8_t valid;
24583 } __attribute__((packed));
24584
24585 /********************************
24586  * hwrm_cfa_vlan_antispoof_qcfg *
24587  ********************************/
24588
24589
24590 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
24591 struct hwrm_cfa_vlan_antispoof_qcfg_input {
24592         /* The HWRM command request type. */
24593         uint16_t        req_type;
24594         /*
24595          * The completion ring to send the completion event on. This should
24596          * be the NQ ID returned from the `nq_alloc` HWRM command.
24597          */
24598         uint16_t        cmpl_ring;
24599         /*
24600          * The sequence ID is used by the driver for tracking multiple
24601          * commands. This ID is treated as opaque data by the firmware and
24602          * the value is returned in the `hwrm_resp_hdr` upon completion.
24603          */
24604         uint16_t        seq_id;
24605         /*
24606          * The target ID of the command:
24607          * * 0x0-0xFFF8 - The function ID
24608          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24609          * * 0xFFFD - Reserved for user-space HWRM interface
24610          * * 0xFFFF - HWRM
24611          */
24612         uint16_t        target_id;
24613         /*
24614          * A physical address pointer pointing to a host buffer that the
24615          * command's response data will be written. This can be either a host
24616          * physical address (HPA) or a guest physical address (GPA) and must
24617          * point to a physically contiguous block of memory.
24618          */
24619         uint64_t        resp_addr;
24620         /*
24621          * Function ID of the function that is being queried.
24622          * Only valid for a VF FID queried by the PF.
24623          */
24624         uint16_t        fid;
24625         uint8_t unused_0[2];
24626         /*
24627          * Maximum number of VLAN entries the firmware is allowed to DMA
24628          * to vlan_tag_mask_tbl.
24629          */
24630         uint32_t        max_vlan_entries;
24631         /*
24632          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
24633          * antispoof table to which firmware will DMA to. Each table
24634          * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
24635          * 16-bit VLAN ID, and a 16-bit mask, all in network order to
24636          * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
24637          * the mask value should be 0xfff for the 12-bit VLAN ID.
24638          */
24639         uint64_t        vlan_tag_mask_tbl_addr;
24640 } __attribute__((packed));
24641
24642 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
24643 struct hwrm_cfa_vlan_antispoof_qcfg_output {
24644         /* The specific error status for the command. */
24645         uint16_t        error_code;
24646         /* The HWRM command request type. */
24647         uint16_t        req_type;
24648         /* The sequence ID from the original command. */
24649         uint16_t        seq_id;
24650         /* The length of the response data in number of bytes. */
24651         uint16_t        resp_len;
24652         /* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
24653         uint32_t        num_vlan_entries;
24654         uint8_t unused_0[3];
24655         /*
24656          * This field is used in Output records to indicate that the output
24657          * is completely written to RAM.  This field should be read as '1'
24658          * to indicate that the output has been completely written.
24659          * When writing a command completion or response to an internal processor,
24660          * the order of writes has to be such that this field is written last.
24661          */
24662         uint8_t valid;
24663 } __attribute__((packed));
24664
24665 /********************************
24666  * hwrm_cfa_tunnel_filter_alloc *
24667  ********************************/
24668
24669
24670 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */
24671 struct hwrm_cfa_tunnel_filter_alloc_input {
24672         /* The HWRM command request type. */
24673         uint16_t        req_type;
24674         /*
24675          * The completion ring to send the completion event on. This should
24676          * be the NQ ID returned from the `nq_alloc` HWRM command.
24677          */
24678         uint16_t        cmpl_ring;
24679         /*
24680          * The sequence ID is used by the driver for tracking multiple
24681          * commands. This ID is treated as opaque data by the firmware and
24682          * the value is returned in the `hwrm_resp_hdr` upon completion.
24683          */
24684         uint16_t        seq_id;
24685         /*
24686          * The target ID of the command:
24687          * * 0x0-0xFFF8 - The function ID
24688          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24689          * * 0xFFFD - Reserved for user-space HWRM interface
24690          * * 0xFFFF - HWRM
24691          */
24692         uint16_t        target_id;
24693         /*
24694          * A physical address pointer pointing to a host buffer that the
24695          * command's response data will be written. This can be either a host
24696          * physical address (HPA) or a guest physical address (GPA) and must
24697          * point to a physically contiguous block of memory.
24698          */
24699         uint64_t        resp_addr;
24700         uint32_t        flags;
24701         /* Setting of this flag indicates the applicability to the loopback path. */
24702         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
24703                 UINT32_C(0x1)
24704         uint32_t        enables;
24705         /*
24706          * This bit must be '1' for the l2_filter_id field to be
24707          * configured.
24708          */
24709         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
24710                 UINT32_C(0x1)
24711         /*
24712          * This bit must be '1' for the l2_addr field to be
24713          * configured.
24714          */
24715         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
24716                 UINT32_C(0x2)
24717         /*
24718          * This bit must be '1' for the l2_ivlan field to be
24719          * configured.
24720          */
24721         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
24722                 UINT32_C(0x4)
24723         /*
24724          * This bit must be '1' for the l3_addr field to be
24725          * configured.
24726          */
24727         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR \
24728                 UINT32_C(0x8)
24729         /*
24730          * This bit must be '1' for the l3_addr_type field to be
24731          * configured.
24732          */
24733         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE \
24734                 UINT32_C(0x10)
24735         /*
24736          * This bit must be '1' for the t_l3_addr_type field to be
24737          * configured.
24738          */
24739         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE \
24740                 UINT32_C(0x20)
24741         /*
24742          * This bit must be '1' for the t_l3_addr field to be
24743          * configured.
24744          */
24745         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR \
24746                 UINT32_C(0x40)
24747         /*
24748          * This bit must be '1' for the tunnel_type field to be
24749          * configured.
24750          */
24751         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
24752                 UINT32_C(0x80)
24753         /*
24754          * This bit must be '1' for the vni field to be
24755          * configured.
24756          */
24757         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI \
24758                 UINT32_C(0x100)
24759         /*
24760          * This bit must be '1' for the dst_vnic_id field to be
24761          * configured.
24762          */
24763         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID \
24764                 UINT32_C(0x200)
24765         /*
24766          * This bit must be '1' for the mirror_vnic_id field to be
24767          * configured.
24768          */
24769         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
24770                 UINT32_C(0x400)
24771         /*
24772          * This value identifies a set of CFA data structures used for an L2
24773          * context.
24774          */
24775         uint64_t        l2_filter_id;
24776         /*
24777          * This value sets the match value for the inner L2
24778          * MAC address.
24779          * Destination MAC address for RX path.
24780          * Source MAC address for TX path.
24781          */
24782         uint8_t l2_addr[6];
24783         /*
24784          * This value sets VLAN ID value for inner VLAN.
24785          * Only 12-bits of VLAN ID are used in setting the filter.
24786          */
24787         uint16_t        l2_ivlan;
24788         /*
24789          * The value of inner destination IP address to be used in filtering.
24790          * For IPv4, first four bytes represent the IP address.
24791          */
24792         uint32_t        l3_addr[4];
24793         /*
24794          * The value of tunnel destination IP address to be used in filtering.
24795          * For IPv4, first four bytes represent the IP address.
24796          */
24797         uint32_t        t_l3_addr[4];
24798         /*
24799          * This value indicates the type of inner IP address.
24800          * 4 - IPv4
24801          * 6 - IPv6
24802          * All others are invalid.
24803          */
24804         uint8_t l3_addr_type;
24805         /*
24806          * This value indicates the type of tunnel IP address.
24807          * 4 - IPv4
24808          * 6 - IPv6
24809          * All others are invalid.
24810          */
24811         uint8_t t_l3_addr_type;
24812         /* Tunnel Type. */
24813         uint8_t tunnel_type;
24814         /* Non-tunnel */
24815         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
24816                 UINT32_C(0x0)
24817         /* Virtual eXtensible Local Area Network (VXLAN) */
24818         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
24819                 UINT32_C(0x1)
24820         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
24821         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
24822                 UINT32_C(0x2)
24823         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
24824         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
24825                 UINT32_C(0x3)
24826         /* IP in IP */
24827         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
24828                 UINT32_C(0x4)
24829         /* Generic Network Virtualization Encapsulation (Geneve) */
24830         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
24831                 UINT32_C(0x5)
24832         /* Multi-Protocol Lable Switching (MPLS) */
24833         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
24834                 UINT32_C(0x6)
24835         /* Stateless Transport Tunnel (STT) */
24836         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
24837                 UINT32_C(0x7)
24838         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
24839         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
24840                 UINT32_C(0x8)
24841         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
24842         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
24843                 UINT32_C(0x9)
24844         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
24845         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
24846                 UINT32_C(0xa)
24847         /* Use fixed layer 2 ether type of 0xFFFF */
24848         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
24849                 UINT32_C(0xb)
24850         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
24851         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
24852                 UINT32_C(0xc)
24853         /* Any tunneled traffic */
24854         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
24855                 UINT32_C(0xff)
24856         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
24857                 HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
24858         /*
24859          * tunnel_flags allows the user to indicate the tunnel tag detection
24860          * for the tunnel type specified in tunnel_type.
24861          */
24862         uint8_t tunnel_flags;
24863         /*
24864          * If the tunnel_type is geneve, then this bit indicates if we
24865          * need to match the geneve OAM packet.
24866          * If the tunnel_type is nvgre or gre, then this bit indicates if
24867          * we need to detect checksum present bit in geneve header.
24868          * If the tunnel_type is mpls, then this bit indicates if we need
24869          * to match mpls packet with explicit IPV4/IPV6 null header.
24870          */
24871         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR \
24872                 UINT32_C(0x1)
24873         /*
24874          * If the tunnel_type is geneve, then this bit indicates if we
24875          * need to detect the critical option bit set in the oam packet.
24876          * If the tunnel_type is nvgre or gre, then this bit indicates
24877          * if we need to match nvgre packets with key present bit set in
24878          * gre header.
24879          * If the tunnel_type is mpls, then this bit indicates if we
24880          * need to match mpls packet with S bit from inner/second label.
24881          */
24882         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1 \
24883                 UINT32_C(0x2)
24884         /*
24885          * If the tunnel_type is geneve, then this bit indicates if we
24886          * need to match geneve packet with extended header bit set in
24887          * geneve header.
24888          * If the tunnel_type is nvgre or gre, then this bit indicates
24889          * if we need to match nvgre packets with sequence number
24890          * present bit set in gre header.
24891          * If the tunnel_type is mpls, then this bit indicates if we
24892          * need to match mpls packet with S bit from out/first label.
24893          */
24894         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0 \
24895                 UINT32_C(0x4)
24896         /*
24897          * Virtual Network Identifier (VNI). Only valid with
24898          * tunnel_types VXLAN, NVGRE, and Geneve.
24899          * Only lower 24-bits of VNI field are used
24900          * in setting up the filter.
24901          */
24902         uint32_t        vni;
24903         /* Logical VNIC ID of the destination VNIC. */
24904         uint32_t        dst_vnic_id;
24905         /*
24906          * Logical VNIC ID of the VNIC where traffic is
24907          * mirrored.
24908          */
24909         uint32_t        mirror_vnic_id;
24910 } __attribute__((packed));
24911
24912 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
24913 struct hwrm_cfa_tunnel_filter_alloc_output {
24914         /* The specific error status for the command. */
24915         uint16_t        error_code;
24916         /* The HWRM command request type. */
24917         uint16_t        req_type;
24918         /* The sequence ID from the original command. */
24919         uint16_t        seq_id;
24920         /* The length of the response data in number of bytes. */
24921         uint16_t        resp_len;
24922         /* This value is an opaque id into CFA data structures. */
24923         uint64_t        tunnel_filter_id;
24924         /*
24925          * The flow id value in bit 0-29 is the actual ID of the flow
24926          * associated with this filter and it shall be used to match
24927          * and associate the flow identifier returned in completion
24928          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
24929          * shall indicate no valid flow id.
24930          */
24931         uint32_t        flow_id;
24932         /* Indicate the flow id value. */
24933         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
24934                 UINT32_C(0x3fffffff)
24935         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
24936         /* Indicate type of the flow. */
24937         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
24938                 UINT32_C(0x40000000)
24939         /*
24940          * If this bit set to 0, then it indicates that the flow is
24941          * internal flow.
24942          */
24943         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
24944                 (UINT32_C(0x0) << 30)
24945         /*
24946          * If this bit is set to 1, then it indicates that the flow is
24947          * external flow.
24948          */
24949         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
24950                 (UINT32_C(0x1) << 30)
24951         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
24952                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
24953         /* Indicate the flow direction. */
24954         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
24955                 UINT32_C(0x80000000)
24956         /* If this bit set to 0, then it indicates rx flow. */
24957         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
24958                 (UINT32_C(0x0) << 31)
24959         /* If this bit is set to 1, then it indicates that tx flow. */
24960         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
24961                 (UINT32_C(0x1) << 31)
24962         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
24963                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
24964         uint8_t unused_0[3];
24965         /*
24966          * This field is used in Output records to indicate that the output
24967          * is completely written to RAM.  This field should be read as '1'
24968          * to indicate that the output has been completely written.
24969          * When writing a command completion or response to an internal processor,
24970          * the order of writes has to be such that this field is written last.
24971          */
24972         uint8_t valid;
24973 } __attribute__((packed));
24974
24975 /*******************************
24976  * hwrm_cfa_tunnel_filter_free *
24977  *******************************/
24978
24979
24980 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */
24981 struct hwrm_cfa_tunnel_filter_free_input {
24982         /* The HWRM command request type. */
24983         uint16_t        req_type;
24984         /*
24985          * The completion ring to send the completion event on. This should
24986          * be the NQ ID returned from the `nq_alloc` HWRM command.
24987          */
24988         uint16_t        cmpl_ring;
24989         /*
24990          * The sequence ID is used by the driver for tracking multiple
24991          * commands. This ID is treated as opaque data by the firmware and
24992          * the value is returned in the `hwrm_resp_hdr` upon completion.
24993          */
24994         uint16_t        seq_id;
24995         /*
24996          * The target ID of the command:
24997          * * 0x0-0xFFF8 - The function ID
24998          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24999          * * 0xFFFD - Reserved for user-space HWRM interface
25000          * * 0xFFFF - HWRM
25001          */
25002         uint16_t        target_id;
25003         /*
25004          * A physical address pointer pointing to a host buffer that the
25005          * command's response data will be written. This can be either a host
25006          * physical address (HPA) or a guest physical address (GPA) and must
25007          * point to a physically contiguous block of memory.
25008          */
25009         uint64_t        resp_addr;
25010         /* This value is an opaque id into CFA data structures. */
25011         uint64_t        tunnel_filter_id;
25012 } __attribute__((packed));
25013
25014 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
25015 struct hwrm_cfa_tunnel_filter_free_output {
25016         /* The specific error status for the command. */
25017         uint16_t        error_code;
25018         /* The HWRM command request type. */
25019         uint16_t        req_type;
25020         /* The sequence ID from the original command. */
25021         uint16_t        seq_id;
25022         /* The length of the response data in number of bytes. */
25023         uint16_t        resp_len;
25024         uint8_t unused_0[7];
25025         /*
25026          * This field is used in Output records to indicate that the output
25027          * is completely written to RAM.  This field should be read as '1'
25028          * to indicate that the output has been completely written.
25029          * When writing a command completion or response to an internal processor,
25030          * the order of writes has to be such that this field is written last.
25031          */
25032         uint8_t valid;
25033 } __attribute__((packed));
25034
25035 /***************************************
25036  * hwrm_cfa_redirect_tunnel_type_alloc *
25037  ***************************************/
25038
25039
25040 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */
25041 struct hwrm_cfa_redirect_tunnel_type_alloc_input {
25042         /* The HWRM command request type. */
25043         uint16_t        req_type;
25044         /*
25045          * The completion ring to send the completion event on. This should
25046          * be the NQ ID returned from the `nq_alloc` HWRM command.
25047          */
25048         uint16_t        cmpl_ring;
25049         /*
25050          * The sequence ID is used by the driver for tracking multiple
25051          * commands. This ID is treated as opaque data by the firmware and
25052          * the value is returned in the `hwrm_resp_hdr` upon completion.
25053          */
25054         uint16_t        seq_id;
25055         /*
25056          * The target ID of the command:
25057          * * 0x0-0xFFF8 - The function ID
25058          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25059          * * 0xFFFD - Reserved for user-space HWRM interface
25060          * * 0xFFFF - HWRM
25061          */
25062         uint16_t        target_id;
25063         /*
25064          * A physical address pointer pointing to a host buffer that the
25065          * command's response data will be written. This can be either a host
25066          * physical address (HPA) or a guest physical address (GPA) and must
25067          * point to a physically contiguous block of memory.
25068          */
25069         uint64_t        resp_addr;
25070         /* The destination function id, to whom the traffic is redirected. */
25071         uint16_t        dest_fid;
25072         /* Tunnel Type. */
25073         uint8_t tunnel_type;
25074         /* Non-tunnel */
25075         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
25076                 UINT32_C(0x0)
25077         /* Virtual eXtensible Local Area Network (VXLAN) */
25078         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
25079                 UINT32_C(0x1)
25080         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25081         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
25082                 UINT32_C(0x2)
25083         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25084         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
25085                 UINT32_C(0x3)
25086         /* IP in IP */
25087         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
25088                 UINT32_C(0x4)
25089         /* Generic Network Virtualization Encapsulation (Geneve) */
25090         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
25091                 UINT32_C(0x5)
25092         /* Multi-Protocol Lable Switching (MPLS) */
25093         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
25094                 UINT32_C(0x6)
25095         /* Stateless Transport Tunnel (STT) */
25096         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT \
25097                 UINT32_C(0x7)
25098         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25099         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
25100                 UINT32_C(0x8)
25101         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25102         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25103                 UINT32_C(0x9)
25104         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25105         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25106                 UINT32_C(0xa)
25107         /* Use fixed layer 2 ether type of 0xFFFF */
25108         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
25109                 UINT32_C(0xb)
25110         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25111         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25112                 UINT32_C(0xc)
25113         /* Any tunneled traffic */
25114         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25115                 UINT32_C(0xff)
25116         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST \
25117                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
25118         /* Tunnel alloc flags. */
25119         uint8_t flags;
25120         /* Setting of this flag indicates modify existing redirect tunnel to new destination function ID. */
25121         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST \
25122                 UINT32_C(0x1)
25123         uint8_t unused_0[4];
25124 } __attribute__((packed));
25125
25126 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
25127 struct hwrm_cfa_redirect_tunnel_type_alloc_output {
25128         /* The specific error status for the command. */
25129         uint16_t        error_code;
25130         /* The HWRM command request type. */
25131         uint16_t        req_type;
25132         /* The sequence ID from the original command. */
25133         uint16_t        seq_id;
25134         /* The length of the response data in number of bytes. */
25135         uint16_t        resp_len;
25136         uint8_t unused_0[7];
25137         /*
25138          * This field is used in Output records to indicate that the output
25139          * is completely written to RAM.  This field should be read as '1'
25140          * to indicate that the output has been completely written.
25141          * When writing a command completion or response to an internal processor,
25142          * the order of writes has to be such that this field is written last.
25143          */
25144         uint8_t valid;
25145 } __attribute__((packed));
25146
25147 /**************************************
25148  * hwrm_cfa_redirect_tunnel_type_free *
25149  **************************************/
25150
25151
25152 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */
25153 struct hwrm_cfa_redirect_tunnel_type_free_input {
25154         /* The HWRM command request type. */
25155         uint16_t        req_type;
25156         /*
25157          * The completion ring to send the completion event on. This should
25158          * be the NQ ID returned from the `nq_alloc` HWRM command.
25159          */
25160         uint16_t        cmpl_ring;
25161         /*
25162          * The sequence ID is used by the driver for tracking multiple
25163          * commands. This ID is treated as opaque data by the firmware and
25164          * the value is returned in the `hwrm_resp_hdr` upon completion.
25165          */
25166         uint16_t        seq_id;
25167         /*
25168          * The target ID of the command:
25169          * * 0x0-0xFFF8 - The function ID
25170          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25171          * * 0xFFFD - Reserved for user-space HWRM interface
25172          * * 0xFFFF - HWRM
25173          */
25174         uint16_t        target_id;
25175         /*
25176          * A physical address pointer pointing to a host buffer that the
25177          * command's response data will be written. This can be either a host
25178          * physical address (HPA) or a guest physical address (GPA) and must
25179          * point to a physically contiguous block of memory.
25180          */
25181         uint64_t        resp_addr;
25182         /* The destination function id, to whom the traffic is redirected. */
25183         uint16_t        dest_fid;
25184         /* Tunnel Type. */
25185         uint8_t tunnel_type;
25186         /* Non-tunnel */
25187         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL \
25188                 UINT32_C(0x0)
25189         /* Virtual eXtensible Local Area Network (VXLAN) */
25190         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN \
25191                 UINT32_C(0x1)
25192         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25193         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE \
25194                 UINT32_C(0x2)
25195         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25196         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE \
25197                 UINT32_C(0x3)
25198         /* IP in IP */
25199         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP \
25200                 UINT32_C(0x4)
25201         /* Generic Network Virtualization Encapsulation (Geneve) */
25202         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE \
25203                 UINT32_C(0x5)
25204         /* Multi-Protocol Lable Switching (MPLS) */
25205         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS \
25206                 UINT32_C(0x6)
25207         /* Stateless Transport Tunnel (STT) */
25208         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT \
25209                 UINT32_C(0x7)
25210         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25211         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE \
25212                 UINT32_C(0x8)
25213         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25214         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25215                 UINT32_C(0x9)
25216         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25217         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25218                 UINT32_C(0xa)
25219         /* Use fixed layer 2 ether type of 0xFFFF */
25220         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
25221                 UINT32_C(0xb)
25222         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25223         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25224                 UINT32_C(0xc)
25225         /* Any tunneled traffic */
25226         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25227                 UINT32_C(0xff)
25228         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST \
25229                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
25230         uint8_t unused_0[5];
25231 } __attribute__((packed));
25232
25233 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
25234 struct hwrm_cfa_redirect_tunnel_type_free_output {
25235         /* The specific error status for the command. */
25236         uint16_t        error_code;
25237         /* The HWRM command request type. */
25238         uint16_t        req_type;
25239         /* The sequence ID from the original command. */
25240         uint16_t        seq_id;
25241         /* The length of the response data in number of bytes. */
25242         uint16_t        resp_len;
25243         uint8_t unused_0[7];
25244         /*
25245          * This field is used in Output records to indicate that the output
25246          * is completely written to RAM.  This field should be read as '1'
25247          * to indicate that the output has been completely written.
25248          * When writing a command completion or response to an internal processor,
25249          * the order of writes has to be such that this field is written last.
25250          */
25251         uint8_t valid;
25252 } __attribute__((packed));
25253
25254 /**************************************
25255  * hwrm_cfa_redirect_tunnel_type_info *
25256  **************************************/
25257
25258
25259 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */
25260 struct hwrm_cfa_redirect_tunnel_type_info_input {
25261         /* The HWRM command request type. */
25262         uint16_t        req_type;
25263         /*
25264          * The completion ring to send the completion event on. This should
25265          * be the NQ ID returned from the `nq_alloc` HWRM command.
25266          */
25267         uint16_t        cmpl_ring;
25268         /*
25269          * The sequence ID is used by the driver for tracking multiple
25270          * commands. This ID is treated as opaque data by the firmware and
25271          * the value is returned in the `hwrm_resp_hdr` upon completion.
25272          */
25273         uint16_t        seq_id;
25274         /*
25275          * The target ID of the command:
25276          * * 0x0-0xFFF8 - The function ID
25277          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25278          * * 0xFFFD - Reserved for user-space HWRM interface
25279          * * 0xFFFF - HWRM
25280          */
25281         uint16_t        target_id;
25282         /*
25283          * A physical address pointer pointing to a host buffer that the
25284          * command's response data will be written. This can be either a host
25285          * physical address (HPA) or a guest physical address (GPA) and must
25286          * point to a physically contiguous block of memory.
25287          */
25288         uint64_t        resp_addr;
25289         /* The source function id. */
25290         uint16_t        src_fid;
25291         /* Tunnel Type. */
25292         uint8_t tunnel_type;
25293         /* Non-tunnel */
25294         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL \
25295                 UINT32_C(0x0)
25296         /* Virtual eXtensible Local Area Network (VXLAN) */
25297         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN \
25298                 UINT32_C(0x1)
25299         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25300         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE \
25301                 UINT32_C(0x2)
25302         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25303         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE \
25304                 UINT32_C(0x3)
25305         /* IP in IP */
25306         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP \
25307                 UINT32_C(0x4)
25308         /* Generic Network Virtualization Encapsulation (Geneve) */
25309         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE \
25310                 UINT32_C(0x5)
25311         /* Multi-Protocol Lable Switching (MPLS) */
25312         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS \
25313                 UINT32_C(0x6)
25314         /* Stateless Transport Tunnel (STT) */
25315         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT \
25316                 UINT32_C(0x7)
25317         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25318         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE \
25319                 UINT32_C(0x8)
25320         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25321         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25322                 UINT32_C(0x9)
25323         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25324         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25325                 UINT32_C(0xa)
25326         /* Use fixed layer 2 ether type of 0xFFFF */
25327         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2_ETYPE \
25328                 UINT32_C(0xb)
25329         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25330         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25331                 UINT32_C(0xc)
25332         /* Any tunneled traffic */
25333         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25334                 UINT32_C(0xff)
25335         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST \
25336                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
25337         uint8_t unused_0[5];
25338 } __attribute__((packed));
25339
25340 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
25341 struct hwrm_cfa_redirect_tunnel_type_info_output {
25342         /* The specific error status for the command. */
25343         uint16_t        error_code;
25344         /* The HWRM command request type. */
25345         uint16_t        req_type;
25346         /* The sequence ID from the original command. */
25347         uint16_t        seq_id;
25348         /* The length of the response data in number of bytes. */
25349         uint16_t        resp_len;
25350         /* The destination function id, to whom the traffic is redirected. */
25351         uint16_t        dest_fid;
25352         uint8_t unused_0[5];
25353         /*
25354          * This field is used in Output records to indicate that the output
25355          * is completely written to RAM.  This field should be read as '1'
25356          * to indicate that the output has been completely written.
25357          * When writing a command completion or response to an internal processor,
25358          * the order of writes has to be such that this field is written last.
25359          */
25360         uint8_t valid;
25361 } __attribute__((packed));
25362
25363 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
25364 struct hwrm_vxlan_ipv4_hdr {
25365         /* IPv4 version and header length. */
25366         uint8_t ver_hlen;
25367         /* IPv4 header length */
25368         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf)
25369         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0
25370         /* Version */
25371         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK      UINT32_C(0xf0)
25372         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT       4
25373         /* IPv4 type of service. */
25374         uint8_t tos;
25375         /* IPv4 identification. */
25376         uint16_t        ip_id;
25377         /* IPv4 flags and offset. */
25378         uint16_t        flags_frag_offset;
25379         /* IPv4 TTL. */
25380         uint8_t ttl;
25381         /* IPv4 protocol. */
25382         uint8_t protocol;
25383         /* IPv4 source address. */
25384         uint32_t        src_ip_addr;
25385         /* IPv4 destination address. */
25386         uint32_t        dest_ip_addr;
25387 } __attribute__((packed));
25388
25389 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
25390 struct hwrm_vxlan_ipv6_hdr {
25391         /* IPv6 version, traffic class and flow label. */
25392         uint32_t        ver_tc_flow_label;
25393         /* IPv6 version shift */
25394         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT \
25395                 UINT32_C(0x1c)
25396         /* IPv6 version mask */
25397         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK \
25398                 UINT32_C(0xf0000000)
25399         /* IPv6 TC shift */
25400         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT \
25401                 UINT32_C(0x14)
25402         /* IPv6 TC mask */
25403         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK \
25404                 UINT32_C(0xff00000)
25405         /* IPv6 flow label shift */
25406         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT \
25407                 UINT32_C(0x0)
25408         /* IPv6 flow label mask */
25409         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK \
25410                 UINT32_C(0xfffff)
25411         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST \
25412                 HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK
25413         /* IPv6 payload length. */
25414         uint16_t        payload_len;
25415         /* IPv6 next header. */
25416         uint8_t next_hdr;
25417         /* IPv6 TTL. */
25418         uint8_t ttl;
25419         /* IPv6 source address. */
25420         uint32_t        src_ip_addr[4];
25421         /* IPv6 destination address. */
25422         uint32_t        dest_ip_addr[4];
25423 } __attribute__((packed));
25424
25425 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
25426 struct hwrm_cfa_encap_data_vxlan {
25427         /* Source MAC address. */
25428         uint8_t src_mac_addr[6];
25429         /* reserved. */
25430         uint16_t        unused_0;
25431         /* Destination MAC address. */
25432         uint8_t dst_mac_addr[6];
25433         /* Number of VLAN tags. */
25434         uint8_t num_vlan_tags;
25435         /* reserved. */
25436         uint8_t unused_1;
25437         /* Outer VLAN TPID. */
25438         uint16_t        ovlan_tpid;
25439         /* Outer VLAN TCI. */
25440         uint16_t        ovlan_tci;
25441         /* Inner VLAN TPID. */
25442         uint16_t        ivlan_tpid;
25443         /* Inner VLAN TCI. */
25444         uint16_t        ivlan_tci;
25445         /* L3 header fields. */
25446         uint32_t        l3[10];
25447         /* IP version mask. */
25448         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf)
25449         /* IP version 4. */
25450         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4)
25451         /* IP version 6. */
25452         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6)
25453         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST \
25454                 HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6
25455         /* UDP source port. */
25456         uint16_t        src_port;
25457         /* UDP destination port. */
25458         uint16_t        dst_port;
25459         /* VXLAN Network Identifier. */
25460         uint32_t        vni;
25461         /* 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN header. */
25462         uint8_t hdr_rsvd0[3];
25463         /* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */
25464         uint8_t hdr_rsvd1;
25465         /* VXLAN header flags field. */
25466         uint8_t hdr_flags;
25467         uint8_t unused[3];
25468 } __attribute__((packed));
25469
25470 /*******************************
25471  * hwrm_cfa_encap_record_alloc *
25472  *******************************/
25473
25474
25475 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */
25476 struct hwrm_cfa_encap_record_alloc_input {
25477         /* The HWRM command request type. */
25478         uint16_t        req_type;
25479         /*
25480          * The completion ring to send the completion event on. This should
25481          * be the NQ ID returned from the `nq_alloc` HWRM command.
25482          */
25483         uint16_t        cmpl_ring;
25484         /*
25485          * The sequence ID is used by the driver for tracking multiple
25486          * commands. This ID is treated as opaque data by the firmware and
25487          * the value is returned in the `hwrm_resp_hdr` upon completion.
25488          */
25489         uint16_t        seq_id;
25490         /*
25491          * The target ID of the command:
25492          * * 0x0-0xFFF8 - The function ID
25493          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25494          * * 0xFFFD - Reserved for user-space HWRM interface
25495          * * 0xFFFF - HWRM
25496          */
25497         uint16_t        target_id;
25498         /*
25499          * A physical address pointer pointing to a host buffer that the
25500          * command's response data will be written. This can be either a host
25501          * physical address (HPA) or a guest physical address (GPA) and must
25502          * point to a physically contiguous block of memory.
25503          */
25504         uint64_t        resp_addr;
25505         uint32_t        flags;
25506         /* Setting of this flag indicates the applicability to the loopback path. */
25507         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK \
25508                 UINT32_C(0x1)
25509         /*
25510          * Setting of this flag indicates this encap record is external encap record.
25511          * Resetting of this flag indicates this flag is internal encap record and
25512          * this is the default setting.
25513          */
25514         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_EXTERNAL \
25515                 UINT32_C(0x2)
25516         /* Encapsulation Type. */
25517         uint8_t encap_type;
25518         /* Virtual eXtensible Local Area Network (VXLAN) */
25519         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN \
25520                 UINT32_C(0x1)
25521         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25522         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE \
25523                 UINT32_C(0x2)
25524         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
25525         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE \
25526                 UINT32_C(0x3)
25527         /* IP in IP */
25528         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP \
25529                 UINT32_C(0x4)
25530         /* Generic Network Virtualization Encapsulation (Geneve) */
25531         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE \
25532                 UINT32_C(0x5)
25533         /* Multi-Protocol Lable Switching (MPLS) */
25534         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS \
25535                 UINT32_C(0x6)
25536         /* VLAN */
25537         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN \
25538                 UINT32_C(0x7)
25539         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25540         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE \
25541                 UINT32_C(0x8)
25542         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25543         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4 \
25544                 UINT32_C(0x9)
25545         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25546         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE_V1 \
25547                 UINT32_C(0xa)
25548         /* Use fixed layer 2 ether type of 0xFFFF */
25549         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE \
25550                 UINT32_C(0xb)
25551         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25552         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6 \
25553                 UINT32_C(0xc)
25554         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST \
25555                 HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6
25556         uint8_t unused_0[3];
25557         /* This value is encap data used for the given encap type. */
25558         uint32_t        encap_data[20];
25559 } __attribute__((packed));
25560
25561 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
25562 struct hwrm_cfa_encap_record_alloc_output {
25563         /* The specific error status for the command. */
25564         uint16_t        error_code;
25565         /* The HWRM command request type. */
25566         uint16_t        req_type;
25567         /* The sequence ID from the original command. */
25568         uint16_t        seq_id;
25569         /* The length of the response data in number of bytes. */
25570         uint16_t        resp_len;
25571         /* This value is an opaque id into CFA data structures. */
25572         uint32_t        encap_record_id;
25573         uint8_t unused_0[3];
25574         /*
25575          * This field is used in Output records to indicate that the output
25576          * is completely written to RAM.  This field should be read as '1'
25577          * to indicate that the output has been completely written.
25578          * When writing a command completion or response to an internal processor,
25579          * the order of writes has to be such that this field is written last.
25580          */
25581         uint8_t valid;
25582 } __attribute__((packed));
25583
25584 /******************************
25585  * hwrm_cfa_encap_record_free *
25586  ******************************/
25587
25588
25589 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */
25590 struct hwrm_cfa_encap_record_free_input {
25591         /* The HWRM command request type. */
25592         uint16_t        req_type;
25593         /*
25594          * The completion ring to send the completion event on. This should
25595          * be the NQ ID returned from the `nq_alloc` HWRM command.
25596          */
25597         uint16_t        cmpl_ring;
25598         /*
25599          * The sequence ID is used by the driver for tracking multiple
25600          * commands. This ID is treated as opaque data by the firmware and
25601          * the value is returned in the `hwrm_resp_hdr` upon completion.
25602          */
25603         uint16_t        seq_id;
25604         /*
25605          * The target ID of the command:
25606          * * 0x0-0xFFF8 - The function ID
25607          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25608          * * 0xFFFD - Reserved for user-space HWRM interface
25609          * * 0xFFFF - HWRM
25610          */
25611         uint16_t        target_id;
25612         /*
25613          * A physical address pointer pointing to a host buffer that the
25614          * command's response data will be written. This can be either a host
25615          * physical address (HPA) or a guest physical address (GPA) and must
25616          * point to a physically contiguous block of memory.
25617          */
25618         uint64_t        resp_addr;
25619         /* This value is an opaque id into CFA data structures. */
25620         uint32_t        encap_record_id;
25621         uint8_t unused_0[4];
25622 } __attribute__((packed));
25623
25624 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
25625 struct hwrm_cfa_encap_record_free_output {
25626         /* The specific error status for the command. */
25627         uint16_t        error_code;
25628         /* The HWRM command request type. */
25629         uint16_t        req_type;
25630         /* The sequence ID from the original command. */
25631         uint16_t        seq_id;
25632         /* The length of the response data in number of bytes. */
25633         uint16_t        resp_len;
25634         uint8_t unused_0[7];
25635         /*
25636          * This field is used in Output records to indicate that the output
25637          * is completely written to RAM.  This field should be read as '1'
25638          * to indicate that the output has been completely written.
25639          * When writing a command completion or response to an internal processor,
25640          * the order of writes has to be such that this field is written last.
25641          */
25642         uint8_t valid;
25643 } __attribute__((packed));
25644
25645 /********************************
25646  * hwrm_cfa_ntuple_filter_alloc *
25647  ********************************/
25648
25649
25650 /* hwrm_cfa_ntuple_filter_alloc_input (size:1088b/136B) */
25651 struct hwrm_cfa_ntuple_filter_alloc_input {
25652         /* The HWRM command request type. */
25653         uint16_t        req_type;
25654         /*
25655          * The completion ring to send the completion event on. This should
25656          * be the NQ ID returned from the `nq_alloc` HWRM command.
25657          */
25658         uint16_t        cmpl_ring;
25659         /*
25660          * The sequence ID is used by the driver for tracking multiple
25661          * commands. This ID is treated as opaque data by the firmware and
25662          * the value is returned in the `hwrm_resp_hdr` upon completion.
25663          */
25664         uint16_t        seq_id;
25665         /*
25666          * The target ID of the command:
25667          * * 0x0-0xFFF8 - The function ID
25668          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25669          * * 0xFFFD - Reserved for user-space HWRM interface
25670          * * 0xFFFF - HWRM
25671          */
25672         uint16_t        target_id;
25673         /*
25674          * A physical address pointer pointing to a host buffer that the
25675          * command's response data will be written. This can be either a host
25676          * physical address (HPA) or a guest physical address (GPA) and must
25677          * point to a physically contiguous block of memory.
25678          */
25679         uint64_t        resp_addr;
25680         uint32_t        flags;
25681         /* Setting of this flag indicates the applicability to the loopback path. */
25682         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
25683                 UINT32_C(0x1)
25684         /*
25685          * Setting of this flag indicates drop action. If this flag is not set,
25686          * then it should be considered accept action.
25687          */
25688         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP \
25689                 UINT32_C(0x2)
25690         /*
25691          * Setting of this flag indicates that a meter is expected to be attached
25692          * to this flow. This hint can be used when choosing the action record
25693          * format required for the flow.
25694          */
25695         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER \
25696                 UINT32_C(0x4)
25697         /*
25698          * Setting of this flag indicates that the dest_id field contains function ID.
25699          * If this is not set it indicates dest_id is VNIC or VPORT.
25700          */
25701         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_FID \
25702                 UINT32_C(0x8)
25703         uint32_t        enables;
25704         /*
25705          * This bit must be '1' for the l2_filter_id field to be
25706          * configured.
25707          */
25708         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
25709                 UINT32_C(0x1)
25710         /*
25711          * This bit must be '1' for the ethertype field to be
25712          * configured.
25713          */
25714         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
25715                 UINT32_C(0x2)
25716         /*
25717          * This bit must be '1' for the tunnel_type field to be
25718          * configured.
25719          */
25720         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
25721                 UINT32_C(0x4)
25722         /*
25723          * This bit must be '1' for the src_macaddr field to be
25724          * configured.
25725          */
25726         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
25727                 UINT32_C(0x8)
25728         /*
25729          * This bit must be '1' for the ipaddr_type field to be
25730          * configured.
25731          */
25732         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
25733                 UINT32_C(0x10)
25734         /*
25735          * This bit must be '1' for the src_ipaddr field to be
25736          * configured.
25737          */
25738         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
25739                 UINT32_C(0x20)
25740         /*
25741          * This bit must be '1' for the src_ipaddr_mask field to be
25742          * configured.
25743          */
25744         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK \
25745                 UINT32_C(0x40)
25746         /*
25747          * This bit must be '1' for the dst_ipaddr field to be
25748          * configured.
25749          */
25750         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
25751                 UINT32_C(0x80)
25752         /*
25753          * This bit must be '1' for the dst_ipaddr_mask field to be
25754          * configured.
25755          */
25756         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK \
25757                 UINT32_C(0x100)
25758         /*
25759          * This bit must be '1' for the ip_protocol field to be
25760          * configured.
25761          */
25762         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
25763                 UINT32_C(0x200)
25764         /*
25765          * This bit must be '1' for the src_port field to be
25766          * configured.
25767          */
25768         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
25769                 UINT32_C(0x400)
25770         /*
25771          * This bit must be '1' for the src_port_mask field to be
25772          * configured.
25773          */
25774         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK \
25775                 UINT32_C(0x800)
25776         /*
25777          * This bit must be '1' for the dst_port field to be
25778          * configured.
25779          */
25780         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
25781                 UINT32_C(0x1000)
25782         /*
25783          * This bit must be '1' for the dst_port_mask field to be
25784          * configured.
25785          */
25786         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK \
25787                 UINT32_C(0x2000)
25788         /*
25789          * This bit must be '1' for the pri_hint field to be
25790          * configured.
25791          */
25792         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT \
25793                 UINT32_C(0x4000)
25794         /*
25795          * This bit must be '1' for the ntuple_filter_id field to be
25796          * configured.
25797          */
25798         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID \
25799                 UINT32_C(0x8000)
25800         /*
25801          * This bit must be '1' for the dst_id field to be
25802          * configured.
25803          */
25804         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
25805                 UINT32_C(0x10000)
25806         /*
25807          * This bit must be '1' for the mirror_vnic_id field to be
25808          * configured.
25809          */
25810         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
25811                 UINT32_C(0x20000)
25812         /*
25813          * This bit must be '1' for the dst_macaddr field to be
25814          * configured.
25815          */
25816         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
25817                 UINT32_C(0x40000)
25818         /*
25819          * This bit must be '1' for the rfs_ring_tbl_idx field to be
25820          * configured.
25821          */
25822         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_RFS_RING_TBL_IDX \
25823                 UINT32_C(0x80000)
25824         /*
25825          * This value identifies a set of CFA data structures used for an L2
25826          * context.
25827          */
25828         uint64_t        l2_filter_id;
25829         /*
25830          * This value indicates the source MAC address in
25831          * the Ethernet header.
25832          */
25833         uint8_t src_macaddr[6];
25834         /* This value indicates the ethertype in the Ethernet header. */
25835         uint16_t        ethertype;
25836         /*
25837          * This value indicates the type of IP address.
25838          * 4 - IPv4
25839          * 6 - IPv6
25840          * All others are invalid.
25841          */
25842         uint8_t ip_addr_type;
25843         /* invalid */
25844         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
25845                 UINT32_C(0x0)
25846         /* IPv4 */
25847         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
25848                 UINT32_C(0x4)
25849         /* IPv6 */
25850         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
25851                 UINT32_C(0x6)
25852         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
25853                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
25854         /*
25855          * The value of protocol filed in IP header.
25856          * Applies to UDP and TCP traffic.
25857          * 6 - TCP
25858          * 17 - UDP
25859          */
25860         uint8_t ip_protocol;
25861         /* invalid */
25862         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
25863                 UINT32_C(0x0)
25864         /* TCP */
25865         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
25866                 UINT32_C(0x6)
25867         /* UDP */
25868         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
25869                 UINT32_C(0x11)
25870         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
25871                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
25872         /*
25873          * If set, this value shall represent the
25874          * Logical VNIC ID of the destination VNIC for the RX
25875          * path and network port id of the destination port for
25876          * the TX path.
25877          */
25878         uint16_t        dst_id;
25879         /*
25880          * Logical VNIC ID of the VNIC where traffic is
25881          * mirrored.
25882          */
25883         uint16_t        mirror_vnic_id;
25884         /*
25885          * This value indicates the tunnel type for this filter.
25886          * If this field is not specified, then the filter shall
25887          * apply to both non-tunneled and tunneled packets.
25888          * If this field conflicts with the tunnel_type specified
25889          * in the l2_filter_id, then the HWRM shall return an
25890          * error for this command.
25891          */
25892         uint8_t tunnel_type;
25893         /* Non-tunnel */
25894         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
25895                 UINT32_C(0x0)
25896         /* Virtual eXtensible Local Area Network (VXLAN) */
25897         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
25898                 UINT32_C(0x1)
25899         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25900         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
25901                 UINT32_C(0x2)
25902         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25903         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
25904                 UINT32_C(0x3)
25905         /* IP in IP */
25906         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
25907                 UINT32_C(0x4)
25908         /* Generic Network Virtualization Encapsulation (Geneve) */
25909         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
25910                 UINT32_C(0x5)
25911         /* Multi-Protocol Lable Switching (MPLS) */
25912         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
25913                 UINT32_C(0x6)
25914         /* Stateless Transport Tunnel (STT) */
25915         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
25916                 UINT32_C(0x7)
25917         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25918         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
25919                 UINT32_C(0x8)
25920         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25921         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25922                 UINT32_C(0x9)
25923         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25924         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25925                 UINT32_C(0xa)
25926         /* Use fixed layer 2 ether type of 0xFFFF */
25927         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
25928                 UINT32_C(0xb)
25929         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25930         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25931                 UINT32_C(0xc)
25932         /* Any tunneled traffic */
25933         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25934                 UINT32_C(0xff)
25935         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
25936                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
25937         /*
25938          * This hint is provided to help in placing
25939          * the filter in the filter table.
25940          */
25941         uint8_t pri_hint;
25942         /* No preference */
25943         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
25944                 UINT32_C(0x0)
25945         /* Above the given filter */
25946         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE \
25947                 UINT32_C(0x1)
25948         /* Below the given filter */
25949         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW \
25950                 UINT32_C(0x2)
25951         /* As high as possible */
25952         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST \
25953                 UINT32_C(0x3)
25954         /* As low as possible */
25955         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST \
25956                 UINT32_C(0x4)
25957         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
25958                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
25959         /*
25960          * The value of source IP address to be used in filtering.
25961          * For IPv4, first four bytes represent the IP address.
25962          */
25963         uint32_t        src_ipaddr[4];
25964         /*
25965          * The value of source IP address mask to be used in
25966          * filtering.
25967          * For IPv4, first four bytes represent the IP address mask.
25968          */
25969         uint32_t        src_ipaddr_mask[4];
25970         /*
25971          * The value of destination IP address to be used in filtering.
25972          * For IPv4, first four bytes represent the IP address.
25973          */
25974         uint32_t        dst_ipaddr[4];
25975         /*
25976          * The value of destination IP address mask to be used in
25977          * filtering.
25978          * For IPv4, first four bytes represent the IP address mask.
25979          */
25980         uint32_t        dst_ipaddr_mask[4];
25981         /*
25982          * The value of source port to be used in filtering.
25983          * Applies to UDP and TCP traffic.
25984          */
25985         uint16_t        src_port;
25986         /*
25987          * The value of source port mask to be used in filtering.
25988          * Applies to UDP and TCP traffic.
25989          */
25990         uint16_t        src_port_mask;
25991         /*
25992          * The value of destination port to be used in filtering.
25993          * Applies to UDP and TCP traffic.
25994          */
25995         uint16_t        dst_port;
25996         /*
25997          * The value of destination port mask to be used in
25998          * filtering.
25999          * Applies to UDP and TCP traffic.
26000          */
26001         uint16_t        dst_port_mask;
26002         /*
26003          * This is the ID of the filter that goes along with
26004          * the pri_hint.
26005          */
26006         uint64_t        ntuple_filter_id_hint;
26007         /*
26008          * The value of rfs_ring_tbl_idx to be used for RFS for this filter.
26009          * This index is used in lieu of the RSS hash when selecting the
26010          * index into the RSS table to determine the rx ring.
26011          */
26012         uint16_t        rfs_ring_tbl_idx;
26013         uint8_t unused_0[6];
26014 } __attribute__((packed));
26015
26016 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
26017 struct hwrm_cfa_ntuple_filter_alloc_output {
26018         /* The specific error status for the command. */
26019         uint16_t        error_code;
26020         /* The HWRM command request type. */
26021         uint16_t        req_type;
26022         /* The sequence ID from the original command. */
26023         uint16_t        seq_id;
26024         /* The length of the response data in number of bytes. */
26025         uint16_t        resp_len;
26026         /* This value is an opaque id into CFA data structures. */
26027         uint64_t        ntuple_filter_id;
26028         /*
26029          * The flow id value in bit 0-29 is the actual ID of the flow
26030          * associated with this filter and it shall be used to match
26031          * and associate the flow identifier returned in completion
26032          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
26033          * shall indicate no valid flow id.
26034          */
26035         uint32_t        flow_id;
26036         /* Indicate the flow id value. */
26037         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
26038                 UINT32_C(0x3fffffff)
26039         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
26040         /* Indicate type of the flow. */
26041         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
26042                 UINT32_C(0x40000000)
26043         /*
26044          * If this bit set to 0, then it indicates that the flow is
26045          * internal flow.
26046          */
26047         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
26048                 (UINT32_C(0x0) << 30)
26049         /*
26050          * If this bit is set to 1, then it indicates that the flow is
26051          * external flow.
26052          */
26053         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
26054                 (UINT32_C(0x1) << 30)
26055         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
26056                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
26057         /* Indicate the flow direction. */
26058         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
26059                 UINT32_C(0x80000000)
26060         /* If this bit set to 0, then it indicates rx flow. */
26061         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
26062                 (UINT32_C(0x0) << 31)
26063         /* If this bit is set to 1, then it indicates that tx flow. */
26064         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
26065                 (UINT32_C(0x1) << 31)
26066         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
26067                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
26068         uint8_t unused_0[3];
26069         /*
26070          * This field is used in Output records to indicate that the output
26071          * is completely written to RAM.  This field should be read as '1'
26072          * to indicate that the output has been completely written.
26073          * When writing a command completion or response to an internal processor,
26074          * the order of writes has to be such that this field is written last.
26075          */
26076         uint8_t valid;
26077 } __attribute__((packed));
26078
26079 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
26080 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
26081         /*
26082          * command specific error codes that goes to
26083          * the cmd_err field in Common HWRM Error Response.
26084          */
26085         uint8_t code;
26086         /* Unknown error */
26087         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN \
26088                 UINT32_C(0x0)
26089         /* Unable to complete operation due to conflict with Rx Mask VLAN */
26090         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR \
26091                 UINT32_C(0x1)
26092         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST \
26093                 HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
26094         uint8_t unused_0[7];
26095 } __attribute__((packed));
26096
26097 /*******************************
26098  * hwrm_cfa_ntuple_filter_free *
26099  *******************************/
26100
26101
26102 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
26103 struct hwrm_cfa_ntuple_filter_free_input {
26104         /* The HWRM command request type. */
26105         uint16_t        req_type;
26106         /*
26107          * The completion ring to send the completion event on. This should
26108          * be the NQ ID returned from the `nq_alloc` HWRM command.
26109          */
26110         uint16_t        cmpl_ring;
26111         /*
26112          * The sequence ID is used by the driver for tracking multiple
26113          * commands. This ID is treated as opaque data by the firmware and
26114          * the value is returned in the `hwrm_resp_hdr` upon completion.
26115          */
26116         uint16_t        seq_id;
26117         /*
26118          * The target ID of the command:
26119          * * 0x0-0xFFF8 - The function ID
26120          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26121          * * 0xFFFD - Reserved for user-space HWRM interface
26122          * * 0xFFFF - HWRM
26123          */
26124         uint16_t        target_id;
26125         /*
26126          * A physical address pointer pointing to a host buffer that the
26127          * command's response data will be written. This can be either a host
26128          * physical address (HPA) or a guest physical address (GPA) and must
26129          * point to a physically contiguous block of memory.
26130          */
26131         uint64_t        resp_addr;
26132         /* This value is an opaque id into CFA data structures. */
26133         uint64_t        ntuple_filter_id;
26134 } __attribute__((packed));
26135
26136 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
26137 struct hwrm_cfa_ntuple_filter_free_output {
26138         /* The specific error status for the command. */
26139         uint16_t        error_code;
26140         /* The HWRM command request type. */
26141         uint16_t        req_type;
26142         /* The sequence ID from the original command. */
26143         uint16_t        seq_id;
26144         /* The length of the response data in number of bytes. */
26145         uint16_t        resp_len;
26146         uint8_t unused_0[7];
26147         /*
26148          * This field is used in Output records to indicate that the output
26149          * is completely written to RAM.  This field should be read as '1'
26150          * to indicate that the output has been completely written.
26151          * When writing a command completion or response to an internal processor,
26152          * the order of writes has to be such that this field is written last.
26153          */
26154         uint8_t valid;
26155 } __attribute__((packed));
26156
26157 /******************************
26158  * hwrm_cfa_ntuple_filter_cfg *
26159  ******************************/
26160
26161
26162 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
26163 struct hwrm_cfa_ntuple_filter_cfg_input {
26164         /* The HWRM command request type. */
26165         uint16_t        req_type;
26166         /*
26167          * The completion ring to send the completion event on. This should
26168          * be the NQ ID returned from the `nq_alloc` HWRM command.
26169          */
26170         uint16_t        cmpl_ring;
26171         /*
26172          * The sequence ID is used by the driver for tracking multiple
26173          * commands. This ID is treated as opaque data by the firmware and
26174          * the value is returned in the `hwrm_resp_hdr` upon completion.
26175          */
26176         uint16_t        seq_id;
26177         /*
26178          * The target ID of the command:
26179          * * 0x0-0xFFF8 - The function ID
26180          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26181          * * 0xFFFD - Reserved for user-space HWRM interface
26182          * * 0xFFFF - HWRM
26183          */
26184         uint16_t        target_id;
26185         /*
26186          * A physical address pointer pointing to a host buffer that the
26187          * command's response data will be written. This can be either a host
26188          * physical address (HPA) or a guest physical address (GPA) and must
26189          * point to a physically contiguous block of memory.
26190          */
26191         uint64_t        resp_addr;
26192         uint32_t        enables;
26193         /*
26194          * This bit must be '1' for the new_dst_id field to be
26195          * configured.
26196          */
26197         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID \
26198                 UINT32_C(0x1)
26199         /*
26200          * This bit must be '1' for the new_mirror_vnic_id field to be
26201          * configured.
26202          */
26203         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
26204                 UINT32_C(0x2)
26205         /*
26206          * This bit must be '1' for the new_meter_instance_id field to be
26207          * configured.
26208          */
26209         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
26210                 UINT32_C(0x4)
26211         uint32_t        flags;
26212         /*
26213          * Setting this bit to 1 indicates that dest_id field contains FID.
26214          * Setting this to 0 indicates that dest_id field contains VNIC or VPORT.
26215          */
26216         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_FID \
26217                 UINT32_C(0x1)
26218         /* This value is an opaque id into CFA data structures. */
26219         uint64_t        ntuple_filter_id;
26220         /*
26221          * If set, this value shall represent the new
26222          * Logical VNIC ID of the destination VNIC for the RX
26223          * path and new network port id of the destination port for
26224          * the TX path.
26225          */
26226         uint32_t        new_dst_id;
26227         /*
26228          * New Logical VNIC ID of the VNIC where traffic is
26229          * mirrored.
26230          */
26231         uint32_t        new_mirror_vnic_id;
26232         /*
26233          * New meter to attach to the flow. Specifying the
26234          * invalid instance ID is used to remove any existing
26235          * meter from the flow.
26236          */
26237         uint16_t        new_meter_instance_id;
26238         /*
26239          * A value of 0xfff is considered invalid and implies the
26240          * instance is not configured.
26241          */
26242         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
26243                 UINT32_C(0xffff)
26244         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \
26245                 HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
26246         uint8_t unused_1[6];
26247 } __attribute__((packed));
26248
26249 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
26250 struct hwrm_cfa_ntuple_filter_cfg_output {
26251         /* The specific error status for the command. */
26252         uint16_t        error_code;
26253         /* The HWRM command request type. */
26254         uint16_t        req_type;
26255         /* The sequence ID from the original command. */
26256         uint16_t        seq_id;
26257         /* The length of the response data in number of bytes. */
26258         uint16_t        resp_len;
26259         uint8_t unused_0[7];
26260         /*
26261          * This field is used in Output records to indicate that the output
26262          * is completely written to RAM.  This field should be read as '1'
26263          * to indicate that the output has been completely written.
26264          * When writing a command completion or response to an internal processor,
26265          * the order of writes has to be such that this field is written last.
26266          */
26267         uint8_t valid;
26268 } __attribute__((packed));
26269
26270 /**************************
26271  * hwrm_cfa_em_flow_alloc *
26272  **************************/
26273
26274
26275 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
26276 struct hwrm_cfa_em_flow_alloc_input {
26277         /* The HWRM command request type. */
26278         uint16_t        req_type;
26279         /*
26280          * The completion ring to send the completion event on. This should
26281          * be the NQ ID returned from the `nq_alloc` HWRM command.
26282          */
26283         uint16_t        cmpl_ring;
26284         /*
26285          * The sequence ID is used by the driver for tracking multiple
26286          * commands. This ID is treated as opaque data by the firmware and
26287          * the value is returned in the `hwrm_resp_hdr` upon completion.
26288          */
26289         uint16_t        seq_id;
26290         /*
26291          * The target ID of the command:
26292          * * 0x0-0xFFF8 - The function ID
26293          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26294          * * 0xFFFD - Reserved for user-space HWRM interface
26295          * * 0xFFFF - HWRM
26296          */
26297         uint16_t        target_id;
26298         /*
26299          * A physical address pointer pointing to a host buffer that the
26300          * command's response data will be written. This can be either a host
26301          * physical address (HPA) or a guest physical address (GPA) and must
26302          * point to a physically contiguous block of memory.
26303          */
26304         uint64_t        resp_addr;
26305         uint32_t        flags;
26306         /*
26307          * Enumeration denoting the RX, TX type of the resource.
26308          * This enumeration is used for resources that are similar for both
26309          * TX and RX paths of the chip.
26310          */
26311         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH         UINT32_C(0x1)
26312         /* tx path */
26313         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX        UINT32_C(0x0)
26314         /* rx path */
26315         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX        UINT32_C(0x1)
26316         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST \
26317                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
26318         /*
26319          * Setting of this flag indicates enabling of a byte counter for a given
26320          * flow.
26321          */
26322         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR     UINT32_C(0x2)
26323         /*
26324          * Setting of this flag indicates enabling of a packet counter for a given
26325          * flow.
26326          */
26327         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR      UINT32_C(0x4)
26328         /* Setting of this flag indicates de-capsulation action for the given flow. */
26329         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP        UINT32_C(0x8)
26330         /* Setting of this flag indicates encapsulation action for the given flow. */
26331         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP        UINT32_C(0x10)
26332         /*
26333          * Setting of this flag indicates drop action. If this flag is not set,
26334          * then it should be considered accept action.
26335          */
26336         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP         UINT32_C(0x20)
26337         /*
26338          * Setting of this flag indicates that a meter is expected to be attached
26339          * to this flow. This hint can be used when choosing the action record
26340          * format required for the flow.
26341          */
26342         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER        UINT32_C(0x40)
26343         uint32_t        enables;
26344         /*
26345          * This bit must be '1' for the l2_filter_id field to be
26346          * configured.
26347          */
26348         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
26349                 UINT32_C(0x1)
26350         /*
26351          * This bit must be '1' for the tunnel_type field to be
26352          * configured.
26353          */
26354         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
26355                 UINT32_C(0x2)
26356         /*
26357          * This bit must be '1' for the tunnel_id field to be
26358          * configured.
26359          */
26360         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID \
26361                 UINT32_C(0x4)
26362         /*
26363          * This bit must be '1' for the src_macaddr field to be
26364          * configured.
26365          */
26366         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR \
26367                 UINT32_C(0x8)
26368         /*
26369          * This bit must be '1' for the dst_macaddr field to be
26370          * configured.
26371          */
26372         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR \
26373                 UINT32_C(0x10)
26374         /*
26375          * This bit must be '1' for the ovlan_vid field to be
26376          * configured.
26377          */
26378         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID \
26379                 UINT32_C(0x20)
26380         /*
26381          * This bit must be '1' for the ivlan_vid field to be
26382          * configured.
26383          */
26384         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID \
26385                 UINT32_C(0x40)
26386         /*
26387          * This bit must be '1' for the ethertype field to be
26388          * configured.
26389          */
26390         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE \
26391                 UINT32_C(0x80)
26392         /*
26393          * This bit must be '1' for the src_ipaddr field to be
26394          * configured.
26395          */
26396         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR \
26397                 UINT32_C(0x100)
26398         /*
26399          * This bit must be '1' for the dst_ipaddr field to be
26400          * configured.
26401          */
26402         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR \
26403                 UINT32_C(0x200)
26404         /*
26405          * This bit must be '1' for the ipaddr_type field to be
26406          * configured.
26407          */
26408         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
26409                 UINT32_C(0x400)
26410         /*
26411          * This bit must be '1' for the ip_protocol field to be
26412          * configured.
26413          */
26414         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
26415                 UINT32_C(0x800)
26416         /*
26417          * This bit must be '1' for the src_port field to be
26418          * configured.
26419          */
26420         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT \
26421                 UINT32_C(0x1000)
26422         /*
26423          * This bit must be '1' for the dst_port field to be
26424          * configured.
26425          */
26426         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT \
26427                 UINT32_C(0x2000)
26428         /*
26429          * This bit must be '1' for the dst_id field to be
26430          * configured.
26431          */
26432         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID \
26433                 UINT32_C(0x4000)
26434         /*
26435          * This bit must be '1' for the mirror_vnic_id field to be
26436          * configured.
26437          */
26438         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
26439                 UINT32_C(0x8000)
26440         /*
26441          * This bit must be '1' for the encap_record_id field to be
26442          * configured.
26443          */
26444         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID \
26445                 UINT32_C(0x10000)
26446         /*
26447          * This bit must be '1' for the meter_instance_id field to be
26448          * configured.
26449          */
26450         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID \
26451                 UINT32_C(0x20000)
26452         /*
26453          * This value identifies a set of CFA data structures used for an L2
26454          * context.
26455          */
26456         uint64_t        l2_filter_id;
26457         /* Tunnel Type. */
26458         uint8_t tunnel_type;
26459         /* Non-tunnel */
26460         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
26461                 UINT32_C(0x0)
26462         /* Virtual eXtensible Local Area Network (VXLAN) */
26463         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
26464                 UINT32_C(0x1)
26465         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
26466         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
26467                 UINT32_C(0x2)
26468         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
26469         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
26470                 UINT32_C(0x3)
26471         /* IP in IP */
26472         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
26473                 UINT32_C(0x4)
26474         /* Generic Network Virtualization Encapsulation (Geneve) */
26475         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
26476                 UINT32_C(0x5)
26477         /* Multi-Protocol Lable Switching (MPLS) */
26478         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
26479                 UINT32_C(0x6)
26480         /* Stateless Transport Tunnel (STT) */
26481         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
26482                 UINT32_C(0x7)
26483         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
26484         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
26485                 UINT32_C(0x8)
26486         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
26487         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
26488                 UINT32_C(0x9)
26489         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
26490         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
26491                 UINT32_C(0xa)
26492         /* Use fixed layer 2 ether type of 0xFFFF */
26493         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
26494                 UINT32_C(0xb)
26495         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
26496         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
26497                 UINT32_C(0xc)
26498         /* Any tunneled traffic */
26499         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
26500                 UINT32_C(0xff)
26501         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
26502                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
26503         uint8_t unused_0[3];
26504         /*
26505          * Tunnel identifier.
26506          * Virtual Network Identifier (VNI). Only valid with
26507          * tunnel_types VXLAN, NVGRE, and Geneve.
26508          * Only lower 24-bits of VNI field are used
26509          * in setting up the filter.
26510          */
26511         uint32_t        tunnel_id;
26512         /*
26513          * This value indicates the source MAC address in
26514          * the Ethernet header.
26515          */
26516         uint8_t src_macaddr[6];
26517         /* The meter instance to attach to the flow. */
26518         uint16_t        meter_instance_id;
26519         /*
26520          * A value of 0xfff is considered invalid and implies the
26521          * instance is not configured.
26522          */
26523         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID \
26524                 UINT32_C(0xffff)
26525         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST \
26526                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
26527         /*
26528          * This value indicates the destination MAC address in
26529          * the Ethernet header.
26530          */
26531         uint8_t dst_macaddr[6];
26532         /*
26533          * This value indicates the VLAN ID of the outer VLAN tag
26534          * in the Ethernet header.
26535          */
26536         uint16_t        ovlan_vid;
26537         /*
26538          * This value indicates the VLAN ID of the inner VLAN tag
26539          * in the Ethernet header.
26540          */
26541         uint16_t        ivlan_vid;
26542         /* This value indicates the ethertype in the Ethernet header. */
26543         uint16_t        ethertype;
26544         /*
26545          * This value indicates the type of IP address.
26546          * 4 - IPv4
26547          * 6 - IPv6
26548          * All others are invalid.
26549          */
26550         uint8_t ip_addr_type;
26551         /* invalid */
26552         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
26553         /* IPv4 */
26554         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4    UINT32_C(0x4)
26555         /* IPv6 */
26556         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6    UINT32_C(0x6)
26557         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
26558                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
26559         /*
26560          * The value of protocol filed in IP header.
26561          * Applies to UDP and TCP traffic.
26562          * 6 - TCP
26563          * 17 - UDP
26564          */
26565         uint8_t ip_protocol;
26566         /* invalid */
26567         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
26568         /* TCP */
26569         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP     UINT32_C(0x6)
26570         /* UDP */
26571         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP     UINT32_C(0x11)
26572         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST \
26573                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
26574         uint8_t unused_1[2];
26575         /*
26576          * The value of source IP address to be used in filtering.
26577          * For IPv4, first four bytes represent the IP address.
26578          */
26579         uint32_t        src_ipaddr[4];
26580         /*
26581          * big_endian = True
26582          *     The value of destination IP address to be used in filtering.
26583          *     For IPv4, first four bytes represent the IP address.
26584          */
26585         uint32_t        dst_ipaddr[4];
26586         /*
26587          * The value of source port to be used in filtering.
26588          * Applies to UDP and TCP traffic.
26589          */
26590         uint16_t        src_port;
26591         /*
26592          * The value of destination port to be used in filtering.
26593          * Applies to UDP and TCP traffic.
26594          */
26595         uint16_t        dst_port;
26596         /*
26597          * If set, this value shall represent the
26598          * Logical VNIC ID of the destination VNIC for the RX
26599          * path and network port id of the destination port for
26600          * the TX path.
26601          */
26602         uint16_t        dst_id;
26603         /*
26604          * Logical VNIC ID of the VNIC where traffic is
26605          * mirrored.
26606          */
26607         uint16_t        mirror_vnic_id;
26608         /* Logical ID of the encapsulation record. */
26609         uint32_t        encap_record_id;
26610         uint8_t unused_2[4];
26611 } __attribute__((packed));
26612
26613 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
26614 struct hwrm_cfa_em_flow_alloc_output {
26615         /* The specific error status for the command. */
26616         uint16_t        error_code;
26617         /* The HWRM command request type. */
26618         uint16_t        req_type;
26619         /* The sequence ID from the original command. */
26620         uint16_t        seq_id;
26621         /* The length of the response data in number of bytes. */
26622         uint16_t        resp_len;
26623         /* This value is an opaque id into CFA data structures. */
26624         uint64_t        em_filter_id;
26625         /*
26626          * The flow id value in bit 0-29 is the actual ID of the flow
26627          * associated with this filter and it shall be used to match
26628          * and associate the flow identifier returned in completion
26629          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
26630          * shall indicate no valid flow id.
26631          */
26632         uint32_t        flow_id;
26633         /* Indicate the flow id value. */
26634         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
26635                 UINT32_C(0x3fffffff)
26636         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
26637         /* Indicate type of the flow. */
26638         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
26639                 UINT32_C(0x40000000)
26640         /*
26641          * If this bit set to 0, then it indicates that the flow is
26642          * internal flow.
26643          */
26644         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
26645                 (UINT32_C(0x0) << 30)
26646         /*
26647          * If this bit is set to 1, then it indicates that the flow is
26648          * external flow.
26649          */
26650         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
26651                 (UINT32_C(0x1) << 30)
26652         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
26653                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
26654         /* Indicate the flow direction. */
26655         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
26656                 UINT32_C(0x80000000)
26657         /* If this bit set to 0, then it indicates rx flow. */
26658         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
26659                 (UINT32_C(0x0) << 31)
26660         /* If this bit is set to 1, then it indicates that tx flow. */
26661         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
26662                 (UINT32_C(0x1) << 31)
26663         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
26664                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
26665         uint8_t unused_0[3];
26666         /*
26667          * This field is used in Output records to indicate that the output
26668          * is completely written to RAM.  This field should be read as '1'
26669          * to indicate that the output has been completely written.
26670          * When writing a command completion or response to an internal processor,
26671          * the order of writes has to be such that this field is written last.
26672          */
26673         uint8_t valid;
26674 } __attribute__((packed));
26675
26676 /*************************
26677  * hwrm_cfa_em_flow_free *
26678  *************************/
26679
26680
26681 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
26682 struct hwrm_cfa_em_flow_free_input {
26683         /* The HWRM command request type. */
26684         uint16_t        req_type;
26685         /*
26686          * The completion ring to send the completion event on. This should
26687          * be the NQ ID returned from the `nq_alloc` HWRM command.
26688          */
26689         uint16_t        cmpl_ring;
26690         /*
26691          * The sequence ID is used by the driver for tracking multiple
26692          * commands. This ID is treated as opaque data by the firmware and
26693          * the value is returned in the `hwrm_resp_hdr` upon completion.
26694          */
26695         uint16_t        seq_id;
26696         /*
26697          * The target ID of the command:
26698          * * 0x0-0xFFF8 - The function ID
26699          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26700          * * 0xFFFD - Reserved for user-space HWRM interface
26701          * * 0xFFFF - HWRM
26702          */
26703         uint16_t        target_id;
26704         /*
26705          * A physical address pointer pointing to a host buffer that the
26706          * command's response data will be written. This can be either a host
26707          * physical address (HPA) or a guest physical address (GPA) and must
26708          * point to a physically contiguous block of memory.
26709          */
26710         uint64_t        resp_addr;
26711         /* This value is an opaque id into CFA data structures. */
26712         uint64_t        em_filter_id;
26713 } __attribute__((packed));
26714
26715 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
26716 struct hwrm_cfa_em_flow_free_output {
26717         /* The specific error status for the command. */
26718         uint16_t        error_code;
26719         /* The HWRM command request type. */
26720         uint16_t        req_type;
26721         /* The sequence ID from the original command. */
26722         uint16_t        seq_id;
26723         /* The length of the response data in number of bytes. */
26724         uint16_t        resp_len;
26725         uint8_t unused_0[7];
26726         /*
26727          * This field is used in Output records to indicate that the output
26728          * is completely written to RAM.  This field should be read as '1'
26729          * to indicate that the output has been completely written.
26730          * When writing a command completion or response to an internal processor,
26731          * the order of writes has to be such that this field is written last.
26732          */
26733         uint8_t valid;
26734 } __attribute__((packed));
26735
26736 /************************
26737  * hwrm_cfa_meter_qcaps *
26738  ************************/
26739
26740
26741 /* hwrm_cfa_meter_qcaps_input (size:128b/16B) */
26742 struct hwrm_cfa_meter_qcaps_input {
26743         /* The HWRM command request type. */
26744         uint16_t        req_type;
26745         /*
26746          * The completion ring to send the completion event on. This should
26747          * be the NQ ID returned from the `nq_alloc` HWRM command.
26748          */
26749         uint16_t        cmpl_ring;
26750         /*
26751          * The sequence ID is used by the driver for tracking multiple
26752          * commands. This ID is treated as opaque data by the firmware and
26753          * the value is returned in the `hwrm_resp_hdr` upon completion.
26754          */
26755         uint16_t        seq_id;
26756         /*
26757          * The target ID of the command:
26758          * * 0x0-0xFFF8 - The function ID
26759          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26760          * * 0xFFFD - Reserved for user-space HWRM interface
26761          * * 0xFFFF - HWRM
26762          */
26763         uint16_t        target_id;
26764         /*
26765          * A physical address pointer pointing to a host buffer that the
26766          * command's response data will be written. This can be either a host
26767          * physical address (HPA) or a guest physical address (GPA) and must
26768          * point to a physically contiguous block of memory.
26769          */
26770         uint64_t        resp_addr;
26771 } __attribute__((packed));
26772
26773 /* hwrm_cfa_meter_qcaps_output (size:320b/40B) */
26774 struct hwrm_cfa_meter_qcaps_output {
26775         /* The specific error status for the command. */
26776         uint16_t        error_code;
26777         /* The HWRM command request type. */
26778         uint16_t        req_type;
26779         /* The sequence ID from the original command. */
26780         uint16_t        seq_id;
26781         /* The length of the response data in number of bytes. */
26782         uint16_t        resp_len;
26783         uint32_t        flags;
26784         /*
26785          * Enumeration denoting the clock at which the Meter is running with.
26786          * This enumeration is used for resources that are similar for both
26787          * TX and RX paths of the chip.
26788          */
26789         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_MASK  UINT32_C(0xf)
26790         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_SFT   0
26791         /* 375 MHz */
26792         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_375MHZ  UINT32_C(0x0)
26793         /* 625 MHz */
26794         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ  UINT32_C(0x1)
26795         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_LAST \
26796                 HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ
26797         uint8_t unused_0[4];
26798         /*
26799          * The minimum guaranteed number of tx meter profiles supported
26800          * for this function.
26801          */
26802         uint16_t        min_tx_profile;
26803         /*
26804          * The maximum non-guaranteed number of tx meter profiles supported
26805          * for this function.
26806          */
26807         uint16_t        max_tx_profile;
26808         /*
26809          * The minimum guaranteed number of rx meter profiles supported
26810          * for this function.
26811          */
26812         uint16_t        min_rx_profile;
26813         /*
26814          * The maximum non-guaranteed number of rx meter profiles supported
26815          * for this function.
26816          */
26817         uint16_t        max_rx_profile;
26818         /*
26819          * The minimum guaranteed number of tx meter instances supported
26820          * for this function.
26821          */
26822         uint16_t        min_tx_instance;
26823         /*
26824          * The maximum non-guaranteed number of tx meter instances supported
26825          * for this function.
26826          */
26827         uint16_t        max_tx_instance;
26828         /*
26829          * The minimum guaranteed number of rx meter instances supported
26830          * for this function.
26831          */
26832         uint16_t        min_rx_instance;
26833         /*
26834          * The maximum non-guaranteed number of rx meter instances supported
26835          * for this function.
26836          */
26837         uint16_t        max_rx_instance;
26838         uint8_t unused_1[7];
26839         /*
26840          * This field is used in Output records to indicate that the output
26841          * is completely written to RAM.  This field should be read as '1'
26842          * to indicate that the output has been completely written.
26843          * When writing a command completion or response to an internal processor,
26844          * the order of writes has to be such that this field is written last.
26845          */
26846         uint8_t valid;
26847 } __attribute__((packed));
26848
26849 /********************************
26850  * hwrm_cfa_meter_profile_alloc *
26851  ********************************/
26852
26853
26854 /* hwrm_cfa_meter_profile_alloc_input (size:320b/40B) */
26855 struct hwrm_cfa_meter_profile_alloc_input {
26856         /* The HWRM command request type. */
26857         uint16_t        req_type;
26858         /*
26859          * The completion ring to send the completion event on. This should
26860          * be the NQ ID returned from the `nq_alloc` HWRM command.
26861          */
26862         uint16_t        cmpl_ring;
26863         /*
26864          * The sequence ID is used by the driver for tracking multiple
26865          * commands. This ID is treated as opaque data by the firmware and
26866          * the value is returned in the `hwrm_resp_hdr` upon completion.
26867          */
26868         uint16_t        seq_id;
26869         /*
26870          * The target ID of the command:
26871          * * 0x0-0xFFF8 - The function ID
26872          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26873          * * 0xFFFD - Reserved for user-space HWRM interface
26874          * * 0xFFFF - HWRM
26875          */
26876         uint16_t        target_id;
26877         /*
26878          * A physical address pointer pointing to a host buffer that the
26879          * command's response data will be written. This can be either a host
26880          * physical address (HPA) or a guest physical address (GPA) and must
26881          * point to a physically contiguous block of memory.
26882          */
26883         uint64_t        resp_addr;
26884         uint8_t flags;
26885         /*
26886          * Enumeration denoting the RX, TX type of the resource.
26887          * This enumeration is used for resources that are similar for both
26888          * TX and RX paths of the chip.
26889          */
26890         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH     UINT32_C(0x1)
26891         /* tx path */
26892         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX \
26893                 UINT32_C(0x0)
26894         /* rx path */
26895         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX \
26896                 UINT32_C(0x1)
26897         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST \
26898                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
26899         /* The meter algorithm type. */
26900         uint8_t meter_type;
26901         /* RFC 2697 (srTCM) */
26902         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 \
26903                 UINT32_C(0x0)
26904         /* RFC 2698 (trTCM) */
26905         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 \
26906                 UINT32_C(0x1)
26907         /* RFC 4115 (trTCM) */
26908         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 \
26909                 UINT32_C(0x2)
26910         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_LAST \
26911                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115
26912         /*
26913          * This field is reserved for the future use.
26914          * It shall be set to 0.
26915          */
26916         uint16_t        reserved1;
26917         /*
26918          * This field is reserved for the future use.
26919          * It shall be set to 0.
26920          */
26921         uint32_t        reserved2;
26922         /* A meter rate specified in bytes-per-second. */
26923         uint32_t        commit_rate;
26924         /* The bandwidth value. */
26925         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK \
26926                 UINT32_C(0xfffffff)
26927         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT \
26928                 0
26929         /* The granularity of the value (bits or bytes). */
26930         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE \
26931                 UINT32_C(0x10000000)
26932         /* Value is in bits. */
26933         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS \
26934                 (UINT32_C(0x0) << 28)
26935         /* Value is in bytes. */
26936         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES \
26937                 (UINT32_C(0x1) << 28)
26938         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST \
26939                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
26940         /* bw_value_unit is 3 b */
26941         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
26942                 UINT32_C(0xe0000000)
26943         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
26944                 29
26945         /* Value is in Mb or MB (base 10). */
26946         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
26947                 (UINT32_C(0x0) << 29)
26948         /* Value is in Kb or KB (base 10). */
26949         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
26950                 (UINT32_C(0x2) << 29)
26951         /* Value is in bits or bytes. */
26952         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
26953                 (UINT32_C(0x4) << 29)
26954         /* Value is in Gb or GB (base 10). */
26955         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
26956                 (UINT32_C(0x6) << 29)
26957         /* Value is in 1/100th of a percentage of total bandwidth. */
26958         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
26959                 (UINT32_C(0x1) << 29)
26960         /* Raw value */
26961         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
26962                 (UINT32_C(0x7) << 29)
26963         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
26964                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
26965         /* A meter burst size specified in bytes. */
26966         uint32_t        commit_burst;
26967         /* The bandwidth value. */
26968         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK \
26969                 UINT32_C(0xfffffff)
26970         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT \
26971                 0
26972         /* The granularity of the value (bits or bytes). */
26973         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE \
26974                 UINT32_C(0x10000000)
26975         /* Value is in bits. */
26976         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS \
26977                 (UINT32_C(0x0) << 28)
26978         /* Value is in bytes. */
26979         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES \
26980                 (UINT32_C(0x1) << 28)
26981         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST \
26982                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
26983         /* bw_value_unit is 3 b */
26984         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
26985                 UINT32_C(0xe0000000)
26986         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
26987                 29
26988         /* Value is in Mb or MB (base 10). */
26989         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
26990                 (UINT32_C(0x0) << 29)
26991         /* Value is in Kb or KB (base 10). */
26992         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
26993                 (UINT32_C(0x2) << 29)
26994         /* Value is in bits or bytes. */
26995         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
26996                 (UINT32_C(0x4) << 29)
26997         /* Value is in Gb or GB (base 10). */
26998         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
26999                 (UINT32_C(0x6) << 29)
27000         /* Value is in 1/100th of a percentage of total bandwidth. */
27001         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27002                 (UINT32_C(0x1) << 29)
27003         /* Invalid value */
27004         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
27005                 (UINT32_C(0x7) << 29)
27006         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
27007                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
27008         /* A meter rate specified in bytes-per-second. */
27009         uint32_t        excess_peak_rate;
27010         /* The bandwidth value. */
27011         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
27012                 UINT32_C(0xfffffff)
27013         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
27014                 0
27015         /* The granularity of the value (bits or bytes). */
27016         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE \
27017                 UINT32_C(0x10000000)
27018         /* Value is in bits. */
27019         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
27020                 (UINT32_C(0x0) << 28)
27021         /* Value is in bytes. */
27022         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
27023                 (UINT32_C(0x1) << 28)
27024         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
27025                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
27026         /* bw_value_unit is 3 b */
27027         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
27028                 UINT32_C(0xe0000000)
27029         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
27030                 29
27031         /* Value is in Mb or MB (base 10). */
27032         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
27033                 (UINT32_C(0x0) << 29)
27034         /* Value is in Kb or KB (base 10). */
27035         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
27036                 (UINT32_C(0x2) << 29)
27037         /* Value is in bits or bytes. */
27038         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
27039                 (UINT32_C(0x4) << 29)
27040         /* Value is in Gb or GB (base 10). */
27041         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
27042                 (UINT32_C(0x6) << 29)
27043         /* Value is in 1/100th of a percentage of total bandwidth. */
27044         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
27045                 (UINT32_C(0x1) << 29)
27046         /* Raw unit */
27047         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
27048                 (UINT32_C(0x7) << 29)
27049         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
27050                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
27051         /* A meter burst size specified in bytes. */
27052         uint32_t        excess_peak_burst;
27053         /* The bandwidth value. */
27054         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
27055                 UINT32_C(0xfffffff)
27056         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
27057                 0
27058         /* The granularity of the value (bits or bytes). */
27059         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE \
27060                 UINT32_C(0x10000000)
27061         /* Value is in bits. */
27062         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
27063                 (UINT32_C(0x0) << 28)
27064         /* Value is in bytes. */
27065         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
27066                 (UINT32_C(0x1) << 28)
27067         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
27068                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
27069         /* bw_value_unit is 3 b */
27070         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
27071                 UINT32_C(0xe0000000)
27072         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
27073                 29
27074         /* Value is in Mb or MB (base 10). */
27075         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
27076                 (UINT32_C(0x0) << 29)
27077         /* Value is in Kb or KB (base 10). */
27078         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
27079                 (UINT32_C(0x2) << 29)
27080         /* Value is in bits or bytes. */
27081         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
27082                 (UINT32_C(0x4) << 29)
27083         /* Value is in Gb or GB (base 10). */
27084         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
27085                 (UINT32_C(0x6) << 29)
27086         /* Value is in 1/100th of a percentage of total bandwidth. */
27087         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27088                 (UINT32_C(0x1) << 29)
27089         /* Invalid unit */
27090         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
27091                 (UINT32_C(0x7) << 29)
27092         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
27093                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
27094 } __attribute__((packed));
27095
27096 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
27097 struct hwrm_cfa_meter_profile_alloc_output {
27098         /* The specific error status for the command. */
27099         uint16_t        error_code;
27100         /* The HWRM command request type. */
27101         uint16_t        req_type;
27102         /* The sequence ID from the original command. */
27103         uint16_t        seq_id;
27104         /* The length of the response data in number of bytes. */
27105         uint16_t        resp_len;
27106         /* This value identifies a meter profile in CFA. */
27107         uint16_t        meter_profile_id;
27108         /*
27109          * A value of 0xfff is considered invalid and implies the
27110          * profile is not configured.
27111          */
27112         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID \
27113                 UINT32_C(0xffff)
27114         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_LAST \
27115                 HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID
27116         uint8_t unused_0[5];
27117         /*
27118          * This field is used in Output records to indicate that the output
27119          * is completely written to RAM.  This field should be read as '1'
27120          * to indicate that the output has been completely written.
27121          * When writing a command completion or response to an internal processor,
27122          * the order of writes has to be such that this field is written last.
27123          */
27124         uint8_t valid;
27125 } __attribute__((packed));
27126
27127 /*******************************
27128  * hwrm_cfa_meter_profile_free *
27129  *******************************/
27130
27131
27132 /* hwrm_cfa_meter_profile_free_input (size:192b/24B) */
27133 struct hwrm_cfa_meter_profile_free_input {
27134         /* The HWRM command request type. */
27135         uint16_t        req_type;
27136         /*
27137          * The completion ring to send the completion event on. This should
27138          * be the NQ ID returned from the `nq_alloc` HWRM command.
27139          */
27140         uint16_t        cmpl_ring;
27141         /*
27142          * The sequence ID is used by the driver for tracking multiple
27143          * commands. This ID is treated as opaque data by the firmware and
27144          * the value is returned in the `hwrm_resp_hdr` upon completion.
27145          */
27146         uint16_t        seq_id;
27147         /*
27148          * The target ID of the command:
27149          * * 0x0-0xFFF8 - The function ID
27150          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27151          * * 0xFFFD - Reserved for user-space HWRM interface
27152          * * 0xFFFF - HWRM
27153          */
27154         uint16_t        target_id;
27155         /*
27156          * A physical address pointer pointing to a host buffer that the
27157          * command's response data will be written. This can be either a host
27158          * physical address (HPA) or a guest physical address (GPA) and must
27159          * point to a physically contiguous block of memory.
27160          */
27161         uint64_t        resp_addr;
27162         uint8_t flags;
27163         /*
27164          * Enumeration denoting the RX, TX type of the resource.
27165          * This enumeration is used for resources that are similar for both
27166          * TX and RX paths of the chip.
27167          */
27168         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
27169         /* tx path */
27170         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX \
27171                 UINT32_C(0x0)
27172         /* rx path */
27173         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX \
27174                 UINT32_C(0x1)
27175         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST \
27176                 HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
27177         uint8_t unused_0;
27178         /* This value identifies a meter profile in CFA. */
27179         uint16_t        meter_profile_id;
27180         /*
27181          * A value of 0xfff is considered invalid and implies the
27182          * profile is not configured.
27183          */
27184         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID \
27185                 UINT32_C(0xffff)
27186         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST \
27187                 HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
27188         uint8_t unused_1[4];
27189 } __attribute__((packed));
27190
27191 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
27192 struct hwrm_cfa_meter_profile_free_output {
27193         /* The specific error status for the command. */
27194         uint16_t        error_code;
27195         /* The HWRM command request type. */
27196         uint16_t        req_type;
27197         /* The sequence ID from the original command. */
27198         uint16_t        seq_id;
27199         /* The length of the response data in number of bytes. */
27200         uint16_t        resp_len;
27201         uint8_t unused_0[7];
27202         /*
27203          * This field is used in Output records to indicate that the output
27204          * is completely written to RAM.  This field should be read as '1'
27205          * to indicate that the output has been completely written.
27206          * When writing a command completion or response to an internal processor,
27207          * the order of writes has to be such that this field is written last.
27208          */
27209         uint8_t valid;
27210 } __attribute__((packed));
27211
27212 /******************************
27213  * hwrm_cfa_meter_profile_cfg *
27214  ******************************/
27215
27216
27217 /* hwrm_cfa_meter_profile_cfg_input (size:320b/40B) */
27218 struct hwrm_cfa_meter_profile_cfg_input {
27219         /* The HWRM command request type. */
27220         uint16_t        req_type;
27221         /*
27222          * The completion ring to send the completion event on. This should
27223          * be the NQ ID returned from the `nq_alloc` HWRM command.
27224          */
27225         uint16_t        cmpl_ring;
27226         /*
27227          * The sequence ID is used by the driver for tracking multiple
27228          * commands. This ID is treated as opaque data by the firmware and
27229          * the value is returned in the `hwrm_resp_hdr` upon completion.
27230          */
27231         uint16_t        seq_id;
27232         /*
27233          * The target ID of the command:
27234          * * 0x0-0xFFF8 - The function ID
27235          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27236          * * 0xFFFD - Reserved for user-space HWRM interface
27237          * * 0xFFFF - HWRM
27238          */
27239         uint16_t        target_id;
27240         /*
27241          * A physical address pointer pointing to a host buffer that the
27242          * command's response data will be written. This can be either a host
27243          * physical address (HPA) or a guest physical address (GPA) and must
27244          * point to a physically contiguous block of memory.
27245          */
27246         uint64_t        resp_addr;
27247         uint8_t flags;
27248         /*
27249          * Enumeration denoting the RX, TX type of the resource.
27250          * This enumeration is used for resources that are similar for both
27251          * TX and RX paths of the chip.
27252          */
27253         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
27254         /* tx path */
27255         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
27256         /* rx path */
27257         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
27258         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST \
27259                 HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
27260         /* The meter algorithm type. */
27261         uint8_t meter_type;
27262         /* RFC 2697 (srTCM) */
27263         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 \
27264                 UINT32_C(0x0)
27265         /* RFC 2698 (trTCM) */
27266         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 \
27267                 UINT32_C(0x1)
27268         /* RFC 4115 (trTCM) */
27269         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 \
27270                 UINT32_C(0x2)
27271         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_LAST \
27272                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115
27273         /* This value identifies a meter profile in CFA. */
27274         uint16_t        meter_profile_id;
27275         /*
27276          * A value of 0xfff is considered invalid and implies the
27277          * profile is not configured.
27278          */
27279         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID \
27280                 UINT32_C(0xffff)
27281         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_LAST \
27282                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID
27283         /*
27284          * This field is reserved for the future use.
27285          * It shall be set to 0.
27286          */
27287         uint32_t        reserved;
27288         /* A meter rate specified in bytes-per-second. */
27289         uint32_t        commit_rate;
27290         /* The bandwidth value. */
27291         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK \
27292                 UINT32_C(0xfffffff)
27293         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT \
27294                 0
27295         /* The granularity of the value (bits or bytes). */
27296         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE \
27297                 UINT32_C(0x10000000)
27298         /* Value is in bits. */
27299         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS \
27300                 (UINT32_C(0x0) << 28)
27301         /* Value is in bytes. */
27302         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES \
27303                 (UINT32_C(0x1) << 28)
27304         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST \
27305                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
27306         /* bw_value_unit is 3 b */
27307         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
27308                 UINT32_C(0xe0000000)
27309         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
27310                 29
27311         /* Value is in Mb or MB (base 10). */
27312         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
27313                 (UINT32_C(0x0) << 29)
27314         /* Value is in Kb or KB (base 10). */
27315         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
27316                 (UINT32_C(0x2) << 29)
27317         /* Value is in bits or bytes. */
27318         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
27319                 (UINT32_C(0x4) << 29)
27320         /* Value is in Gb or GB (base 10). */
27321         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
27322                 (UINT32_C(0x6) << 29)
27323         /* Value is in 1/100th of a percentage of total bandwidth. */
27324         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
27325                 (UINT32_C(0x1) << 29)
27326         /* Raw value */
27327         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
27328                 (UINT32_C(0x7) << 29)
27329         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
27330                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
27331         /* A meter burst size specified in bytes. */
27332         uint32_t        commit_burst;
27333         /* The bandwidth value. */
27334         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK \
27335                 UINT32_C(0xfffffff)
27336         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT \
27337                 0
27338         /* The granularity of the value (bits or bytes). */
27339         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE \
27340                 UINT32_C(0x10000000)
27341         /* Value is in bits. */
27342         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS \
27343                 (UINT32_C(0x0) << 28)
27344         /* Value is in bytes. */
27345         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES \
27346                 (UINT32_C(0x1) << 28)
27347         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST \
27348                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
27349         /* bw_value_unit is 3 b */
27350         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
27351                 UINT32_C(0xe0000000)
27352         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
27353                 29
27354         /* Value is in Mb or MB (base 10). */
27355         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
27356                 (UINT32_C(0x0) << 29)
27357         /* Value is in Kb or KB (base 10). */
27358         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
27359                 (UINT32_C(0x2) << 29)
27360         /* Value is in bits or bytes. */
27361         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
27362                 (UINT32_C(0x4) << 29)
27363         /* Value is in Gb or GB (base 10). */
27364         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
27365                 (UINT32_C(0x6) << 29)
27366         /* Value is in 1/100th of a percentage of total bandwidth. */
27367         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27368                 (UINT32_C(0x1) << 29)
27369         /* Invalid value */
27370         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
27371                 (UINT32_C(0x7) << 29)
27372         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
27373                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
27374         /* A meter rate specified in bytes-per-second. */
27375         uint32_t        excess_peak_rate;
27376         /* The bandwidth value. */
27377         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
27378                 UINT32_C(0xfffffff)
27379         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
27380                 0
27381         /* The granularity of the value (bits or bytes). */
27382         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE \
27383                 UINT32_C(0x10000000)
27384         /* Value is in bits. */
27385         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
27386                 (UINT32_C(0x0) << 28)
27387         /* Value is in bytes. */
27388         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
27389                 (UINT32_C(0x1) << 28)
27390         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
27391                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
27392         /* bw_value_unit is 3 b */
27393         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
27394                 UINT32_C(0xe0000000)
27395         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
27396                 29
27397         /* Value is in Mb or MB (base 10). */
27398         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
27399                 (UINT32_C(0x0) << 29)
27400         /* Value is in Kb or KB (base 10). */
27401         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
27402                 (UINT32_C(0x2) << 29)
27403         /* Value is in bits or bytes. */
27404         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
27405                 (UINT32_C(0x4) << 29)
27406         /* Value is in Gb or GB (base 10). */
27407         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
27408                 (UINT32_C(0x6) << 29)
27409         /* Value is in 1/100th of a percentage of total bandwidth. */
27410         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
27411                 (UINT32_C(0x1) << 29)
27412         /* Raw unit */
27413         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
27414                 (UINT32_C(0x7) << 29)
27415         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
27416                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
27417         /* A meter burst size specified in bytes. */
27418         uint32_t        excess_peak_burst;
27419         /* The bandwidth value. */
27420         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
27421                 UINT32_C(0xfffffff)
27422         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
27423                 0
27424         /* The granularity of the value (bits or bytes). */
27425         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE \
27426                 UINT32_C(0x10000000)
27427         /* Value is in bits. */
27428         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
27429                 (UINT32_C(0x0) << 28)
27430         /* Value is in bytes. */
27431         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
27432                 (UINT32_C(0x1) << 28)
27433         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
27434                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
27435         /* bw_value_unit is 3 b */
27436         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
27437                 UINT32_C(0xe0000000)
27438         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
27439                 29
27440         /* Value is in Mb or MB (base 10). */
27441         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
27442                 (UINT32_C(0x0) << 29)
27443         /* Value is in Kb or KB (base 10). */
27444         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
27445                 (UINT32_C(0x2) << 29)
27446         /* Value is in bits or bytes. */
27447         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
27448                 (UINT32_C(0x4) << 29)
27449         /* Value is in Gb or GB (base 10). */
27450         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
27451                 (UINT32_C(0x6) << 29)
27452         /* Value is in 1/100th of a percentage of total bandwidth. */
27453         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27454                 (UINT32_C(0x1) << 29)
27455         /* Invalid unit */
27456         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
27457                 (UINT32_C(0x7) << 29)
27458         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
27459                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
27460 } __attribute__((packed));
27461
27462 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
27463 struct hwrm_cfa_meter_profile_cfg_output {
27464         /* The specific error status for the command. */
27465         uint16_t        error_code;
27466         /* The HWRM command request type. */
27467         uint16_t        req_type;
27468         /* The sequence ID from the original command. */
27469         uint16_t        seq_id;
27470         /* The length of the response data in number of bytes. */
27471         uint16_t        resp_len;
27472         uint8_t unused_0[7];
27473         /*
27474          * This field is used in Output records to indicate that the output
27475          * is completely written to RAM.  This field should be read as '1'
27476          * to indicate that the output has been completely written.
27477          * When writing a command completion or response to an internal processor,
27478          * the order of writes has to be such that this field is written last.
27479          */
27480         uint8_t valid;
27481 } __attribute__((packed));
27482
27483 /*********************************
27484  * hwrm_cfa_meter_instance_alloc *
27485  *********************************/
27486
27487
27488 /* hwrm_cfa_meter_instance_alloc_input (size:192b/24B) */
27489 struct hwrm_cfa_meter_instance_alloc_input {
27490         /* The HWRM command request type. */
27491         uint16_t        req_type;
27492         /*
27493          * The completion ring to send the completion event on. This should
27494          * be the NQ ID returned from the `nq_alloc` HWRM command.
27495          */
27496         uint16_t        cmpl_ring;
27497         /*
27498          * The sequence ID is used by the driver for tracking multiple
27499          * commands. This ID is treated as opaque data by the firmware and
27500          * the value is returned in the `hwrm_resp_hdr` upon completion.
27501          */
27502         uint16_t        seq_id;
27503         /*
27504          * The target ID of the command:
27505          * * 0x0-0xFFF8 - The function ID
27506          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27507          * * 0xFFFD - Reserved for user-space HWRM interface
27508          * * 0xFFFF - HWRM
27509          */
27510         uint16_t        target_id;
27511         /*
27512          * A physical address pointer pointing to a host buffer that the
27513          * command's response data will be written. This can be either a host
27514          * physical address (HPA) or a guest physical address (GPA) and must
27515          * point to a physically contiguous block of memory.
27516          */
27517         uint64_t        resp_addr;
27518         uint8_t flags;
27519         /*
27520          * Enumeration denoting the RX, TX type of the resource.
27521          * This enumeration is used for resources that are similar for both
27522          * TX and RX paths of the chip.
27523          */
27524         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH \
27525                 UINT32_C(0x1)
27526         /* tx path */
27527         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX \
27528                 UINT32_C(0x0)
27529         /* rx path */
27530         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX \
27531                 UINT32_C(0x1)
27532         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST \
27533                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
27534         uint8_t unused_0;
27535         /* This value identifies a meter profile in CFA. */
27536         uint16_t        meter_profile_id;
27537         /*
27538          * A value of 0xffff is considered invalid and implies the
27539          * profile is not configured.
27540          */
27541         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID \
27542                 UINT32_C(0xffff)
27543         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST \
27544                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
27545         uint8_t unused_1[4];
27546 } __attribute__((packed));
27547
27548 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
27549 struct hwrm_cfa_meter_instance_alloc_output {
27550         /* The specific error status for the command. */
27551         uint16_t        error_code;
27552         /* The HWRM command request type. */
27553         uint16_t        req_type;
27554         /* The sequence ID from the original command. */
27555         uint16_t        seq_id;
27556         /* The length of the response data in number of bytes. */
27557         uint16_t        resp_len;
27558         /* This value identifies a meter instance in CFA. */
27559         uint16_t        meter_instance_id;
27560         /*
27561          * A value of 0xffff is considered invalid and implies the
27562          * instance is not configured.
27563          */
27564         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID \
27565                 UINT32_C(0xffff)
27566         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_LAST \
27567                 HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID
27568         uint8_t unused_0[5];
27569         /*
27570          * This field is used in Output records to indicate that the output
27571          * is completely written to RAM.  This field should be read as '1'
27572          * to indicate that the output has been completely written.
27573          * When writing a command completion or response to an internal processor,
27574          * the order of writes has to be such that this field is written last.
27575          */
27576         uint8_t valid;
27577 } __attribute__((packed));
27578
27579 /*******************************
27580  * hwrm_cfa_meter_instance_cfg *
27581  *******************************/
27582
27583
27584 /* hwrm_cfa_meter_instance_cfg_input (size:192b/24B) */
27585 struct hwrm_cfa_meter_instance_cfg_input {
27586         /* The HWRM command request type. */
27587         uint16_t        req_type;
27588         /*
27589          * The completion ring to send the completion event on. This should
27590          * be the NQ ID returned from the `nq_alloc` HWRM command.
27591          */
27592         uint16_t        cmpl_ring;
27593         /*
27594          * The sequence ID is used by the driver for tracking multiple
27595          * commands. This ID is treated as opaque data by the firmware and
27596          * the value is returned in the `hwrm_resp_hdr` upon completion.
27597          */
27598         uint16_t        seq_id;
27599         /*
27600          * The target ID of the command:
27601          * * 0x0-0xFFF8 - The function ID
27602          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27603          * * 0xFFFD - Reserved for user-space HWRM interface
27604          * * 0xFFFF - HWRM
27605          */
27606         uint16_t        target_id;
27607         /*
27608          * A physical address pointer pointing to a host buffer that the
27609          * command's response data will be written. This can be either a host
27610          * physical address (HPA) or a guest physical address (GPA) and must
27611          * point to a physically contiguous block of memory.
27612          */
27613         uint64_t        resp_addr;
27614         uint8_t flags;
27615         /*
27616          * Enumeration denoting the RX, TX type of the resource.
27617          * This enumeration is used for resources that are similar for both
27618          * TX and RX paths of the chip.
27619          */
27620         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
27621         /* tx path */
27622         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_TX \
27623                 UINT32_C(0x0)
27624         /* rx path */
27625         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX \
27626                 UINT32_C(0x1)
27627         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_LAST \
27628                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX
27629         uint8_t unused_0;
27630         /*
27631          * This value identifies a new meter profile to be associated with
27632          * the meter instance specified in this command.
27633          */
27634         uint16_t        meter_profile_id;
27635         /*
27636          * A value of 0xffff is considered invalid and implies the
27637          * profile is not configured.
27638          */
27639         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID \
27640                 UINT32_C(0xffff)
27641         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_LAST \
27642                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID
27643         /*
27644          * This value identifies the ID of a meter instance that needs to be updated with
27645          * a new meter profile specified in this command.
27646          */
27647         uint16_t        meter_instance_id;
27648         uint8_t unused_1[2];
27649 } __attribute__((packed));
27650
27651 /* hwrm_cfa_meter_instance_cfg_output (size:128b/16B) */
27652 struct hwrm_cfa_meter_instance_cfg_output {
27653         /* The specific error status for the command. */
27654         uint16_t        error_code;
27655         /* The HWRM command request type. */
27656         uint16_t        req_type;
27657         /* The sequence ID from the original command. */
27658         uint16_t        seq_id;
27659         /* The length of the response data in number of bytes. */
27660         uint16_t        resp_len;
27661         uint8_t unused_0[7];
27662         /*
27663          * This field is used in Output records to indicate that the output
27664          * is completely written to RAM.  This field should be read as '1'
27665          * to indicate that the output has been completely written.
27666          * When writing a command completion or response to an internal processor,
27667          * the order of writes has to be such that this field is written last.
27668          */
27669         uint8_t valid;
27670 } __attribute__((packed));
27671
27672 /********************************
27673  * hwrm_cfa_meter_instance_free *
27674  ********************************/
27675
27676
27677 /* hwrm_cfa_meter_instance_free_input (size:192b/24B) */
27678 struct hwrm_cfa_meter_instance_free_input {
27679         /* The HWRM command request type. */
27680         uint16_t        req_type;
27681         /*
27682          * The completion ring to send the completion event on. This should
27683          * be the NQ ID returned from the `nq_alloc` HWRM command.
27684          */
27685         uint16_t        cmpl_ring;
27686         /*
27687          * The sequence ID is used by the driver for tracking multiple
27688          * commands. This ID is treated as opaque data by the firmware and
27689          * the value is returned in the `hwrm_resp_hdr` upon completion.
27690          */
27691         uint16_t        seq_id;
27692         /*
27693          * The target ID of the command:
27694          * * 0x0-0xFFF8 - The function ID
27695          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27696          * * 0xFFFD - Reserved for user-space HWRM interface
27697          * * 0xFFFF - HWRM
27698          */
27699         uint16_t        target_id;
27700         /*
27701          * A physical address pointer pointing to a host buffer that the
27702          * command's response data will be written. This can be either a host
27703          * physical address (HPA) or a guest physical address (GPA) and must
27704          * point to a physically contiguous block of memory.
27705          */
27706         uint64_t        resp_addr;
27707         uint8_t flags;
27708         /*
27709          * Enumeration denoting the RX, TX type of the resource.
27710          * This enumeration is used for resources that are similar for both
27711          * TX and RX paths of the chip.
27712          */
27713         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
27714         /* tx path */
27715         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX \
27716                 UINT32_C(0x0)
27717         /* rx path */
27718         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX \
27719                 UINT32_C(0x1)
27720         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST \
27721                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
27722         uint8_t unused_0;
27723         /* This value identifies a meter instance in CFA. */
27724         uint16_t        meter_instance_id;
27725         /*
27726          * A value of 0xfff is considered invalid and implies the
27727          * instance is not configured.
27728          */
27729         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID \
27730                 UINT32_C(0xffff)
27731         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST \
27732                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
27733         uint8_t unused_1[4];
27734 } __attribute__((packed));
27735
27736 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
27737 struct hwrm_cfa_meter_instance_free_output {
27738         /* The specific error status for the command. */
27739         uint16_t        error_code;
27740         /* The HWRM command request type. */
27741         uint16_t        req_type;
27742         /* The sequence ID from the original command. */
27743         uint16_t        seq_id;
27744         /* The length of the response data in number of bytes. */
27745         uint16_t        resp_len;
27746         uint8_t unused_0[7];
27747         /*
27748          * This field is used in Output records to indicate that the output
27749          * is completely written to RAM.  This field should be read as '1'
27750          * to indicate that the output has been completely written.
27751          * When writing a command completion or response to an internal processor,
27752          * the order of writes has to be such that this field is written last.
27753          */
27754         uint8_t valid;
27755 } __attribute__((packed));
27756
27757 /*******************************
27758  * hwrm_cfa_decap_filter_alloc *
27759  *******************************/
27760
27761
27762 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */
27763 struct hwrm_cfa_decap_filter_alloc_input {
27764         /* The HWRM command request type. */
27765         uint16_t        req_type;
27766         /*
27767          * The completion ring to send the completion event on. This should
27768          * be the NQ ID returned from the `nq_alloc` HWRM command.
27769          */
27770         uint16_t        cmpl_ring;
27771         /*
27772          * The sequence ID is used by the driver for tracking multiple
27773          * commands. This ID is treated as opaque data by the firmware and
27774          * the value is returned in the `hwrm_resp_hdr` upon completion.
27775          */
27776         uint16_t        seq_id;
27777         /*
27778          * The target ID of the command:
27779          * * 0x0-0xFFF8 - The function ID
27780          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27781          * * 0xFFFD - Reserved for user-space HWRM interface
27782          * * 0xFFFF - HWRM
27783          */
27784         uint16_t        target_id;
27785         /*
27786          * A physical address pointer pointing to a host buffer that the
27787          * command's response data will be written. This can be either a host
27788          * physical address (HPA) or a guest physical address (GPA) and must
27789          * point to a physically contiguous block of memory.
27790          */
27791         uint64_t        resp_addr;
27792         uint32_t        flags;
27793         /* ovs_tunnel is 1 b */
27794         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL \
27795                 UINT32_C(0x1)
27796         uint32_t        enables;
27797         /*
27798          * This bit must be '1' for the tunnel_type field to be
27799          * configured.
27800          */
27801         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
27802                 UINT32_C(0x1)
27803         /*
27804          * This bit must be '1' for the tunnel_id field to be
27805          * configured.
27806          */
27807         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID \
27808                 UINT32_C(0x2)
27809         /*
27810          * This bit must be '1' for the src_macaddr field to be
27811          * configured.
27812          */
27813         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
27814                 UINT32_C(0x4)
27815         /*
27816          * This bit must be '1' for the dst_macaddr field to be
27817          * configured.
27818          */
27819         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
27820                 UINT32_C(0x8)
27821         /*
27822          * This bit must be '1' for the ovlan_vid field to be
27823          * configured.
27824          */
27825         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID \
27826                 UINT32_C(0x10)
27827         /*
27828          * This bit must be '1' for the ivlan_vid field to be
27829          * configured.
27830          */
27831         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID \
27832                 UINT32_C(0x20)
27833         /*
27834          * This bit must be '1' for the t_ovlan_vid field to be
27835          * configured.
27836          */
27837         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID \
27838                 UINT32_C(0x40)
27839         /*
27840          * This bit must be '1' for the t_ivlan_vid field to be
27841          * configured.
27842          */
27843         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID \
27844                 UINT32_C(0x80)
27845         /*
27846          * This bit must be '1' for the ethertype field to be
27847          * configured.
27848          */
27849         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
27850                 UINT32_C(0x100)
27851         /*
27852          * This bit must be '1' for the src_ipaddr field to be
27853          * configured.
27854          */
27855         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
27856                 UINT32_C(0x200)
27857         /*
27858          * This bit must be '1' for the dst_ipaddr field to be
27859          * configured.
27860          */
27861         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
27862                 UINT32_C(0x400)
27863         /*
27864          * This bit must be '1' for the ipaddr_type field to be
27865          * configured.
27866          */
27867         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
27868                 UINT32_C(0x800)
27869         /*
27870          * This bit must be '1' for the ip_protocol field to be
27871          * configured.
27872          */
27873         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
27874                 UINT32_C(0x1000)
27875         /*
27876          * This bit must be '1' for the src_port field to be
27877          * configured.
27878          */
27879         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
27880                 UINT32_C(0x2000)
27881         /*
27882          * This bit must be '1' for the dst_port field to be
27883          * configured.
27884          */
27885         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
27886                 UINT32_C(0x4000)
27887         /*
27888          * This bit must be '1' for the dst_id field to be
27889          * configured.
27890          */
27891         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
27892                 UINT32_C(0x8000)
27893         /*
27894          * This bit must be '1' for the mirror_vnic_id field to be
27895          * configured.
27896          */
27897         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
27898                 UINT32_C(0x10000)
27899         /*
27900          * Tunnel identifier.
27901          * Virtual Network Identifier (VNI). Only valid with
27902          * tunnel_types VXLAN, NVGRE, and Geneve.
27903          * Only lower 24-bits of VNI field are used
27904          * in setting up the filter.
27905          */
27906         uint32_t        tunnel_id;
27907         /* Tunnel Type. */
27908         uint8_t tunnel_type;
27909         /* Non-tunnel */
27910         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
27911                 UINT32_C(0x0)
27912         /* Virtual eXtensible Local Area Network (VXLAN) */
27913         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
27914                 UINT32_C(0x1)
27915         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
27916         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
27917                 UINT32_C(0x2)
27918         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
27919         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
27920                 UINT32_C(0x3)
27921         /* IP in IP */
27922         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
27923                 UINT32_C(0x4)
27924         /* Generic Network Virtualization Encapsulation (Geneve) */
27925         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
27926                 UINT32_C(0x5)
27927         /* Multi-Protocol Lable Switching (MPLS) */
27928         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
27929                 UINT32_C(0x6)
27930         /* Stateless Transport Tunnel (STT) */
27931         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
27932                 UINT32_C(0x7)
27933         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
27934         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
27935                 UINT32_C(0x8)
27936         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
27937         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
27938                 UINT32_C(0x9)
27939         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
27940         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
27941                 UINT32_C(0xa)
27942         /* Use fixed layer 2 ether type of 0xFFFF */
27943         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
27944                 UINT32_C(0xb)
27945         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
27946         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
27947                 UINT32_C(0xc)
27948         /* Any tunneled traffic */
27949         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
27950                 UINT32_C(0xff)
27951         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
27952                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
27953         uint8_t unused_0;
27954         uint16_t        unused_1;
27955         /*
27956          * This value indicates the source MAC address in
27957          * the Ethernet header.
27958          */
27959         uint8_t src_macaddr[6];
27960         uint8_t unused_2[2];
27961         /*
27962          * This value indicates the destination MAC address in
27963          * the Ethernet header.
27964          */
27965         uint8_t dst_macaddr[6];
27966         /*
27967          * This value indicates the VLAN ID of the outer VLAN tag
27968          * in the Ethernet header.
27969          */
27970         uint16_t        ovlan_vid;
27971         /*
27972          * This value indicates the VLAN ID of the inner VLAN tag
27973          * in the Ethernet header.
27974          */
27975         uint16_t        ivlan_vid;
27976         /*
27977          * This value indicates the VLAN ID of the outer VLAN tag
27978          * in the tunnel Ethernet header.
27979          */
27980         uint16_t        t_ovlan_vid;
27981         /*
27982          * This value indicates the VLAN ID of the inner VLAN tag
27983          * in the tunnel Ethernet header.
27984          */
27985         uint16_t        t_ivlan_vid;
27986         /* This value indicates the ethertype in the Ethernet header. */
27987         uint16_t        ethertype;
27988         /*
27989          * This value indicates the type of IP address.
27990          * 4 - IPv4
27991          * 6 - IPv6
27992          * All others are invalid.
27993          */
27994         uint8_t ip_addr_type;
27995         /* invalid */
27996         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
27997                 UINT32_C(0x0)
27998         /* IPv4 */
27999         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
28000                 UINT32_C(0x4)
28001         /* IPv6 */
28002         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
28003                 UINT32_C(0x6)
28004         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
28005                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
28006         /*
28007          * The value of protocol filed in IP header.
28008          * Applies to UDP and TCP traffic.
28009          * 6 - TCP
28010          * 17 - UDP
28011          */
28012         uint8_t ip_protocol;
28013         /* invalid */
28014         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
28015                 UINT32_C(0x0)
28016         /* TCP */
28017         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
28018                 UINT32_C(0x6)
28019         /* UDP */
28020         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
28021                 UINT32_C(0x11)
28022         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
28023                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
28024         uint16_t        unused_3;
28025         uint32_t        unused_4;
28026         /*
28027          * The value of source IP address to be used in filtering.
28028          * For IPv4, first four bytes represent the IP address.
28029          */
28030         uint32_t        src_ipaddr[4];
28031         /*
28032          * The value of destination IP address to be used in filtering.
28033          * For IPv4, first four bytes represent the IP address.
28034          */
28035         uint32_t        dst_ipaddr[4];
28036         /*
28037          * The value of source port to be used in filtering.
28038          * Applies to UDP and TCP traffic.
28039          */
28040         uint16_t        src_port;
28041         /*
28042          * The value of destination port to be used in filtering.
28043          * Applies to UDP and TCP traffic.
28044          */
28045         uint16_t        dst_port;
28046         /*
28047          * If set, this value shall represent the
28048          * Logical VNIC ID of the destination VNIC for the RX
28049          * path.
28050          */
28051         uint16_t        dst_id;
28052         /*
28053          * If set, this value shall represent the L2 context that matches the L2
28054          * information of the decap filter.
28055          */
28056         uint16_t        l2_ctxt_ref_id;
28057 } __attribute__((packed));
28058
28059 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
28060 struct hwrm_cfa_decap_filter_alloc_output {
28061         /* The specific error status for the command. */
28062         uint16_t        error_code;
28063         /* The HWRM command request type. */
28064         uint16_t        req_type;
28065         /* The sequence ID from the original command. */
28066         uint16_t        seq_id;
28067         /* The length of the response data in number of bytes. */
28068         uint16_t        resp_len;
28069         /* This value is an opaque id into CFA data structures. */
28070         uint32_t        decap_filter_id;
28071         uint8_t unused_0[3];
28072         /*
28073          * This field is used in Output records to indicate that the output
28074          * is completely written to RAM.  This field should be read as '1'
28075          * to indicate that the output has been completely written.
28076          * When writing a command completion or response to an internal processor,
28077          * the order of writes has to be such that this field is written last.
28078          */
28079         uint8_t valid;
28080 } __attribute__((packed));
28081
28082 /******************************
28083  * hwrm_cfa_decap_filter_free *
28084  ******************************/
28085
28086
28087 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */
28088 struct hwrm_cfa_decap_filter_free_input {
28089         /* The HWRM command request type. */
28090         uint16_t        req_type;
28091         /*
28092          * The completion ring to send the completion event on. This should
28093          * be the NQ ID returned from the `nq_alloc` HWRM command.
28094          */
28095         uint16_t        cmpl_ring;
28096         /*
28097          * The sequence ID is used by the driver for tracking multiple
28098          * commands. This ID is treated as opaque data by the firmware and
28099          * the value is returned in the `hwrm_resp_hdr` upon completion.
28100          */
28101         uint16_t        seq_id;
28102         /*
28103          * The target ID of the command:
28104          * * 0x0-0xFFF8 - The function ID
28105          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28106          * * 0xFFFD - Reserved for user-space HWRM interface
28107          * * 0xFFFF - HWRM
28108          */
28109         uint16_t        target_id;
28110         /*
28111          * A physical address pointer pointing to a host buffer that the
28112          * command's response data will be written. This can be either a host
28113          * physical address (HPA) or a guest physical address (GPA) and must
28114          * point to a physically contiguous block of memory.
28115          */
28116         uint64_t        resp_addr;
28117         /* This value is an opaque id into CFA data structures. */
28118         uint32_t        decap_filter_id;
28119         uint8_t unused_0[4];
28120 } __attribute__((packed));
28121
28122 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
28123 struct hwrm_cfa_decap_filter_free_output {
28124         /* The specific error status for the command. */
28125         uint16_t        error_code;
28126         /* The HWRM command request type. */
28127         uint16_t        req_type;
28128         /* The sequence ID from the original command. */
28129         uint16_t        seq_id;
28130         /* The length of the response data in number of bytes. */
28131         uint16_t        resp_len;
28132         uint8_t unused_0[7];
28133         /*
28134          * This field is used in Output records to indicate that the output
28135          * is completely written to RAM.  This field should be read as '1'
28136          * to indicate that the output has been completely written.
28137          * When writing a command completion or response to an internal processor,
28138          * the order of writes has to be such that this field is written last.
28139          */
28140         uint8_t valid;
28141 } __attribute__((packed));
28142
28143 /***********************
28144  * hwrm_cfa_flow_alloc *
28145  ***********************/
28146
28147
28148 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */
28149 struct hwrm_cfa_flow_alloc_input {
28150         /* The HWRM command request type. */
28151         uint16_t        req_type;
28152         /*
28153          * The completion ring to send the completion event on. This should
28154          * be the NQ ID returned from the `nq_alloc` HWRM command.
28155          */
28156         uint16_t        cmpl_ring;
28157         /*
28158          * The sequence ID is used by the driver for tracking multiple
28159          * commands. This ID is treated as opaque data by the firmware and
28160          * the value is returned in the `hwrm_resp_hdr` upon completion.
28161          */
28162         uint16_t        seq_id;
28163         /*
28164          * The target ID of the command:
28165          * * 0x0-0xFFF8 - The function ID
28166          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28167          * * 0xFFFD - Reserved for user-space HWRM interface
28168          * * 0xFFFF - HWRM
28169          */
28170         uint16_t        target_id;
28171         /*
28172          * A physical address pointer pointing to a host buffer that the
28173          * command's response data will be written. This can be either a host
28174          * physical address (HPA) or a guest physical address (GPA) and must
28175          * point to a physically contiguous block of memory.
28176          */
28177         uint64_t        resp_addr;
28178         uint16_t        flags;
28179         /* tunnel is 1 b */
28180         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL \
28181                 UINT32_C(0x1)
28182         /* num_vlan is 2 b */
28183         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK \
28184                 UINT32_C(0x6)
28185         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT           1
28186         /* no tags */
28187         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE \
28188                 (UINT32_C(0x0) << 1)
28189         /* 1 tag */
28190         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE \
28191                 (UINT32_C(0x1) << 1)
28192         /* 2 tags */
28193         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO \
28194                 (UINT32_C(0x2) << 1)
28195         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST \
28196                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
28197         /* Enumeration denoting the Flow Type. */
28198         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK \
28199                 UINT32_C(0x38)
28200         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT           3
28201         /* L2 flow */
28202         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2 \
28203                 (UINT32_C(0x0) << 3)
28204         /* IPV4 flow */
28205         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4 \
28206                 (UINT32_C(0x1) << 3)
28207         /* IPV6 flow */
28208         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6 \
28209                 (UINT32_C(0x2) << 3)
28210         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST \
28211                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
28212         /*
28213          * when set to 1, indicates TX flow offload for function specified in src_fid and
28214          * the dst_fid should be set to invalid value. To indicate a VM to VM flow, both
28215          * of the path_tx and path_rx flags need to be set. For virtio vSwitch offload
28216          * case, the src_fid and dst_fid is set to the same fid value. For the SRIOV
28217          * vSwitch offload case, the src_fid and dst_fid must be set to the same VF FID
28218          * belong to the children VFs of the same PF to indicate VM to VM flow.
28219          */
28220         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX \
28221                 UINT32_C(0x40)
28222         /*
28223          * when set to 1, indicates RX flow offload for function specified in dst_fid and
28224          * the src_fid should be set to invalid value.
28225          */
28226         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX \
28227                 UINT32_C(0x80)
28228         /*
28229          * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan header is
28230          * required and the VXLAN VNI value is stored in the first 24 bits of the dmac field.
28231          * This flag is only valid when the flow direction is RX.
28232          */
28233         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI \
28234                 UINT32_C(0x100)
28235         /* Set to 1 to indicate vhost_id is specified in the outer_vlan_tci field. */
28236         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_VHOST_ID_USE_VLAN \
28237                 UINT32_C(0x200)
28238         /*
28239          * Tx Flow: vf fid.
28240          * Rx Flow: pf fid.
28241          */
28242         uint16_t        src_fid;
28243         /* Tunnel handle valid when tunnel flag is set. */
28244         uint32_t        tunnel_handle;
28245         uint16_t        action_flags;
28246         /*
28247          * Setting of this flag indicates drop action. If this flag is not set,
28248          * then it should be considered accept action.
28249          */
28250         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD \
28251                 UINT32_C(0x1)
28252         /* recycle is 1 b */
28253         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE \
28254                 UINT32_C(0x2)
28255         /*
28256          * Setting of this flag indicates drop action. If this flag is not set,
28257          * then it should be considered accept action.
28258          */
28259         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP \
28260                 UINT32_C(0x4)
28261         /* meter is 1 b */
28262         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER \
28263                 UINT32_C(0x8)
28264         /* tunnel is 1 b */
28265         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL \
28266                 UINT32_C(0x10)
28267         /* nat_src is 1 b */
28268         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC \
28269                 UINT32_C(0x20)
28270         /* nat_dest is 1 b */
28271         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST \
28272                 UINT32_C(0x40)
28273         /* nat_ipv4_address is 1 b */
28274         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS \
28275                 UINT32_C(0x80)
28276         /* l2_header_rewrite is 1 b */
28277         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE \
28278                 UINT32_C(0x100)
28279         /* ttl_decrement is 1 b */
28280         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT \
28281                 UINT32_C(0x200)
28282         /*
28283          * If set to 1 and flow direction is TX, it indicates decap of L2 header
28284          * and encap of tunnel header. If set to 1 and flow direction is RX, it
28285          * indicates decap of tunnel header and encap L2 header. The type of tunnel
28286          * is specified in the tunnel_type field.
28287          */
28288         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP \
28289                 UINT32_C(0x400)
28290         /* If set to 1, flow aging is enabled for this flow. */
28291         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FLOW_AGING_ENABLED \
28292                 UINT32_C(0x800)
28293         /*
28294          * If set to 1 an attempt will be made to try to offload this flow to the
28295          * most optimal flow table resource.  If set to 0, the flow will be
28296          * placed to the default flow table resource.
28297          */
28298         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_PRI_HINT \
28299                 UINT32_C(0x1000)
28300         /*
28301          * If set to 1 there will be no attempt to allocate an on-chip try to
28302          * offload this flow. If set to 0, which will keep compatibility with the
28303          * older drivers, will cause the FW to attempt to allocate an on-chip flow
28304          * counter for the newly created flow.  This will keep the existing behavior
28305          * with EM flows which always had an associated flow counter.
28306          */
28307         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NO_FLOW_COUNTER_ALLOC \
28308                 UINT32_C(0x2000)
28309         /*
28310          * Tx Flow: pf or vf fid.
28311          * Rx Flow: vf fid.
28312          */
28313         uint16_t        dst_fid;
28314         /* VLAN tpid, valid when push_vlan flag is set. */
28315         uint16_t        l2_rewrite_vlan_tpid;
28316         /* VLAN tci, valid when push_vlan flag is set. */
28317         uint16_t        l2_rewrite_vlan_tci;
28318         /* Meter id, valid when meter flag is set. */
28319         uint16_t        act_meter_id;
28320         /* Flow with the same l2 context tcam key. */
28321         uint16_t        ref_flow_handle;
28322         /* This value sets the match value for the ethertype. */
28323         uint16_t        ethertype;
28324         /* valid when num tags is 1 or 2. */
28325         uint16_t        outer_vlan_tci;
28326         /* This value sets the match value for the Destination MAC address. */
28327         uint16_t        dmac[3];
28328         /* valid when num tags is 2. */
28329         uint16_t        inner_vlan_tci;
28330         /* This value sets the match value for the Source MAC address. */
28331         uint16_t        smac[3];
28332         /* The bit length of destination IP address mask. */
28333         uint8_t ip_dst_mask_len;
28334         /* The bit length of source IP address mask. */
28335         uint8_t ip_src_mask_len;
28336         /* The value of destination IPv4/IPv6 address. */
28337         uint32_t        ip_dst[4];
28338         /* The source IPv4/IPv6 address. */
28339         uint32_t        ip_src[4];
28340         /*
28341          * The value of source port.
28342          * Applies to UDP and TCP traffic.
28343          */
28344         uint16_t        l4_src_port;
28345         /*
28346          * The value of source port mask.
28347          * Applies to UDP and TCP traffic.
28348          */
28349         uint16_t        l4_src_port_mask;
28350         /*
28351          * The value of destination port.
28352          * Applies to UDP and TCP traffic.
28353          */
28354         uint16_t        l4_dst_port;
28355         /*
28356          * The value of destination port mask.
28357          * Applies to UDP and TCP traffic.
28358          */
28359         uint16_t        l4_dst_port_mask;
28360         /*
28361          * NAT IPv4/6 address based on address type flag.
28362          * 0 values are ignored.
28363          */
28364         uint32_t        nat_ip_address[4];
28365         /* L2 header re-write Destination MAC address. */
28366         uint16_t        l2_rewrite_dmac[3];
28367         /*
28368          * The NAT source/destination port based on direction flag.
28369          * Applies to UDP and TCP traffic.
28370          * 0 values are ignored.
28371          */
28372         uint16_t        nat_port;
28373         /* L2 header re-write Source MAC address. */
28374         uint16_t        l2_rewrite_smac[3];
28375         /* The value of ip protocol. */
28376         uint8_t ip_proto;
28377         /* Tunnel Type. */
28378         uint8_t tunnel_type;
28379         /* Non-tunnel */
28380         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
28381                 UINT32_C(0x0)
28382         /* Virtual eXtensible Local Area Network (VXLAN) */
28383         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
28384                 UINT32_C(0x1)
28385         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
28386         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
28387                 UINT32_C(0x2)
28388         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
28389         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
28390                 UINT32_C(0x3)
28391         /* IP in IP */
28392         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
28393                 UINT32_C(0x4)
28394         /* Generic Network Virtualization Encapsulation (Geneve) */
28395         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
28396                 UINT32_C(0x5)
28397         /* Multi-Protocol Lable Switching (MPLS) */
28398         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
28399                 UINT32_C(0x6)
28400         /* Stateless Transport Tunnel (STT) */
28401         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
28402                 UINT32_C(0x7)
28403         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
28404         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
28405                 UINT32_C(0x8)
28406         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
28407         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
28408                 UINT32_C(0x9)
28409         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
28410         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
28411                 UINT32_C(0xa)
28412         /* Use fixed layer 2 ether type of 0xFFFF */
28413         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
28414                 UINT32_C(0xb)
28415         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
28416         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
28417                 UINT32_C(0xc)
28418         /* Any tunneled traffic */
28419         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
28420                 UINT32_C(0xff)
28421         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
28422                 HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
28423 } __attribute__((packed));
28424
28425 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
28426 struct hwrm_cfa_flow_alloc_output {
28427         /* The specific error status for the command. */
28428         uint16_t        error_code;
28429         /* The HWRM command request type. */
28430         uint16_t        req_type;
28431         /* The sequence ID from the original command. */
28432         uint16_t        seq_id;
28433         /* The length of the response data in number of bytes. */
28434         uint16_t        resp_len;
28435         /* Flow record index. */
28436         uint16_t        flow_handle;
28437         uint8_t unused_0[2];
28438         /*
28439          * The flow id value in bit 0-29 is the actual ID of the flow
28440          * associated with this filter and it shall be used to match
28441          * and associate the flow identifier returned in completion
28442          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
28443          * shall indicate no valid flow id.
28444          */
28445         uint32_t        flow_id;
28446         /* Indicate the flow id value. */
28447         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
28448                 UINT32_C(0x3fffffff)
28449         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
28450         /* Indicate type of the flow. */
28451         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
28452                 UINT32_C(0x40000000)
28453         /*
28454          * If this bit set to 0, then it indicates that the flow is
28455          * internal flow.
28456          */
28457         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
28458                 (UINT32_C(0x0) << 30)
28459         /*
28460          * If this bit is set to 1, then it indicates that the flow is
28461          * external flow.
28462          */
28463         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
28464                 (UINT32_C(0x1) << 30)
28465         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
28466                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
28467         /* Indicate the flow direction. */
28468         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
28469                 UINT32_C(0x80000000)
28470         /* If this bit set to 0, then it indicates rx flow. */
28471         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
28472                 (UINT32_C(0x0) << 31)
28473         /* If this bit is set to 1, then it indicates that tx flow. */
28474         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
28475                 (UINT32_C(0x1) << 31)
28476         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
28477                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
28478         /* This value identifies a set of CFA data structures used for a flow. */
28479         uint64_t        ext_flow_handle;
28480         uint32_t        flow_counter_id;
28481         uint8_t unused_1[3];
28482         /*
28483          * This field is used in Output records to indicate that the output
28484          * is completely written to RAM.  This field should be read as '1'
28485          * to indicate that the output has been completely written.
28486          * When writing a command completion or response to an internal processor,
28487          * the order of writes has to be such that this field is written last.
28488          */
28489         uint8_t valid;
28490 } __attribute__((packed));
28491
28492 /* hwrm_cfa_flow_alloc_cmd_err (size:64b/8B) */
28493 struct hwrm_cfa_flow_alloc_cmd_err {
28494         /*
28495          * command specific error codes that goes to
28496          * the cmd_err field in Common HWRM Error Response.
28497          */
28498         uint8_t code;
28499         /* Unknown error */
28500         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_UNKNOWN         UINT32_C(0x0)
28501         /* No more L2 Context TCAM */
28502         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_L2_CONTEXT_TCAM UINT32_C(0x1)
28503         /* No more action records */
28504         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_ACTION_RECORD   UINT32_C(0x2)
28505         /* No more flow counters */
28506         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_COUNTER    UINT32_C(0x3)
28507         /* No more wild-card TCAM */
28508         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_WILD_CARD_TCAM  UINT32_C(0x4)
28509         /* Hash collsion in exact match tables */
28510         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_HASH_COLLISION  UINT32_C(0x5)
28511         /* Key is already installed */
28512         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_KEY_EXISTS      UINT32_C(0x6)
28513         /* Flow Context DB is out of resource */
28514         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB    UINT32_C(0x7)
28515         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_LAST \
28516                 HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB
28517         uint8_t unused_0[7];
28518 } __attribute__((packed));
28519
28520 /**********************
28521  * hwrm_cfa_flow_free *
28522  **********************/
28523
28524
28525 /* hwrm_cfa_flow_free_input (size:256b/32B) */
28526 struct hwrm_cfa_flow_free_input {
28527         /* The HWRM command request type. */
28528         uint16_t        req_type;
28529         /*
28530          * The completion ring to send the completion event on. This should
28531          * be the NQ ID returned from the `nq_alloc` HWRM command.
28532          */
28533         uint16_t        cmpl_ring;
28534         /*
28535          * The sequence ID is used by the driver for tracking multiple
28536          * commands. This ID is treated as opaque data by the firmware and
28537          * the value is returned in the `hwrm_resp_hdr` upon completion.
28538          */
28539         uint16_t        seq_id;
28540         /*
28541          * The target ID of the command:
28542          * * 0x0-0xFFF8 - The function ID
28543          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28544          * * 0xFFFD - Reserved for user-space HWRM interface
28545          * * 0xFFFF - HWRM
28546          */
28547         uint16_t        target_id;
28548         /*
28549          * A physical address pointer pointing to a host buffer that the
28550          * command's response data will be written. This can be either a host
28551          * physical address (HPA) or a guest physical address (GPA) and must
28552          * point to a physically contiguous block of memory.
28553          */
28554         uint64_t        resp_addr;
28555         /* Flow record index. */
28556         uint16_t        flow_handle;
28557         uint16_t        unused_0;
28558         /* Flow counter id to be freed. */
28559         uint32_t        flow_counter_id;
28560         /* This value identifies a set of CFA data structures used for a flow. */
28561         uint64_t        ext_flow_handle;
28562 } __attribute__((packed));
28563
28564 /* hwrm_cfa_flow_free_output (size:256b/32B) */
28565 struct hwrm_cfa_flow_free_output {
28566         /* The specific error status for the command. */
28567         uint16_t        error_code;
28568         /* The HWRM command request type. */
28569         uint16_t        req_type;
28570         /* The sequence ID from the original command. */
28571         uint16_t        seq_id;
28572         /* The length of the response data in number of bytes. */
28573         uint16_t        resp_len;
28574         /* packet is 64 b */
28575         uint64_t        packet;
28576         /* byte is 64 b */
28577         uint64_t        byte;
28578         uint8_t unused_0[7];
28579         /*
28580          * This field is used in Output records to indicate that the output
28581          * is completely written to RAM.  This field should be read as '1'
28582          * to indicate that the output has been completely written.
28583          * When writing a command completion or response to an internal processor,
28584          * the order of writes has to be such that this field is written last.
28585          */
28586         uint8_t valid;
28587 } __attribute__((packed));
28588
28589 /* hwrm_cfa_flow_action_data (size:960b/120B) */
28590 struct hwrm_cfa_flow_action_data {
28591         uint16_t        action_flags;
28592         /* Setting of this flag indicates accept action. */
28593         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FWD \
28594                 UINT32_C(0x1)
28595         /* Setting of this flag indicates recycle action. */
28596         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_RECYCLE \
28597                 UINT32_C(0x2)
28598         /* Setting of this flag indicates drop action. */
28599         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DROP \
28600                 UINT32_C(0x4)
28601         /* Setting of this flag indicates meter action. */
28602         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_METER \
28603                 UINT32_C(0x8)
28604         /* Setting of this flag indicates tunnel action. */
28605         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL \
28606                 UINT32_C(0x10)
28607         /*
28608          * If set to 1 and flow direction is TX, it indicates decap of L2 header
28609          * and encap of tunnel header. If set to 1 and flow direction is RX, it
28610          * indicates decap of tunnel header and encap L2 header.
28611          */
28612         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL_IP \
28613                 UINT32_C(0x20)
28614         /* Setting of this flag indicates ttl decrement action. */
28615         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TTL_DECREMENT \
28616                 UINT32_C(0x40)
28617         /* If set to 1, flow aging is enabled for this flow. */
28618         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FLOW_AGING_ENABLED \
28619                 UINT32_C(0x80)
28620         /* Setting of this flag indicates encap action.. */
28621         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_ENCAP \
28622                 UINT32_C(0x100)
28623         /* Setting of this flag indicates decap action.. */
28624         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DECAP \
28625                 UINT32_C(0x200)
28626         /* Meter id. */
28627         uint16_t        act_meter_id;
28628         /* VNIC id. */
28629         uint16_t        vnic_id;
28630         /* vport number. */
28631         uint16_t        vport_id;
28632         /* The NAT source/destination. */
28633         uint16_t        nat_port;
28634         uint16_t        unused_0[3];
28635         /* NAT IPv4/IPv6 address. */
28636         uint32_t        nat_ip_address[4];
28637         /* Encapsulation Type. */
28638         uint8_t encap_type;
28639         /* Virtual eXtensible Local Area Network (VXLAN) */
28640         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN        UINT32_C(0x1)
28641         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
28642         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_NVGRE        UINT32_C(0x2)
28643         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
28644         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2GRE        UINT32_C(0x3)
28645         /* IP in IP */
28646         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPIP         UINT32_C(0x4)
28647         /* Generic Network Virtualization Encapsulation (Geneve) */
28648         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_GENEVE       UINT32_C(0x5)
28649         /* Multi-Protocol Lable Switching (MPLS) */
28650         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_MPLS         UINT32_C(0x6)
28651         /* VLAN */
28652         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VLAN         UINT32_C(0x7)
28653         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
28654         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE        UINT32_C(0x8)
28655         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
28656         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_V4     UINT32_C(0x9)
28657         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
28658         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE_V1     UINT32_C(0xa)
28659         /* Use fixed layer 2 ether type of 0xFFFF */
28660         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2_ETYPE     UINT32_C(0xb)
28661         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
28662         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
28663         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_LAST \
28664                 HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6
28665         uint8_t unused[7];
28666         /* This value is encap data for the associated encap type. */
28667         uint32_t        encap_data[20];
28668 } __attribute__((packed));
28669
28670 /* hwrm_cfa_flow_tunnel_hdr_data (size:64b/8B) */
28671 struct hwrm_cfa_flow_tunnel_hdr_data {
28672         /* Tunnel Type. */
28673         uint8_t tunnel_type;
28674         /* Non-tunnel */
28675         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NONTUNNEL \
28676                 UINT32_C(0x0)
28677         /* Virtual eXtensible Local Area Network (VXLAN) */
28678         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN \
28679                 UINT32_C(0x1)
28680         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
28681         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NVGRE \
28682                 UINT32_C(0x2)
28683         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
28684         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2GRE \
28685                 UINT32_C(0x3)
28686         /* IP in IP */
28687         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPIP \
28688                 UINT32_C(0x4)
28689         /* Generic Network Virtualization Encapsulation (Geneve) */
28690         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_GENEVE \
28691                 UINT32_C(0x5)
28692         /* Multi-Protocol Lable Switching (MPLS) */
28693         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_MPLS \
28694                 UINT32_C(0x6)
28695         /* Stateless Transport Tunnel (STT) */
28696         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_STT \
28697                 UINT32_C(0x7)
28698         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
28699         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE \
28700                 UINT32_C(0x8)
28701         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
28702         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_V4 \
28703                 UINT32_C(0x9)
28704         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
28705         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE_V1 \
28706                 UINT32_C(0xa)
28707         /* Use fixed layer 2 ether type of 0xFFFF */
28708         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2_ETYPE \
28709                 UINT32_C(0xb)
28710         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
28711         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE_V6 \
28712                 UINT32_C(0xc)
28713         /* Any tunneled traffic */
28714         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL \
28715                 UINT32_C(0xff)
28716         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_LAST \
28717                 HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL
28718         uint8_t unused[3];
28719         /*
28720          * Tunnel identifier.
28721          * Virtual Network Identifier (VNI).
28722          */
28723         uint32_t        tunnel_id;
28724 } __attribute__((packed));
28725
28726 /* hwrm_cfa_flow_l4_key_data (size:64b/8B) */
28727 struct hwrm_cfa_flow_l4_key_data {
28728         /* The value of source port. */
28729         uint16_t        l4_src_port;
28730         /* The value of destination port. */
28731         uint16_t        l4_dst_port;
28732         uint32_t        unused;
28733 } __attribute__((packed));
28734
28735 /* hwrm_cfa_flow_l3_key_data (size:512b/64B) */
28736 struct hwrm_cfa_flow_l3_key_data {
28737         /* The value of ip protocol. */
28738         uint8_t ip_protocol;
28739         uint8_t unused_0[7];
28740         /* The value of destination IPv4/IPv6 address. */
28741         uint32_t        ip_dst[4];
28742         /* The source IPv4/IPv6 address. */
28743         uint32_t        ip_src[4];
28744         /* NAT IPv4/IPv6 address. */
28745         uint32_t        nat_ip_address[4];
28746         uint32_t        unused[2];
28747 } __attribute__((packed));
28748
28749 /* hwrm_cfa_flow_l2_key_data (size:448b/56B) */
28750 struct hwrm_cfa_flow_l2_key_data {
28751         /* Destination MAC address. */
28752         uint16_t        dmac[3];
28753         uint16_t        unused_0;
28754         /* Source MAC address. */
28755         uint16_t        smac[3];
28756         uint16_t        unused_1;
28757         /* L2 header re-write Destination MAC address. */
28758         uint16_t        l2_rewrite_dmac[3];
28759         uint16_t        unused_2;
28760         /* L2 header re-write Source MAC address. */
28761         uint16_t        l2_rewrite_smac[3];
28762         /* Ethertype. */
28763         uint16_t        ethertype;
28764         /* Number of VLAN tags. */
28765         uint16_t        num_vlan_tags;
28766         /* VLAN tpid. */
28767         uint16_t        l2_rewrite_vlan_tpid;
28768         /* VLAN tci. */
28769         uint16_t        l2_rewrite_vlan_tci;
28770         uint8_t unused_3[2];
28771         /* Outer VLAN TPID. */
28772         uint16_t        ovlan_tpid;
28773         /* Outer VLAN TCI. */
28774         uint16_t        ovlan_tci;
28775         /* Inner VLAN TPID. */
28776         uint16_t        ivlan_tpid;
28777         /* Inner VLAN TCI. */
28778         uint16_t        ivlan_tci;
28779         uint8_t unused[8];
28780 } __attribute__((packed));
28781
28782 /* hwrm_cfa_flow_key_data (size:4160b/520B) */
28783 struct hwrm_cfa_flow_key_data {
28784         /* Flow associated tunnel L2 header key info. */
28785         uint32_t        t_l2_key_data[14];
28786         /* Flow associated tunnel L2 header mask info. */
28787         uint32_t        t_l2_key_mask[14];
28788         /* Flow associated tunnel L3 header key info. */
28789         uint32_t        t_l3_key_data[16];
28790         /* Flow associated tunnel L3 header mask info. */
28791         uint32_t        t_l3_key_mask[16];
28792         /* Flow associated tunnel L4 header key info. */
28793         uint32_t        t_l4_key_data[2];
28794         /* Flow associated tunnel L4 header mask info. */
28795         uint32_t        t_l4_key_mask[2];
28796         /* Flow associated tunnel header info. */
28797         uint32_t        tunnel_hdr[2];
28798         /* Flow associated L2 header key info. */
28799         uint32_t        l2_key_data[14];
28800         /* Flow associated L2 header mask info. */
28801         uint32_t        l2_key_mask[14];
28802         /* Flow associated L3 header key info. */
28803         uint32_t        l3_key_data[16];
28804         /* Flow associated L3 header mask info. */
28805         uint32_t        l3_key_mask[16];
28806         /* Flow associated L4 header key info. */
28807         uint32_t        l4_key_data[2];
28808         /* Flow associated L4 header mask info. */
28809         uint32_t        l4_key_mask[2];
28810 } __attribute__((packed));
28811
28812 /**********************
28813  * hwrm_cfa_flow_info *
28814  **********************/
28815
28816
28817 /* hwrm_cfa_flow_info_input (size:256b/32B) */
28818 struct hwrm_cfa_flow_info_input {
28819         /* The HWRM command request type. */
28820         uint16_t        req_type;
28821         /*
28822          * The completion ring to send the completion event on. This should
28823          * be the NQ ID returned from the `nq_alloc` HWRM command.
28824          */
28825         uint16_t        cmpl_ring;
28826         /*
28827          * The sequence ID is used by the driver for tracking multiple
28828          * commands. This ID is treated as opaque data by the firmware and
28829          * the value is returned in the `hwrm_resp_hdr` upon completion.
28830          */
28831         uint16_t        seq_id;
28832         /*
28833          * The target ID of the command:
28834          * * 0x0-0xFFF8 - The function ID
28835          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28836          * * 0xFFFD - Reserved for user-space HWRM interface
28837          * * 0xFFFF - HWRM
28838          */
28839         uint16_t        target_id;
28840         /*
28841          * A physical address pointer pointing to a host buffer that the
28842          * command's response data will be written. This can be either a host
28843          * physical address (HPA) or a guest physical address (GPA) and must
28844          * point to a physically contiguous block of memory.
28845          */
28846         uint64_t        resp_addr;
28847         /* Flow record index. */
28848         uint16_t        flow_handle;
28849         /* Max flow handle */
28850         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK \
28851                 UINT32_C(0xfff)
28852         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_SFT        0
28853         /* CNP flow handle */
28854         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT \
28855                 UINT32_C(0x1000)
28856         /* RoCEv1 flow handle */
28857         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT \
28858                 UINT32_C(0x2000)
28859         /* RoCEv2 flow handle */
28860         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT \
28861                 UINT32_C(0x4000)
28862         /* Direction rx = 1 */
28863         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX \
28864                 UINT32_C(0x8000)
28865         uint8_t unused_0[6];
28866         /* This value identifies a set of CFA data structures used for a flow. */
28867         uint64_t        ext_flow_handle;
28868 } __attribute__((packed));
28869
28870 /* hwrm_cfa_flow_info_output (size:5632b/704B) */
28871 struct hwrm_cfa_flow_info_output {
28872         /* The specific error status for the command. */
28873         uint16_t        error_code;
28874         /* The HWRM command request type. */
28875         uint16_t        req_type;
28876         /* The sequence ID from the original command. */
28877         uint16_t        seq_id;
28878         /* The length of the response data in number of bytes. */
28879         uint16_t        resp_len;
28880         uint8_t flags;
28881         /* When set to 1, indicates the configuration is the TX flow. */
28882         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_TX     UINT32_C(0x1)
28883         /* When set to 1, indicates the configuration is the RX flow. */
28884         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_RX     UINT32_C(0x2)
28885         /* profile is 8 b */
28886         uint8_t profile;
28887         /* src_fid is 16 b */
28888         uint16_t        src_fid;
28889         /* dst_fid is 16 b */
28890         uint16_t        dst_fid;
28891         /* l2_ctxt_id is 16 b */
28892         uint16_t        l2_ctxt_id;
28893         /* em_info is 64 b */
28894         uint64_t        em_info;
28895         /* tcam_info is 64 b */
28896         uint64_t        tcam_info;
28897         /* vfp_tcam_info is 64 b */
28898         uint64_t        vfp_tcam_info;
28899         /* ar_id is 16 b */
28900         uint16_t        ar_id;
28901         /* flow_handle is 16 b */
28902         uint16_t        flow_handle;
28903         /* tunnel_handle is 32 b */
28904         uint32_t        tunnel_handle;
28905         /* The flow aging timer for the flow, the unit is 100 milliseconds */
28906         uint16_t        flow_timer;
28907         uint8_t unused_0[6];
28908         /* Flow associated L2, L3 and L4 headers info. */
28909         uint32_t        flow_key_data[130];
28910         /* Flow associated action record info. */
28911         uint32_t        flow_action_info[30];
28912         uint8_t unused_1[7];
28913         /*
28914          * This field is used in Output records to indicate that the output
28915          * is completely written to RAM.  This field should be read as '1'
28916          * to indicate that the output has been completely written.
28917          * When writing a command completion or response to an internal processor,
28918          * the order of writes has to be such that this field is written last.
28919          */
28920         uint8_t valid;
28921 } __attribute__((packed));
28922
28923 /***********************
28924  * hwrm_cfa_flow_flush *
28925  ***********************/
28926
28927
28928 /* hwrm_cfa_flow_flush_input (size:256b/32B) */
28929 struct hwrm_cfa_flow_flush_input {
28930         /* The HWRM command request type. */
28931         uint16_t        req_type;
28932         /*
28933          * The completion ring to send the completion event on. This should
28934          * be the NQ ID returned from the `nq_alloc` HWRM command.
28935          */
28936         uint16_t        cmpl_ring;
28937         /*
28938          * The sequence ID is used by the driver for tracking multiple
28939          * commands. This ID is treated as opaque data by the firmware and
28940          * the value is returned in the `hwrm_resp_hdr` upon completion.
28941          */
28942         uint16_t        seq_id;
28943         /*
28944          * The target ID of the command:
28945          * * 0x0-0xFFF8 - The function ID
28946          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28947          * * 0xFFFD - Reserved for user-space HWRM interface
28948          * * 0xFFFF - HWRM
28949          */
28950         uint16_t        target_id;
28951         /*
28952          * A physical address pointer pointing to a host buffer that the
28953          * command's response data will be written. This can be either a host
28954          * physical address (HPA) or a guest physical address (GPA) and must
28955          * point to a physically contiguous block of memory.
28956          */
28957         uint64_t        resp_addr;
28958         /* flags is 32 b */
28959         uint32_t        flags;
28960         /*
28961          * Set to 1 to indicate the page size, page layers, and flow_handle_table_dma_addr
28962          * fields are valid. The flow flush operation should only flush the flows from the
28963          * flow table specified. This flag is set to 0 by older driver. For older firmware,
28964          * setting this flag has no effect.
28965          */
28966         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_TABLE_VALID \
28967                 UINT32_C(0x1)
28968         /*
28969          * Set to 1 to indicate flow flush operation to cleanup all the flows, meters, CFA
28970          * context memory tables..etc.  This flag is set to 0 by older driver. For older firmware,
28971          * setting this flag has no effect.
28972          */
28973         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_ALL \
28974                 UINT32_C(0x2)
28975         /*
28976          * Set to 1 to indicate flow flush operation to cleanup all the flows by the caller.
28977          * This flag is set to 0 by older driver. For older firmware, setting this flag has no effect.
28978          */
28979         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_PORT \
28980                 UINT32_C(0x4)
28981         /* Set to 1 to indicate the flow counter IDs are included in the flow table. */
28982         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_INCL_FC \
28983                 UINT32_C(0x8000000)
28984         /*
28985          * This specifies the size of flow handle entries provided by the driver
28986          * in the flow table specified below. Only two flow handle size enums are defined.
28987          */
28988         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_MASK \
28989                 UINT32_C(0xc0000000)
28990         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_SFT \
28991                 30
28992         /* The flow handle is 16bit */
28993         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_16BIT \
28994                 (UINT32_C(0x0) << 30)
28995         /* The flow handle is 64bit */
28996         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT \
28997                 (UINT32_C(0x1) << 30)
28998         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_LAST \
28999                 HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT
29000         /* Specify page size of the flow table memory. */
29001         uint8_t page_size;
29002         /* The page size is 4K */
29003         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
29004         /* The page size is 8K */
29005         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
29006         /* The page size is 64K */
29007         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
29008         /* The page size is 256K */
29009         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
29010         /* The page size is 1M */
29011         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
29012         /* The page size is 2M */
29013         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
29014         /* The page size is 4M */
29015         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
29016         /* The page size is 1G */
29017         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
29018         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_LAST \
29019                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G
29020         /* FLow table memory indirect levels. */
29021         uint8_t page_level;
29022         /* PBL pointer is physical start address. */
29023         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
29024         /* PBL pointer points to PTE table. */
29025         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
29026         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
29027         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
29028         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LAST \
29029                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2
29030         /* number of flows in the flow table */
29031         uint16_t        num_flows;
29032         /* Pointer to the PBL, or PDL depending on number of levels */
29033         uint64_t        page_dir;
29034 } __attribute__((packed));
29035
29036 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
29037 struct hwrm_cfa_flow_flush_output {
29038         /* The specific error status for the command. */
29039         uint16_t        error_code;
29040         /* The HWRM command request type. */
29041         uint16_t        req_type;
29042         /* The sequence ID from the original command. */
29043         uint16_t        seq_id;
29044         /* The length of the response data in number of bytes. */
29045         uint16_t        resp_len;
29046         uint8_t unused_0[7];
29047         /*
29048          * This field is used in Output records to indicate that the output
29049          * is completely written to RAM.  This field should be read as '1'
29050          * to indicate that the output has been completely written.
29051          * When writing a command completion or response to an internal processor,
29052          * the order of writes has to be such that this field is written last.
29053          */
29054         uint8_t valid;
29055 } __attribute__((packed));
29056
29057 /***********************
29058  * hwrm_cfa_flow_stats *
29059  ***********************/
29060
29061
29062 /* hwrm_cfa_flow_stats_input (size:640b/80B) */
29063 struct hwrm_cfa_flow_stats_input {
29064         /* The HWRM command request type. */
29065         uint16_t        req_type;
29066         /*
29067          * The completion ring to send the completion event on. This should
29068          * be the NQ ID returned from the `nq_alloc` HWRM command.
29069          */
29070         uint16_t        cmpl_ring;
29071         /*
29072          * The sequence ID is used by the driver for tracking multiple
29073          * commands. This ID is treated as opaque data by the firmware and
29074          * the value is returned in the `hwrm_resp_hdr` upon completion.
29075          */
29076         uint16_t        seq_id;
29077         /*
29078          * The target ID of the command:
29079          * * 0x0-0xFFF8 - The function ID
29080          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29081          * * 0xFFFD - Reserved for user-space HWRM interface
29082          * * 0xFFFF - HWRM
29083          */
29084         uint16_t        target_id;
29085         /*
29086          * A physical address pointer pointing to a host buffer that the
29087          * command's response data will be written. This can be either a host
29088          * physical address (HPA) or a guest physical address (GPA) and must
29089          * point to a physically contiguous block of memory.
29090          */
29091         uint64_t        resp_addr;
29092         /* Flow handle. */
29093         uint16_t        num_flows;
29094         /* Flow handle. */
29095         uint16_t        flow_handle_0;
29096         /* Flow handle. */
29097         uint16_t        flow_handle_1;
29098         /* Flow handle. */
29099         uint16_t        flow_handle_2;
29100         /* Flow handle. */
29101         uint16_t        flow_handle_3;
29102         /* Flow handle. */
29103         uint16_t        flow_handle_4;
29104         /* Flow handle. */
29105         uint16_t        flow_handle_5;
29106         /* Flow handle. */
29107         uint16_t        flow_handle_6;
29108         /* Flow handle. */
29109         uint16_t        flow_handle_7;
29110         /* Flow handle. */
29111         uint16_t        flow_handle_8;
29112         /* Flow handle. */
29113         uint16_t        flow_handle_9;
29114         uint8_t unused_0[2];
29115         /* Flow ID of a flow. */
29116         uint32_t        flow_id_0;
29117         /* Flow ID of a flow. */
29118         uint32_t        flow_id_1;
29119         /* Flow ID of a flow. */
29120         uint32_t        flow_id_2;
29121         /* Flow ID of a flow. */
29122         uint32_t        flow_id_3;
29123         /* Flow ID of a flow. */
29124         uint32_t        flow_id_4;
29125         /* Flow ID of a flow. */
29126         uint32_t        flow_id_5;
29127         /* Flow ID of a flow. */
29128         uint32_t        flow_id_6;
29129         /* Flow ID of a flow. */
29130         uint32_t        flow_id_7;
29131         /* Flow ID of a flow. */
29132         uint32_t        flow_id_8;
29133         /* Flow ID of a flow. */
29134         uint32_t        flow_id_9;
29135 } __attribute__((packed));
29136
29137 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
29138 struct hwrm_cfa_flow_stats_output {
29139         /* The specific error status for the command. */
29140         uint16_t        error_code;
29141         /* The HWRM command request type. */
29142         uint16_t        req_type;
29143         /* The sequence ID from the original command. */
29144         uint16_t        seq_id;
29145         /* The length of the response data in number of bytes. */
29146         uint16_t        resp_len;
29147         /* packet_0 is 64 b */
29148         uint64_t        packet_0;
29149         /* packet_1 is 64 b */
29150         uint64_t        packet_1;
29151         /* packet_2 is 64 b */
29152         uint64_t        packet_2;
29153         /* packet_3 is 64 b */
29154         uint64_t        packet_3;
29155         /* packet_4 is 64 b */
29156         uint64_t        packet_4;
29157         /* packet_5 is 64 b */
29158         uint64_t        packet_5;
29159         /* packet_6 is 64 b */
29160         uint64_t        packet_6;
29161         /* packet_7 is 64 b */
29162         uint64_t        packet_7;
29163         /* packet_8 is 64 b */
29164         uint64_t        packet_8;
29165         /* packet_9 is 64 b */
29166         uint64_t        packet_9;
29167         /* byte_0 is 64 b */
29168         uint64_t        byte_0;
29169         /* byte_1 is 64 b */
29170         uint64_t        byte_1;
29171         /* byte_2 is 64 b */
29172         uint64_t        byte_2;
29173         /* byte_3 is 64 b */
29174         uint64_t        byte_3;
29175         /* byte_4 is 64 b */
29176         uint64_t        byte_4;
29177         /* byte_5 is 64 b */
29178         uint64_t        byte_5;
29179         /* byte_6 is 64 b */
29180         uint64_t        byte_6;
29181         /* byte_7 is 64 b */
29182         uint64_t        byte_7;
29183         /* byte_8 is 64 b */
29184         uint64_t        byte_8;
29185         /* byte_9 is 64 b */
29186         uint64_t        byte_9;
29187         uint8_t unused_0[7];
29188         /*
29189          * This field is used in Output records to indicate that the output
29190          * is completely written to RAM.  This field should be read as '1'
29191          * to indicate that the output has been completely written.
29192          * When writing a command completion or response to an internal processor,
29193          * the order of writes has to be such that this field is written last.
29194          */
29195         uint8_t valid;
29196 } __attribute__((packed));
29197
29198 /***********************************
29199  * hwrm_cfa_flow_aging_timer_reset *
29200  ***********************************/
29201
29202
29203 /* hwrm_cfa_flow_aging_timer_reset_input (size:256b/32B) */
29204 struct hwrm_cfa_flow_aging_timer_reset_input {
29205         /* The HWRM command request type. */
29206         uint16_t        req_type;
29207         /*
29208          * The completion ring to send the completion event on. This should
29209          * be the NQ ID returned from the `nq_alloc` HWRM command.
29210          */
29211         uint16_t        cmpl_ring;
29212         /*
29213          * The sequence ID is used by the driver for tracking multiple
29214          * commands. This ID is treated as opaque data by the firmware and
29215          * the value is returned in the `hwrm_resp_hdr` upon completion.
29216          */
29217         uint16_t        seq_id;
29218         /*
29219          * The target ID of the command:
29220          * * 0x0-0xFFF8 - The function ID
29221          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29222          * * 0xFFFD - Reserved for user-space HWRM interface
29223          * * 0xFFFF - HWRM
29224          */
29225         uint16_t        target_id;
29226         /*
29227          * A physical address pointer pointing to a host buffer that the
29228          * command's response data will be written. This can be either a host
29229          * physical address (HPA) or a guest physical address (GPA) and must
29230          * point to a physically contiguous block of memory.
29231          */
29232         uint64_t        resp_addr;
29233         /* Flow record index. */
29234         uint16_t        flow_handle;
29235         uint8_t unused_0[2];
29236         /*
29237          * New flow timer value for the flow specified in the ext_flow_handle.
29238          * The flow timer unit is 100ms.
29239          */
29240         uint32_t        flow_timer;
29241         /* This value identifies a set of CFA data structures used for a flow. */
29242         uint64_t        ext_flow_handle;
29243 } __attribute__((packed));
29244
29245 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
29246 struct hwrm_cfa_flow_aging_timer_reset_output {
29247         /* The specific error status for the command. */
29248         uint16_t        error_code;
29249         /* The HWRM command request type. */
29250         uint16_t        req_type;
29251         /* The sequence ID from the original command. */
29252         uint16_t        seq_id;
29253         /* The length of the response data in number of bytes. */
29254         uint16_t        resp_len;
29255         uint8_t unused_0[7];
29256         /*
29257          * This field is used in Output records to indicate that the output
29258          * is completely written to RAM.  This field should be read as '1'
29259          * to indicate that the output has been completely written.
29260          * When writing a command completion or response to an internal processor,
29261          * the order of writes has to be such that this field is written last.
29262          */
29263         uint8_t valid;
29264 } __attribute__((packed));
29265
29266 /***************************
29267  * hwrm_cfa_flow_aging_cfg *
29268  ***************************/
29269
29270
29271 /* hwrm_cfa_flow_aging_cfg_input (size:384b/48B) */
29272 struct hwrm_cfa_flow_aging_cfg_input {
29273         /* The HWRM command request type. */
29274         uint16_t        req_type;
29275         /*
29276          * The completion ring to send the completion event on. This should
29277          * be the NQ ID returned from the `nq_alloc` HWRM command.
29278          */
29279         uint16_t        cmpl_ring;
29280         /*
29281          * The sequence ID is used by the driver for tracking multiple
29282          * commands. This ID is treated as opaque data by the firmware and
29283          * the value is returned in the `hwrm_resp_hdr` upon completion.
29284          */
29285         uint16_t        seq_id;
29286         /*
29287          * The target ID of the command:
29288          * * 0x0-0xFFF8 - The function ID
29289          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29290          * * 0xFFFD - Reserved for user-space HWRM interface
29291          * * 0xFFFF - HWRM
29292          */
29293         uint16_t        target_id;
29294         /*
29295          * A physical address pointer pointing to a host buffer that the
29296          * command's response data will be written. This can be either a host
29297          * physical address (HPA) or a guest physical address (GPA) and must
29298          * point to a physically contiguous block of memory.
29299          */
29300         uint64_t        resp_addr;
29301         /* The bit field to enable per flow aging configuration. */
29302         uint16_t        enables;
29303         /* This bit must be '1' for the tcp flow timer field to be configured */
29304         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FLOW_TIMER \
29305                 UINT32_C(0x1)
29306         /* This bit must be '1' for the tcp finish timer field to be configured */
29307         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FIN_TIMER \
29308                 UINT32_C(0x2)
29309         /* This bit must be '1' for the udp flow timer field to be configured */
29310         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_UDP_FLOW_TIMER \
29311                 UINT32_C(0x4)
29312         /* This bit must be '1' for the eem dma interval field to be configured */
29313         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_DMA_INTERVAL \
29314                 UINT32_C(0x8)
29315         /* This bit must be '1' for the eem notice interval field to be configured */
29316         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_NOTICE_INTERVAL \
29317                 UINT32_C(0x10)
29318         /* This bit must be '1' for the eem context memory maximum entries field to be configured */
29319         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MAX_ENTRIES \
29320                 UINT32_C(0x20)
29321         /* This bit must be '1' for the eem context memory ID field to be configured */
29322         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_ID \
29323                 UINT32_C(0x40)
29324         /* This bit must be '1' for the eem context memory type field to be configured */
29325         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MEM_TYPE \
29326                 UINT32_C(0x80)
29327         uint8_t flags;
29328         /* Enumeration denoting the RX, TX type of the resource. */
29329         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH       UINT32_C(0x1)
29330         /* tx path */
29331         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_TX      UINT32_C(0x0)
29332         /* rx path */
29333         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX      UINT32_C(0x1)
29334         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_LAST \
29335                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX
29336         /* Enumeration denoting the enable, disable eem flow aging configuration. */
29337         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM        UINT32_C(0x2)
29338         /* tx path */
29339         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_DISABLE \
29340                 (UINT32_C(0x0) << 1)
29341         /* rx path */
29342         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE \
29343                 (UINT32_C(0x1) << 1)
29344         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_LAST \
29345                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE
29346         uint8_t unused_0;
29347         /* The flow aging timer for all TCP flows, the unit is 100 milliseconds. */
29348         uint32_t        tcp_flow_timer;
29349         /* The TCP finished timer for all TCP flows, the unit is 100 milliseconds. */
29350         uint32_t        tcp_fin_timer;
29351         /* The flow aging timer for all UDP flows, the unit is 100 milliseconds. */
29352         uint32_t        udp_flow_timer;
29353         /* The interval to dma eem ejection data to host memory, the unit is milliseconds. */
29354         uint16_t        eem_dma_interval;
29355         /* The interval to notify driver to read the eem ejection data, the unit is milliseconds. */
29356         uint16_t        eem_notice_interval;
29357         /* The maximum entries number in the eem context memory. */
29358         uint32_t        eem_ctx_max_entries;
29359         /* The context memory ID for eem flow aging. */
29360         uint16_t        eem_ctx_id;
29361         uint16_t        eem_ctx_mem_type;
29362         /* The content of context memory is eem ejection data, the size of each entry is 4 bytes. */
29363         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA \
29364                 UINT32_C(0x0)
29365         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_LAST \
29366                 HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA
29367         uint8_t unused_1[4];
29368 } __attribute__((packed));
29369
29370 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
29371 struct hwrm_cfa_flow_aging_cfg_output {
29372         /* The specific error status for the command. */
29373         uint16_t        error_code;
29374         /* The HWRM command request type. */
29375         uint16_t        req_type;
29376         /* The sequence ID from the original command. */
29377         uint16_t        seq_id;
29378         /* The length of the response data in number of bytes. */
29379         uint16_t        resp_len;
29380         uint8_t unused_0[7];
29381         /*
29382          * This field is used in Output records to indicate that the output
29383          * is completely written to RAM.  This field should be read as '1'
29384          * to indicate that the output has been completely written.
29385          * When writing a command completion or response to an internal processor,
29386          * the order of writes has to be such that this field is written last.
29387          */
29388         uint8_t valid;
29389 } __attribute__((packed));
29390
29391 /****************************
29392  * hwrm_cfa_flow_aging_qcfg *
29393  ****************************/
29394
29395
29396 /* hwrm_cfa_flow_aging_qcfg_input (size:192b/24B) */
29397 struct hwrm_cfa_flow_aging_qcfg_input {
29398         /* The HWRM command request type. */
29399         uint16_t        req_type;
29400         /*
29401          * The completion ring to send the completion event on. This should
29402          * be the NQ ID returned from the `nq_alloc` HWRM command.
29403          */
29404         uint16_t        cmpl_ring;
29405         /*
29406          * The sequence ID is used by the driver for tracking multiple
29407          * commands. This ID is treated as opaque data by the firmware and
29408          * the value is returned in the `hwrm_resp_hdr` upon completion.
29409          */
29410         uint16_t        seq_id;
29411         /*
29412          * The target ID of the command:
29413          * * 0x0-0xFFF8 - The function ID
29414          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29415          * * 0xFFFD - Reserved for user-space HWRM interface
29416          * * 0xFFFF - HWRM
29417          */
29418         uint16_t        target_id;
29419         /*
29420          * A physical address pointer pointing to a host buffer that the
29421          * command's response data will be written. This can be either a host
29422          * physical address (HPA) or a guest physical address (GPA) and must
29423          * point to a physically contiguous block of memory.
29424          */
29425         uint64_t        resp_addr;
29426         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
29427         uint8_t flags;
29428         /* Enumeration denoting the RX, TX type of the resource. */
29429         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
29430         /* tx path */
29431         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
29432         /* rx path */
29433         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
29434         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST \
29435                 HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
29436         uint8_t unused_0[7];
29437 } __attribute__((packed));
29438
29439 /* hwrm_cfa_flow_aging_qcfg_output (size:320b/40B) */
29440 struct hwrm_cfa_flow_aging_qcfg_output {
29441         /* The specific error status for the command. */
29442         uint16_t        error_code;
29443         /* The HWRM command request type. */
29444         uint16_t        req_type;
29445         /* The sequence ID from the original command. */
29446         uint16_t        seq_id;
29447         /* The length of the response data in number of bytes. */
29448         uint16_t        resp_len;
29449         /* The current flow aging timer for all TCP flows, the unit is 100 millisecond. */
29450         uint32_t        tcp_flow_timer;
29451         /* The current TCP finished timer for all TCP flows, the unit is 100 millisecond. */
29452         uint32_t        tcp_fin_timer;
29453         /* The current flow aging timer for all UDP flows, the unit is 100 millisecond. */
29454         uint32_t        udp_flow_timer;
29455         /* The interval to dma eem ejection data to host memory, the unit is milliseconds. */
29456         uint16_t        eem_dma_interval;
29457         /* The interval to notify driver to read the eem ejection data, the unit is milliseconds. */
29458         uint16_t        eem_notice_interval;
29459         /* The maximum entries number in the eem context memory. */
29460         uint32_t        eem_ctx_max_entries;
29461         /* The context memory ID for eem flow aging. */
29462         uint16_t        eem_ctx_id;
29463         /* The context memory type for eem flow aging. */
29464         uint16_t        eem_ctx_mem_type;
29465         uint8_t unused_0[7];
29466         /*
29467          * This field is used in Output records to indicate that the output
29468          * is completely written to RAM.  This field should be read as '1'
29469          * to indicate that the output has been completely written.
29470          * When writing a command completion or response to an internal processor,
29471          * the order of writes has to be such that this field is written last.
29472          */
29473         uint8_t valid;
29474 } __attribute__((packed));
29475
29476 /*****************************
29477  * hwrm_cfa_flow_aging_qcaps *
29478  *****************************/
29479
29480
29481 /* hwrm_cfa_flow_aging_qcaps_input (size:192b/24B) */
29482 struct hwrm_cfa_flow_aging_qcaps_input {
29483         /* The HWRM command request type. */
29484         uint16_t        req_type;
29485         /*
29486          * The completion ring to send the completion event on. This should
29487          * be the NQ ID returned from the `nq_alloc` HWRM command.
29488          */
29489         uint16_t        cmpl_ring;
29490         /*
29491          * The sequence ID is used by the driver for tracking multiple
29492          * commands. This ID is treated as opaque data by the firmware and
29493          * the value is returned in the `hwrm_resp_hdr` upon completion.
29494          */
29495         uint16_t        seq_id;
29496         /*
29497          * The target ID of the command:
29498          * * 0x0-0xFFF8 - The function ID
29499          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29500          * * 0xFFFD - Reserved for user-space HWRM interface
29501          * * 0xFFFF - HWRM
29502          */
29503         uint16_t        target_id;
29504         /*
29505          * A physical address pointer pointing to a host buffer that the
29506          * command's response data will be written. This can be either a host
29507          * physical address (HPA) or a guest physical address (GPA) and must
29508          * point to a physically contiguous block of memory.
29509          */
29510         uint64_t        resp_addr;
29511         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
29512         uint8_t flags;
29513         /* Enumeration denoting the RX, TX type of the resource. */
29514         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH     UINT32_C(0x1)
29515         /* tx path */
29516         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
29517         /* rx path */
29518         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
29519         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST \
29520                 HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
29521         uint8_t unused_0[7];
29522 } __attribute__((packed));
29523
29524 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
29525 struct hwrm_cfa_flow_aging_qcaps_output {
29526         /* The specific error status for the command. */
29527         uint16_t        error_code;
29528         /* The HWRM command request type. */
29529         uint16_t        req_type;
29530         /* The sequence ID from the original command. */
29531         uint16_t        seq_id;
29532         /* The length of the response data in number of bytes. */
29533         uint16_t        resp_len;
29534         /* The maximum flow aging timer for all TCP flows, the unit is 100 millisecond. */
29535         uint32_t        max_tcp_flow_timer;
29536         /* The maximum TCP finished timer for all TCP flows, the unit is 100 millisecond. */
29537         uint32_t        max_tcp_fin_timer;
29538         /* The maximum flow aging timer for all UDP flows, the unit is 100 millisecond. */
29539         uint32_t        max_udp_flow_timer;
29540         /* The maximum aging flows that HW can support. */
29541         uint32_t        max_aging_flows;
29542         uint8_t unused_0[7];
29543         /*
29544          * This field is used in Output records to indicate that the output
29545          * is completely written to RAM.  This field should be read as '1'
29546          * to indicate that the output has been completely written.
29547          * When writing a command completion or response to an internal processor,
29548          * the order of writes has to be such that this field is written last.
29549          */
29550         uint8_t valid;
29551 } __attribute__((packed));
29552
29553 /**********************************
29554  * hwrm_cfa_tcp_flag_process_qcfg *
29555  **********************************/
29556
29557
29558 /* hwrm_cfa_tcp_flag_process_qcfg_input (size:128b/16B) */
29559 struct hwrm_cfa_tcp_flag_process_qcfg_input {
29560         /* The HWRM command request type. */
29561         uint16_t        req_type;
29562         /*
29563          * The completion ring to send the completion event on. This should
29564          * be the NQ ID returned from the `nq_alloc` HWRM command.
29565          */
29566         uint16_t        cmpl_ring;
29567         /*
29568          * The sequence ID is used by the driver for tracking multiple
29569          * commands. This ID is treated as opaque data by the firmware and
29570          * the value is returned in the `hwrm_resp_hdr` upon completion.
29571          */
29572         uint16_t        seq_id;
29573         /*
29574          * The target ID of the command:
29575          * * 0x0-0xFFF8 - The function ID
29576          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29577          * * 0xFFFD - Reserved for user-space HWRM interface
29578          * * 0xFFFF - HWRM
29579          */
29580         uint16_t        target_id;
29581         /*
29582          * A physical address pointer pointing to a host buffer that the
29583          * command's response data will be written. This can be either a host
29584          * physical address (HPA) or a guest physical address (GPA) and must
29585          * point to a physically contiguous block of memory.
29586          */
29587         uint64_t        resp_addr;
29588 } __attribute__((packed));
29589
29590 /* hwrm_cfa_tcp_flag_process_qcfg_output (size:192b/24B) */
29591 struct hwrm_cfa_tcp_flag_process_qcfg_output {
29592         /* The specific error status for the command. */
29593         uint16_t        error_code;
29594         /* The HWRM command request type. */
29595         uint16_t        req_type;
29596         /* The sequence ID from the original command. */
29597         uint16_t        seq_id;
29598         /* The length of the response data in number of bytes. */
29599         uint16_t        resp_len;
29600         /* The port 0 RX mirror action record ID. */
29601         uint16_t        rx_ar_id_port0;
29602         /* The port 1 RX mirror action record ID. */
29603         uint16_t        rx_ar_id_port1;
29604         /* The port 0 RX action record ID for TX TCP flag packets from loopback path. */
29605         uint16_t        tx_ar_id_port0;
29606         /* The port 1 RX action record ID for TX TCP flag packets from loopback path. */
29607         uint16_t        tx_ar_id_port1;
29608         uint8_t unused_0[7];
29609         /*
29610          * This field is used in Output records to indicate that the output
29611          * is completely written to RAM.  This field should be read as '1'
29612          * to indicate that the output has been completely written.
29613          * When writing a command completion or response to an internal processor,
29614          * the order of writes has to be such that this field is written last.
29615          */
29616         uint8_t valid;
29617 } __attribute__((packed));
29618
29619 /**********************
29620  * hwrm_cfa_pair_info *
29621  **********************/
29622
29623
29624 /* hwrm_cfa_pair_info_input (size:448b/56B) */
29625 struct hwrm_cfa_pair_info_input {
29626         /* The HWRM command request type. */
29627         uint16_t        req_type;
29628         /*
29629          * The completion ring to send the completion event on. This should
29630          * be the NQ ID returned from the `nq_alloc` HWRM command.
29631          */
29632         uint16_t        cmpl_ring;
29633         /*
29634          * The sequence ID is used by the driver for tracking multiple
29635          * commands. This ID is treated as opaque data by the firmware and
29636          * the value is returned in the `hwrm_resp_hdr` upon completion.
29637          */
29638         uint16_t        seq_id;
29639         /*
29640          * The target ID of the command:
29641          * * 0x0-0xFFF8 - The function ID
29642          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29643          * * 0xFFFD - Reserved for user-space HWRM interface
29644          * * 0xFFFF - HWRM
29645          */
29646         uint16_t        target_id;
29647         /*
29648          * A physical address pointer pointing to a host buffer that the
29649          * command's response data will be written. This can be either a host
29650          * physical address (HPA) or a guest physical address (GPA) and must
29651          * point to a physically contiguous block of memory.
29652          */
29653         uint64_t        resp_addr;
29654         uint32_t        flags;
29655         /* If this flag is set, lookup by name else lookup by index. */
29656         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE      UINT32_C(0x1)
29657         /* If this flag is set, lookup by PF id and VF id. */
29658         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE     UINT32_C(0x2)
29659         /* Pair table index. */
29660         uint16_t        pair_index;
29661         /* Pair pf index. */
29662         uint8_t pair_pfid;
29663         /* Pair vf index. */
29664         uint8_t pair_vfid;
29665         /* Pair name (32 byte string). */
29666         char    pair_name[32];
29667 } __attribute__((packed));
29668
29669 /* hwrm_cfa_pair_info_output (size:576b/72B) */
29670 struct hwrm_cfa_pair_info_output {
29671         /* The specific error status for the command. */
29672         uint16_t        error_code;
29673         /* The HWRM command request type. */
29674         uint16_t        req_type;
29675         /* The sequence ID from the original command. */
29676         uint16_t        seq_id;
29677         /* The length of the response data in number of bytes. */
29678         uint16_t        resp_len;
29679         /* Pair table index. */
29680         uint16_t        next_pair_index;
29681         /* Pair member a's fid. */
29682         uint16_t        a_fid;
29683         /* Logical host number. */
29684         uint8_t host_a_index;
29685         /* Logical PF number. */
29686         uint8_t pf_a_index;
29687         /* Pair member a's Linux logical VF number. */
29688         uint16_t        vf_a_index;
29689         /* Rx CFA code. */
29690         uint16_t        rx_cfa_code_a;
29691         /* Tx CFA action. */
29692         uint16_t        tx_cfa_action_a;
29693         /* Pair member b's fid. */
29694         uint16_t        b_fid;
29695         /* Logical host number. */
29696         uint8_t host_b_index;
29697         /* Logical PF number. */
29698         uint8_t pf_b_index;
29699         /* Pair member a's Linux logical VF number. */
29700         uint16_t        vf_b_index;
29701         /* Rx CFA code. */
29702         uint16_t        rx_cfa_code_b;
29703         /* Tx CFA action. */
29704         uint16_t        tx_cfa_action_b;
29705         /* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */
29706         uint8_t pair_mode;
29707         /* Pair between VF on local host with PF or VF on specified host. */
29708         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN   UINT32_C(0x0)
29709         /* Pair between REP on local host with PF or VF on specified host. */
29710         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN  UINT32_C(0x1)
29711         /* Pair between REP on local host with REP on specified host. */
29712         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
29713         /* Pair for the proxy interface. */
29714         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY   UINT32_C(0x3)
29715         /* Pair for the PF interface. */
29716         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR  UINT32_C(0x4)
29717         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST \
29718                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR
29719         /* Pair state. */
29720         uint8_t pair_state;
29721         /* Pair has been allocated */
29722         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
29723         /* Both pair members are active */
29724         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE    UINT32_C(0x2)
29725         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST \
29726                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
29727         /* Pair name (32 byte string). */
29728         char    pair_name[32];
29729         uint8_t unused_0[7];
29730         /*
29731          * This field is used in Output records to indicate that the output
29732          * is completely written to RAM.  This field should be read as '1'
29733          * to indicate that the output has been completely written.
29734          * When writing a command completion or response to an internal processor,
29735          * the order of writes has to be such that this field is written last.
29736          */
29737         uint8_t valid;
29738 } __attribute__((packed));
29739
29740 /***************************************
29741  * hwrm_cfa_redirect_query_tunnel_type *
29742  ***************************************/
29743
29744
29745 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */
29746 struct hwrm_cfa_redirect_query_tunnel_type_input {
29747         /* The HWRM command request type. */
29748         uint16_t        req_type;
29749         /*
29750          * The completion ring to send the completion event on. This should
29751          * be the NQ ID returned from the `nq_alloc` HWRM command.
29752          */
29753         uint16_t        cmpl_ring;
29754         /*
29755          * The sequence ID is used by the driver for tracking multiple
29756          * commands. This ID is treated as opaque data by the firmware and
29757          * the value is returned in the `hwrm_resp_hdr` upon completion.
29758          */
29759         uint16_t        seq_id;
29760         /*
29761          * The target ID of the command:
29762          * * 0x0-0xFFF8 - The function ID
29763          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29764          * * 0xFFFD - Reserved for user-space HWRM interface
29765          * * 0xFFFF - HWRM
29766          */
29767         uint16_t        target_id;
29768         /*
29769          * A physical address pointer pointing to a host buffer that the
29770          * command's response data will be written. This can be either a host
29771          * physical address (HPA) or a guest physical address (GPA) and must
29772          * point to a physically contiguous block of memory.
29773          */
29774         uint64_t        resp_addr;
29775         /* The source function id. */
29776         uint16_t        src_fid;
29777         uint8_t unused_0[6];
29778 } __attribute__((packed));
29779
29780 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
29781 struct hwrm_cfa_redirect_query_tunnel_type_output {
29782         /* The specific error status for the command. */
29783         uint16_t        error_code;
29784         /* The HWRM command request type. */
29785         uint16_t        req_type;
29786         /* The sequence ID from the original command. */
29787         uint16_t        seq_id;
29788         /* The length of the response data in number of bytes. */
29789         uint16_t        resp_len;
29790         /* Tunnel Mask. */
29791         uint32_t        tunnel_mask;
29792         /* Non-tunnel */
29793         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL \
29794                 UINT32_C(0x1)
29795         /* Virtual eXtensible Local Area Network (VXLAN) */
29796         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN \
29797                 UINT32_C(0x2)
29798         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
29799         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE \
29800                 UINT32_C(0x4)
29801         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
29802         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE \
29803                 UINT32_C(0x8)
29804         /* IP in IP */
29805         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP \
29806                 UINT32_C(0x10)
29807         /* Generic Network Virtualization Encapsulation (Geneve) */
29808         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE \
29809                 UINT32_C(0x20)
29810         /* Multi-Protocol Lable Switching (MPLS) */
29811         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS \
29812                 UINT32_C(0x40)
29813         /* Stateless Transport Tunnel (STT) */
29814         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT \
29815                 UINT32_C(0x80)
29816         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
29817         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE \
29818                 UINT32_C(0x100)
29819         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
29820         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4 \
29821                 UINT32_C(0x200)
29822         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
29823         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1 \
29824                 UINT32_C(0x400)
29825         /* Any tunneled traffic */
29826         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL \
29827                 UINT32_C(0x800)
29828         /* Use fixed layer 2 ether type of 0xFFFF */
29829         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2_ETYPE \
29830                 UINT32_C(0x1000)
29831         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
29832         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE_V6 \
29833                 UINT32_C(0x2000)
29834         uint8_t unused_0[3];
29835         /*
29836          * This field is used in Output records to indicate that the output
29837          * is completely written to RAM.  This field should be read as '1'
29838          * to indicate that the output has been completely written.
29839          * When writing a command completion or response to an internal processor,
29840          * the order of writes has to be such that this field is written last.
29841          */
29842         uint8_t valid;
29843 } __attribute__((packed));
29844
29845 /*************************
29846  * hwrm_cfa_ctx_mem_rgtr *
29847  *************************/
29848
29849
29850 /* hwrm_cfa_ctx_mem_rgtr_input (size:256b/32B) */
29851 struct hwrm_cfa_ctx_mem_rgtr_input {
29852         /* The HWRM command request type. */
29853         uint16_t        req_type;
29854         /*
29855          * The completion ring to send the completion event on. This should
29856          * be the NQ ID returned from the `nq_alloc` HWRM command.
29857          */
29858         uint16_t        cmpl_ring;
29859         /*
29860          * The sequence ID is used by the driver for tracking multiple
29861          * commands. This ID is treated as opaque data by the firmware and
29862          * the value is returned in the `hwrm_resp_hdr` upon completion.
29863          */
29864         uint16_t        seq_id;
29865         /*
29866          * The target ID of the command:
29867          * * 0x0-0xFFF8 - The function ID
29868          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29869          * * 0xFFFD - Reserved for user-space HWRM interface
29870          * * 0xFFFF - HWRM
29871          */
29872         uint16_t        target_id;
29873         /*
29874          * A physical address pointer pointing to a host buffer that the
29875          * command's response data will be written. This can be either a host
29876          * physical address (HPA) or a guest physical address (GPA) and must
29877          * point to a physically contiguous block of memory.
29878          */
29879         uint64_t        resp_addr;
29880         uint16_t        flags;
29881         /* Counter PBL indirect levels. */
29882         uint8_t page_level;
29883         /* PBL pointer is physical start address. */
29884         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
29885         /* PBL pointer points to PTE table. */
29886         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
29887         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
29888         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
29889         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LAST \
29890                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
29891         /* Page size. */
29892         uint8_t page_size;
29893         /* 4KB page size. */
29894         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
29895         /* 8KB page size. */
29896         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
29897         /* 64KB page size. */
29898         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
29899         /* 256KB page size. */
29900         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
29901         /* 1MB page size. */
29902         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
29903         /* 2MB page size. */
29904         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
29905         /* 4MB page size. */
29906         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
29907         /* 1GB page size. */
29908         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
29909         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_LAST \
29910                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G
29911         uint32_t        unused_0;
29912         /* Pointer to the PBL, or PDL depending on number of levels */
29913         uint64_t        page_dir;
29914 } __attribute__((packed));
29915
29916 /* hwrm_cfa_ctx_mem_rgtr_output (size:128b/16B) */
29917 struct hwrm_cfa_ctx_mem_rgtr_output {
29918         /* The specific error status for the command. */
29919         uint16_t        error_code;
29920         /* The HWRM command request type. */
29921         uint16_t        req_type;
29922         /* The sequence ID from the original command. */
29923         uint16_t        seq_id;
29924         /* The length of the response data in number of bytes. */
29925         uint16_t        resp_len;
29926         /*
29927          * Id/Handle to the recently register context memory.  This handle is passed
29928          * to the CFA feature.
29929          */
29930         uint16_t        ctx_id;
29931         uint8_t unused_0[5];
29932         /*
29933          * This field is used in Output records to indicate that the output
29934          * is completely written to RAM.  This field should be read as '1'
29935          * to indicate that the output has been completely written.
29936          * When writing a command completion or response to an internal processor,
29937          * the order of writes has to be such that this field is written last.
29938          */
29939         uint8_t valid;
29940 } __attribute__((packed));
29941
29942 /***************************
29943  * hwrm_cfa_ctx_mem_unrgtr *
29944  ***************************/
29945
29946
29947 /* hwrm_cfa_ctx_mem_unrgtr_input (size:192b/24B) */
29948 struct hwrm_cfa_ctx_mem_unrgtr_input {
29949         /* The HWRM command request type. */
29950         uint16_t        req_type;
29951         /*
29952          * The completion ring to send the completion event on. This should
29953          * be the NQ ID returned from the `nq_alloc` HWRM command.
29954          */
29955         uint16_t        cmpl_ring;
29956         /*
29957          * The sequence ID is used by the driver for tracking multiple
29958          * commands. This ID is treated as opaque data by the firmware and
29959          * the value is returned in the `hwrm_resp_hdr` upon completion.
29960          */
29961         uint16_t        seq_id;
29962         /*
29963          * The target ID of the command:
29964          * * 0x0-0xFFF8 - The function ID
29965          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29966          * * 0xFFFD - Reserved for user-space HWRM interface
29967          * * 0xFFFF - HWRM
29968          */
29969         uint16_t        target_id;
29970         /*
29971          * A physical address pointer pointing to a host buffer that the
29972          * command's response data will be written. This can be either a host
29973          * physical address (HPA) or a guest physical address (GPA) and must
29974          * point to a physically contiguous block of memory.
29975          */
29976         uint64_t        resp_addr;
29977         /*
29978          * Id/Handle to the recently register context memory.  This handle is passed
29979          * to the CFA feature.
29980          */
29981         uint16_t        ctx_id;
29982         uint8_t unused_0[6];
29983 } __attribute__((packed));
29984
29985 /* hwrm_cfa_ctx_mem_unrgtr_output (size:128b/16B) */
29986 struct hwrm_cfa_ctx_mem_unrgtr_output {
29987         /* The specific error status for the command. */
29988         uint16_t        error_code;
29989         /* The HWRM command request type. */
29990         uint16_t        req_type;
29991         /* The sequence ID from the original command. */
29992         uint16_t        seq_id;
29993         /* The length of the response data in number of bytes. */
29994         uint16_t        resp_len;
29995         uint8_t unused_0[7];
29996         /*
29997          * This field is used in Output records to indicate that the output
29998          * is completely written to RAM.  This field should be read as '1'
29999          * to indicate that the output has been completely written.
30000          * When writing a command completion or response to an internal processor,
30001          * the order of writes has to be such that this field is written last.
30002          */
30003         uint8_t valid;
30004 } __attribute__((packed));
30005
30006 /*************************
30007  * hwrm_cfa_ctx_mem_qctx *
30008  *************************/
30009
30010
30011 /* hwrm_cfa_ctx_mem_qctx_input (size:192b/24B) */
30012 struct hwrm_cfa_ctx_mem_qctx_input {
30013         /* The HWRM command request type. */
30014         uint16_t        req_type;
30015         /*
30016          * The completion ring to send the completion event on. This should
30017          * be the NQ ID returned from the `nq_alloc` HWRM command.
30018          */
30019         uint16_t        cmpl_ring;
30020         /*
30021          * The sequence ID is used by the driver for tracking multiple
30022          * commands. This ID is treated as opaque data by the firmware and
30023          * the value is returned in the `hwrm_resp_hdr` upon completion.
30024          */
30025         uint16_t        seq_id;
30026         /*
30027          * The target ID of the command:
30028          * * 0x0-0xFFF8 - The function ID
30029          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30030          * * 0xFFFD - Reserved for user-space HWRM interface
30031          * * 0xFFFF - HWRM
30032          */
30033         uint16_t        target_id;
30034         /*
30035          * A physical address pointer pointing to a host buffer that the
30036          * command's response data will be written. This can be either a host
30037          * physical address (HPA) or a guest physical address (GPA) and must
30038          * point to a physically contiguous block of memory.
30039          */
30040         uint64_t        resp_addr;
30041         /*
30042          * Id/Handle to the recently register context memory.  This handle is passed
30043          * to the CFA feature.
30044          */
30045         uint16_t        ctx_id;
30046         uint8_t unused_0[6];
30047 } __attribute__((packed));
30048
30049 /* hwrm_cfa_ctx_mem_qctx_output (size:256b/32B) */
30050 struct hwrm_cfa_ctx_mem_qctx_output {
30051         /* The specific error status for the command. */
30052         uint16_t        error_code;
30053         /* The HWRM command request type. */
30054         uint16_t        req_type;
30055         /* The sequence ID from the original command. */
30056         uint16_t        seq_id;
30057         /* The length of the response data in number of bytes. */
30058         uint16_t        resp_len;
30059         uint16_t        flags;
30060         /* Counter PBL indirect levels. */
30061         uint8_t page_level;
30062         /* PBL pointer is physical start address. */
30063         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
30064         /* PBL pointer points to PTE table. */
30065         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
30066         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
30067         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
30068         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LAST \
30069                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2
30070         /* Page size. */
30071         uint8_t page_size;
30072         /* 4KB page size. */
30073         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
30074         /* 8KB page size. */
30075         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
30076         /* 64KB page size. */
30077         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
30078         /* 256KB page size. */
30079         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
30080         /* 1MB page size. */
30081         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
30082         /* 2MB page size. */
30083         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
30084         /* 4MB page size. */
30085         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
30086         /* 1GB page size. */
30087         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
30088         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_LAST \
30089                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G
30090         uint8_t unused_0[4];
30091         /* Pointer to the PBL, or PDL depending on number of levels */
30092         uint64_t        page_dir;
30093         uint8_t unused_1[7];
30094         /*
30095          * This field is used in Output records to indicate that the output
30096          * is completely written to RAM.  This field should be read as '1'
30097          * to indicate that the output has been completely written.
30098          * When writing a command completion or response to an internal processor,
30099          * the order of writes has to be such that this field is written last.
30100          */
30101         uint8_t valid;
30102 } __attribute__((packed));
30103
30104 /**************************
30105  * hwrm_cfa_ctx_mem_qcaps *
30106  **************************/
30107
30108
30109 /* hwrm_cfa_ctx_mem_qcaps_input (size:128b/16B) */
30110 struct hwrm_cfa_ctx_mem_qcaps_input {
30111         /* The HWRM command request type. */
30112         uint16_t        req_type;
30113         /*
30114          * The completion ring to send the completion event on. This should
30115          * be the NQ ID returned from the `nq_alloc` HWRM command.
30116          */
30117         uint16_t        cmpl_ring;
30118         /*
30119          * The sequence ID is used by the driver for tracking multiple
30120          * commands. This ID is treated as opaque data by the firmware and
30121          * the value is returned in the `hwrm_resp_hdr` upon completion.
30122          */
30123         uint16_t        seq_id;
30124         /*
30125          * The target ID of the command:
30126          * * 0x0-0xFFF8 - The function ID
30127          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30128          * * 0xFFFD - Reserved for user-space HWRM interface
30129          * * 0xFFFF - HWRM
30130          */
30131         uint16_t        target_id;
30132         /*
30133          * A physical address pointer pointing to a host buffer that the
30134          * command's response data will be written. This can be either a host
30135          * physical address (HPA) or a guest physical address (GPA) and must
30136          * point to a physically contiguous block of memory.
30137          */
30138         uint64_t        resp_addr;
30139 } __attribute__((packed));
30140
30141 /* hwrm_cfa_ctx_mem_qcaps_output (size:128b/16B) */
30142 struct hwrm_cfa_ctx_mem_qcaps_output {
30143         /* The specific error status for the command. */
30144         uint16_t        error_code;
30145         /* The HWRM command request type. */
30146         uint16_t        req_type;
30147         /* The sequence ID from the original command. */
30148         uint16_t        seq_id;
30149         /* The length of the response data in number of bytes. */
30150         uint16_t        resp_len;
30151         /* Indicates the maximum number of context memory which can be registered. */
30152         uint16_t        max_entries;
30153         uint8_t unused_0[5];
30154         /*
30155          * This field is used in Output records to indicate that the output
30156          * is completely written to RAM.  This field should be read as '1'
30157          * to indicate that the output has been completely written.
30158          * When writing a command completion or response to an internal processor,
30159          * the order of writes has to be such that this field is written last.
30160          */
30161         uint8_t valid;
30162 } __attribute__((packed));
30163
30164 /**********************
30165  * hwrm_cfa_eem_qcaps *
30166  **********************/
30167
30168
30169 /* hwrm_cfa_eem_qcaps_input (size:192b/24B) */
30170 struct hwrm_cfa_eem_qcaps_input {
30171         /* The HWRM command request type. */
30172         uint16_t        req_type;
30173         /*
30174          * The completion ring to send the completion event on. This should
30175          * be the NQ ID returned from the `nq_alloc` HWRM command.
30176          */
30177         uint16_t        cmpl_ring;
30178         /*
30179          * The sequence ID is used by the driver for tracking multiple
30180          * commands. This ID is treated as opaque data by the firmware and
30181          * the value is returned in the `hwrm_resp_hdr` upon completion.
30182          */
30183         uint16_t        seq_id;
30184         /*
30185          * The target ID of the command:
30186          * * 0x0-0xFFF8 - The function ID
30187          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30188          * * 0xFFFD - Reserved for user-space HWRM interface
30189          * * 0xFFFF - HWRM
30190          */
30191         uint16_t        target_id;
30192         /*
30193          * A physical address pointer pointing to a host buffer that the
30194          * command's response data will be written. This can be either a host
30195          * physical address (HPA) or a guest physical address (GPA) and must
30196          * point to a physically contiguous block of memory.
30197          */
30198         uint64_t        resp_addr;
30199         uint32_t        flags;
30200         /*
30201          * When set to 1, indicates the configuration will apply to TX flows
30202          * which are to be offloaded.
30203          * Note if this bit is set then the path_rx bit can't be set.
30204          */
30205         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_TX \
30206                 UINT32_C(0x1)
30207         /*
30208          * When set to 1, indicates the configuration will apply to RX flows
30209          * which are to be offloaded.
30210          * Note if this bit is set then the path_tx bit can't be set.
30211          */
30212         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_RX \
30213                 UINT32_C(0x2)
30214         /* When set to 1, all offloaded flows will be sent to EEM. */
30215         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD \
30216                 UINT32_C(0x4)
30217         uint32_t        unused_0;
30218 } __attribute__((packed));
30219
30220 /* hwrm_cfa_eem_qcaps_output (size:320b/40B) */
30221 struct hwrm_cfa_eem_qcaps_output {
30222         /* The specific error status for the command. */
30223         uint16_t        error_code;
30224         /* The HWRM command request type. */
30225         uint16_t        req_type;
30226         /* The sequence ID from the original command. */
30227         uint16_t        seq_id;
30228         /* The length of the response data in number of bytes. */
30229         uint16_t        resp_len;
30230         uint32_t        flags;
30231         /*
30232          * When set to 1, indicates the configuration will apply to TX flows
30233          * which are to be offloaded.
30234          * Note if this bit is set then the path_rx bit can't be set.
30235          */
30236         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_TX \
30237                 UINT32_C(0x1)
30238         /*
30239          * When set to 1, indicates the configuration will apply to RX flows
30240          * which are to be offloaded.
30241          * Note if this bit is set then the path_tx bit can't be set.
30242          */
30243         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_RX \
30244                 UINT32_C(0x2)
30245         /*
30246          * When set to 1, indicates the the FW supports the Centralized
30247          * Memory Model.  The concept designates one entity for the
30248          * memory allocation while all others â€˜subscribe’ to it.
30249          */
30250         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
30251                 UINT32_C(0x4)
30252         /*
30253          * When set to 1, indicates the the FW supports the Detached
30254          * Centralized Memory Model.  The memory is allocated and managed
30255          * as a separate entity.  All PFs and VFs will be granted direct
30256          * or semi-direct access to the allocated memory while none of
30257          * which can interfere with the management of the memory.
30258          */
30259         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
30260                 UINT32_C(0x8)
30261         uint32_t        unused_0;
30262         uint32_t        supported;
30263         /*
30264          * If set to 1, then EEM KEY0 table is supported using crc32 hash.
30265          * If set to 0, EEM KEY0 table is not supported.
30266          */
30267         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE \
30268                 UINT32_C(0x1)
30269         /*
30270          * If set to 1, then EEM KEY1 table is supported using lookup3 hash.
30271          * If set to 0, EEM KEY1 table is not supported.
30272          */
30273         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE \
30274                 UINT32_C(0x2)
30275         /*
30276          * If set to 1, then EEM External Record table is supported.
30277          * If set to 0, EEM External Record table is not supported.
30278          * (This table includes action record, EFC pointers, encap pointers)
30279          */
30280         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE \
30281                 UINT32_C(0x4)
30282         /*
30283          * If set to 1, then EEM External Flow Counters table is supported.
30284          * If set to 0, EEM External Flow Counters table is not supported.
30285          */
30286         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE \
30287                 UINT32_C(0x8)
30288         /*
30289          * If set to 1, then FID table used for implicit flow flush is supported.
30290          * If set to 0, then FID table used for implicit flow flush is not supported.
30291          */
30292         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE \
30293                 UINT32_C(0x10)
30294         /*
30295          * The maximum number of entries supported by EEM.   When configuring the host memory
30296          * the number of numbers of entries that can supported are -
30297          *      32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M, 128M entries.
30298          * Any value that are not these values, the FW will round down to the closest support
30299          * number of entries.
30300          */
30301         uint32_t        max_entries_supported;
30302         /* The entry size in bytes of each entry in the EEM KEY0/KEY1 tables. */
30303         uint16_t        key_entry_size;
30304         /* The entry size in bytes of each entry in the EEM RECORD tables. */
30305         uint16_t        record_entry_size;
30306         /* The entry size in bytes of each entry in the EEM EFC tables. */
30307         uint16_t        efc_entry_size;
30308         /* The FID size in bytes of each entry in the EEM FID tables. */
30309         uint16_t        fid_entry_size;
30310         uint8_t unused_1[7];
30311         /*
30312          * This field is used in Output records to indicate that the output
30313          * is completely written to RAM.  This field should be read as '1'
30314          * to indicate that the output has been completely written.
30315          * When writing a command completion or response to an internal processor,
30316          * the order of writes has to be such that this field is written last.
30317          */
30318         uint8_t valid;
30319 } __attribute__((packed));
30320
30321 /********************
30322  * hwrm_cfa_eem_cfg *
30323  ********************/
30324
30325
30326 /* hwrm_cfa_eem_cfg_input (size:384b/48B) */
30327 struct hwrm_cfa_eem_cfg_input {
30328         /* The HWRM command request type. */
30329         uint16_t        req_type;
30330         /*
30331          * The completion ring to send the completion event on. This should
30332          * be the NQ ID returned from the `nq_alloc` HWRM command.
30333          */
30334         uint16_t        cmpl_ring;
30335         /*
30336          * The sequence ID is used by the driver for tracking multiple
30337          * commands. This ID is treated as opaque data by the firmware and
30338          * the value is returned in the `hwrm_resp_hdr` upon completion.
30339          */
30340         uint16_t        seq_id;
30341         /*
30342          * The target ID of the command:
30343          * * 0x0-0xFFF8 - The function ID
30344          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30345          * * 0xFFFD - Reserved for user-space HWRM interface
30346          * * 0xFFFF - HWRM
30347          */
30348         uint16_t        target_id;
30349         /*
30350          * A physical address pointer pointing to a host buffer that the
30351          * command's response data will be written. This can be either a host
30352          * physical address (HPA) or a guest physical address (GPA) and must
30353          * point to a physically contiguous block of memory.
30354          */
30355         uint64_t        resp_addr;
30356         uint32_t        flags;
30357         /*
30358          * When set to 1, indicates the configuration will apply to TX flows
30359          * which are to be offloaded.
30360          * Note if this bit is set then the path_rx bit can't be set.
30361          */
30362         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_TX \
30363                 UINT32_C(0x1)
30364         /*
30365          * When set to 1, indicates the configuration will apply to RX flows
30366          * which are to be offloaded.
30367          * Note if this bit is set then the path_tx bit can't be set.
30368          */
30369         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_RX \
30370                 UINT32_C(0x2)
30371         /* When set to 1, all offloaded flows will be sent to EEM. */
30372         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD \
30373                 UINT32_C(0x4)
30374         /* When set to 1, secondary, 0 means primary. */
30375         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_SECONDARY_PF \
30376                 UINT32_C(0x8)
30377         /*
30378          * Group_id which used by Firmware to identify memory pools belonging
30379          * to certain group.
30380          */
30381         uint16_t        group_id;
30382         uint16_t        unused_0;
30383         /*
30384          * Configured EEM with the given number of entries.  All the EEM tables KEY0, KEY1,
30385          * RECORD, EFC all have the same number of entries and all tables will be configured
30386          * using this value.  Current minimum value is 32k. Current maximum value is 128M.
30387          */
30388         uint32_t        num_entries;
30389         uint32_t        unused_1;
30390         /* Configured EEM with the given context if for KEY0 table. */
30391         uint16_t        key0_ctx_id;
30392         /* Configured EEM with the given context if for KEY1 table. */
30393         uint16_t        key1_ctx_id;
30394         /* Configured EEM with the given context if for RECORD table. */
30395         uint16_t        record_ctx_id;
30396         /* Configured EEM with the given context if for EFC table. */
30397         uint16_t        efc_ctx_id;
30398         /* Configured EEM with the given context if for EFC table. */
30399         uint16_t        fid_ctx_id;
30400         uint16_t        unused_2;
30401         uint32_t        unused_3;
30402 } __attribute__((packed));
30403
30404 /* hwrm_cfa_eem_cfg_output (size:128b/16B) */
30405 struct hwrm_cfa_eem_cfg_output {
30406         /* The specific error status for the command. */
30407         uint16_t        error_code;
30408         /* The HWRM command request type. */
30409         uint16_t        req_type;
30410         /* The sequence ID from the original command. */
30411         uint16_t        seq_id;
30412         /* The length of the response data in number of bytes. */
30413         uint16_t        resp_len;
30414         uint8_t unused_0[7];
30415         /*
30416          * This field is used in Output records to indicate that the output
30417          * is completely written to RAM.  This field should be read as '1'
30418          * to indicate that the output has been completely written.
30419          * When writing a command completion or response to an internal processor,
30420          * the order of writes has to be such that this field is written last.
30421          */
30422         uint8_t valid;
30423 } __attribute__((packed));
30424
30425 /*********************
30426  * hwrm_cfa_eem_qcfg *
30427  *********************/
30428
30429
30430 /* hwrm_cfa_eem_qcfg_input (size:192b/24B) */
30431 struct hwrm_cfa_eem_qcfg_input {
30432         /* The HWRM command request type. */
30433         uint16_t        req_type;
30434         /*
30435          * The completion ring to send the completion event on. This should
30436          * be the NQ ID returned from the `nq_alloc` HWRM command.
30437          */
30438         uint16_t        cmpl_ring;
30439         /*
30440          * The sequence ID is used by the driver for tracking multiple
30441          * commands. This ID is treated as opaque data by the firmware and
30442          * the value is returned in the `hwrm_resp_hdr` upon completion.
30443          */
30444         uint16_t        seq_id;
30445         /*
30446          * The target ID of the command:
30447          * * 0x0-0xFFF8 - The function ID
30448          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30449          * * 0xFFFD - Reserved for user-space HWRM interface
30450          * * 0xFFFF - HWRM
30451          */
30452         uint16_t        target_id;
30453         /*
30454          * A physical address pointer pointing to a host buffer that the
30455          * command's response data will be written. This can be either a host
30456          * physical address (HPA) or a guest physical address (GPA) and must
30457          * point to a physically contiguous block of memory.
30458          */
30459         uint64_t        resp_addr;
30460         uint32_t        flags;
30461         /* When set to 1, indicates the configuration is the TX flow. */
30462         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
30463         /* When set to 1, indicates the configuration is the RX flow. */
30464         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
30465         uint32_t        unused_0;
30466 } __attribute__((packed));
30467
30468 /* hwrm_cfa_eem_qcfg_output (size:256b/32B) */
30469 struct hwrm_cfa_eem_qcfg_output {
30470         /* The specific error status for the command. */
30471         uint16_t        error_code;
30472         /* The HWRM command request type. */
30473         uint16_t        req_type;
30474         /* The sequence ID from the original command. */
30475         uint16_t        seq_id;
30476         /* The length of the response data in number of bytes. */
30477         uint16_t        resp_len;
30478         uint32_t        flags;
30479         /* When set to 1, indicates the configuration is the TX flow. */
30480         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_TX \
30481                 UINT32_C(0x1)
30482         /* When set to 1, indicates the configuration is the RX flow. */
30483         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_RX \
30484                 UINT32_C(0x2)
30485         /* When set to 1, all offloaded flows will be sent to EEM. */
30486         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD \
30487                 UINT32_C(0x4)
30488         /* The number of entries the FW has configured for EEM. */
30489         uint32_t        num_entries;
30490         /* Configured EEM with the given context if for KEY0 table. */
30491         uint16_t        key0_ctx_id;
30492         /* Configured EEM with the given context if for KEY1 table. */
30493         uint16_t        key1_ctx_id;
30494         /* Configured EEM with the given context if for RECORD table. */
30495         uint16_t        record_ctx_id;
30496         /* Configured EEM with the given context if for EFC table. */
30497         uint16_t        efc_ctx_id;
30498         /* Configured EEM with the given context if for EFC table. */
30499         uint16_t        fid_ctx_id;
30500         uint8_t unused_2[5];
30501         /*
30502          * This field is used in Output records to indicate that the output
30503          * is completely written to RAM.  This field should be read as '1'
30504          * to indicate that the output has been completely written.
30505          * When writing a command completion or response to an internal processor,
30506          * the order of writes has to be such that this field is written last.
30507          */
30508         uint8_t valid;
30509 } __attribute__((packed));
30510
30511 /*******************
30512  * hwrm_cfa_eem_op *
30513  *******************/
30514
30515
30516 /* hwrm_cfa_eem_op_input (size:192b/24B) */
30517 struct hwrm_cfa_eem_op_input {
30518         /* The HWRM command request type. */
30519         uint16_t        req_type;
30520         /*
30521          * The completion ring to send the completion event on. This should
30522          * be the NQ ID returned from the `nq_alloc` HWRM command.
30523          */
30524         uint16_t        cmpl_ring;
30525         /*
30526          * The sequence ID is used by the driver for tracking multiple
30527          * commands. This ID is treated as opaque data by the firmware and
30528          * the value is returned in the `hwrm_resp_hdr` upon completion.
30529          */
30530         uint16_t        seq_id;
30531         /*
30532          * The target ID of the command:
30533          * * 0x0-0xFFF8 - The function ID
30534          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30535          * * 0xFFFD - Reserved for user-space HWRM interface
30536          * * 0xFFFF - HWRM
30537          */
30538         uint16_t        target_id;
30539         /*
30540          * A physical address pointer pointing to a host buffer that the
30541          * command's response data will be written. This can be either a host
30542          * physical address (HPA) or a guest physical address (GPA) and must
30543          * point to a physically contiguous block of memory.
30544          */
30545         uint64_t        resp_addr;
30546         uint32_t        flags;
30547         /*
30548          * When set to 1, indicates the host memory which is passed will be
30549          * used for the TX flow offload function specified in fid.
30550          * Note if this bit is set then the path_rx bit can't be set.
30551          */
30552         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
30553         /*
30554          * When set to 1, indicates the host memory which is passed will be
30555          * used for the RX flow offload function specified in fid.
30556          * Note if this bit is set then the path_tx bit can't be set.
30557          */
30558         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
30559         uint16_t        unused_0;
30560         /* The number of EEM key table entries to be configured. */
30561         uint16_t        op;
30562         /* This value is reserved and should not be used. */
30563         #define HWRM_CFA_EEM_OP_INPUT_OP_RESERVED    UINT32_C(0x0)
30564         /*
30565          * To properly stop EEM and ensure there are no DMA's, the caller
30566          * must disable EEM for the given PF, using this call.  This will
30567          * safely disable EEM and ensure that all DMA'ed to the
30568          * keys/records/efc have been completed.
30569          */
30570         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_DISABLE UINT32_C(0x1)
30571         /*
30572          * Once the EEM host memory has been configured, EEM options have
30573          * been configured. Then the caller should enable EEM for the given
30574          * PF.  Note once this call has been made, then the EEM mechanism
30575          * will be active and DMA's will occur as packets are processed.
30576          */
30577         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_ENABLE  UINT32_C(0x2)
30578         /*
30579          * Clear EEM settings for the given PF so that the register values
30580          * are reset back to there initial state.
30581          */
30582         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP UINT32_C(0x3)
30583         #define HWRM_CFA_EEM_OP_INPUT_OP_LAST \
30584                 HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP
30585 } __attribute__((packed));
30586
30587 /* hwrm_cfa_eem_op_output (size:128b/16B) */
30588 struct hwrm_cfa_eem_op_output {
30589         /* The specific error status for the command. */
30590         uint16_t        error_code;
30591         /* The HWRM command request type. */
30592         uint16_t        req_type;
30593         /* The sequence ID from the original command. */
30594         uint16_t        seq_id;
30595         /* The length of the response data in number of bytes. */
30596         uint16_t        resp_len;
30597         uint8_t unused_0[7];
30598         /*
30599          * This field is used in Output records to indicate that the output
30600          * is completely written to RAM.  This field should be read as '1'
30601          * to indicate that the output has been completely written.
30602          * When writing a command completion or response to an internal processor,
30603          * the order of writes has to be such that this field is written last.
30604          */
30605         uint8_t valid;
30606 } __attribute__((packed));
30607
30608 /********************************
30609  * hwrm_cfa_adv_flow_mgnt_qcaps *
30610  ********************************/
30611
30612
30613 /* hwrm_cfa_adv_flow_mgnt_qcaps_input (size:256b/32B) */
30614 struct hwrm_cfa_adv_flow_mgnt_qcaps_input {
30615         /* The HWRM command request type. */
30616         uint16_t        req_type;
30617         /*
30618          * The completion ring to send the completion event on. This should
30619          * be the NQ ID returned from the `nq_alloc` HWRM command.
30620          */
30621         uint16_t        cmpl_ring;
30622         /*
30623          * The sequence ID is used by the driver for tracking multiple
30624          * commands. This ID is treated as opaque data by the firmware and
30625          * the value is returned in the `hwrm_resp_hdr` upon completion.
30626          */
30627         uint16_t        seq_id;
30628         /*
30629          * The target ID of the command:
30630          * * 0x0-0xFFF8 - The function ID
30631          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30632          * * 0xFFFD - Reserved for user-space HWRM interface
30633          * * 0xFFFF - HWRM
30634          */
30635         uint16_t        target_id;
30636         /*
30637          * A physical address pointer pointing to a host buffer that the
30638          * command's response data will be written. This can be either a host
30639          * physical address (HPA) or a guest physical address (GPA) and must
30640          * point to a physically contiguous block of memory.
30641          */
30642         uint64_t        resp_addr;
30643         uint32_t        unused_0[4];
30644 } __attribute__((packed));
30645
30646 /* hwrm_cfa_adv_flow_mgnt_qcaps_output (size:128b/16B) */
30647 struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
30648         /* The specific error status for the command. */
30649         uint16_t        error_code;
30650         /* The HWRM command request type. */
30651         uint16_t        req_type;
30652         /* The sequence ID from the original command. */
30653         uint16_t        seq_id;
30654         /* The length of the response data in number of bytes. */
30655         uint16_t        resp_len;
30656         uint32_t        flags;
30657         /*
30658          * Value of 1 to indicate firmware support 16-bit flow handle.
30659          * Value of 0 to indicate firmware not support 16-bit flow handle.
30660          */
30661         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_16BIT_SUPPORTED \
30662                 UINT32_C(0x1)
30663         /*
30664          * Value of 1 to indicate firmware support 64-bit flow handle.
30665          * Value of 0 to indicate firmware not support 64-bit flow handle.
30666          */
30667         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_64BIT_SUPPORTED \
30668                 UINT32_C(0x2)
30669         /*
30670          * Value of 1 to indicate firmware support flow batch delete operation through
30671          * HWRM_CFA_FLOW_FLUSH command.
30672          * Value of 0 to indicate that the firmware does not support flow batch delete
30673          * operation.
30674          */
30675         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_BATCH_DELETE_SUPPORTED \
30676                 UINT32_C(0x4)
30677         /*
30678          * Value of 1 to indicate that the firmware support flow reset all operation through
30679          * HWRM_CFA_FLOW_FLUSH command.
30680          * Value of 0 indicates firmware does not support flow reset all operation.
30681          */
30682         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_RESET_ALL_SUPPORTED \
30683                 UINT32_C(0x8)
30684         /*
30685          * Value of 1 to indicate that firmware supports use of FID as dest_id in
30686          * HWRM_CFA_NTUPLE_ALLOC/CFG commands.
30687          * Value of 0 indicates firmware does not support use of FID as dest_id.
30688          */
30689         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_DEST_FUNC_SUPPORTED \
30690                 UINT32_C(0x10)
30691         /*
30692          * Value of 1 to indicate that firmware supports TX EEM flows.
30693          * Value of 0 indicates firmware does not support TX EEM flows.
30694          */
30695         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TX_EEM_FLOW_SUPPORTED \
30696                 UINT32_C(0x20)
30697         /*
30698          * Value of 1 to indicate that firmware supports RX EEM flows.
30699          * Value of 0 indicates firmware does not support RX EEM flows.
30700          */
30701         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RX_EEM_FLOW_SUPPORTED \
30702                 UINT32_C(0x40)
30703         /*
30704          * Value of 1 to indicate that firmware supports the dynamic allocation of an
30705          * on-chip flow counter which can be used for EEM flows.
30706          * Value of 0 indicates firmware does not support the dynamic allocation of an
30707          * on-chip flow counter.
30708          */
30709         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_COUNTER_ALLOC_SUPPORTED \
30710                 UINT32_C(0x80)
30711         /*
30712          * Value of 1 to indicate that firmware supports setting of
30713          * rfs_ring_tbl_idx in HWRM_CFA_NTUPLE_ALLOC command.
30714          * Value of 0 indicates firmware does not support rfs_ring_tbl_idx.
30715          */
30716         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_SUPPORTED \
30717                 UINT32_C(0x100)
30718         /*
30719          * Value of 1 to indicate that firmware supports untagged matching
30720          * criteria on HWRM_CFA_L2_FILTER_ALLOC command. Value of 0
30721          * indicates firmware does not support untagged matching.
30722          */
30723         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_UNTAGGED_VLAN_SUPPORTED \
30724                 UINT32_C(0x200)
30725         /*
30726          * Value of 1 to indicate that firmware supports XDP filter. Value
30727          * of 0 indicates firmware does not support XDP filter.
30728          */
30729         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_XDP_SUPPORTED \
30730                 UINT32_C(0x400)
30731         /*
30732          * Value of 1 to indicate that the firmware support L2 header source
30733          * fields matching criteria on HWRM_CFA_L2_FILTER_ALLOC command.
30734          * Value of 0 indicates firmware does not support L2 header source
30735          * fields matching.
30736          */
30737         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_HEADER_SOURCE_FIELDS_SUPPORTED \
30738                 UINT32_C(0x800)
30739         uint8_t unused_0[3];
30740         /*
30741          * This field is used in Output records to indicate that the output
30742          * is completely written to RAM.  This field should be read as '1'
30743          * to indicate that the output has been completely written.
30744          * When writing a command completion or response to an internal processor,
30745          * the order of writes has to be such that this field is written last.
30746          */
30747         uint8_t valid;
30748 } __attribute__((packed));
30749
30750 /******************
30751  * hwrm_cfa_tflib *
30752  ******************/
30753
30754
30755 /* hwrm_cfa_tflib_input (size:1024b/128B) */
30756 struct hwrm_cfa_tflib_input {
30757         /* The HWRM command request type. */
30758         uint16_t        req_type;
30759         /*
30760          * The completion ring to send the completion event on. This should
30761          * be the NQ ID returned from the `nq_alloc` HWRM command.
30762          */
30763         uint16_t        cmpl_ring;
30764         /*
30765          * The sequence ID is used by the driver for tracking multiple
30766          * commands. This ID is treated as opaque data by the firmware and
30767          * the value is returned in the `hwrm_resp_hdr` upon completion.
30768          */
30769         uint16_t        seq_id;
30770         /*
30771          * The target ID of the command:
30772          * * 0x0-0xFFF8 - The function ID
30773          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30774          * * 0xFFFD - Reserved for user-space HWRM interface
30775          * * 0xFFFF - HWRM
30776          */
30777         uint16_t        target_id;
30778         /*
30779          * A physical address pointer pointing to a host buffer that the
30780          * command's response data will be written. This can be either a host
30781          * physical address (HPA) or a guest physical address (GPA) and must
30782          * point to a physically contiguous block of memory.
30783          */
30784         uint64_t        resp_addr;
30785         /* TFLIB message type. */
30786         uint16_t        tf_type;
30787         /* TFLIB message subtype. */
30788         uint16_t        tf_subtype;
30789         /* unused. */
30790         uint8_t unused0[4];
30791         /* TFLIB request data. */
30792         uint32_t        tf_req[26];
30793 } __attribute__((packed));
30794
30795 /* hwrm_cfa_tflib_output (size:5632b/704B) */
30796 struct hwrm_cfa_tflib_output {
30797         /* The specific error status for the command. */
30798         uint16_t        error_code;
30799         /* The HWRM command request type. */
30800         uint16_t        req_type;
30801         /* The sequence ID from the original command. */
30802         uint16_t        seq_id;
30803         /* The length of the response data in number of bytes. */
30804         uint16_t        resp_len;
30805         /* TFLIB message type. */
30806         uint16_t        tf_type;
30807         /* TFLIB message subtype. */
30808         uint16_t        tf_subtype;
30809         /* TFLIB response code */
30810         uint32_t        tf_resp_code;
30811         /* TFLIB response data. */
30812         uint32_t        tf_resp[170];
30813         /* unused. */
30814         uint8_t unused1[7];
30815         /*
30816          * This field is used in Output records to indicate that the output
30817          * is completely written to RAM.  This field should be read as '1'
30818          * to indicate that the output has been completely written.
30819          * When writing a command completion or response to an internal processor,
30820          * the order of writes has to be such that this field is written last.
30821          */
30822         uint8_t valid;
30823 } __attribute__((packed));
30824
30825 /******************************
30826  * hwrm_tunnel_dst_port_query *
30827  ******************************/
30828
30829
30830 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
30831 struct hwrm_tunnel_dst_port_query_input {
30832         /* The HWRM command request type. */
30833         uint16_t        req_type;
30834         /*
30835          * The completion ring to send the completion event on. This should
30836          * be the NQ ID returned from the `nq_alloc` HWRM command.
30837          */
30838         uint16_t        cmpl_ring;
30839         /*
30840          * The sequence ID is used by the driver for tracking multiple
30841          * commands. This ID is treated as opaque data by the firmware and
30842          * the value is returned in the `hwrm_resp_hdr` upon completion.
30843          */
30844         uint16_t        seq_id;
30845         /*
30846          * The target ID of the command:
30847          * * 0x0-0xFFF8 - The function ID
30848          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30849          * * 0xFFFD - Reserved for user-space HWRM interface
30850          * * 0xFFFF - HWRM
30851          */
30852         uint16_t        target_id;
30853         /*
30854          * A physical address pointer pointing to a host buffer that the
30855          * command's response data will be written. This can be either a host
30856          * physical address (HPA) or a guest physical address (GPA) and must
30857          * point to a physically contiguous block of memory.
30858          */
30859         uint64_t        resp_addr;
30860         /* Tunnel Type. */
30861         uint8_t tunnel_type;
30862         /* Virtual eXtensible Local Area Network (VXLAN) */
30863         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
30864                 UINT32_C(0x1)
30865         /* Generic Network Virtualization Encapsulation (Geneve) */
30866         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
30867                 UINT32_C(0x5)
30868         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
30869         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 \
30870                 UINT32_C(0x9)
30871         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
30872         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 \
30873                 UINT32_C(0xa)
30874         /* Use fixed layer 2 ether type of 0xFFFF */
30875         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_L2_ETYPE \
30876                 UINT32_C(0xb)
30877         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
30878         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
30879                 UINT32_C(0xc)
30880         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST \
30881                 HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
30882         uint8_t unused_0[7];
30883 } __attribute__((packed));
30884
30885 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
30886 struct hwrm_tunnel_dst_port_query_output {
30887         /* The specific error status for the command. */
30888         uint16_t        error_code;
30889         /* The HWRM command request type. */
30890         uint16_t        req_type;
30891         /* The sequence ID from the original command. */
30892         uint16_t        seq_id;
30893         /* The length of the response data in number of bytes. */
30894         uint16_t        resp_len;
30895         /*
30896          * This field represents the identifier of L4 destination port
30897          * used for the given tunnel type. This field is valid for
30898          * specific tunnel types that use layer 4 (e.g. UDP)
30899          * transports for tunneling.
30900          */
30901         uint16_t        tunnel_dst_port_id;
30902         /*
30903          * This field represents the value of L4 destination port
30904          * identified by tunnel_dst_port_id. This field is valid for
30905          * specific tunnel types that use layer 4 (e.g. UDP)
30906          * transports for tunneling.
30907          * This field is in network byte order.
30908          *
30909          * A value of 0 means that the destination port is not
30910          * configured.
30911          */
30912         uint16_t        tunnel_dst_port_val;
30913         uint8_t unused_0[3];
30914         /*
30915          * This field is used in Output records to indicate that the output
30916          * is completely written to RAM.  This field should be read as '1'
30917          * to indicate that the output has been completely written.
30918          * When writing a command completion or response to an internal processor,
30919          * the order of writes has to be such that this field is written last.
30920          */
30921         uint8_t valid;
30922 } __attribute__((packed));
30923
30924 /******************************
30925  * hwrm_tunnel_dst_port_alloc *
30926  ******************************/
30927
30928
30929 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
30930 struct hwrm_tunnel_dst_port_alloc_input {
30931         /* The HWRM command request type. */
30932         uint16_t        req_type;
30933         /*
30934          * The completion ring to send the completion event on. This should
30935          * be the NQ ID returned from the `nq_alloc` HWRM command.
30936          */
30937         uint16_t        cmpl_ring;
30938         /*
30939          * The sequence ID is used by the driver for tracking multiple
30940          * commands. This ID is treated as opaque data by the firmware and
30941          * the value is returned in the `hwrm_resp_hdr` upon completion.
30942          */
30943         uint16_t        seq_id;
30944         /*
30945          * The target ID of the command:
30946          * * 0x0-0xFFF8 - The function ID
30947          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30948          * * 0xFFFD - Reserved for user-space HWRM interface
30949          * * 0xFFFF - HWRM
30950          */
30951         uint16_t        target_id;
30952         /*
30953          * A physical address pointer pointing to a host buffer that the
30954          * command's response data will be written. This can be either a host
30955          * physical address (HPA) or a guest physical address (GPA) and must
30956          * point to a physically contiguous block of memory.
30957          */
30958         uint64_t        resp_addr;
30959         /* Tunnel Type. */
30960         uint8_t tunnel_type;
30961         /* Virtual eXtensible Local Area Network (VXLAN) */
30962         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
30963                 UINT32_C(0x1)
30964         /* Generic Network Virtualization Encapsulation (Geneve) */
30965         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
30966                 UINT32_C(0x5)
30967         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
30968         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
30969                 UINT32_C(0x9)
30970         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
30971         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
30972                 UINT32_C(0xa)
30973         /* Use fixed layer 2 ether type of 0xFFFF */
30974         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
30975                 UINT32_C(0xb)
30976         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
30977         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
30978                 UINT32_C(0xc)
30979         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST \
30980                 HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
30981         uint8_t unused_0;
30982         /*
30983          * This field represents the value of L4 destination port used
30984          * for the given tunnel type. This field is valid for
30985          * specific tunnel types that use layer 4 (e.g. UDP)
30986          * transports for tunneling.
30987          *
30988          * This field is in network byte order.
30989          *
30990          * A value of 0 shall fail the command.
30991          */
30992         uint16_t        tunnel_dst_port_val;
30993         uint8_t unused_1[4];
30994 } __attribute__((packed));
30995
30996 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
30997 struct hwrm_tunnel_dst_port_alloc_output {
30998         /* The specific error status for the command. */
30999         uint16_t        error_code;
31000         /* The HWRM command request type. */
31001         uint16_t        req_type;
31002         /* The sequence ID from the original command. */
31003         uint16_t        seq_id;
31004         /* The length of the response data in number of bytes. */
31005         uint16_t        resp_len;
31006         /*
31007          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
31008          * types that has l4 destination port parameters.
31009          */
31010         uint16_t        tunnel_dst_port_id;
31011         uint8_t unused_0[5];
31012         /*
31013          * This field is used in Output records to indicate that the output
31014          * is completely written to RAM.  This field should be read as '1'
31015          * to indicate that the output has been completely written.
31016          * When writing a command completion or response to an internal processor,
31017          * the order of writes has to be such that this field is written last.
31018          */
31019         uint8_t valid;
31020 } __attribute__((packed));
31021
31022 /*****************************
31023  * hwrm_tunnel_dst_port_free *
31024  *****************************/
31025
31026
31027 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
31028 struct hwrm_tunnel_dst_port_free_input {
31029         /* The HWRM command request type. */
31030         uint16_t        req_type;
31031         /*
31032          * The completion ring to send the completion event on. This should
31033          * be the NQ ID returned from the `nq_alloc` HWRM command.
31034          */
31035         uint16_t        cmpl_ring;
31036         /*
31037          * The sequence ID is used by the driver for tracking multiple
31038          * commands. This ID is treated as opaque data by the firmware and
31039          * the value is returned in the `hwrm_resp_hdr` upon completion.
31040          */
31041         uint16_t        seq_id;
31042         /*
31043          * The target ID of the command:
31044          * * 0x0-0xFFF8 - The function ID
31045          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31046          * * 0xFFFD - Reserved for user-space HWRM interface
31047          * * 0xFFFF - HWRM
31048          */
31049         uint16_t        target_id;
31050         /*
31051          * A physical address pointer pointing to a host buffer that the
31052          * command's response data will be written. This can be either a host
31053          * physical address (HPA) or a guest physical address (GPA) and must
31054          * point to a physically contiguous block of memory.
31055          */
31056         uint64_t        resp_addr;
31057         /* Tunnel Type. */
31058         uint8_t tunnel_type;
31059         /* Virtual eXtensible Local Area Network (VXLAN) */
31060         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN \
31061                 UINT32_C(0x1)
31062         /* Generic Network Virtualization Encapsulation (Geneve) */
31063         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE \
31064                 UINT32_C(0x5)
31065         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
31066         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
31067                 UINT32_C(0x9)
31068         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
31069         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
31070                 UINT32_C(0xa)
31071         /* Use fixed layer 2 ether type of 0xFFFF */
31072         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
31073                 UINT32_C(0xb)
31074         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
31075         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
31076                 UINT32_C(0xc)
31077         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST \
31078                 HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
31079         uint8_t unused_0;
31080         /*
31081          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
31082          * types that has l4 destination port parameters.
31083          */
31084         uint16_t        tunnel_dst_port_id;
31085         uint8_t unused_1[4];
31086 } __attribute__((packed));
31087
31088 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
31089 struct hwrm_tunnel_dst_port_free_output {
31090         /* The specific error status for the command. */
31091         uint16_t        error_code;
31092         /* The HWRM command request type. */
31093         uint16_t        req_type;
31094         /* The sequence ID from the original command. */
31095         uint16_t        seq_id;
31096         /* The length of the response data in number of bytes. */
31097         uint16_t        resp_len;
31098         uint8_t unused_1[7];
31099         /*
31100          * This field is used in Output records to indicate that the output
31101          * is completely written to RAM.  This field should be read as '1'
31102          * to indicate that the output has been completely written.
31103          * When writing a command completion or response to an internal processor,
31104          * the order of writes has to be such that this field is written last.
31105          */
31106         uint8_t valid;
31107 } __attribute__((packed));
31108
31109 /* Periodic statistics context DMA to host. */
31110 /* ctx_hw_stats (size:1280b/160B) */
31111 struct ctx_hw_stats {
31112         /* Number of received unicast packets */
31113         uint64_t        rx_ucast_pkts;
31114         /* Number of received multicast packets */
31115         uint64_t        rx_mcast_pkts;
31116         /* Number of received broadcast packets */
31117         uint64_t        rx_bcast_pkts;
31118         /* Number of discarded packets on received path */
31119         uint64_t        rx_discard_pkts;
31120         /* Number of dropped packets on received path */
31121         uint64_t        rx_drop_pkts;
31122         /* Number of received bytes for unicast traffic */
31123         uint64_t        rx_ucast_bytes;
31124         /* Number of received bytes for multicast traffic */
31125         uint64_t        rx_mcast_bytes;
31126         /* Number of received bytes for broadcast traffic */
31127         uint64_t        rx_bcast_bytes;
31128         /* Number of transmitted unicast packets */
31129         uint64_t        tx_ucast_pkts;
31130         /* Number of transmitted multicast packets */
31131         uint64_t        tx_mcast_pkts;
31132         /* Number of transmitted broadcast packets */
31133         uint64_t        tx_bcast_pkts;
31134         /* Number of discarded packets on transmit path */
31135         uint64_t        tx_discard_pkts;
31136         /* Number of dropped packets on transmit path */
31137         uint64_t        tx_drop_pkts;
31138         /* Number of transmitted bytes for unicast traffic */
31139         uint64_t        tx_ucast_bytes;
31140         /* Number of transmitted bytes for multicast traffic */
31141         uint64_t        tx_mcast_bytes;
31142         /* Number of transmitted bytes for broadcast traffic */
31143         uint64_t        tx_bcast_bytes;
31144         /* Number of TPA packets */
31145         uint64_t        tpa_pkts;
31146         /* Number of TPA bytes */
31147         uint64_t        tpa_bytes;
31148         /* Number of TPA events */
31149         uint64_t        tpa_events;
31150         /* Number of TPA aborts */
31151         uint64_t        tpa_aborts;
31152 } __attribute__((packed));
31153
31154 /* Periodic statistics context DMA to host. */
31155 /* ctx_hw_stats_ext (size:1344b/168B) */
31156 struct ctx_hw_stats_ext {
31157         /* Number of received unicast packets */
31158         uint64_t        rx_ucast_pkts;
31159         /* Number of received multicast packets */
31160         uint64_t        rx_mcast_pkts;
31161         /* Number of received broadcast packets */
31162         uint64_t        rx_bcast_pkts;
31163         /* Number of discarded packets on received path */
31164         uint64_t        rx_discard_pkts;
31165         /* Number of dropped packets on received path */
31166         uint64_t        rx_drop_pkts;
31167         /* Number of received bytes for unicast traffic */
31168         uint64_t        rx_ucast_bytes;
31169         /* Number of received bytes for multicast traffic */
31170         uint64_t        rx_mcast_bytes;
31171         /* Number of received bytes for broadcast traffic */
31172         uint64_t        rx_bcast_bytes;
31173         /* Number of transmitted unicast packets */
31174         uint64_t        tx_ucast_pkts;
31175         /* Number of transmitted multicast packets */
31176         uint64_t        tx_mcast_pkts;
31177         /* Number of transmitted broadcast packets */
31178         uint64_t        tx_bcast_pkts;
31179         /* Number of discarded packets on transmit path */
31180         uint64_t        tx_discard_pkts;
31181         /* Number of dropped packets on transmit path */
31182         uint64_t        tx_drop_pkts;
31183         /* Number of transmitted bytes for unicast traffic */
31184         uint64_t        tx_ucast_bytes;
31185         /* Number of transmitted bytes for multicast traffic */
31186         uint64_t        tx_mcast_bytes;
31187         /* Number of transmitted bytes for broadcast traffic */
31188         uint64_t        tx_bcast_bytes;
31189         /* Number of TPA eligible packets */
31190         uint64_t        rx_tpa_eligible_pkt;
31191         /* Number of TPA eligible bytes */
31192         uint64_t        rx_tpa_eligible_bytes;
31193         /* Number of TPA packets */
31194         uint64_t        rx_tpa_pkt;
31195         /* Number of TPA bytes */
31196         uint64_t        rx_tpa_bytes;
31197         /* Number of TPA errors */
31198         uint64_t        rx_tpa_errors;
31199 } __attribute__((packed));
31200
31201 /* Periodic Engine statistics context DMA to host. */
31202 /* ctx_eng_stats (size:512b/64B) */
31203 struct ctx_eng_stats {
31204         /*
31205          * Count of data bytes into the Engine.
31206          * This includes any user supplied prefix,
31207          * but does not include any predefined
31208          * prefix data.
31209          */
31210         uint64_t        eng_bytes_in;
31211         /* Count of data bytes out of the Engine. */
31212         uint64_t        eng_bytes_out;
31213         /*
31214          * Count, in 4-byte (dword) units, of bytes
31215          * that are input as auxiliary data.
31216          * This includes the aux_cmd data.
31217          */
31218         uint64_t        aux_bytes_in;
31219         /*
31220          * Count, in 4-byte (dword) units, of bytes
31221          * that are output as auxiliary data.
31222          * This count is the buffer space for aux_data
31223          * output provided in the RQE, not the actual
31224          * aux_data written
31225          */
31226         uint64_t        aux_bytes_out;
31227         /* Count of number of commands executed. */
31228         uint64_t        commands;
31229         /*
31230          * Count of number of error commands.
31231          * These are the commands with a
31232          * non-zero status value.
31233          */
31234         uint64_t        error_commands;
31235         /*
31236          * Compression/Encryption Engine usage,
31237          * the unit is count of clock cycles
31238          */
31239         uint64_t        cce_engine_usage;
31240         /*
31241          * De-Compression/De-cryption Engine usage,
31242          * the unit is count of clock cycles
31243          */
31244         uint64_t        cdd_engine_usage;
31245 } __attribute__((packed));
31246
31247 /***********************
31248  * hwrm_stat_ctx_alloc *
31249  ***********************/
31250
31251
31252 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */
31253 struct hwrm_stat_ctx_alloc_input {
31254         /* The HWRM command request type. */
31255         uint16_t        req_type;
31256         /*
31257          * The completion ring to send the completion event on. This should
31258          * be the NQ ID returned from the `nq_alloc` HWRM command.
31259          */
31260         uint16_t        cmpl_ring;
31261         /*
31262          * The sequence ID is used by the driver for tracking multiple
31263          * commands. This ID is treated as opaque data by the firmware and
31264          * the value is returned in the `hwrm_resp_hdr` upon completion.
31265          */
31266         uint16_t        seq_id;
31267         /*
31268          * The target ID of the command:
31269          * * 0x0-0xFFF8 - The function ID
31270          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31271          * * 0xFFFD - Reserved for user-space HWRM interface
31272          * * 0xFFFF - HWRM
31273          */
31274         uint16_t        target_id;
31275         /*
31276          * A physical address pointer pointing to a host buffer that the
31277          * command's response data will be written. This can be either a host
31278          * physical address (HPA) or a guest physical address (GPA) and must
31279          * point to a physically contiguous block of memory.
31280          */
31281         uint64_t        resp_addr;
31282         /*
31283          * This is the address for statistic block.
31284          * > For new versions of the chip, this address should be 128B
31285          * > aligned.
31286          */
31287         uint64_t        stats_dma_addr;
31288         /*
31289          * The statistic block update period in ms.
31290          * e.g. 250ms, 500ms, 750ms, 1000ms.
31291          * If update_period_ms is 0, then the stats update
31292          * shall be never done and the DMA address shall not be used.
31293          * In this case, the stat block can only be read by
31294          * hwrm_stat_ctx_query command.
31295          * On Ethernet/L2 based devices:
31296          *   if tpa v2 supported (hwrm_vnic_qcaps[max_aggs_supported]>0),
31297          *       ctx_hw_stats_ext is used for DMA,
31298          *   else
31299          *       ctx_hw_stats is used for DMA.
31300          */
31301         uint32_t        update_period_ms;
31302         /*
31303          * This field is used to specify statistics context specific
31304          * configuration flags.
31305          */
31306         uint8_t stat_ctx_flags;
31307         /*
31308          * When this bit is set to '1', the statistics context shall be
31309          * allocated for RoCE traffic only. In this case, traffic other
31310          * than offloaded RoCE traffic shall not be included in this
31311          * statistic context.
31312          * When this bit is set to '0', the statistics context shall be
31313          * used for network traffic or engine traffic.
31314          */
31315         #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE     UINT32_C(0x1)
31316         uint8_t unused_0;
31317         /*
31318          * This is the size of the structure (ctx_hw_stats or
31319          * ctx_hw_stats_ext) that the driver has allocated to be used
31320          * for the periodic DMA updates.
31321          */
31322         uint16_t        stats_dma_length;
31323 } __attribute__((packed));
31324
31325 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
31326 struct hwrm_stat_ctx_alloc_output {
31327         /* The specific error status for the command. */
31328         uint16_t        error_code;
31329         /* The HWRM command request type. */
31330         uint16_t        req_type;
31331         /* The sequence ID from the original command. */
31332         uint16_t        seq_id;
31333         /* The length of the response data in number of bytes. */
31334         uint16_t        resp_len;
31335         /* This is the statistics context ID value. */
31336         uint32_t        stat_ctx_id;
31337         uint8_t unused_0[3];
31338         /*
31339          * This field is used in Output records to indicate that the output
31340          * is completely written to RAM.  This field should be read as '1'
31341          * to indicate that the output has been completely written.
31342          * When writing a command completion or response to an internal processor,
31343          * the order of writes has to be such that this field is written last.
31344          */
31345         uint8_t valid;
31346 } __attribute__((packed));
31347
31348 /**********************
31349  * hwrm_stat_ctx_free *
31350  **********************/
31351
31352
31353 /* hwrm_stat_ctx_free_input (size:192b/24B) */
31354 struct hwrm_stat_ctx_free_input {
31355         /* The HWRM command request type. */
31356         uint16_t        req_type;
31357         /*
31358          * The completion ring to send the completion event on. This should
31359          * be the NQ ID returned from the `nq_alloc` HWRM command.
31360          */
31361         uint16_t        cmpl_ring;
31362         /*
31363          * The sequence ID is used by the driver for tracking multiple
31364          * commands. This ID is treated as opaque data by the firmware and
31365          * the value is returned in the `hwrm_resp_hdr` upon completion.
31366          */
31367         uint16_t        seq_id;
31368         /*
31369          * The target ID of the command:
31370          * * 0x0-0xFFF8 - The function ID
31371          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31372          * * 0xFFFD - Reserved for user-space HWRM interface
31373          * * 0xFFFF - HWRM
31374          */
31375         uint16_t        target_id;
31376         /*
31377          * A physical address pointer pointing to a host buffer that the
31378          * command's response data will be written. This can be either a host
31379          * physical address (HPA) or a guest physical address (GPA) and must
31380          * point to a physically contiguous block of memory.
31381          */
31382         uint64_t        resp_addr;
31383         /* ID of the statistics context that is being queried. */
31384         uint32_t        stat_ctx_id;
31385         uint8_t unused_0[4];
31386 } __attribute__((packed));
31387
31388 /* hwrm_stat_ctx_free_output (size:128b/16B) */
31389 struct hwrm_stat_ctx_free_output {
31390         /* The specific error status for the command. */
31391         uint16_t        error_code;
31392         /* The HWRM command request type. */
31393         uint16_t        req_type;
31394         /* The sequence ID from the original command. */
31395         uint16_t        seq_id;
31396         /* The length of the response data in number of bytes. */
31397         uint16_t        resp_len;
31398         /* This is the statistics context ID value. */
31399         uint32_t        stat_ctx_id;
31400         uint8_t unused_0[3];
31401         /*
31402          * This field is used in Output records to indicate that the output
31403          * is completely written to RAM.  This field should be read as '1'
31404          * to indicate that the output has been completely written.
31405          * When writing a command completion or response to an internal processor,
31406          * the order of writes has to be such that this field is written last.
31407          */
31408         uint8_t valid;
31409 } __attribute__((packed));
31410
31411 /***********************
31412  * hwrm_stat_ctx_query *
31413  ***********************/
31414
31415
31416 /* hwrm_stat_ctx_query_input (size:192b/24B) */
31417 struct hwrm_stat_ctx_query_input {
31418         /* The HWRM command request type. */
31419         uint16_t        req_type;
31420         /*
31421          * The completion ring to send the completion event on. This should
31422          * be the NQ ID returned from the `nq_alloc` HWRM command.
31423          */
31424         uint16_t        cmpl_ring;
31425         /*
31426          * The sequence ID is used by the driver for tracking multiple
31427          * commands. This ID is treated as opaque data by the firmware and
31428          * the value is returned in the `hwrm_resp_hdr` upon completion.
31429          */
31430         uint16_t        seq_id;
31431         /*
31432          * The target ID of the command:
31433          * * 0x0-0xFFF8 - The function ID
31434          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31435          * * 0xFFFD - Reserved for user-space HWRM interface
31436          * * 0xFFFF - HWRM
31437          */
31438         uint16_t        target_id;
31439         /*
31440          * A physical address pointer pointing to a host buffer that the
31441          * command's response data will be written. This can be either a host
31442          * physical address (HPA) or a guest physical address (GPA) and must
31443          * point to a physically contiguous block of memory.
31444          */
31445         uint64_t        resp_addr;
31446         /* ID of the statistics context that is being queried. */
31447         uint32_t        stat_ctx_id;
31448         uint8_t unused_0[4];
31449 } __attribute__((packed));
31450
31451 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
31452 struct hwrm_stat_ctx_query_output {
31453         /* The specific error status for the command. */
31454         uint16_t        error_code;
31455         /* The HWRM command request type. */
31456         uint16_t        req_type;
31457         /* The sequence ID from the original command. */
31458         uint16_t        seq_id;
31459         /* The length of the response data in number of bytes. */
31460         uint16_t        resp_len;
31461         /* Number of transmitted unicast packets */
31462         uint64_t        tx_ucast_pkts;
31463         /* Number of transmitted multicast packets */
31464         uint64_t        tx_mcast_pkts;
31465         /* Number of transmitted broadcast packets */
31466         uint64_t        tx_bcast_pkts;
31467         /* Number of transmitted packets with error */
31468         uint64_t        tx_err_pkts;
31469         /* Number of dropped packets on transmit path */
31470         uint64_t        tx_drop_pkts;
31471         /* Number of transmitted bytes for unicast traffic */
31472         uint64_t        tx_ucast_bytes;
31473         /* Number of transmitted bytes for multicast traffic */
31474         uint64_t        tx_mcast_bytes;
31475         /* Number of transmitted bytes for broadcast traffic */
31476         uint64_t        tx_bcast_bytes;
31477         /* Number of received unicast packets */
31478         uint64_t        rx_ucast_pkts;
31479         /* Number of received multicast packets */
31480         uint64_t        rx_mcast_pkts;
31481         /* Number of received broadcast packets */
31482         uint64_t        rx_bcast_pkts;
31483         /* Number of received packets with error */
31484         uint64_t        rx_err_pkts;
31485         /* Number of dropped packets on received path */
31486         uint64_t        rx_drop_pkts;
31487         /* Number of received bytes for unicast traffic */
31488         uint64_t        rx_ucast_bytes;
31489         /* Number of received bytes for multicast traffic */
31490         uint64_t        rx_mcast_bytes;
31491         /* Number of received bytes for broadcast traffic */
31492         uint64_t        rx_bcast_bytes;
31493         /* Number of aggregated unicast packets */
31494         uint64_t        rx_agg_pkts;
31495         /* Number of aggregated unicast bytes */
31496         uint64_t        rx_agg_bytes;
31497         /* Number of aggregation events */
31498         uint64_t        rx_agg_events;
31499         /* Number of aborted aggregations */
31500         uint64_t        rx_agg_aborts;
31501         uint8_t unused_0[7];
31502         /*
31503          * This field is used in Output records to indicate that the output
31504          * is completely written to RAM.  This field should be read as '1'
31505          * to indicate that the output has been completely written.
31506          * When writing a command completion or response to an internal processor,
31507          * the order of writes has to be such that this field is written last.
31508          */
31509         uint8_t valid;
31510 } __attribute__((packed));
31511
31512 /***************************
31513  * hwrm_stat_ctx_eng_query *
31514  ***************************/
31515
31516
31517 /* hwrm_stat_ctx_eng_query_input (size:192b/24B) */
31518 struct hwrm_stat_ctx_eng_query_input {
31519         /* The HWRM command request type. */
31520         uint16_t        req_type;
31521         /*
31522          * The completion ring to send the completion event on. This should
31523          * be the NQ ID returned from the `nq_alloc` HWRM command.
31524          */
31525         uint16_t        cmpl_ring;
31526         /*
31527          * The sequence ID is used by the driver for tracking multiple
31528          * commands. This ID is treated as opaque data by the firmware and
31529          * the value is returned in the `hwrm_resp_hdr` upon completion.
31530          */
31531         uint16_t        seq_id;
31532         /*
31533          * The target ID of the command:
31534          * * 0x0-0xFFF8 - The function ID
31535          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31536          * * 0xFFFD - Reserved for user-space HWRM interface
31537          * * 0xFFFF - HWRM
31538          */
31539         uint16_t        target_id;
31540         /*
31541          * A physical address pointer pointing to a host buffer that the
31542          * command's response data will be written. This can be either a host
31543          * physical address (HPA) or a guest physical address (GPA) and must
31544          * point to a physically contiguous block of memory.
31545          */
31546         uint64_t        resp_addr;
31547         /* ID of the statistics context that is being queried. */
31548         uint32_t        stat_ctx_id;
31549         uint8_t unused_0[4];
31550 } __attribute__((packed));
31551
31552 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
31553 struct hwrm_stat_ctx_eng_query_output {
31554         /* The specific error status for the command. */
31555         uint16_t        error_code;
31556         /* The HWRM command request type. */
31557         uint16_t        req_type;
31558         /* The sequence ID from the original command. */
31559         uint16_t        seq_id;
31560         /* The length of the response data in number of bytes. */
31561         uint16_t        resp_len;
31562         /*
31563          * Count of data bytes into the Engine.
31564          * This includes any user supplied prefix,
31565          * but does not include any predefined
31566          * prefix data.
31567          */
31568         uint64_t        eng_bytes_in;
31569         /* Count of data bytes out of the Engine. */
31570         uint64_t        eng_bytes_out;
31571         /*
31572          * Count, in 4-byte (dword) units, of bytes
31573          * that are input as auxiliary data.
31574          * This includes the aux_cmd data.
31575          */
31576         uint64_t        aux_bytes_in;
31577         /*
31578          * Count, in 4-byte (dword) units, of bytes
31579          * that are output as auxiliary data.
31580          * This count is the buffer space for aux_data
31581          * output provided in the RQE, not the actual
31582          * aux_data written
31583          */
31584         uint64_t        aux_bytes_out;
31585         /* Count of number of commands executed. */
31586         uint64_t        commands;
31587         /*
31588          * Count of number of error commands.
31589          * These are the commands with a
31590          * non-zero status value.
31591          */
31592         uint64_t        error_commands;
31593         /*
31594          * Compression/Encryption Engine usage,
31595          * the unit is count of clock cycles
31596          */
31597         uint64_t        cce_engine_usage;
31598         /*
31599          * De-Compression/De-cryption Engine usage,
31600          * the unit is count of clock cycles
31601          */
31602         uint64_t        cdd_engine_usage;
31603         uint8_t unused_0[7];
31604         /*
31605          * This field is used in Output records to indicate that the output
31606          * is completely written to RAM.  This field should be read as '1'
31607          * to indicate that the output has been completely written.
31608          * When writing a command completion or response to an internal processor,
31609          * the order of writes has to be such that this field is written last.
31610          */
31611         uint8_t valid;
31612 } __attribute__((packed));
31613
31614 /***************************
31615  * hwrm_stat_ctx_clr_stats *
31616  ***************************/
31617
31618
31619 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
31620 struct hwrm_stat_ctx_clr_stats_input {
31621         /* The HWRM command request type. */
31622         uint16_t        req_type;
31623         /*
31624          * The completion ring to send the completion event on. This should
31625          * be the NQ ID returned from the `nq_alloc` HWRM command.
31626          */
31627         uint16_t        cmpl_ring;
31628         /*
31629          * The sequence ID is used by the driver for tracking multiple
31630          * commands. This ID is treated as opaque data by the firmware and
31631          * the value is returned in the `hwrm_resp_hdr` upon completion.
31632          */
31633         uint16_t        seq_id;
31634         /*
31635          * The target ID of the command:
31636          * * 0x0-0xFFF8 - The function ID
31637          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31638          * * 0xFFFD - Reserved for user-space HWRM interface
31639          * * 0xFFFF - HWRM
31640          */
31641         uint16_t        target_id;
31642         /*
31643          * A physical address pointer pointing to a host buffer that the
31644          * command's response data will be written. This can be either a host
31645          * physical address (HPA) or a guest physical address (GPA) and must
31646          * point to a physically contiguous block of memory.
31647          */
31648         uint64_t        resp_addr;
31649         /* ID of the statistics context that is being queried. */
31650         uint32_t        stat_ctx_id;
31651         uint8_t unused_0[4];
31652 } __attribute__((packed));
31653
31654 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
31655 struct hwrm_stat_ctx_clr_stats_output {
31656         /* The specific error status for the command. */
31657         uint16_t        error_code;
31658         /* The HWRM command request type. */
31659         uint16_t        req_type;
31660         /* The sequence ID from the original command. */
31661         uint16_t        seq_id;
31662         /* The length of the response data in number of bytes. */
31663         uint16_t        resp_len;
31664         uint8_t unused_0[7];
31665         /*
31666          * This field is used in Output records to indicate that the output
31667          * is completely written to RAM.  This field should be read as '1'
31668          * to indicate that the output has been completely written.
31669          * When writing a command completion or response to an internal processor,
31670          * the order of writes has to be such that this field is written last.
31671          */
31672         uint8_t valid;
31673 } __attribute__((packed));
31674
31675 /********************
31676  * hwrm_pcie_qstats *
31677  ********************/
31678
31679
31680 /* hwrm_pcie_qstats_input (size:256b/32B) */
31681 struct hwrm_pcie_qstats_input {
31682         /* The HWRM command request type. */
31683         uint16_t        req_type;
31684         /*
31685          * The completion ring to send the completion event on. This should
31686          * be the NQ ID returned from the `nq_alloc` HWRM command.
31687          */
31688         uint16_t        cmpl_ring;
31689         /*
31690          * The sequence ID is used by the driver for tracking multiple
31691          * commands. This ID is treated as opaque data by the firmware and
31692          * the value is returned in the `hwrm_resp_hdr` upon completion.
31693          */
31694         uint16_t        seq_id;
31695         /*
31696          * The target ID of the command:
31697          * * 0x0-0xFFF8 - The function ID
31698          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31699          * * 0xFFFD - Reserved for user-space HWRM interface
31700          * * 0xFFFF - HWRM
31701          */
31702         uint16_t        target_id;
31703         /*
31704          * A physical address pointer pointing to a host buffer that the
31705          * command's response data will be written. This can be either a host
31706          * physical address (HPA) or a guest physical address (GPA) and must
31707          * point to a physically contiguous block of memory.
31708          */
31709         uint64_t        resp_addr;
31710         /*
31711          * The size of PCIe statistics block in bytes.
31712          * Firmware will DMA the PCIe statistics to
31713          * the host with this field size in the response.
31714          */
31715         uint16_t        pcie_stat_size;
31716         uint8_t unused_0[6];
31717         /*
31718          * This is the host address where
31719          * PCIe statistics will be stored
31720          */
31721         uint64_t        pcie_stat_host_addr;
31722 } __attribute__((packed));
31723
31724 /* hwrm_pcie_qstats_output (size:128b/16B) */
31725 struct hwrm_pcie_qstats_output {
31726         /* The specific error status for the command. */
31727         uint16_t        error_code;
31728         /* The HWRM command request type. */
31729         uint16_t        req_type;
31730         /* The sequence ID from the original command. */
31731         uint16_t        seq_id;
31732         /* The length of the response data in number of bytes. */
31733         uint16_t        resp_len;
31734         /* The size of PCIe statistics block in bytes. */
31735         uint16_t        pcie_stat_size;
31736         uint8_t unused_0[5];
31737         /*
31738          * This field is used in Output records to indicate that the output
31739          * is completely written to RAM.  This field should be read as '1'
31740          * to indicate that the output has been completely written.
31741          * When writing a command completion or response to an internal processor,
31742          * the order of writes has to be such that this field is written last.
31743          */
31744         uint8_t valid;
31745 } __attribute__((packed));
31746
31747 /* PCIe Statistics Formats */
31748 /* pcie_ctx_hw_stats (size:768b/96B) */
31749 struct pcie_ctx_hw_stats {
31750         /* Number of physical layer receiver errors */
31751         uint64_t        pcie_pl_signal_integrity;
31752         /* Number of DLLP CRC errors detected by Data Link Layer */
31753         uint64_t        pcie_dl_signal_integrity;
31754         /*
31755          * Number of TLP LCRC and sequence number errors detected
31756          * by Data Link Layer
31757          */
31758         uint64_t        pcie_tl_signal_integrity;
31759         /* Number of times LTSSM entered Recovery state */
31760         uint64_t        pcie_link_integrity;
31761         /* Number of TLP bytes that have been trasmitted */
31762         uint64_t        pcie_tx_traffic_rate;
31763         /* Number of TLP bytes that have been received */
31764         uint64_t        pcie_rx_traffic_rate;
31765         /* Number of DLLP bytes that have been trasmitted */
31766         uint64_t        pcie_tx_dllp_statistics;
31767         /* Number of DLLP bytes that have been received */
31768         uint64_t        pcie_rx_dllp_statistics;
31769         /*
31770          * Number of times spent in each phase of gen3
31771          * equalization
31772          */
31773         uint64_t        pcie_equalization_time;
31774         /* Records the last 16 transitions of the LTSSM */
31775         uint32_t        pcie_ltssm_histogram[4];
31776         /*
31777          * Record the last 8 reasons on why LTSSM transitioned
31778          * to Recovery
31779          */
31780         uint64_t        pcie_recovery_histogram;
31781 } __attribute__((packed));
31782
31783 /**********************
31784  * hwrm_exec_fwd_resp *
31785  **********************/
31786
31787
31788 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
31789 struct hwrm_exec_fwd_resp_input {
31790         /* The HWRM command request type. */
31791         uint16_t        req_type;
31792         /*
31793          * The completion ring to send the completion event on. This should
31794          * be the NQ ID returned from the `nq_alloc` HWRM command.
31795          */
31796         uint16_t        cmpl_ring;
31797         /*
31798          * The sequence ID is used by the driver for tracking multiple
31799          * commands. This ID is treated as opaque data by the firmware and
31800          * the value is returned in the `hwrm_resp_hdr` upon completion.
31801          */
31802         uint16_t        seq_id;
31803         /*
31804          * The target ID of the command:
31805          * * 0x0-0xFFF8 - The function ID
31806          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31807          * * 0xFFFD - Reserved for user-space HWRM interface
31808          * * 0xFFFF - HWRM
31809          */
31810         uint16_t        target_id;
31811         /*
31812          * A physical address pointer pointing to a host buffer that the
31813          * command's response data will be written. This can be either a host
31814          * physical address (HPA) or a guest physical address (GPA) and must
31815          * point to a physically contiguous block of memory.
31816          */
31817         uint64_t        resp_addr;
31818         /*
31819          * This is an encapsulated request. This request should
31820          * be executed by the HWRM and the response should be
31821          * provided in the response buffer inside the encapsulated
31822          * request.
31823          */
31824         uint32_t        encap_request[26];
31825         /*
31826          * This value indicates the target id of the response to
31827          * the encapsulated request.
31828          * 0x0 - 0xFFF8 - Used for function ids
31829          * 0xFFF8 - 0xFFFE - Reserved for internal processors
31830          * 0xFFFF - HWRM
31831          */
31832         uint16_t        encap_resp_target_id;
31833         uint8_t unused_0[6];
31834 } __attribute__((packed));
31835
31836 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
31837 struct hwrm_exec_fwd_resp_output {
31838         /* The specific error status for the command. */
31839         uint16_t        error_code;
31840         /* The HWRM command request type. */
31841         uint16_t        req_type;
31842         /* The sequence ID from the original command. */
31843         uint16_t        seq_id;
31844         /* The length of the response data in number of bytes. */
31845         uint16_t        resp_len;
31846         uint8_t unused_0[7];
31847         /*
31848          * This field is used in Output records to indicate that the output
31849          * is completely written to RAM.  This field should be read as '1'
31850          * to indicate that the output has been completely written.
31851          * When writing a command completion or response to an internal processor,
31852          * the order of writes has to be such that this field is written last.
31853          */
31854         uint8_t valid;
31855 } __attribute__((packed));
31856
31857 /************************
31858  * hwrm_reject_fwd_resp *
31859  ************************/
31860
31861
31862 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
31863 struct hwrm_reject_fwd_resp_input {
31864         /* The HWRM command request type. */
31865         uint16_t        req_type;
31866         /*
31867          * The completion ring to send the completion event on. This should
31868          * be the NQ ID returned from the `nq_alloc` HWRM command.
31869          */
31870         uint16_t        cmpl_ring;
31871         /*
31872          * The sequence ID is used by the driver for tracking multiple
31873          * commands. This ID is treated as opaque data by the firmware and
31874          * the value is returned in the `hwrm_resp_hdr` upon completion.
31875          */
31876         uint16_t        seq_id;
31877         /*
31878          * The target ID of the command:
31879          * * 0x0-0xFFF8 - The function ID
31880          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31881          * * 0xFFFD - Reserved for user-space HWRM interface
31882          * * 0xFFFF - HWRM
31883          */
31884         uint16_t        target_id;
31885         /*
31886          * A physical address pointer pointing to a host buffer that the
31887          * command's response data will be written. This can be either a host
31888          * physical address (HPA) or a guest physical address (GPA) and must
31889          * point to a physically contiguous block of memory.
31890          */
31891         uint64_t        resp_addr;
31892         /*
31893          * This is an encapsulated request. This request should
31894          * be rejected by the HWRM and the error response should be
31895          * provided in the response buffer inside the encapsulated
31896          * request.
31897          */
31898         uint32_t        encap_request[26];
31899         /*
31900          * This value indicates the target id of the response to
31901          * the encapsulated request.
31902          * 0x0 - 0xFFF8 - Used for function ids
31903          * 0xFFF8 - 0xFFFE - Reserved for internal processors
31904          * 0xFFFF - HWRM
31905          */
31906         uint16_t        encap_resp_target_id;
31907         uint8_t unused_0[6];
31908 } __attribute__((packed));
31909
31910 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
31911 struct hwrm_reject_fwd_resp_output {
31912         /* The specific error status for the command. */
31913         uint16_t        error_code;
31914         /* The HWRM command request type. */
31915         uint16_t        req_type;
31916         /* The sequence ID from the original command. */
31917         uint16_t        seq_id;
31918         /* The length of the response data in number of bytes. */
31919         uint16_t        resp_len;
31920         uint8_t unused_0[7];
31921         /*
31922          * This field is used in Output records to indicate that the output
31923          * is completely written to RAM.  This field should be read as '1'
31924          * to indicate that the output has been completely written.
31925          * When writing a command completion or response to an internal processor,
31926          * the order of writes has to be such that this field is written last.
31927          */
31928         uint8_t valid;
31929 } __attribute__((packed));
31930
31931 /*****************
31932  * hwrm_fwd_resp *
31933  *****************/
31934
31935
31936 /* hwrm_fwd_resp_input (size:1024b/128B) */
31937 struct hwrm_fwd_resp_input {
31938         /* The HWRM command request type. */
31939         uint16_t        req_type;
31940         /*
31941          * The completion ring to send the completion event on. This should
31942          * be the NQ ID returned from the `nq_alloc` HWRM command.
31943          */
31944         uint16_t        cmpl_ring;
31945         /*
31946          * The sequence ID is used by the driver for tracking multiple
31947          * commands. This ID is treated as opaque data by the firmware and
31948          * the value is returned in the `hwrm_resp_hdr` upon completion.
31949          */
31950         uint16_t        seq_id;
31951         /*
31952          * The target ID of the command:
31953          * * 0x0-0xFFF8 - The function ID
31954          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31955          * * 0xFFFD - Reserved for user-space HWRM interface
31956          * * 0xFFFF - HWRM
31957          */
31958         uint16_t        target_id;
31959         /*
31960          * A physical address pointer pointing to a host buffer that the
31961          * command's response data will be written. This can be either a host
31962          * physical address (HPA) or a guest physical address (GPA) and must
31963          * point to a physically contiguous block of memory.
31964          */
31965         uint64_t        resp_addr;
31966         /*
31967          * This value indicates the target id of the encapsulated
31968          * response.
31969          * 0x0 - 0xFFF8 - Used for function ids
31970          * 0xFFF8 - 0xFFFE - Reserved for internal processors
31971          * 0xFFFF - HWRM
31972          */
31973         uint16_t        encap_resp_target_id;
31974         /*
31975          * This value indicates the completion ring the encapsulated
31976          * response will be optionally completed on.  If the value is
31977          * -1, then no CR completion shall be generated for the
31978          * encapsulated response. Any other value must be a
31979          * valid CR ring_id value. If a valid encap_resp_cmpl_ring
31980          * is provided, then a CR completion shall be generated for
31981          * the encapsulated response.
31982          */
31983         uint16_t        encap_resp_cmpl_ring;
31984         /* This field indicates the length of encapsulated response. */
31985         uint16_t        encap_resp_len;
31986         uint8_t unused_0;
31987         uint8_t unused_1;
31988         /*
31989          * This is the host address where the encapsulated response
31990          * will be written.
31991          * This area must be 16B aligned and must be cleared to zero
31992          * before the original request is made.
31993          */
31994         uint64_t        encap_resp_addr;
31995         /* This is an encapsulated response. */
31996         uint32_t        encap_resp[24];
31997 } __attribute__((packed));
31998
31999 /* hwrm_fwd_resp_output (size:128b/16B) */
32000 struct hwrm_fwd_resp_output {
32001         /* The specific error status for the command. */
32002         uint16_t        error_code;
32003         /* The HWRM command request type. */
32004         uint16_t        req_type;
32005         /* The sequence ID from the original command. */
32006         uint16_t        seq_id;
32007         /* The length of the response data in number of bytes. */
32008         uint16_t        resp_len;
32009         uint8_t unused_0[7];
32010         /*
32011          * This field is used in Output records to indicate that the output
32012          * is completely written to RAM.  This field should be read as '1'
32013          * to indicate that the output has been completely written.
32014          * When writing a command completion or response to an internal processor,
32015          * the order of writes has to be such that this field is written last.
32016          */
32017         uint8_t valid;
32018 } __attribute__((packed));
32019
32020 /*****************************
32021  * hwrm_fwd_async_event_cmpl *
32022  *****************************/
32023
32024
32025 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */
32026 struct hwrm_fwd_async_event_cmpl_input {
32027         /* The HWRM command request type. */
32028         uint16_t        req_type;
32029         /*
32030          * The completion ring to send the completion event on. This should
32031          * be the NQ ID returned from the `nq_alloc` HWRM command.
32032          */
32033         uint16_t        cmpl_ring;
32034         /*
32035          * The sequence ID is used by the driver for tracking multiple
32036          * commands. This ID is treated as opaque data by the firmware and
32037          * the value is returned in the `hwrm_resp_hdr` upon completion.
32038          */
32039         uint16_t        seq_id;
32040         /*
32041          * The target ID of the command:
32042          * * 0x0-0xFFF8 - The function ID
32043          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32044          * * 0xFFFD - Reserved for user-space HWRM interface
32045          * * 0xFFFF - HWRM
32046          */
32047         uint16_t        target_id;
32048         /*
32049          * A physical address pointer pointing to a host buffer that the
32050          * command's response data will be written. This can be either a host
32051          * physical address (HPA) or a guest physical address (GPA) and must
32052          * point to a physically contiguous block of memory.
32053          */
32054         uint64_t        resp_addr;
32055         /*
32056          * This value indicates the target id of the encapsulated
32057          * asynchronous event.
32058          * 0x0 - 0xFFF8 - Used for function ids
32059          * 0xFFF8 - 0xFFFE - Reserved for internal processors
32060          * 0xFFFF - Broadcast to all children VFs (only applicable when
32061          * a PF is the requester)
32062          */
32063         uint16_t        encap_async_event_target_id;
32064         uint8_t unused_0[6];
32065         /* This is an encapsulated asynchronous event completion. */
32066         uint32_t        encap_async_event_cmpl[4];
32067 } __attribute__((packed));
32068
32069 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
32070 struct hwrm_fwd_async_event_cmpl_output {
32071         /* The specific error status for the command. */
32072         uint16_t        error_code;
32073         /* The HWRM command request type. */
32074         uint16_t        req_type;
32075         /* The sequence ID from the original command. */
32076         uint16_t        seq_id;
32077         /* The length of the response data in number of bytes. */
32078         uint16_t        resp_len;
32079         uint8_t unused_0[7];
32080         /*
32081          * This field is used in Output records to indicate that the output
32082          * is completely written to RAM.  This field should be read as '1'
32083          * to indicate that the output has been completely written.
32084          * When writing a command completion or response to an internal processor,
32085          * the order of writes has to be such that this field is written last.
32086          */
32087         uint8_t valid;
32088 } __attribute__((packed));
32089
32090 /**************************
32091  * hwrm_nvm_raw_write_blk *
32092  **************************/
32093
32094
32095 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */
32096 struct hwrm_nvm_raw_write_blk_input {
32097         /* The HWRM command request type. */
32098         uint16_t        req_type;
32099         /*
32100          * The completion ring to send the completion event on. This should
32101          * be the NQ ID returned from the `nq_alloc` HWRM command.
32102          */
32103         uint16_t        cmpl_ring;
32104         /*
32105          * The sequence ID is used by the driver for tracking multiple
32106          * commands. This ID is treated as opaque data by the firmware and
32107          * the value is returned in the `hwrm_resp_hdr` upon completion.
32108          */
32109         uint16_t        seq_id;
32110         /*
32111          * The target ID of the command:
32112          * * 0x0-0xFFF8 - The function ID
32113          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32114          * * 0xFFFD - Reserved for user-space HWRM interface
32115          * * 0xFFFF - HWRM
32116          */
32117         uint16_t        target_id;
32118         /*
32119          * A physical address pointer pointing to a host buffer that the
32120          * command's response data will be written. This can be either a host
32121          * physical address (HPA) or a guest physical address (GPA) and must
32122          * point to a physically contiguous block of memory.
32123          */
32124         uint64_t        resp_addr;
32125         /*
32126          * 64-bit Host Source Address.
32127          * This is the loation of the source data to be written.
32128          */
32129         uint64_t        host_src_addr;
32130         /*
32131          * 32-bit Destination Address.
32132          * This is the NVRAM byte-offset where the source data will be written to.
32133          */
32134         uint32_t        dest_addr;
32135         /* Length of data to be written, in bytes. */
32136         uint32_t        len;
32137 } __attribute__((packed));
32138
32139 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
32140 struct hwrm_nvm_raw_write_blk_output {
32141         /* The specific error status for the command. */
32142         uint16_t        error_code;
32143         /* The HWRM command request type. */
32144         uint16_t        req_type;
32145         /* The sequence ID from the original command. */
32146         uint16_t        seq_id;
32147         /* The length of the response data in number of bytes. */
32148         uint16_t        resp_len;
32149         uint8_t unused_0[7];
32150         /*
32151          * This field is used in Output records to indicate that the output
32152          * is completely written to RAM.  This field should be read as '1'
32153          * to indicate that the output has been completely written.
32154          * When writing a command completion or response to an internal processor,
32155          * the order of writes has to be such that this field is written last.
32156          */
32157         uint8_t valid;
32158 } __attribute__((packed));
32159
32160 /*****************
32161  * hwrm_nvm_read *
32162  *****************/
32163
32164
32165 /* hwrm_nvm_read_input (size:320b/40B) */
32166 struct hwrm_nvm_read_input {
32167         /* The HWRM command request type. */
32168         uint16_t        req_type;
32169         /*
32170          * The completion ring to send the completion event on. This should
32171          * be the NQ ID returned from the `nq_alloc` HWRM command.
32172          */
32173         uint16_t        cmpl_ring;
32174         /*
32175          * The sequence ID is used by the driver for tracking multiple
32176          * commands. This ID is treated as opaque data by the firmware and
32177          * the value is returned in the `hwrm_resp_hdr` upon completion.
32178          */
32179         uint16_t        seq_id;
32180         /*
32181          * The target ID of the command:
32182          * * 0x0-0xFFF8 - The function ID
32183          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32184          * * 0xFFFD - Reserved for user-space HWRM interface
32185          * * 0xFFFF - HWRM
32186          */
32187         uint16_t        target_id;
32188         /*
32189          * A physical address pointer pointing to a host buffer that the
32190          * command's response data will be written. This can be either a host
32191          * physical address (HPA) or a guest physical address (GPA) and must
32192          * point to a physically contiguous block of memory.
32193          */
32194         uint64_t        resp_addr;
32195         /*
32196          * 64-bit Host Destination Address.
32197          * This is the host address where the data will be written to.
32198          */
32199         uint64_t        host_dest_addr;
32200         /* The 0-based index of the directory entry. */
32201         uint16_t        dir_idx;
32202         uint8_t unused_0[2];
32203         /* The NVRAM byte-offset to read from. */
32204         uint32_t        offset;
32205         /* The length of the data to be read, in bytes. */
32206         uint32_t        len;
32207         uint8_t unused_1[4];
32208 } __attribute__((packed));
32209
32210 /* hwrm_nvm_read_output (size:128b/16B) */
32211 struct hwrm_nvm_read_output {
32212         /* The specific error status for the command. */
32213         uint16_t        error_code;
32214         /* The HWRM command request type. */
32215         uint16_t        req_type;
32216         /* The sequence ID from the original command. */
32217         uint16_t        seq_id;
32218         /* The length of the response data in number of bytes. */
32219         uint16_t        resp_len;
32220         uint8_t unused_0[7];
32221         /*
32222          * This field is used in Output records to indicate that the output
32223          * is completely written to RAM.  This field should be read as '1'
32224          * to indicate that the output has been completely written.
32225          * When writing a command completion or response to an internal processor,
32226          * the order of writes has to be such that this field is written last.
32227          */
32228         uint8_t valid;
32229 } __attribute__((packed));
32230
32231 /*********************
32232  * hwrm_nvm_raw_dump *
32233  *********************/
32234
32235
32236 /* hwrm_nvm_raw_dump_input (size:256b/32B) */
32237 struct hwrm_nvm_raw_dump_input {
32238         /* The HWRM command request type. */
32239         uint16_t        req_type;
32240         /*
32241          * The completion ring to send the completion event on. This should
32242          * be the NQ ID returned from the `nq_alloc` HWRM command.
32243          */
32244         uint16_t        cmpl_ring;
32245         /*
32246          * The sequence ID is used by the driver for tracking multiple
32247          * commands. This ID is treated as opaque data by the firmware and
32248          * the value is returned in the `hwrm_resp_hdr` upon completion.
32249          */
32250         uint16_t        seq_id;
32251         /*
32252          * The target ID of the command:
32253          * * 0x0-0xFFF8 - The function ID
32254          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32255          * * 0xFFFD - Reserved for user-space HWRM interface
32256          * * 0xFFFF - HWRM
32257          */
32258         uint16_t        target_id;
32259         /*
32260          * A physical address pointer pointing to a host buffer that the
32261          * command's response data will be written. This can be either a host
32262          * physical address (HPA) or a guest physical address (GPA) and must
32263          * point to a physically contiguous block of memory.
32264          */
32265         uint64_t        resp_addr;
32266         /*
32267          * 64-bit Host Destination Address.
32268          * This is the host address where the data will be written to.
32269          */
32270         uint64_t        host_dest_addr;
32271         /* 32-bit NVRAM byte-offset to read from. */
32272         uint32_t        offset;
32273         /* Total length of NVRAM contents to be read, in bytes. */
32274         uint32_t        len;
32275 } __attribute__((packed));
32276
32277 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
32278 struct hwrm_nvm_raw_dump_output {
32279         /* The specific error status for the command. */
32280         uint16_t        error_code;
32281         /* The HWRM command request type. */
32282         uint16_t        req_type;
32283         /* The sequence ID from the original command. */
32284         uint16_t        seq_id;
32285         /* The length of the response data in number of bytes. */
32286         uint16_t        resp_len;
32287         uint8_t unused_0[7];
32288         /*
32289          * This field is used in Output records to indicate that the output
32290          * is completely written to RAM.  This field should be read as '1'
32291          * to indicate that the output has been completely written.
32292          * When writing a command completion or response to an internal processor,
32293          * the order of writes has to be such that this field is written last.
32294          */
32295         uint8_t valid;
32296 } __attribute__((packed));
32297
32298 /****************************
32299  * hwrm_nvm_get_dir_entries *
32300  ****************************/
32301
32302
32303 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
32304 struct hwrm_nvm_get_dir_entries_input {
32305         /* The HWRM command request type. */
32306         uint16_t        req_type;
32307         /*
32308          * The completion ring to send the completion event on. This should
32309          * be the NQ ID returned from the `nq_alloc` HWRM command.
32310          */
32311         uint16_t        cmpl_ring;
32312         /*
32313          * The sequence ID is used by the driver for tracking multiple
32314          * commands. This ID is treated as opaque data by the firmware and
32315          * the value is returned in the `hwrm_resp_hdr` upon completion.
32316          */
32317         uint16_t        seq_id;
32318         /*
32319          * The target ID of the command:
32320          * * 0x0-0xFFF8 - The function ID
32321          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32322          * * 0xFFFD - Reserved for user-space HWRM interface
32323          * * 0xFFFF - HWRM
32324          */
32325         uint16_t        target_id;
32326         /*
32327          * A physical address pointer pointing to a host buffer that the
32328          * command's response data will be written. This can be either a host
32329          * physical address (HPA) or a guest physical address (GPA) and must
32330          * point to a physically contiguous block of memory.
32331          */
32332         uint64_t        resp_addr;
32333         /*
32334          * 64-bit Host Destination Address.
32335          * This is the host address where the directory will be written.
32336          */
32337         uint64_t        host_dest_addr;
32338 } __attribute__((packed));
32339
32340 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
32341 struct hwrm_nvm_get_dir_entries_output {
32342         /* The specific error status for the command. */
32343         uint16_t        error_code;
32344         /* The HWRM command request type. */
32345         uint16_t        req_type;
32346         /* The sequence ID from the original command. */
32347         uint16_t        seq_id;
32348         /* The length of the response data in number of bytes. */
32349         uint16_t        resp_len;
32350         uint8_t unused_0[7];
32351         /*
32352          * This field is used in Output records to indicate that the output
32353          * is completely written to RAM.  This field should be read as '1'
32354          * to indicate that the output has been completely written.
32355          * When writing a command completion or response to an internal processor,
32356          * the order of writes has to be such that this field is written last.
32357          */
32358         uint8_t valid;
32359 } __attribute__((packed));
32360
32361 /*************************
32362  * hwrm_nvm_get_dir_info *
32363  *************************/
32364
32365
32366 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
32367 struct hwrm_nvm_get_dir_info_input {
32368         /* The HWRM command request type. */
32369         uint16_t        req_type;
32370         /*
32371          * The completion ring to send the completion event on. This should
32372          * be the NQ ID returned from the `nq_alloc` HWRM command.
32373          */
32374         uint16_t        cmpl_ring;
32375         /*
32376          * The sequence ID is used by the driver for tracking multiple
32377          * commands. This ID is treated as opaque data by the firmware and
32378          * the value is returned in the `hwrm_resp_hdr` upon completion.
32379          */
32380         uint16_t        seq_id;
32381         /*
32382          * The target ID of the command:
32383          * * 0x0-0xFFF8 - The function ID
32384          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32385          * * 0xFFFD - Reserved for user-space HWRM interface
32386          * * 0xFFFF - HWRM
32387          */
32388         uint16_t        target_id;
32389         /*
32390          * A physical address pointer pointing to a host buffer that the
32391          * command's response data will be written. This can be either a host
32392          * physical address (HPA) or a guest physical address (GPA) and must
32393          * point to a physically contiguous block of memory.
32394          */
32395         uint64_t        resp_addr;
32396 } __attribute__((packed));
32397
32398 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
32399 struct hwrm_nvm_get_dir_info_output {
32400         /* The specific error status for the command. */
32401         uint16_t        error_code;
32402         /* The HWRM command request type. */
32403         uint16_t        req_type;
32404         /* The sequence ID from the original command. */
32405         uint16_t        seq_id;
32406         /* The length of the response data in number of bytes. */
32407         uint16_t        resp_len;
32408         /* Number of directory entries in the directory. */
32409         uint32_t        entries;
32410         /* Size of each directory entry, in bytes. */
32411         uint32_t        entry_length;
32412         uint8_t unused_0[7];
32413         /*
32414          * This field is used in Output records to indicate that the output
32415          * is completely written to RAM.  This field should be read as '1'
32416          * to indicate that the output has been completely written.
32417          * When writing a command completion or response to an internal processor,
32418          * the order of writes has to be such that this field is written last.
32419          */
32420         uint8_t valid;
32421 } __attribute__((packed));
32422
32423 /******************
32424  * hwrm_nvm_write *
32425  ******************/
32426
32427
32428 /* hwrm_nvm_write_input (size:384b/48B) */
32429 struct hwrm_nvm_write_input {
32430         /* The HWRM command request type. */
32431         uint16_t        req_type;
32432         /*
32433          * The completion ring to send the completion event on. This should
32434          * be the NQ ID returned from the `nq_alloc` HWRM command.
32435          */
32436         uint16_t        cmpl_ring;
32437         /*
32438          * The sequence ID is used by the driver for tracking multiple
32439          * commands. This ID is treated as opaque data by the firmware and
32440          * the value is returned in the `hwrm_resp_hdr` upon completion.
32441          */
32442         uint16_t        seq_id;
32443         /*
32444          * The target ID of the command:
32445          * * 0x0-0xFFF8 - The function ID
32446          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32447          * * 0xFFFD - Reserved for user-space HWRM interface
32448          * * 0xFFFF - HWRM
32449          */
32450         uint16_t        target_id;
32451         /*
32452          * A physical address pointer pointing to a host buffer that the
32453          * command's response data will be written. This can be either a host
32454          * physical address (HPA) or a guest physical address (GPA) and must
32455          * point to a physically contiguous block of memory.
32456          */
32457         uint64_t        resp_addr;
32458         /*
32459          * 64-bit Host Source Address.
32460          * This is where the source data is.
32461          */
32462         uint64_t        host_src_addr;
32463         /* The Directory Entry Type (valid values are defined in the bnxnvm_directory_type enum defined in the file bnxnvm_defs.h). */
32464         uint16_t        dir_type;
32465         /*
32466          * Directory ordinal.
32467          * The 0-based instance of the combined Directory Entry Type and Extension.
32468          */
32469         uint16_t        dir_ordinal;
32470         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file bnxnvm_defs.h). */
32471         uint16_t        dir_ext;
32472         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file bnxnvm_defs.h). */
32473         uint16_t        dir_attr;
32474         /*
32475          * Length of data to write, in bytes. May be less than or equal to the allocated size for the directory entry.
32476          * The data length stored in the directory entry will be updated to reflect this value once the write is complete.
32477          */
32478         uint32_t        dir_data_length;
32479         /* Option. */
32480         uint16_t        option;
32481         uint16_t        flags;
32482         /*
32483          * When this bit is '1', the original active image
32484          * will not be removed. TBD: what purpose is this?
32485          */
32486         #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG \
32487                 UINT32_C(0x1)
32488         /*
32489          * 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).
32490          * If this value is less than the specified data length, it will be ignored.
32491          * The response will contain the actual allocated item length, which may be greater than the requested item length.
32492          * 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
32493          * the potential future growth of an item (e.g. upgraded firmware with a size increase, log growth, expanded configuration data).
32494          */
32495         uint32_t        dir_item_length;
32496         uint32_t        unused_0;
32497 } __attribute__((packed));
32498
32499 /* hwrm_nvm_write_output (size:128b/16B) */
32500 struct hwrm_nvm_write_output {
32501         /* The specific error status for the command. */
32502         uint16_t        error_code;
32503         /* The HWRM command request type. */
32504         uint16_t        req_type;
32505         /* The sequence ID from the original command. */
32506         uint16_t        seq_id;
32507         /* The length of the response data in number of bytes. */
32508         uint16_t        resp_len;
32509         /*
32510          * 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.
32511          * The actual item length used when creating a new directory entry will be a multiple of an NVM block size.
32512          */
32513         uint32_t        dir_item_length;
32514         /* The directory index of the created or modified item. */
32515         uint16_t        dir_idx;
32516         uint8_t unused_0;
32517         /*
32518          * This field is used in Output records to indicate that the output
32519          * is completely written to RAM.  This field should be read as '1'
32520          * to indicate that the output has been completely written.
32521          * When writing a command completion or response to an internal processor,
32522          * the order of writes has to be such that this field is written last.
32523          */
32524         uint8_t valid;
32525 } __attribute__((packed));
32526
32527 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
32528 struct hwrm_nvm_write_cmd_err {
32529         /*
32530          * command specific error codes that goes to
32531          * the cmd_err field in Common HWRM Error Response.
32532          */
32533         uint8_t code;
32534         /* Unknown error */
32535         #define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
32536         /* Unable to complete operation due to fragmentation */
32537         #define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
32538         /* nvm is completely full. */
32539         #define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
32540         #define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST \
32541                 HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
32542         uint8_t unused_0[7];
32543 } __attribute__((packed));
32544
32545 /*******************
32546  * hwrm_nvm_modify *
32547  *******************/
32548
32549
32550 /* hwrm_nvm_modify_input (size:320b/40B) */
32551 struct hwrm_nvm_modify_input {
32552         /* The HWRM command request type. */
32553         uint16_t        req_type;
32554         /*
32555          * The completion ring to send the completion event on. This should
32556          * be the NQ ID returned from the `nq_alloc` HWRM command.
32557          */
32558         uint16_t        cmpl_ring;
32559         /*
32560          * The sequence ID is used by the driver for tracking multiple
32561          * commands. This ID is treated as opaque data by the firmware and
32562          * the value is returned in the `hwrm_resp_hdr` upon completion.
32563          */
32564         uint16_t        seq_id;
32565         /*
32566          * The target ID of the command:
32567          * * 0x0-0xFFF8 - The function ID
32568          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32569          * * 0xFFFD - Reserved for user-space HWRM interface
32570          * * 0xFFFF - HWRM
32571          */
32572         uint16_t        target_id;
32573         /*
32574          * A physical address pointer pointing to a host buffer that the
32575          * command's response data will be written. This can be either a host
32576          * physical address (HPA) or a guest physical address (GPA) and must
32577          * point to a physically contiguous block of memory.
32578          */
32579         uint64_t        resp_addr;
32580         /*
32581          * 64-bit Host Source Address.
32582          * This is where the modified data is.
32583          */
32584         uint64_t        host_src_addr;
32585         /* 16-bit directory entry index. */
32586         uint16_t        dir_idx;
32587         uint8_t unused_0[2];
32588         /* 32-bit NVRAM byte-offset to modify content from. */
32589         uint32_t        offset;
32590         /*
32591          * Length of data to be modified, in bytes. The length shall
32592          * be non-zero.
32593          */
32594         uint32_t        len;
32595         uint8_t unused_1[4];
32596 } __attribute__((packed));
32597
32598 /* hwrm_nvm_modify_output (size:128b/16B) */
32599 struct hwrm_nvm_modify_output {
32600         /* The specific error status for the command. */
32601         uint16_t        error_code;
32602         /* The HWRM command request type. */
32603         uint16_t        req_type;
32604         /* The sequence ID from the original command. */
32605         uint16_t        seq_id;
32606         /* The length of the response data in number of bytes. */
32607         uint16_t        resp_len;
32608         uint8_t unused_0[7];
32609         /*
32610          * This field is used in Output records to indicate that the output
32611          * is completely written to RAM.  This field should be read as '1'
32612          * to indicate that the output has been completely written.
32613          * When writing a command completion or response to an internal processor,
32614          * the order of writes has to be such that this field is written last.
32615          */
32616         uint8_t valid;
32617 } __attribute__((packed));
32618
32619 /***************************
32620  * hwrm_nvm_find_dir_entry *
32621  ***************************/
32622
32623
32624 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
32625 struct hwrm_nvm_find_dir_entry_input {
32626         /* The HWRM command request type. */
32627         uint16_t        req_type;
32628         /*
32629          * The completion ring to send the completion event on. This should
32630          * be the NQ ID returned from the `nq_alloc` HWRM command.
32631          */
32632         uint16_t        cmpl_ring;
32633         /*
32634          * The sequence ID is used by the driver for tracking multiple
32635          * commands. This ID is treated as opaque data by the firmware and
32636          * the value is returned in the `hwrm_resp_hdr` upon completion.
32637          */
32638         uint16_t        seq_id;
32639         /*
32640          * The target ID of the command:
32641          * * 0x0-0xFFF8 - The function ID
32642          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32643          * * 0xFFFD - Reserved for user-space HWRM interface
32644          * * 0xFFFF - HWRM
32645          */
32646         uint16_t        target_id;
32647         /*
32648          * A physical address pointer pointing to a host buffer that the
32649          * command's response data will be written. This can be either a host
32650          * physical address (HPA) or a guest physical address (GPA) and must
32651          * point to a physically contiguous block of memory.
32652          */
32653         uint64_t        resp_addr;
32654         uint32_t        enables;
32655         /*
32656          * This bit must be '1' for the dir_idx_valid field to be
32657          * configured.
32658          */
32659         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID \
32660                 UINT32_C(0x1)
32661         /* Directory Entry Index */
32662         uint16_t        dir_idx;
32663         /* Directory Entry (Image) Type */
32664         uint16_t        dir_type;
32665         /*
32666          * Directory ordinal.
32667          * The instance of this Directory Type
32668          */
32669         uint16_t        dir_ordinal;
32670         /* The Directory Entry Extension flags. */
32671         uint16_t        dir_ext;
32672         /* This value indicates the search option using dir_ordinal. */
32673         uint8_t opt_ordinal;
32674         /* This value indicates the search option using dir_ordinal. */
32675         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
32676         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
32677         /* Equal to specified ordinal value. */
32678         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ    UINT32_C(0x0)
32679         /* Greater than or equal to specified ordinal value */
32680         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE    UINT32_C(0x1)
32681         /* Greater than specified ordinal value */
32682         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT    UINT32_C(0x2)
32683         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST \
32684                 HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
32685         uint8_t unused_0[3];
32686 } __attribute__((packed));
32687
32688 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
32689 struct hwrm_nvm_find_dir_entry_output {
32690         /* The specific error status for the command. */
32691         uint16_t        error_code;
32692         /* The HWRM command request type. */
32693         uint16_t        req_type;
32694         /* The sequence ID from the original command. */
32695         uint16_t        seq_id;
32696         /* The length of the response data in number of bytes. */
32697         uint16_t        resp_len;
32698         /* Allocated NVRAM for this directory entry, in bytes. */
32699         uint32_t        dir_item_length;
32700         /* Size of the stored data for this directory entry, in bytes. */
32701         uint32_t        dir_data_length;
32702         /*
32703          * Firmware version.
32704          * Only valid if the directory entry is for embedded firmware stored in APE_BIN Format.
32705          */
32706         uint32_t        fw_ver;
32707         /* Directory ordinal. */
32708         uint16_t        dir_ordinal;
32709         /* Directory Entry Index */
32710         uint16_t        dir_idx;
32711         uint8_t unused_0[7];
32712         /*
32713          * This field is used in Output records to indicate that the output
32714          * is completely written to RAM.  This field should be read as '1'
32715          * to indicate that the output has been completely written.
32716          * When writing a command completion or response to an internal processor,
32717          * the order of writes has to be such that this field is written last.
32718          */
32719         uint8_t valid;
32720 } __attribute__((packed));
32721
32722 /****************************
32723  * hwrm_nvm_erase_dir_entry *
32724  ****************************/
32725
32726
32727 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
32728 struct hwrm_nvm_erase_dir_entry_input {
32729         /* The HWRM command request type. */
32730         uint16_t        req_type;
32731         /*
32732          * The completion ring to send the completion event on. This should
32733          * be the NQ ID returned from the `nq_alloc` HWRM command.
32734          */
32735         uint16_t        cmpl_ring;
32736         /*
32737          * The sequence ID is used by the driver for tracking multiple
32738          * commands. This ID is treated as opaque data by the firmware and
32739          * the value is returned in the `hwrm_resp_hdr` upon completion.
32740          */
32741         uint16_t        seq_id;
32742         /*
32743          * The target ID of the command:
32744          * * 0x0-0xFFF8 - The function ID
32745          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32746          * * 0xFFFD - Reserved for user-space HWRM interface
32747          * * 0xFFFF - HWRM
32748          */
32749         uint16_t        target_id;
32750         /*
32751          * A physical address pointer pointing to a host buffer that the
32752          * command's response data will be written. This can be either a host
32753          * physical address (HPA) or a guest physical address (GPA) and must
32754          * point to a physically contiguous block of memory.
32755          */
32756         uint64_t        resp_addr;
32757         /* Directory Entry Index */
32758         uint16_t        dir_idx;
32759         uint8_t unused_0[6];
32760 } __attribute__((packed));
32761
32762 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
32763 struct hwrm_nvm_erase_dir_entry_output {
32764         /* The specific error status for the command. */
32765         uint16_t        error_code;
32766         /* The HWRM command request type. */
32767         uint16_t        req_type;
32768         /* The sequence ID from the original command. */
32769         uint16_t        seq_id;
32770         /* The length of the response data in number of bytes. */
32771         uint16_t        resp_len;
32772         uint8_t unused_0[7];
32773         /*
32774          * This field is used in Output records to indicate that the output
32775          * is completely written to RAM.  This field should be read as '1'
32776          * to indicate that the output has been completely written.
32777          * When writing a command completion or response to an internal processor,
32778          * the order of writes has to be such that this field is written last.
32779          */
32780         uint8_t valid;
32781 } __attribute__((packed));
32782
32783 /*************************
32784  * hwrm_nvm_get_dev_info *
32785  *************************/
32786
32787
32788 /* hwrm_nvm_get_dev_info_input (size:128b/16B) */
32789 struct hwrm_nvm_get_dev_info_input {
32790         /* The HWRM command request type. */
32791         uint16_t        req_type;
32792         /*
32793          * The completion ring to send the completion event on. This should
32794          * be the NQ ID returned from the `nq_alloc` HWRM command.
32795          */
32796         uint16_t        cmpl_ring;
32797         /*
32798          * The sequence ID is used by the driver for tracking multiple
32799          * commands. This ID is treated as opaque data by the firmware and
32800          * the value is returned in the `hwrm_resp_hdr` upon completion.
32801          */
32802         uint16_t        seq_id;
32803         /*
32804          * The target ID of the command:
32805          * * 0x0-0xFFF8 - The function ID
32806          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32807          * * 0xFFFD - Reserved for user-space HWRM interface
32808          * * 0xFFFF - HWRM
32809          */
32810         uint16_t        target_id;
32811         /*
32812          * A physical address pointer pointing to a host buffer that the
32813          * command's response data will be written. This can be either a host
32814          * physical address (HPA) or a guest physical address (GPA) and must
32815          * point to a physically contiguous block of memory.
32816          */
32817         uint64_t        resp_addr;
32818 } __attribute__((packed));
32819
32820 /* hwrm_nvm_get_dev_info_output (size:256b/32B) */
32821 struct hwrm_nvm_get_dev_info_output {
32822         /* The specific error status for the command. */
32823         uint16_t        error_code;
32824         /* The HWRM command request type. */
32825         uint16_t        req_type;
32826         /* The sequence ID from the original command. */
32827         uint16_t        seq_id;
32828         /* The length of the response data in number of bytes. */
32829         uint16_t        resp_len;
32830         /* Manufacturer ID. */
32831         uint16_t        manufacturer_id;
32832         /* Device ID. */
32833         uint16_t        device_id;
32834         /* Sector size of the NVRAM device. */
32835         uint32_t        sector_size;
32836         /* Total size, in bytes of the NVRAM device. */
32837         uint32_t        nvram_size;
32838         uint32_t        reserved_size;
32839         /* Available size that can be used, in bytes.  Available size is the NVRAM size take away the used size and reserved size. */
32840         uint32_t        available_size;
32841         /* This field represents the major version of NVM cfg */
32842         uint8_t nvm_cfg_ver_maj;
32843         /* This field represents the minor version of NVM cfg */
32844         uint8_t nvm_cfg_ver_min;
32845         /* This field represents the update version of NVM cfg */
32846         uint8_t nvm_cfg_ver_upd;
32847         /*
32848          * This field is used in Output records to indicate that the output
32849          * is completely written to RAM.  This field should be read as '1'
32850          * to indicate that the output has been completely written.
32851          * When writing a command completion or response to an internal processor,
32852          * the order of writes has to be such that this field is written last.
32853          */
32854         uint8_t valid;
32855 } __attribute__((packed));
32856
32857 /**************************
32858  * hwrm_nvm_mod_dir_entry *
32859  **************************/
32860
32861
32862 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */
32863 struct hwrm_nvm_mod_dir_entry_input {
32864         /* The HWRM command request type. */
32865         uint16_t        req_type;
32866         /*
32867          * The completion ring to send the completion event on. This should
32868          * be the NQ ID returned from the `nq_alloc` HWRM command.
32869          */
32870         uint16_t        cmpl_ring;
32871         /*
32872          * The sequence ID is used by the driver for tracking multiple
32873          * commands. This ID is treated as opaque data by the firmware and
32874          * the value is returned in the `hwrm_resp_hdr` upon completion.
32875          */
32876         uint16_t        seq_id;
32877         /*
32878          * The target ID of the command:
32879          * * 0x0-0xFFF8 - The function ID
32880          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32881          * * 0xFFFD - Reserved for user-space HWRM interface
32882          * * 0xFFFF - HWRM
32883          */
32884         uint16_t        target_id;
32885         /*
32886          * A physical address pointer pointing to a host buffer that the
32887          * command's response data will be written. This can be either a host
32888          * physical address (HPA) or a guest physical address (GPA) and must
32889          * point to a physically contiguous block of memory.
32890          */
32891         uint64_t        resp_addr;
32892         uint32_t        enables;
32893         /*
32894          * This bit must be '1' for the checksum field to be
32895          * configured.
32896          */
32897         #define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM     UINT32_C(0x1)
32898         /* Directory Entry Index */
32899         uint16_t        dir_idx;
32900         /*
32901          * Directory ordinal.
32902          * The (0-based) instance of this Directory Type.
32903          */
32904         uint16_t        dir_ordinal;
32905         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* for extension flag definitions). */
32906         uint16_t        dir_ext;
32907         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute flag definitions). */
32908         uint16_t        dir_attr;
32909         /*
32910          * If valid, then this field updates the checksum
32911          * value of the content in the directory entry.
32912          */
32913         uint32_t        checksum;
32914 } __attribute__((packed));
32915
32916 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
32917 struct hwrm_nvm_mod_dir_entry_output {
32918         /* The specific error status for the command. */
32919         uint16_t        error_code;
32920         /* The HWRM command request type. */
32921         uint16_t        req_type;
32922         /* The sequence ID from the original command. */
32923         uint16_t        seq_id;
32924         /* The length of the response data in number of bytes. */
32925         uint16_t        resp_len;
32926         uint8_t unused_0[7];
32927         /*
32928          * This field is used in Output records to indicate that the output
32929          * is completely written to RAM.  This field should be read as '1'
32930          * to indicate that the output has been completely written.
32931          * When writing a command completion or response to an internal processor,
32932          * the order of writes has to be such that this field is written last.
32933          */
32934         uint8_t valid;
32935 } __attribute__((packed));
32936
32937 /**************************
32938  * hwrm_nvm_verify_update *
32939  **************************/
32940
32941
32942 /* hwrm_nvm_verify_update_input (size:192b/24B) */
32943 struct hwrm_nvm_verify_update_input {
32944         /* The HWRM command request type. */
32945         uint16_t        req_type;
32946         /*
32947          * The completion ring to send the completion event on. This should
32948          * be the NQ ID returned from the `nq_alloc` HWRM command.
32949          */
32950         uint16_t        cmpl_ring;
32951         /*
32952          * The sequence ID is used by the driver for tracking multiple
32953          * commands. This ID is treated as opaque data by the firmware and
32954          * the value is returned in the `hwrm_resp_hdr` upon completion.
32955          */
32956         uint16_t        seq_id;
32957         /*
32958          * The target ID of the command:
32959          * * 0x0-0xFFF8 - The function ID
32960          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32961          * * 0xFFFD - Reserved for user-space HWRM interface
32962          * * 0xFFFF - HWRM
32963          */
32964         uint16_t        target_id;
32965         /*
32966          * A physical address pointer pointing to a host buffer that the
32967          * command's response data will be written. This can be either a host
32968          * physical address (HPA) or a guest physical address (GPA) and must
32969          * point to a physically contiguous block of memory.
32970          */
32971         uint64_t        resp_addr;
32972         /* Directory Entry Type, to be verified. */
32973         uint16_t        dir_type;
32974         /*
32975          * Directory ordinal.
32976          * The instance of the Directory Type to be verified.
32977          */
32978         uint16_t        dir_ordinal;
32979         /*
32980          * The Directory Entry Extension flags.
32981          * The "UPDATE" extension flag must be set in this value.
32982          * A corresponding directory entry with the same type and ordinal values but *without*
32983          * the "UPDATE" extension flag must also exist. The other flags of the extension must
32984          * be identical between the active and update entries.
32985          */
32986         uint16_t        dir_ext;
32987         uint8_t unused_0[2];
32988 } __attribute__((packed));
32989
32990 /* hwrm_nvm_verify_update_output (size:128b/16B) */
32991 struct hwrm_nvm_verify_update_output {
32992         /* The specific error status for the command. */
32993         uint16_t        error_code;
32994         /* The HWRM command request type. */
32995         uint16_t        req_type;
32996         /* The sequence ID from the original command. */
32997         uint16_t        seq_id;
32998         /* The length of the response data in number of bytes. */
32999         uint16_t        resp_len;
33000         uint8_t unused_0[7];
33001         /*
33002          * This field is used in Output records to indicate that the output
33003          * is completely written to RAM.  This field should be read as '1'
33004          * to indicate that the output has been completely written.
33005          * When writing a command completion or response to an internal processor,
33006          * the order of writes has to be such that this field is written last.
33007          */
33008         uint8_t valid;
33009 } __attribute__((packed));
33010
33011 /***************************
33012  * hwrm_nvm_install_update *
33013  ***************************/
33014
33015
33016 /* hwrm_nvm_install_update_input (size:192b/24B) */
33017 struct hwrm_nvm_install_update_input {
33018         /* The HWRM command request type. */
33019         uint16_t        req_type;
33020         /*
33021          * The completion ring to send the completion event on. This should
33022          * be the NQ ID returned from the `nq_alloc` HWRM command.
33023          */
33024         uint16_t        cmpl_ring;
33025         /*
33026          * The sequence ID is used by the driver for tracking multiple
33027          * commands. This ID is treated as opaque data by the firmware and
33028          * the value is returned in the `hwrm_resp_hdr` upon completion.
33029          */
33030         uint16_t        seq_id;
33031         /*
33032          * The target ID of the command:
33033          * * 0x0-0xFFF8 - The function ID
33034          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33035          * * 0xFFFD - Reserved for user-space HWRM interface
33036          * * 0xFFFF - HWRM
33037          */
33038         uint16_t        target_id;
33039         /*
33040          * A physical address pointer pointing to a host buffer that the
33041          * command's response data will be written. This can be either a host
33042          * physical address (HPA) or a guest physical address (GPA) and must
33043          * point to a physically contiguous block of memory.
33044          */
33045         uint64_t        resp_addr;
33046         /*
33047          * Installation type. If the value 3 through 0xffff is used,
33048          * only packaged items with that type value will be installed and
33049          * conditional installation directives for those packaged items
33050          * will be over-ridden (i.e. 'create' or 'replace' will be treated
33051          * as 'install').
33052          */
33053         uint32_t        install_type;
33054         /*
33055          * Perform a normal package installation. Conditional installation
33056          * directives (e.g. 'create' and 'replace') of packaged items
33057          * will be followed.
33058          */
33059         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
33060         /*
33061          * Install all packaged items regardless of installation directive
33062          * (i.e. treat all packaged items as though they have an installation
33063          * directive of 'install').
33064          */
33065         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL \
33066                 UINT32_C(0xffffffff)
33067         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST \
33068                 HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL
33069         uint16_t        flags;
33070         /* If set to 1, then securely erase all unused locations in persistent storage. */
33071         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE \
33072                 UINT32_C(0x1)
33073         /*
33074          * If set to 1, then unspecifed images, images not in the package file, will be safely deleted.
33075          * When combined with erase_unused_space then unspecified images will be securely erased.
33076          */
33077         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG \
33078                 UINT32_C(0x2)
33079         /*
33080          * If set to 1, FW will defragment the NVM if defragmentation is required for the update.
33081          * Allow additional time for this command to complete if this bit is set to 1.
33082          */
33083         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG \
33084                 UINT32_C(0x4)
33085         uint8_t unused_0[2];
33086 } __attribute__((packed));
33087
33088 /* hwrm_nvm_install_update_output (size:192b/24B) */
33089 struct hwrm_nvm_install_update_output {
33090         /* The specific error status for the command. */
33091         uint16_t        error_code;
33092         /* The HWRM command request type. */
33093         uint16_t        req_type;
33094         /* The sequence ID from the original command. */
33095         uint16_t        seq_id;
33096         /* The length of the response data in number of bytes. */
33097         uint16_t        resp_len;
33098         /*
33099          * Bit-mask of successfully installed items.
33100          * Bit-0 corresponding to the first packaged item, Bit-1 for the second item, etc.
33101          * A value of 0 indicates that no items were successfully installed.
33102          */
33103         uint64_t        installed_items;
33104         /* result is 8 b */
33105         uint8_t result;
33106         /* There was no problem with the package installation. */
33107         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS UINT32_C(0x0)
33108         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST \
33109                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS
33110         /* problem_item is 8 b */
33111         uint8_t problem_item;
33112         /* There was no problem with any packaged items. */
33113         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE \
33114                 UINT32_C(0x0)
33115         /* There was a problem with the NVM package itself. */
33116         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE \
33117                 UINT32_C(0xff)
33118         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST \
33119                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE
33120         /* reset_required is 8 b */
33121         uint8_t reset_required;
33122         /*
33123          * No reset is required for installed/updated firmware or
33124          * microcode to take effect.
33125          */
33126         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE \
33127                 UINT32_C(0x0)
33128         /*
33129          * A PCIe reset (e.g. system reboot) is
33130          * required for newly installed/updated firmware or
33131          * microcode to take effect.
33132          */
33133         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI \
33134                 UINT32_C(0x1)
33135         /*
33136          * A controller power reset (e.g. system power-cycle) is
33137          * required for newly installed/updated firmware or
33138          * microcode to take effect. Some newly installed/updated
33139          * firmware or microcode may still take effect upon the
33140          * next PCIe reset.
33141          */
33142         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER \
33143                 UINT32_C(0x2)
33144         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST \
33145                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER
33146         uint8_t unused_0[4];
33147         /*
33148          * This field is used in Output records to indicate that the output
33149          * is completely written to RAM.  This field should be read as '1'
33150          * to indicate that the output has been completely written.
33151          * When writing a command completion or response to an internal processor,
33152          * the order of writes has to be such that this field is written last.
33153          */
33154         uint8_t valid;
33155 } __attribute__((packed));
33156
33157 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
33158 struct hwrm_nvm_install_update_cmd_err {
33159         /*
33160          * command specific error codes that goes to
33161          * the cmd_err field in Common HWRM Error Response.
33162          */
33163         uint8_t code;
33164         /* Unknown error */
33165         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
33166         /* Unable to complete operation due to fragmentation */
33167         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
33168         /* nvm is completely full. */
33169         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
33170         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST \
33171                 HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE
33172         uint8_t unused_0[7];
33173 } __attribute__((packed));
33174
33175 /******************
33176  * hwrm_nvm_flush *
33177  ******************/
33178
33179
33180 /* hwrm_nvm_flush_input (size:128b/16B) */
33181 struct hwrm_nvm_flush_input {
33182         /* The HWRM command request type. */
33183         uint16_t        req_type;
33184         /*
33185          * The completion ring to send the completion event on. This should
33186          * be the NQ ID returned from the `nq_alloc` HWRM command.
33187          */
33188         uint16_t        cmpl_ring;
33189         /*
33190          * The sequence ID is used by the driver for tracking multiple
33191          * commands. This ID is treated as opaque data by the firmware and
33192          * the value is returned in the `hwrm_resp_hdr` upon completion.
33193          */
33194         uint16_t        seq_id;
33195         /*
33196          * The target ID of the command:
33197          * * 0x0-0xFFF8 - The function ID
33198          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33199          * * 0xFFFD - Reserved for user-space HWRM interface
33200          * * 0xFFFF - HWRM
33201          */
33202         uint16_t        target_id;
33203         /*
33204          * A physical address pointer pointing to a host buffer that the
33205          * command's response data will be written. This can be either a host
33206          * physical address (HPA) or a guest physical address (GPA) and must
33207          * point to a physically contiguous block of memory.
33208          */
33209         uint64_t        resp_addr;
33210 } __attribute__((packed));
33211
33212 /* hwrm_nvm_flush_output (size:128b/16B) */
33213 struct hwrm_nvm_flush_output {
33214         /* The specific error status for the command. */
33215         uint16_t        error_code;
33216         /* The HWRM command request type. */
33217         uint16_t        req_type;
33218         /* The sequence ID from the original command. */
33219         uint16_t        seq_id;
33220         /* The length of the response data in number of bytes. */
33221         uint16_t        resp_len;
33222         uint8_t unused_0[7];
33223         /*
33224          * This field is used in Output records to indicate that the output
33225          * is completely written to RAM.  This field should be read as '1'
33226          * to indicate that the output has been completely written.
33227          * When writing a command completion or response to an internal processor,
33228          * the order of writes has to be such that this field is written last.
33229          */
33230         uint8_t valid;
33231 } __attribute__((packed));
33232
33233 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
33234 struct hwrm_nvm_flush_cmd_err {
33235         /*
33236          * command specific error codes that goes to
33237          * the cmd_err field in Common HWRM Error Response.
33238          */
33239         uint8_t code;
33240         /* Unknown error */
33241         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
33242         /* flush could not be performed */
33243         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL    UINT32_C(0x1)
33244         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST \
33245                 HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
33246         uint8_t unused_0[7];
33247 } __attribute__((packed));
33248
33249 /*************************
33250  * hwrm_nvm_get_variable *
33251  *************************/
33252
33253
33254 /* hwrm_nvm_get_variable_input (size:320b/40B) */
33255 struct hwrm_nvm_get_variable_input {
33256         /* The HWRM command request type. */
33257         uint16_t        req_type;
33258         /*
33259          * The completion ring to send the completion event on. This should
33260          * be the NQ ID returned from the `nq_alloc` HWRM command.
33261          */
33262         uint16_t        cmpl_ring;
33263         /*
33264          * The sequence ID is used by the driver for tracking multiple
33265          * commands. This ID is treated as opaque data by the firmware and
33266          * the value is returned in the `hwrm_resp_hdr` upon completion.
33267          */
33268         uint16_t        seq_id;
33269         /*
33270          * The target ID of the command:
33271          * * 0x0-0xFFF8 - The function ID
33272          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33273          * * 0xFFFD - Reserved for user-space HWRM interface
33274          * * 0xFFFF - HWRM
33275          */
33276         uint16_t        target_id;
33277         /*
33278          * A physical address pointer pointing to a host buffer that the
33279          * command's response data will be written. This can be either a host
33280          * physical address (HPA) or a guest physical address (GPA) and must
33281          * point to a physically contiguous block of memory.
33282          */
33283         uint64_t        resp_addr;
33284         /*
33285          * This is the host address where
33286          * nvm variable will be stored
33287          */
33288         uint64_t        dest_data_addr;
33289         /* size of data in bits */
33290         uint16_t        data_len;
33291         /* nvm cfg option number */
33292         uint16_t        option_num;
33293         /* reserved. */
33294         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
33295         /* reserved. */
33296         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
33297                 UINT32_C(0xffff)
33298         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST \
33299                 HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
33300         /*
33301          * Number of dimensions for this nvm configuration variable.
33302          * This value indicates how many of the indexN values to use.
33303          * A value of 0 means that none of the indexN values are valid.
33304          * A value of 1 requires at index0 is valued, a value of 2
33305          * requires that index0 and index1 are valid, and so forth
33306          */
33307         uint16_t        dimensions;
33308         /* index for the 1st dimensions */
33309         uint16_t        index_0;
33310         /* index for the 2nd dimensions */
33311         uint16_t        index_1;
33312         /* index for the 3rd dimensions */
33313         uint16_t        index_2;
33314         /* index for the 4th dimensions */
33315         uint16_t        index_3;
33316         uint8_t flags;
33317         /*
33318          * When this bit is set to 1, the factory default value will be returned,
33319          * 0 returns the operational value.
33320          */
33321         #define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT \
33322                 UINT32_C(0x1)
33323         uint8_t unused_0;
33324 } __attribute__((packed));
33325
33326 /* hwrm_nvm_get_variable_output (size:128b/16B) */
33327 struct hwrm_nvm_get_variable_output {
33328         /* The specific error status for the command. */
33329         uint16_t        error_code;
33330         /* The HWRM command request type. */
33331         uint16_t        req_type;
33332         /* The sequence ID from the original command. */
33333         uint16_t        seq_id;
33334         /* The length of the response data in number of bytes. */
33335         uint16_t        resp_len;
33336         /* size of data of the actual variable retrieved in bits */
33337         uint16_t        data_len;
33338         /*
33339          * option_num is the option number for the data retrieved.  It is possible in the
33340          * future that the option number returned would be different than requested.  This
33341          * condition could occur if an option is deprecated and a new option id is defined
33342          * with similar characteristics, but has a slightly different definition.  This
33343          * also makes it convenient for the caller to identify the variable result with
33344          * the option id from the response.
33345          */
33346         uint16_t        option_num;
33347         /* reserved. */
33348         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
33349         /* reserved. */
33350         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF \
33351                 UINT32_C(0xffff)
33352         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST \
33353                 HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF
33354         uint8_t unused_0[3];
33355         /*
33356          * This field is used in Output records to indicate that the output
33357          * is completely written to RAM.  This field should be read as '1'
33358          * to indicate that the output has been completely written.
33359          * When writing a command completion or response to an internal processor,
33360          * the order of writes has to be such that this field is written last.
33361          */
33362         uint8_t valid;
33363 } __attribute__((packed));
33364
33365 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
33366 struct hwrm_nvm_get_variable_cmd_err {
33367         /*
33368          * command specific error codes that goes to
33369          * the cmd_err field in Common HWRM Error Response.
33370          */
33371         uint8_t code;
33372         /* Unknown error */
33373         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
33374         /* variable does not exist */
33375         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
33376         /* configuration is corrupted and the variable cannot be saved */
33377         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
33378         /* length specified is too small */
33379         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3)
33380         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST \
33381                 HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
33382         uint8_t unused_0[7];
33383 } __attribute__((packed));
33384
33385 /*************************
33386  * hwrm_nvm_set_variable *
33387  *************************/
33388
33389
33390 /* hwrm_nvm_set_variable_input (size:320b/40B) */
33391 struct hwrm_nvm_set_variable_input {
33392         /* The HWRM command request type. */
33393         uint16_t        req_type;
33394         /*
33395          * The completion ring to send the completion event on. This should
33396          * be the NQ ID returned from the `nq_alloc` HWRM command.
33397          */
33398         uint16_t        cmpl_ring;
33399         /*
33400          * The sequence ID is used by the driver for tracking multiple
33401          * commands. This ID is treated as opaque data by the firmware and
33402          * the value is returned in the `hwrm_resp_hdr` upon completion.
33403          */
33404         uint16_t        seq_id;
33405         /*
33406          * The target ID of the command:
33407          * * 0x0-0xFFF8 - The function ID
33408          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33409          * * 0xFFFD - Reserved for user-space HWRM interface
33410          * * 0xFFFF - HWRM
33411          */
33412         uint16_t        target_id;
33413         /*
33414          * A physical address pointer pointing to a host buffer that the
33415          * command's response data will be written. This can be either a host
33416          * physical address (HPA) or a guest physical address (GPA) and must
33417          * point to a physically contiguous block of memory.
33418          */
33419         uint64_t        resp_addr;
33420         /*
33421          * This is the host address where
33422          * nvm variable will be copied from
33423          */
33424         uint64_t        src_data_addr;
33425         /* size of data in bits */
33426         uint16_t        data_len;
33427         /* nvm cfg option number */
33428         uint16_t        option_num;
33429         /* reserved. */
33430         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
33431         /* reserved. */
33432         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
33433                 UINT32_C(0xffff)
33434         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST \
33435                 HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
33436         /*
33437          * Number of dimensions for this nvm configuration variable.
33438          * This value indicates how many of the indexN values to use.
33439          * A value of 0 means that none of the indexN values are valid.
33440          * A value of 1 requires at index0 is valued, a value of 2
33441          * requires that index0 and index1 are valid, and so forth
33442          */
33443         uint16_t        dimensions;
33444         /* index for the 1st dimensions */
33445         uint16_t        index_0;
33446         /* index for the 2nd dimensions */
33447         uint16_t        index_1;
33448         /* index for the 3rd dimensions */
33449         uint16_t        index_2;
33450         /* index for the 4th dimensions */
33451         uint16_t        index_3;
33452         uint8_t flags;
33453         /* When this bit is 1, flush internal cache after this write operation (see hwrm_nvm_flush command.) */
33454         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH \
33455                 UINT32_C(0x1)
33456         /* encryption method */
33457         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK \
33458                 UINT32_C(0xe)
33459         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT           1
33460         /* No encryption. */
33461         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE \
33462                 (UINT32_C(0x0) << 1)
33463         /* one-way encryption. */
33464         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1 \
33465                 (UINT32_C(0x1) << 1)
33466         /* symmetric AES256 encryption. */
33467         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256 \
33468                 (UINT32_C(0x2) << 1)
33469         /* SHA1 digest appended to plaintext contents, for authentication */
33470         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH \
33471                 (UINT32_C(0x3) << 1)
33472         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST \
33473                 HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH
33474         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_MASK \
33475                 UINT32_C(0x70)
33476         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_SFT         4
33477         /* When this bit is 1, update the factory default region */
33478         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FACTORY_DEFAULT \
33479                 UINT32_C(0x80)
33480         uint8_t unused_0;
33481 } __attribute__((packed));
33482
33483 /* hwrm_nvm_set_variable_output (size:128b/16B) */
33484 struct hwrm_nvm_set_variable_output {
33485         /* The specific error status for the command. */
33486         uint16_t        error_code;
33487         /* The HWRM command request type. */
33488         uint16_t        req_type;
33489         /* The sequence ID from the original command. */
33490         uint16_t        seq_id;
33491         /* The length of the response data in number of bytes. */
33492         uint16_t        resp_len;
33493         uint8_t unused_0[7];
33494         /*
33495          * This field is used in Output records to indicate that the output
33496          * is completely written to RAM.  This field should be read as '1'
33497          * to indicate that the output has been completely written.
33498          * When writing a command completion or response to an internal processor,
33499          * the order of writes has to be such that this field is written last.
33500          */
33501         uint8_t valid;
33502 } __attribute__((packed));
33503
33504 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
33505 struct hwrm_nvm_set_variable_cmd_err {
33506         /*
33507          * command specific error codes that goes to
33508          * the cmd_err field in Common HWRM Error Response.
33509          */
33510         uint8_t code;
33511         /* Unknown error */
33512         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
33513         /* variable does not exist */
33514         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
33515         /* configuration is corrupted and the variable cannot be saved */
33516         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
33517         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST \
33518                 HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
33519         uint8_t unused_0[7];
33520 } __attribute__((packed));
33521
33522 /****************************
33523  * hwrm_nvm_validate_option *
33524  ****************************/
33525
33526
33527 /* hwrm_nvm_validate_option_input (size:320b/40B) */
33528 struct hwrm_nvm_validate_option_input {
33529         /* The HWRM command request type. */
33530         uint16_t        req_type;
33531         /*
33532          * The completion ring to send the completion event on. This should
33533          * be the NQ ID returned from the `nq_alloc` HWRM command.
33534          */
33535         uint16_t        cmpl_ring;
33536         /*
33537          * The sequence ID is used by the driver for tracking multiple
33538          * commands. This ID is treated as opaque data by the firmware and
33539          * the value is returned in the `hwrm_resp_hdr` upon completion.
33540          */
33541         uint16_t        seq_id;
33542         /*
33543          * The target ID of the command:
33544          * * 0x0-0xFFF8 - The function ID
33545          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33546          * * 0xFFFD - Reserved for user-space HWRM interface
33547          * * 0xFFFF - HWRM
33548          */
33549         uint16_t        target_id;
33550         /*
33551          * A physical address pointer pointing to a host buffer that the
33552          * command's response data will be written. This can be either a host
33553          * physical address (HPA) or a guest physical address (GPA) and must
33554          * point to a physically contiguous block of memory.
33555          */
33556         uint64_t        resp_addr;
33557         /*
33558          * This is the host address where
33559          * nvm variable will be copied from
33560          */
33561         uint64_t        src_data_addr;
33562         /* size of data in bits */
33563         uint16_t        data_len;
33564         /* nvm cfg option number */
33565         uint16_t        option_num;
33566         /* reserved. */
33567         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0 \
33568                 UINT32_C(0x0)
33569         /* reserved. */
33570         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF \
33571                 UINT32_C(0xffff)
33572         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST \
33573                 HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF
33574         /*
33575          * Number of dimensions for this nvm configuration variable.
33576          * This value indicates how many of the indexN values to use.
33577          * A value of 0 means that none of the indexN values are valid.
33578          * A value of 1 requires at index0 is valued, a value of 2
33579          * requires that index0 and index1 are valid, and so forth
33580          */
33581         uint16_t        dimensions;
33582         /* index for the 1st dimensions */
33583         uint16_t        index_0;
33584         /* index for the 2nd dimensions */
33585         uint16_t        index_1;
33586         /* index for the 3rd dimensions */
33587         uint16_t        index_2;
33588         /* index for the 4th dimensions */
33589         uint16_t        index_3;
33590         uint8_t unused_0[2];
33591 } __attribute__((packed));
33592
33593 /* hwrm_nvm_validate_option_output (size:128b/16B) */
33594 struct hwrm_nvm_validate_option_output {
33595         /* The specific error status for the command. */
33596         uint16_t        error_code;
33597         /* The HWRM command request type. */
33598         uint16_t        req_type;
33599         /* The sequence ID from the original command. */
33600         uint16_t        seq_id;
33601         /* The length of the response data in number of bytes. */
33602         uint16_t        resp_len;
33603         uint8_t result;
33604         /* indicates that the value provided for the option is not matching with the saved data. */
33605         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0)
33606         /* indicates that the value provided for the option is matching the saved data. */
33607         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH     UINT32_C(0x1)
33608         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST \
33609                 HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH
33610         uint8_t unused_0[6];
33611         /*
33612          * This field is used in Output records to indicate that the output
33613          * is completely written to RAM.  This field should be read as '1'
33614          * to indicate that the output has been completely written.
33615          * When writing a command completion or response to an internal processor,
33616          * the order of writes has to be such that this field is written last.
33617          */
33618         uint8_t valid;
33619 } __attribute__((packed));
33620
33621 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
33622 struct hwrm_nvm_validate_option_cmd_err {
33623         /*
33624          * command specific error codes that goes to
33625          * the cmd_err field in Common HWRM Error Response.
33626          */
33627         uint8_t code;
33628         /* Unknown error */
33629         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
33630         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST \
33631                 HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
33632         uint8_t unused_0[7];
33633 } __attribute__((packed));
33634
33635 /*****************
33636  * hwrm_fw_reset *
33637  ******************/
33638
33639
33640 /* hwrm_fw_reset_input (size:192b/24B) */
33641 struct hwrm_fw_reset_input {
33642         /* The HWRM command request type. */
33643         uint16_t        req_type;
33644         /*
33645          * The completion ring to send the completion event on. This should
33646          * be the NQ ID returned from the `nq_alloc` HWRM command.
33647          */
33648         uint16_t        cmpl_ring;
33649         /*
33650          * The sequence ID is used by the driver for tracking multiple
33651          * commands. This ID is treated as opaque data by the firmware and
33652          * the value is returned in the `hwrm_resp_hdr` upon completion.
33653          */
33654         uint16_t        seq_id;
33655         /*
33656          * The target ID of the command:
33657          * * 0x0-0xFFF8 - The function ID
33658          * * 0xFFF8-0xFFFE - Reserved for internal processors
33659          * * 0xFFFF - HWRM
33660          */
33661         uint16_t        target_id;
33662         /*
33663          * A physical address pointer pointing to a host buffer that the
33664          * command's response data will be written. This can be either a host
33665          * physical address (HPA) or a guest physical address (GPA) and must
33666          * point to a physically contiguous block of memory.
33667          */
33668         uint64_t        resp_addr;
33669         /* Type of embedded processor. */
33670         uint8_t embedded_proc_type;
33671         /* Boot Processor */
33672         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_BOOT \
33673                 UINT32_C(0x0)
33674         /* Management Processor */
33675         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_MGMT \
33676                 UINT32_C(0x1)
33677         /* Network control processor */
33678         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_NETCTRL \
33679                 UINT32_C(0x2)
33680         /* RoCE control processor */
33681         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_ROCE \
33682                 UINT32_C(0x3)
33683         /*
33684          * Host (in multi-host environment): This is only valid if requester is IPC.
33685          * Reinit host hardware resources and PCIe.
33686          */
33687         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST \
33688                 UINT32_C(0x4)
33689         /* AP processor complex (in multi-host environment). Use host_idx to control which core is reset */
33690         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_AP \
33691                 UINT32_C(0x5)
33692         /* Reset all blocks of the chip (including all processors) */
33693         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_CHIP \
33694                 UINT32_C(0x6)
33695         /*
33696          * Host (in multi-host environment): This is only valid if requester is IPC.
33697          * Reinit host hardware resources.
33698          */
33699         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT \
33700                 UINT32_C(0x7)
33701         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_LAST \
33702                 HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT
33703         /* Type of self reset. */
33704         uint8_t selfrst_status;
33705         /* No Self Reset */
33706         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTNONE \
33707                 UINT32_C(0x0)
33708         /* Self Reset as soon as possible to do so safely */
33709         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP \
33710                 UINT32_C(0x1)
33711         /* Self Reset on PCIe Reset */
33712         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTPCIERST \
33713                 UINT32_C(0x2)
33714         /* Self Reset immediately after notification to all clients. */
33715         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
33716                 UINT32_C(0x3)
33717         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_LAST \
33718                 HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
33719         /*
33720          * Indicate which host is being reset. 0 means first host.
33721          * Only valid when embedded_proc_type is host in multihost
33722          * environment
33723          */
33724         uint8_t host_idx;
33725         uint8_t flags;
33726         /*
33727          * When this bit is '1', then the core firmware initiates
33728          * the reset only after graceful shut down of all registered instances.
33729          * If not, the device will continue with the existing firmware.
33730          */
33731         #define HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL     UINT32_C(0x1)
33732         uint8_t unused_0[4];
33733 } __attribute__((packed));
33734
33735 /* hwrm_fw_reset_output (size:128b/16B) */
33736 struct hwrm_fw_reset_output {
33737         /* The specific error status for the command. */
33738         uint16_t        error_code;
33739         /* The HWRM command request type. */
33740         uint16_t        req_type;
33741         /* The sequence ID from the original command. */
33742         uint16_t        seq_id;
33743         /* The length of the response data in number of bytes. */
33744         uint16_t        resp_len;
33745         /* Type of self reset. */
33746         uint8_t selfrst_status;
33747         /* No Self Reset */
33748         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTNONE \
33749                 UINT32_C(0x0)
33750         /* Self Reset as soon as possible to do so safely */
33751         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTASAP \
33752                 UINT32_C(0x1)
33753         /* Self Reset on PCIe Reset */
33754         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST \
33755                 UINT32_C(0x2)
33756         /* Self Reset immediately after notification to all clients. */
33757         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
33758                 UINT32_C(0x3)
33759         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_LAST \
33760                 HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
33761         uint8_t unused_0[6];
33762         /*
33763          * This field is used in Output records to indicate that the output
33764          * is completely written to RAM.  This field should be read as '1'
33765          * to indicate that the output has been completely written.
33766          * When writing a command completion or response to an internal processor,
33767          * the order of writes has to be such that this field is written last.
33768          */
33769         uint8_t valid;
33770 } __attribute__((packed));
33771
33772 #endif /* _HSI_STRUCT_DEF_DPDK_H_ */