net/ice: enable advanced RSS
[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          * If the query is for a VF, then this flag shall be ignored.
7332          * If this query is for a PF and this flag is set to 1, then host
7333          * must initiate reset or reload (or fastboot) the firmware image
7334          * upon detection of device shutdown state.
7335          */
7336         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERR_RECOVER_RELOAD \
7337                 UINT32_C(0x2000000)
7338         /*
7339          * This value is current MAC address configured for this
7340          * function. A value of 00-00-00-00-00-00 indicates no
7341          * MAC address is currently configured.
7342          */
7343         uint8_t mac_address[6];
7344         /*
7345          * The maximum number of RSS/COS contexts that can be
7346          * allocated to the function.
7347          */
7348         uint16_t        max_rsscos_ctx;
7349         /*
7350          * The maximum number of completion rings that can be
7351          * allocated to the function.
7352          */
7353         uint16_t        max_cmpl_rings;
7354         /*
7355          * The maximum number of transmit rings that can be
7356          * allocated to the function.
7357          */
7358         uint16_t        max_tx_rings;
7359         /*
7360          * The maximum number of receive rings that can be
7361          * allocated to the function.
7362          */
7363         uint16_t        max_rx_rings;
7364         /*
7365          * The maximum number of L2 contexts that can be
7366          * allocated to the function.
7367          */
7368         uint16_t        max_l2_ctxs;
7369         /*
7370          * The maximum number of VNICs that can be
7371          * allocated to the function.
7372          */
7373         uint16_t        max_vnics;
7374         /*
7375          * The identifier for the first VF enabled on a PF. This
7376          * is valid only on the PF with SR-IOV enabled.
7377          * 0xFF... (All Fs) if this command is called on a PF with
7378          * SR-IOV disabled or on a VF.
7379          */
7380         uint16_t        first_vf_id;
7381         /*
7382          * The maximum number of VFs that can be
7383          * allocated to the function. This is valid only on the
7384          * PF with SR-IOV enabled. 0xFF... (All Fs) if this
7385          * command is called on a PF with SR-IOV disabled or
7386          * on a VF.
7387          */
7388         uint16_t        max_vfs;
7389         /*
7390          * The maximum number of statistic contexts that can be
7391          * allocated to the function.
7392          */
7393         uint16_t        max_stat_ctx;
7394         /*
7395          * The maximum number of Encapsulation records that can be
7396          * offloaded by this function.
7397          */
7398         uint32_t        max_encap_records;
7399         /*
7400          * The maximum number of decapsulation records that can
7401          * be offloaded by this function.
7402          */
7403         uint32_t        max_decap_records;
7404         /*
7405          * The maximum number of Exact Match (EM) flows that can be
7406          * offloaded by this function on the TX side.
7407          */
7408         uint32_t        max_tx_em_flows;
7409         /*
7410          * The maximum number of Wildcard Match (WM) flows that can
7411          * be offloaded by this function on the TX side.
7412          */
7413         uint32_t        max_tx_wm_flows;
7414         /*
7415          * The maximum number of Exact Match (EM) flows that can be
7416          * offloaded by this function on the RX side.
7417          */
7418         uint32_t        max_rx_em_flows;
7419         /*
7420          * The maximum number of Wildcard Match (WM) flows that can
7421          * be offloaded by this function on the RX side.
7422          */
7423         uint32_t        max_rx_wm_flows;
7424         /*
7425          * The maximum number of multicast filters that can
7426          * be supported by this function on the RX side.
7427          */
7428         uint32_t        max_mcast_filters;
7429         /*
7430          * The maximum value of flow_id that can be supported
7431          * in completion records.
7432          */
7433         uint32_t        max_flow_id;
7434         /*
7435          * The maximum number of HW ring groups that can be
7436          * supported on this function.
7437          */
7438         uint32_t        max_hw_ring_grps;
7439         /*
7440          * The maximum number of strict priority transmit rings
7441          * that can be allocated to the function.
7442          * This number indicates the maximum number of TX rings
7443          * that can be assigned strict priorities out of the
7444          * maximum number of TX rings that can be allocated
7445          * (max_tx_rings) to the function.
7446          */
7447         uint16_t        max_sp_tx_rings;
7448         uint8_t unused_0;
7449         /*
7450          * This field is used in Output records to indicate that the output
7451          * is completely written to RAM.  This field should be read as '1'
7452          * to indicate that the output has been completely written.
7453          * When writing a command completion or response to an internal processor,
7454          * the order of writes has to be such that this field is written last.
7455          */
7456         uint8_t valid;
7457 } __attribute__((packed));
7458
7459 /******************
7460  * hwrm_func_qcfg *
7461  ******************/
7462
7463
7464 /* hwrm_func_qcfg_input (size:192b/24B) */
7465 struct hwrm_func_qcfg_input {
7466         /* The HWRM command request type. */
7467         uint16_t        req_type;
7468         /*
7469          * The completion ring to send the completion event on. This should
7470          * be the NQ ID returned from the `nq_alloc` HWRM command.
7471          */
7472         uint16_t        cmpl_ring;
7473         /*
7474          * The sequence ID is used by the driver for tracking multiple
7475          * commands. This ID is treated as opaque data by the firmware and
7476          * the value is returned in the `hwrm_resp_hdr` upon completion.
7477          */
7478         uint16_t        seq_id;
7479         /*
7480          * The target ID of the command:
7481          * * 0x0-0xFFF8 - The function ID
7482          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
7483          * * 0xFFFD - Reserved for user-space HWRM interface
7484          * * 0xFFFF - HWRM
7485          */
7486         uint16_t        target_id;
7487         /*
7488          * A physical address pointer pointing to a host buffer that the
7489          * command's response data will be written. This can be either a host
7490          * physical address (HPA) or a guest physical address (GPA) and must
7491          * point to a physically contiguous block of memory.
7492          */
7493         uint64_t        resp_addr;
7494         /*
7495          * Function ID of the function that is being queried.
7496          * 0xFF... (All Fs) if the query is for the requesting
7497          * function.
7498          */
7499         uint16_t        fid;
7500         uint8_t unused_0[6];
7501 } __attribute__((packed));
7502
7503 /* hwrm_func_qcfg_output (size:704b/88B) */
7504 struct hwrm_func_qcfg_output {
7505         /* The specific error status for the command. */
7506         uint16_t        error_code;
7507         /* The HWRM command request type. */
7508         uint16_t        req_type;
7509         /* The sequence ID from the original command. */
7510         uint16_t        seq_id;
7511         /* The length of the response data in number of bytes. */
7512         uint16_t        resp_len;
7513         /*
7514          * FID value.  This value is used to identify operations on the PCI
7515          * bus as belonging to a particular PCI function.
7516          */
7517         uint16_t        fid;
7518         /*
7519          * Port ID of port that this function is associated with.
7520          * 0xFF... (All Fs) if this function is not associated with
7521          * any port.
7522          */
7523         uint16_t        port_id;
7524         /*
7525          * This value is the current VLAN setting for this
7526          * function. The value of 0 for this field indicates
7527          * no priority tagging or VLAN is used.
7528          * This field's format is same as 802.1Q Tag's
7529          * Tag Control Information (TCI) format that includes both
7530          * Priority Code Point (PCP) and VLAN Identifier (VID).
7531          */
7532         uint16_t        vlan;
7533         uint16_t        flags;
7534         /*
7535          * If 1, then magic packet based Out-Of-Box WoL is enabled on
7536          * the port associated with this function.
7537          */
7538         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \
7539                 UINT32_C(0x1)
7540         /*
7541          * If 1, then bitmap pattern based Out-Of-Box WoL packet is enabled
7542          * on the port associated with this function.
7543          */
7544         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED \
7545                 UINT32_C(0x2)
7546         /*
7547          * If set to 1, then FW based DCBX agent is enabled and running on
7548          * the port associated with this function.
7549          * If set to 0, then DCBX agent is not running in the firmware.
7550          */
7551         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \
7552                 UINT32_C(0x4)
7553         /*
7554          * Standard TX Ring mode is used for the allocation of TX ring
7555          * and underlying scheduling resources that allow bandwidth
7556          * reservation and limit settings on the queried function.
7557          * If set to 1, then standard TX ring mode is enabled
7558          * on the queried function.
7559          * If set to 0, then the standard TX ring mode is disabled
7560          * on the queried function. In this extended TX ring resource
7561          * mode, the minimum and maximum bandwidth settings are not
7562          * supported to allow the allocation of TX rings to span multiple
7563          * scheduler nodes.
7564          */
7565         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \
7566                 UINT32_C(0x8)
7567         /*
7568          * If set to 1 then FW based LLDP agent is enabled and running on
7569          * the port associated with this function.
7570          * If set to 0 then the LLDP agent is not running in the firmware.
7571          */
7572         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED \
7573                 UINT32_C(0x10)
7574         /*
7575          * If set to 1, then multi-host mode is active for this function.
7576          * If set to 0, then multi-host mode is inactive for this function
7577          * or not applicable for this device.
7578          */
7579         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST \
7580                 UINT32_C(0x20)
7581         /*
7582          * If the function that is being queried is a PF, then the HWRM shall
7583          * set this field to 0 and the HWRM client shall ignore this field.
7584          * If the function that is being queried is a VF, then the HWRM shall
7585          * set this field to 1 if the queried VF is trusted, otherwise the HWRM
7586          * shall set this field to 0.
7587          */
7588         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF \
7589                 UINT32_C(0x40)
7590         /*
7591          * If set to 1, then secure mode is enabled for this function or device.
7592          * If set to 0, then secure mode is disabled (or normal mode) for this
7593          * function or device.
7594          */
7595         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_SECURE_MODE_ENABLED \
7596                 UINT32_C(0x80)
7597         /*
7598          * If set to 1, then this PF is enabled with a preboot driver that
7599          * requires access to the legacy L2 ring model and legacy 32b
7600          * doorbells. If set to 0, then this PF is not allowed to use
7601          * the legacy L2 rings. This feature is not allowed on VFs and
7602          * is only relevant for devices that require a context backing
7603          * store.
7604          */
7605         #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \
7606                 UINT32_C(0x100)
7607         /*
7608          * This value is current MAC address configured for this
7609          * function. A value of 00-00-00-00-00-00 indicates no
7610          * MAC address is currently configured.
7611          */
7612         uint8_t mac_address[6];
7613         /*
7614          * This value is current PCI ID of this
7615          * function. If ARI is enabled, then it is
7616          * Bus Number (8b):Function Number(8b). Otherwise, it is
7617          * Bus Number (8b):Device Number (4b):Function Number(4b).
7618          * If multi-host mode is active, the 4 lsb will indicate
7619          * the PF index for this function.
7620          */
7621         uint16_t        pci_id;
7622         /*
7623          * The number of RSS/COS contexts currently
7624          * allocated to the function.
7625          */
7626         uint16_t        alloc_rsscos_ctx;
7627         /*
7628          * The number of completion rings currently allocated to
7629          * the function. This does not include the rings allocated
7630          * to any children functions if any.
7631          */
7632         uint16_t        alloc_cmpl_rings;
7633         /*
7634          * The number of transmit rings currently allocated to
7635          * the function. This does not include the rings allocated
7636          * to any children functions if any.
7637          */
7638         uint16_t        alloc_tx_rings;
7639         /*
7640          * The number of receive rings currently allocated to
7641          * the function. This does not include the rings allocated
7642          * to any children functions if any.
7643          */
7644         uint16_t        alloc_rx_rings;
7645         /* The allocated number of L2 contexts to the function. */
7646         uint16_t        alloc_l2_ctx;
7647         /* The allocated number of vnics to the function. */
7648         uint16_t        alloc_vnics;
7649         /*
7650          * The maximum transmission unit of the function.
7651          * If the reported mtu value is non-zero then it will used for the
7652          * rings allocated on this function. otherwise the default
7653          * value is used if ring MTU is not specified.
7654          */
7655         uint16_t        mtu;
7656         /*
7657          * The maximum receive unit of the function.
7658          * For vnics allocated on this function, this default
7659          * value is used if vnic MRU is not specified.
7660          */
7661         uint16_t        mru;
7662         /* The statistics context assigned to a function. */
7663         uint16_t        stat_ctx_id;
7664         /*
7665          * The HWRM shall return Unknown value for this field
7666          * when this command is used to query VF's configuration.
7667          */
7668         uint8_t port_partition_type;
7669         /* Single physical function */
7670         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF     UINT32_C(0x0)
7671         /* Multiple physical functions */
7672         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS    UINT32_C(0x1)
7673         /* Network Partitioning 1.0 */
7674         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
7675         /* Network Partitioning 1.5 */
7676         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
7677         /* Network Partitioning 2.0 */
7678         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
7679         /* Unknown */
7680         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN \
7681                 UINT32_C(0xff)
7682         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_LAST \
7683                 HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN
7684         /*
7685          * This field will indicate number of physical functions on this port_partition.
7686          * HWRM shall return unavail (i.e. value of 0) for this field
7687          * when this command is used to query VF's configuration or
7688          * from older firmware that doesn't support this field.
7689          */
7690         uint8_t port_pf_cnt;
7691         /* number of PFs is not available */
7692         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
7693         #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_LAST \
7694                 HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL
7695         /*
7696          * The default VNIC ID assigned to a function that is
7697          * being queried.
7698          */
7699         uint16_t        dflt_vnic_id;
7700         uint16_t        max_mtu_configured;
7701         /*
7702          * Minimum BW allocated for this function.
7703          * The HWRM will translate this value into byte counter and
7704          * time interval used for the scheduler inside the device.
7705          * A value of 0 indicates the minimum bandwidth is not
7706          * configured.
7707          */
7708         uint32_t        min_bw;
7709         /* The bandwidth value. */
7710         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK \
7711                 UINT32_C(0xfffffff)
7712         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT              0
7713         /* The granularity of the value (bits or bytes). */
7714         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE \
7715                 UINT32_C(0x10000000)
7716         /* Value is in bits. */
7717         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS \
7718                 (UINT32_C(0x0) << 28)
7719         /* Value is in bytes. */
7720         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \
7721                 (UINT32_C(0x1) << 28)
7722         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \
7723                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
7724         /* bw_value_unit is 3 b */
7725         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \
7726                 UINT32_C(0xe0000000)
7727         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
7728         /* Value is in Mb or MB (base 10). */
7729         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
7730                 (UINT32_C(0x0) << 29)
7731         /* Value is in Kb or KB (base 10). */
7732         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \
7733                 (UINT32_C(0x2) << 29)
7734         /* Value is in bits or bytes. */
7735         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \
7736                 (UINT32_C(0x4) << 29)
7737         /* Value is in Gb or GB (base 10). */
7738         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
7739                 (UINT32_C(0x6) << 29)
7740         /* Value is in 1/100th of a percentage of total bandwidth. */
7741         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
7742                 (UINT32_C(0x1) << 29)
7743         /* Invalid unit */
7744         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
7745                 (UINT32_C(0x7) << 29)
7746         #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \
7747                 HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
7748         /*
7749          * Maximum BW allocated for this function.
7750          * The HWRM will translate this value into byte counter and
7751          * time interval used for the scheduler inside the device.
7752          * A value of 0 indicates that the maximum bandwidth is not
7753          * configured.
7754          */
7755         uint32_t        max_bw;
7756         /* The bandwidth value. */
7757         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK \
7758                 UINT32_C(0xfffffff)
7759         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT              0
7760         /* The granularity of the value (bits or bytes). */
7761         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE \
7762                 UINT32_C(0x10000000)
7763         /* Value is in bits. */
7764         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS \
7765                 (UINT32_C(0x0) << 28)
7766         /* Value is in bytes. */
7767         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \
7768                 (UINT32_C(0x1) << 28)
7769         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \
7770                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
7771         /* bw_value_unit is 3 b */
7772         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \
7773                 UINT32_C(0xe0000000)
7774         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
7775         /* Value is in Mb or MB (base 10). */
7776         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
7777                 (UINT32_C(0x0) << 29)
7778         /* Value is in Kb or KB (base 10). */
7779         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \
7780                 (UINT32_C(0x2) << 29)
7781         /* Value is in bits or bytes. */
7782         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \
7783                 (UINT32_C(0x4) << 29)
7784         /* Value is in Gb or GB (base 10). */
7785         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
7786                 (UINT32_C(0x6) << 29)
7787         /* Value is in 1/100th of a percentage of total bandwidth. */
7788         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
7789                 (UINT32_C(0x1) << 29)
7790         /* Invalid unit */
7791         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
7792                 (UINT32_C(0x7) << 29)
7793         #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \
7794                 HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
7795         /*
7796          * This value indicates the Edge virtual bridge mode for the
7797          * domain that this function belongs to.
7798          */
7799         uint8_t evb_mode;
7800         /* No Edge Virtual Bridging (EVB) */
7801         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
7802         /* Virtual Ethernet Bridge (VEB) */
7803         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB    UINT32_C(0x1)
7804         /* Virtual Ethernet Port Aggregator (VEPA) */
7805         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA   UINT32_C(0x2)
7806         #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_LAST \
7807                 HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA
7808         uint8_t options;
7809         /*
7810          * This value indicates the PCIE device cache line size.
7811          * The cache line size allows the DMA writes to terminate and
7812          * start at the cache boundary.
7813          */
7814         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_MASK \
7815                 UINT32_C(0x3)
7816         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SFT          0
7817         /* Cache Line Size 64 bytes */
7818         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
7819                 UINT32_C(0x0)
7820         /* Cache Line Size 128 bytes */
7821         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
7822                 UINT32_C(0x1)
7823         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_LAST \
7824                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
7825         /* This value is the virtual link admin state setting. */
7826         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
7827                 UINT32_C(0xc)
7828         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
7829         /* Admin link state is in forced down mode. */
7830         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
7831                 (UINT32_C(0x0) << 2)
7832         /* Admin link state is in forced up mode. */
7833         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
7834                 (UINT32_C(0x1) << 2)
7835         /* Admin link state is in auto mode  - follows the physical link state. */
7836         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
7837                 (UINT32_C(0x2) << 2)
7838         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
7839                 HWRM_FUNC_QCFG_OUTPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
7840         /* Reserved for future. */
7841         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_MASK \
7842                 UINT32_C(0xf0)
7843         #define HWRM_FUNC_QCFG_OUTPUT_OPTIONS_RSVD_SFT                    4
7844         /*
7845          * The number of VFs that are allocated to the function.
7846          * This is valid only on the PF with SR-IOV enabled.
7847          * 0xFF... (All Fs) if this command is called on a PF with
7848          * SR-IOV disabled or on a VF.
7849          */
7850         uint16_t        alloc_vfs;
7851         /*
7852          * The number of allocated multicast filters for this
7853          * function on the RX side.
7854          */
7855         uint32_t        alloc_mcast_filters;
7856         /*
7857          * The number of allocated HW ring groups for this
7858          * function.
7859          */
7860         uint32_t        alloc_hw_ring_grps;
7861         /*
7862          * The number of strict priority transmit rings out of
7863          * currently allocated TX rings to the function
7864          * (alloc_tx_rings).
7865          */
7866         uint16_t        alloc_sp_tx_rings;
7867         /*
7868          * The number of statistics contexts
7869          * currently reserved for the function.
7870          */
7871         uint16_t        alloc_stat_ctx;
7872         /*
7873          * This field specifies how many NQs are reserved for the PF.
7874          * Remaining NQs that belong to the PF are available for VFs.
7875          * Once a PF has created VFs, it cannot change how many NQs are
7876          * reserved for itself (since the NQs must be contiguous in HW).
7877          */
7878         uint16_t        alloc_msix;
7879         /*
7880          * The number of registered VF’s associated with the PF. This field
7881          * should be ignored when the request received on the VF interface.
7882          * This field will be updated on the PF interface to initiate
7883          * the unregister request on PF in the HOT Reset Process.
7884          */
7885         uint16_t        registered_vfs;
7886         /*
7887          * The size of the doorbell BAR in KBytes reserved for L2 including
7888          * any area that is shared between L2 and RoCE.  The L2 driver
7889          * should only map the L2 portion of the doorbell BAR.  Any rounding
7890          * of the BAR size to the native CPU page size should be performed
7891          * by the driver.  If the value is zero, no special partitioning
7892          * of the doorbell BAR between L2 and RoCE is required.
7893          */
7894         uint16_t        l2_doorbell_bar_size_kb;
7895         uint8_t unused_1;
7896         /*
7897          * For backward compatibility this field must be set to 1.
7898          * Older drivers might look for this field to be 1 before
7899          * processing the message.
7900          */
7901         uint8_t always_1;
7902         /*
7903          * This GRC address location is used by the Host driver interfaces to poll
7904          * the adapter ready state to re-initiate the registration process again
7905          * after receiving the RESET Notify event.
7906          */
7907         uint32_t        reset_addr_poll;
7908         uint8_t unused_2[3];
7909         /*
7910          * This field is used in Output records to indicate that the output
7911          * is completely written to RAM.  This field should be read as '1'
7912          * to indicate that the output has been completely written.
7913          * When writing a command completion or response to an internal processor,
7914          * the order of writes has to be such that this field is written last.
7915          */
7916         uint8_t valid;
7917 } __attribute__((packed));
7918
7919 /*****************
7920  * hwrm_func_cfg *
7921  *****************/
7922
7923
7924 /* hwrm_func_cfg_input (size:704b/88B) */
7925 struct hwrm_func_cfg_input {
7926         /* The HWRM command request type. */
7927         uint16_t        req_type;
7928         /*
7929          * The completion ring to send the completion event on. This should
7930          * be the NQ ID returned from the `nq_alloc` HWRM command.
7931          */
7932         uint16_t        cmpl_ring;
7933         /*
7934          * The sequence ID is used by the driver for tracking multiple
7935          * commands. This ID is treated as opaque data by the firmware and
7936          * the value is returned in the `hwrm_resp_hdr` upon completion.
7937          */
7938         uint16_t        seq_id;
7939         /*
7940          * The target ID of the command:
7941          * * 0x0-0xFFF8 - The function ID
7942          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
7943          * * 0xFFFD - Reserved for user-space HWRM interface
7944          * * 0xFFFF - HWRM
7945          */
7946         uint16_t        target_id;
7947         /*
7948          * A physical address pointer pointing to a host buffer that the
7949          * command's response data will be written. This can be either a host
7950          * physical address (HPA) or a guest physical address (GPA) and must
7951          * point to a physically contiguous block of memory.
7952          */
7953         uint64_t        resp_addr;
7954         /*
7955          * Function ID of the function that is being
7956          * configured.
7957          * If set to 0xFF... (All Fs), then the the configuration is
7958          * for the requesting function.
7959          */
7960         uint16_t        fid;
7961         /*
7962          * This field specifies how many NQs will be reserved for the PF.
7963          * Remaining NQs that belong to the PF become available for VFs.
7964          * Once a PF has created VFs, it cannot change how many NQs are
7965          * reserved for itself (since the NQs must be contiguous in HW).
7966          */
7967         uint16_t        num_msix;
7968         uint32_t        flags;
7969         /*
7970          * When this bit is '1', the function is disabled with
7971          * source MAC address check.
7972          * This is an anti-spoofing check. If this flag is set,
7973          * then the function shall be configured to disallow
7974          * transmission of frames with the source MAC address that
7975          * is configured for this function.
7976          */
7977         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \
7978                 UINT32_C(0x1)
7979         /*
7980          * When this bit is '1', the function is enabled with
7981          * source MAC address check.
7982          * This is an anti-spoofing check. If this flag is set,
7983          * then the function shall be configured to allow
7984          * transmission of frames with the source MAC address that
7985          * is configured for this function.
7986          */
7987         #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \
7988                 UINT32_C(0x2)
7989         /* reserved. */
7990         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK \
7991                 UINT32_C(0x1fc)
7992         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT                       2
7993         /*
7994          * Standard TX Ring mode is used for the allocation of TX ring
7995          * and underlying scheduling resources that allow bandwidth
7996          * reservation and limit settings on the queried function.
7997          * If set to 1, then standard TX ring mode is requested to be
7998          * enabled on the function being configured.
7999          */
8000         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \
8001                 UINT32_C(0x200)
8002         /*
8003          * Standard TX Ring mode is used for the allocation of TX ring
8004          * and underlying scheduling resources that allow bandwidth
8005          * reservation and limit settings on the queried function.
8006          * If set to 1, then the standard TX ring mode is requested to
8007          * be disabled on the function being configured. In this extended
8008          * TX ring resource mode, the minimum and maximum bandwidth settings
8009          * are not supported to allow the allocation of TX rings to
8010          * span multiple scheduler nodes.
8011          */
8012         #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \
8013                 UINT32_C(0x400)
8014         /*
8015          * If this bit is set, virtual mac address configured
8016          * in this command will be persistent over warm boot.
8017          */
8018         #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST \
8019                 UINT32_C(0x800)
8020         /*
8021          * This bit only applies to the VF. If this bit is set, the statistic
8022          * context counters will not be cleared when the statistic context is freed
8023          * or a function reset is called on VF. This bit will be cleared when the PF
8024          * is unloaded or a function reset is called on the PF.
8025          */
8026         #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC \
8027                 UINT32_C(0x1000)
8028         /*
8029          * This bit requests that the firmware test to see if all the assets
8030          * requested in this command (i.e. number of TX rings) are available.
8031          * The firmware will return an error if the requested assets are
8032          * not available. The firwmare will NOT reserve the assets if they
8033          * are available.
8034          */
8035         #define HWRM_FUNC_CFG_INPUT_FLAGS_TX_ASSETS_TEST \
8036                 UINT32_C(0x2000)
8037         /*
8038          * This bit requests that the firmware test to see if all the assets
8039          * requested in this command (i.e. number of RX rings) are available.
8040          * The firmware will return an error if the requested assets are
8041          * not available. The firwmare will NOT reserve the assets if they
8042          * are available.
8043          */
8044         #define HWRM_FUNC_CFG_INPUT_FLAGS_RX_ASSETS_TEST \
8045                 UINT32_C(0x4000)
8046         /*
8047          * This bit requests that the firmware test to see if all the assets
8048          * requested in this command (i.e. number of CMPL rings) are available.
8049          * The firmware will return an error if the requested assets are
8050          * not available. The firwmare will NOT reserve the assets if they
8051          * are available.
8052          */
8053         #define HWRM_FUNC_CFG_INPUT_FLAGS_CMPL_ASSETS_TEST \
8054                 UINT32_C(0x8000)
8055         /*
8056          * This bit requests that the firmware test to see if all the assets
8057          * requested in this command (i.e. number of RSS ctx) are available.
8058          * The firmware will return an error if the requested assets are
8059          * not available. The firwmare will NOT reserve the assets if they
8060          * are available.
8061          */
8062         #define HWRM_FUNC_CFG_INPUT_FLAGS_RSSCOS_CTX_ASSETS_TEST \
8063                 UINT32_C(0x10000)
8064         /*
8065          * This bit requests that the firmware test to see if all the assets
8066          * requested in this command (i.e. number of ring groups) are available.
8067          * The firmware will return an error if the requested assets are
8068          * not available. The firwmare will NOT reserve the assets if they
8069          * are available.
8070          */
8071         #define HWRM_FUNC_CFG_INPUT_FLAGS_RING_GRP_ASSETS_TEST \
8072                 UINT32_C(0x20000)
8073         /*
8074          * This bit requests that the firmware test to see if all the assets
8075          * requested in this command (i.e. number of stat ctx) are available.
8076          * The firmware will return an error if the requested assets are
8077          * not available. The firwmare will NOT reserve the assets if they
8078          * are available.
8079          */
8080         #define HWRM_FUNC_CFG_INPUT_FLAGS_STAT_CTX_ASSETS_TEST \
8081                 UINT32_C(0x40000)
8082         /*
8083          * This bit requests that the firmware test to see if all the assets
8084          * requested in this command (i.e. number of VNICs) are available.
8085          * The firmware will return an error if the requested assets are
8086          * not available. The firwmare will NOT reserve the assets if they
8087          * are available.
8088          */
8089         #define HWRM_FUNC_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST \
8090                 UINT32_C(0x80000)
8091         /*
8092          * This bit requests that the firmware test to see if all the assets
8093          * requested in this command (i.e. number of L2 ctx) are available.
8094          * The firmware will return an error if the requested assets are
8095          * not available. The firwmare will NOT reserve the assets if they
8096          * are available.
8097          */
8098         #define HWRM_FUNC_CFG_INPUT_FLAGS_L2_CTX_ASSETS_TEST \
8099                 UINT32_C(0x100000)
8100         /*
8101          * This configuration change can be initiated by a PF driver. This
8102          * configuration request shall be targeted to a VF. From local host
8103          * resident HWRM clients, only the parent PF driver shall be allowed
8104          * to initiate this change on one of its children VFs. If this bit is
8105          * set to 1, then the VF that is being configured is requested to be
8106          * trusted.
8107          */
8108         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_ENABLE \
8109                 UINT32_C(0x200000)
8110         /*
8111          * When this bit it set, even if PF reserved pool size is zero,
8112          * FW will allow driver to create TX rings in ring alloc,
8113          * by reserving TX ring, S3 node dynamically.
8114          */
8115         #define HWRM_FUNC_CFG_INPUT_FLAGS_DYNAMIC_TX_RING_ALLOC \
8116                 UINT32_C(0x400000)
8117         /*
8118          * This bit requests that the firmware test to see if all the assets
8119          * requested in this command (i.e. number of NQ rings) are available.
8120          * The firmware will return an error if the requested assets are
8121          * not available. The firwmare will NOT reserve the assets if they
8122          * are available.
8123          */
8124         #define HWRM_FUNC_CFG_INPUT_FLAGS_NQ_ASSETS_TEST \
8125                 UINT32_C(0x800000)
8126         /*
8127          * This configuration change can be initiated by a PF driver. This
8128          * configuration request shall be targeted to a VF. From local host
8129          * resident HWRM clients, only the parent PF driver shall be allowed
8130          * to initiate this change on one of its children VFs. If this bit is
8131          * set to 1, then the VF that is being configured is requested to be
8132          * untrusted.
8133          */
8134         #define HWRM_FUNC_CFG_INPUT_FLAGS_TRUSTED_VF_DISABLE \
8135                 UINT32_C(0x1000000)
8136         /*
8137          * This bit is used by preboot drivers on a PF that require access
8138          * to the legacy L2 ring model and legacy 32b doorbells. This
8139          * feature is not allowed on VFs and is only relevant for devices
8140          * that require a context backing store.
8141          */
8142         #define HWRM_FUNC_CFG_INPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \
8143                 UINT32_C(0x2000000)
8144         uint32_t        enables;
8145         /*
8146          * This bit must be '1' for the mtu field to be
8147          * configured.
8148          */
8149         #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU \
8150                 UINT32_C(0x1)
8151         /*
8152          * This bit must be '1' for the mru field to be
8153          * configured.
8154          */
8155         #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU \
8156                 UINT32_C(0x2)
8157         /*
8158          * This bit must be '1' for the num_rsscos_ctxs field to be
8159          * configured.
8160          */
8161         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS \
8162                 UINT32_C(0x4)
8163         /*
8164          * This bit must be '1' for the num_cmpl_rings field to be
8165          * configured.
8166          */
8167         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS \
8168                 UINT32_C(0x8)
8169         /*
8170          * This bit must be '1' for the num_tx_rings field to be
8171          * configured.
8172          */
8173         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS \
8174                 UINT32_C(0x10)
8175         /*
8176          * This bit must be '1' for the num_rx_rings field to be
8177          * configured.
8178          */
8179         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS \
8180                 UINT32_C(0x20)
8181         /*
8182          * This bit must be '1' for the num_l2_ctxs field to be
8183          * configured.
8184          */
8185         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS \
8186                 UINT32_C(0x40)
8187         /*
8188          * This bit must be '1' for the num_vnics field to be
8189          * configured.
8190          */
8191         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS \
8192                 UINT32_C(0x80)
8193         /*
8194          * This bit must be '1' for the num_stat_ctxs field to be
8195          * configured.
8196          */
8197         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS \
8198                 UINT32_C(0x100)
8199         /*
8200          * This bit must be '1' for the dflt_mac_addr field to be
8201          * configured.
8202          */
8203         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR \
8204                 UINT32_C(0x200)
8205         /*
8206          * This bit must be '1' for the dflt_vlan field to be
8207          * configured.
8208          */
8209         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN \
8210                 UINT32_C(0x400)
8211         /*
8212          * This bit must be '1' for the dflt_ip_addr field to be
8213          * configured.
8214          */
8215         #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR \
8216                 UINT32_C(0x800)
8217         /*
8218          * This bit must be '1' for the min_bw field to be
8219          * configured.
8220          */
8221         #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW \
8222                 UINT32_C(0x1000)
8223         /*
8224          * This bit must be '1' for the max_bw field to be
8225          * configured.
8226          */
8227         #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW \
8228                 UINT32_C(0x2000)
8229         /*
8230          * This bit must be '1' for the async_event_cr field to be
8231          * configured.
8232          */
8233         #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR \
8234                 UINT32_C(0x4000)
8235         /*
8236          * This bit must be '1' for the vlan_antispoof_mode field to be
8237          * configured.
8238          */
8239         #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE \
8240                 UINT32_C(0x8000)
8241         /*
8242          * This bit must be '1' for the allowed_vlan_pris field to be
8243          * configured.
8244          */
8245         #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS \
8246                 UINT32_C(0x10000)
8247         /*
8248          * This bit must be '1' for the evb_mode field to be
8249          * configured.
8250          */
8251         #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE \
8252                 UINT32_C(0x20000)
8253         /*
8254          * This bit must be '1' for the num_mcast_filters field to be
8255          * configured.
8256          */
8257         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS \
8258                 UINT32_C(0x40000)
8259         /*
8260          * This bit must be '1' for the num_hw_ring_grps field to be
8261          * configured.
8262          */
8263         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS \
8264                 UINT32_C(0x80000)
8265         /*
8266          * This bit must be '1' for the cache_linesize field to be
8267          * configured.
8268          */
8269         #define HWRM_FUNC_CFG_INPUT_ENABLES_CACHE_LINESIZE \
8270                 UINT32_C(0x100000)
8271         /*
8272          * This bit must be '1' for the num_msix field to be
8273          * configured.
8274          */
8275         #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MSIX \
8276                 UINT32_C(0x200000)
8277         /*
8278          * This bit must be '1' for the link admin state field to be
8279          * configured.
8280          */
8281         #define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE \
8282                 UINT32_C(0x400000)
8283         /*
8284          * The maximum transmission unit of the function.
8285          * The HWRM should make sure that the mtu of
8286          * the function does not exceed the mtu of the physical
8287          * port that this function is associated with.
8288          *
8289          * In addition to configuring mtu per function, it is
8290          * possible to configure mtu per transmit ring.
8291          * By default, the mtu of each transmit ring associated
8292          * with a function is equal to the mtu of the function.
8293          * The HWRM should make sure that the mtu of each transmit
8294          * ring that is assigned to a function has a valid mtu.
8295          */
8296         uint16_t        mtu;
8297         /*
8298          * The maximum receive unit of the function.
8299          * The HWRM should make sure that the mru of
8300          * the function does not exceed the mru of the physical
8301          * port that this function is associated with.
8302          *
8303          * In addition to configuring mru per function, it is
8304          * possible to configure mru per vnic.
8305          * By default, the mru of each vnic associated
8306          * with a function is equal to the mru of the function.
8307          * The HWRM should make sure that the mru of each vnic
8308          * that is assigned to a function has a valid mru.
8309          */
8310         uint16_t        mru;
8311         /*
8312          * The number of RSS/COS contexts requested for the
8313          * function.
8314          */
8315         uint16_t        num_rsscos_ctxs;
8316         /*
8317          * The number of completion rings requested for the
8318          * function. This does not include the rings allocated
8319          * to any children functions if any.
8320          */
8321         uint16_t        num_cmpl_rings;
8322         /*
8323          * The number of transmit rings requested for the function.
8324          * This does not include the rings allocated to any
8325          * children functions if any.
8326          */
8327         uint16_t        num_tx_rings;
8328         /*
8329          * The number of receive rings requested for the function.
8330          * This does not include the rings allocated
8331          * to any children functions if any.
8332          */
8333         uint16_t        num_rx_rings;
8334         /* The requested number of L2 contexts for the function. */
8335         uint16_t        num_l2_ctxs;
8336         /* The requested number of vnics for the function. */
8337         uint16_t        num_vnics;
8338         /* The requested number of statistic contexts for the function. */
8339         uint16_t        num_stat_ctxs;
8340         /*
8341          * The number of HW ring groups that should
8342          * be reserved for this function.
8343          */
8344         uint16_t        num_hw_ring_grps;
8345         /* The default MAC address for the function being configured. */
8346         uint8_t dflt_mac_addr[6];
8347         /*
8348          * The default VLAN for the function being configured.
8349          * This field's format is same as 802.1Q Tag's
8350          * Tag Control Information (TCI) format that includes both
8351          * Priority Code Point (PCP) and VLAN Identifier (VID).
8352          */
8353         uint16_t        dflt_vlan;
8354         /*
8355          * The default IP address for the function being configured.
8356          * This address is only used in enabling source property check.
8357          */
8358         uint32_t        dflt_ip_addr[4];
8359         /*
8360          * Minimum BW allocated for this function.
8361          * The HWRM will translate this value into byte counter and
8362          * time interval used for the scheduler inside the device.
8363          */
8364         uint32_t        min_bw;
8365         /* The bandwidth value. */
8366         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK \
8367                 UINT32_C(0xfffffff)
8368         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT              0
8369         /* The granularity of the value (bits or bytes). */
8370         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE \
8371                 UINT32_C(0x10000000)
8372         /* Value is in bits. */
8373         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS \
8374                 (UINT32_C(0x0) << 28)
8375         /* Value is in bytes. */
8376         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES \
8377                 (UINT32_C(0x1) << 28)
8378         #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \
8379                 HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
8380         /* bw_value_unit is 3 b */
8381         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \
8382                 UINT32_C(0xe0000000)
8383         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT         29
8384         /* Value is in Mb or MB (base 10). */
8385         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
8386                 (UINT32_C(0x0) << 29)
8387         /* Value is in Kb or KB (base 10). */
8388         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \
8389                 (UINT32_C(0x2) << 29)
8390         /* Value is in bits or bytes. */
8391         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \
8392                 (UINT32_C(0x4) << 29)
8393         /* Value is in Gb or GB (base 10). */
8394         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
8395                 (UINT32_C(0x6) << 29)
8396         /* Value is in 1/100th of a percentage of total bandwidth. */
8397         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
8398                 (UINT32_C(0x1) << 29)
8399         /* Invalid unit */
8400         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
8401                 (UINT32_C(0x7) << 29)
8402         #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \
8403                 HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
8404         /*
8405          * Maximum BW allocated for this function.
8406          * The HWRM will translate this value into byte counter and
8407          * time interval used for the scheduler inside the device.
8408          */
8409         uint32_t        max_bw;
8410         /* The bandwidth value. */
8411         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \
8412                 UINT32_C(0xfffffff)
8413         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT              0
8414         /* The granularity of the value (bits or bytes). */
8415         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE \
8416                 UINT32_C(0x10000000)
8417         /* Value is in bits. */
8418         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS \
8419                 (UINT32_C(0x0) << 28)
8420         /* Value is in bytes. */
8421         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES \
8422                 (UINT32_C(0x1) << 28)
8423         #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \
8424                 HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
8425         /* bw_value_unit is 3 b */
8426         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
8427                 UINT32_C(0xe0000000)
8428         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
8429         /* Value is in Mb or MB (base 10). */
8430         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
8431                 (UINT32_C(0x0) << 29)
8432         /* Value is in Kb or KB (base 10). */
8433         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
8434                 (UINT32_C(0x2) << 29)
8435         /* Value is in bits or bytes. */
8436         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
8437                 (UINT32_C(0x4) << 29)
8438         /* Value is in Gb or GB (base 10). */
8439         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
8440                 (UINT32_C(0x6) << 29)
8441         /* Value is in 1/100th of a percentage of total bandwidth. */
8442         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
8443                 (UINT32_C(0x1) << 29)
8444         /* Invalid unit */
8445         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
8446                 (UINT32_C(0x7) << 29)
8447         #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
8448                 HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
8449         /*
8450          * ID of the target completion ring for receiving asynchronous
8451          * event completions. If this field is not valid, then the
8452          * HWRM shall use the default completion ring of the function
8453          * that is being configured as the target completion ring for
8454          * providing any asynchronous event completions for that
8455          * function.
8456          * If this field is valid, then the HWRM shall use the
8457          * completion ring identified by this ID as the target
8458          * completion ring for providing any asynchronous event
8459          * completions for the function that is being configured.
8460          */
8461         uint16_t        async_event_cr;
8462         /* VLAN Anti-spoofing mode. */
8463         uint8_t vlan_antispoof_mode;
8464         /* No VLAN anti-spoofing checks are enabled */
8465         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK \
8466                 UINT32_C(0x0)
8467         /* Validate VLAN against the configured VLAN(s) */
8468         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \
8469                 UINT32_C(0x1)
8470         /* Insert VLAN if it does not exist, otherwise discard */
8471         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \
8472                 UINT32_C(0x2)
8473         /* Insert VLAN if it does not exist, override VLAN if it exists */
8474         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \
8475                 UINT32_C(0x3)
8476         #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_LAST \
8477                 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN
8478         /*
8479          * This bit field defines VLAN PRIs that are allowed on
8480          * this function.
8481          * If nth bit is set, then VLAN PRI n is allowed on this
8482          * function.
8483          */
8484         uint8_t allowed_vlan_pris;
8485         /*
8486          * The HWRM shall allow a PF driver to change EVB mode for the
8487          * partition it belongs to.
8488          * The HWRM shall not allow a VF driver to change the EVB mode.
8489          * The HWRM shall take into account the switching of EVB mode
8490          * from one to another and reconfigure hardware resources as
8491          * appropriately.
8492          * The switching from VEB to VEPA mode requires
8493          * the disabling of the loopback traffic. Additionally,
8494          * source knock outs are handled differently in VEB and VEPA
8495          * modes.
8496          */
8497         uint8_t evb_mode;
8498         /* No Edge Virtual Bridging (EVB) */
8499         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
8500         /* Virtual Ethernet Bridge (VEB) */
8501         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB    UINT32_C(0x1)
8502         /* Virtual Ethernet Port Aggregator (VEPA) */
8503         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA   UINT32_C(0x2)
8504         #define HWRM_FUNC_CFG_INPUT_EVB_MODE_LAST \
8505                 HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA
8506         uint8_t options;
8507         /*
8508          * This value indicates the PCIE device cache line size.
8509          * The cache line size allows the DMA writes to terminate and
8510          * start at the cache boundary.
8511          */
8512         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_MASK \
8513                 UINT32_C(0x3)
8514         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SFT          0
8515         /* Cache Line Size 64 bytes */
8516         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_64 \
8517                 UINT32_C(0x0)
8518         /* Cache Line Size 128 bytes */
8519         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128 \
8520                 UINT32_C(0x1)
8521         #define HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_LAST \
8522                 HWRM_FUNC_CFG_INPUT_OPTIONS_CACHE_LINESIZE_SIZE_128
8523         /* This value is the virtual link admin state setting. */
8524         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_MASK \
8525                 UINT32_C(0xc)
8526         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_SFT        2
8527         /* Admin state is forced down. */
8528         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_DOWN \
8529                 (UINT32_C(0x0) << 2)
8530         /* Admin state is forced up. */
8531         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_FORCED_UP \
8532                 (UINT32_C(0x1) << 2)
8533         /* Admin state is in auto mode - is to follow the physical link state. */
8534         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO \
8535                 (UINT32_C(0x2) << 2)
8536         #define HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_LAST \
8537                 HWRM_FUNC_CFG_INPUT_OPTIONS_LINK_ADMIN_STATE_AUTO
8538         /* Reserved for future. */
8539         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_MASK \
8540                 UINT32_C(0xf0)
8541         #define HWRM_FUNC_CFG_INPUT_OPTIONS_RSVD_SFT                    4
8542         /*
8543          * The number of multicast filters that should
8544          * be reserved for this function on the RX side.
8545          */
8546         uint16_t        num_mcast_filters;
8547 } __attribute__((packed));
8548
8549 /* hwrm_func_cfg_output (size:128b/16B) */
8550 struct hwrm_func_cfg_output {
8551         /* The specific error status for the command. */
8552         uint16_t        error_code;
8553         /* The HWRM command request type. */
8554         uint16_t        req_type;
8555         /* The sequence ID from the original command. */
8556         uint16_t        seq_id;
8557         /* The length of the response data in number of bytes. */
8558         uint16_t        resp_len;
8559         uint8_t unused_0[7];
8560         /*
8561          * This field is used in Output records to indicate that the output
8562          * is completely written to RAM.  This field should be read as '1'
8563          * to indicate that the output has been completely written.
8564          * When writing a command completion or response to an internal processor,
8565          * the order of writes has to be such that this field is written last.
8566          */
8567         uint8_t valid;
8568 } __attribute__((packed));
8569
8570 /********************
8571  * hwrm_func_qstats *
8572  ********************/
8573
8574
8575 /* hwrm_func_qstats_input (size:192b/24B) */
8576 struct hwrm_func_qstats_input {
8577         /* The HWRM command request type. */
8578         uint16_t        req_type;
8579         /*
8580          * The completion ring to send the completion event on. This should
8581          * be the NQ ID returned from the `nq_alloc` HWRM command.
8582          */
8583         uint16_t        cmpl_ring;
8584         /*
8585          * The sequence ID is used by the driver for tracking multiple
8586          * commands. This ID is treated as opaque data by the firmware and
8587          * the value is returned in the `hwrm_resp_hdr` upon completion.
8588          */
8589         uint16_t        seq_id;
8590         /*
8591          * The target ID of the command:
8592          * * 0x0-0xFFF8 - The function ID
8593          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8594          * * 0xFFFD - Reserved for user-space HWRM interface
8595          * * 0xFFFF - HWRM
8596          */
8597         uint16_t        target_id;
8598         /*
8599          * A physical address pointer pointing to a host buffer that the
8600          * command's response data will be written. This can be either a host
8601          * physical address (HPA) or a guest physical address (GPA) and must
8602          * point to a physically contiguous block of memory.
8603          */
8604         uint64_t        resp_addr;
8605         /*
8606          * Function ID of the function that is being queried.
8607          * 0xFF... (All Fs) if the query is for the requesting
8608          * function.
8609          */
8610         uint16_t        fid;
8611         uint8_t unused_0[6];
8612 } __attribute__((packed));
8613
8614 /* hwrm_func_qstats_output (size:1408b/176B) */
8615 struct hwrm_func_qstats_output {
8616         /* The specific error status for the command. */
8617         uint16_t        error_code;
8618         /* The HWRM command request type. */
8619         uint16_t        req_type;
8620         /* The sequence ID from the original command. */
8621         uint16_t        seq_id;
8622         /* The length of the response data in number of bytes. */
8623         uint16_t        resp_len;
8624         /* Number of transmitted unicast packets on the function. */
8625         uint64_t        tx_ucast_pkts;
8626         /* Number of transmitted multicast packets on the function. */
8627         uint64_t        tx_mcast_pkts;
8628         /* Number of transmitted broadcast packets on the function. */
8629         uint64_t        tx_bcast_pkts;
8630         /*
8631          * Number of transmitted packets that were discarded due to
8632          * internal NIC resource problems.  For transmit, this
8633          * can only happen if TMP is configured to allow dropping
8634          * in HOL blocking conditions, which is not a normal
8635          * configuration.
8636          */
8637         uint64_t        tx_discard_pkts;
8638         /*
8639          * Number of dropped packets on transmit path on the function.
8640          * These are packets that have been marked for drop by
8641          * the TE CFA block or are packets that exceeded the
8642          * transmit MTU limit for the function.
8643          */
8644         uint64_t        tx_drop_pkts;
8645         /* Number of transmitted bytes for unicast traffic on the function. */
8646         uint64_t        tx_ucast_bytes;
8647         /* Number of transmitted bytes for multicast traffic on the function. */
8648         uint64_t        tx_mcast_bytes;
8649         /* Number of transmitted bytes for broadcast traffic on the function. */
8650         uint64_t        tx_bcast_bytes;
8651         /* Number of received unicast packets on the function. */
8652         uint64_t        rx_ucast_pkts;
8653         /* Number of received multicast packets on the function. */
8654         uint64_t        rx_mcast_pkts;
8655         /* Number of received broadcast packets on the function. */
8656         uint64_t        rx_bcast_pkts;
8657         /*
8658          * Number of received packets that were discarded on the function
8659          * due to resource limitations.  This can happen for 3 reasons.
8660          * # The BD used for the packet has a bad format.
8661          * # There were no BDs available in the ring for the packet.
8662          * # There were no BDs available on-chip for the packet.
8663          */
8664         uint64_t        rx_discard_pkts;
8665         /*
8666          * Number of dropped packets on received path on the function.
8667          * These are packets that have been marked for drop by the
8668          * RE CFA.
8669          */
8670         uint64_t        rx_drop_pkts;
8671         /* Number of received bytes for unicast traffic on the function. */
8672         uint64_t        rx_ucast_bytes;
8673         /* Number of received bytes for multicast traffic on the function. */
8674         uint64_t        rx_mcast_bytes;
8675         /* Number of received bytes for broadcast traffic on the function. */
8676         uint64_t        rx_bcast_bytes;
8677         /* Number of aggregated unicast packets on the function. */
8678         uint64_t        rx_agg_pkts;
8679         /* Number of aggregated unicast bytes on the function. */
8680         uint64_t        rx_agg_bytes;
8681         /* Number of aggregation events on the function. */
8682         uint64_t        rx_agg_events;
8683         /* Number of aborted aggregations on the function. */
8684         uint64_t        rx_agg_aborts;
8685         uint8_t unused_0[7];
8686         /*
8687          * This field is used in Output records to indicate that the output
8688          * is completely written to RAM.  This field should be read as '1'
8689          * to indicate that the output has been completely written.
8690          * When writing a command completion or response to an internal processor,
8691          * the order of writes has to be such that this field is written last.
8692          */
8693         uint8_t valid;
8694 } __attribute__((packed));
8695
8696 /***********************
8697  * hwrm_func_clr_stats *
8698  ***********************/
8699
8700
8701 /* hwrm_func_clr_stats_input (size:192b/24B) */
8702 struct hwrm_func_clr_stats_input {
8703         /* The HWRM command request type. */
8704         uint16_t        req_type;
8705         /*
8706          * The completion ring to send the completion event on. This should
8707          * be the NQ ID returned from the `nq_alloc` HWRM command.
8708          */
8709         uint16_t        cmpl_ring;
8710         /*
8711          * The sequence ID is used by the driver for tracking multiple
8712          * commands. This ID is treated as opaque data by the firmware and
8713          * the value is returned in the `hwrm_resp_hdr` upon completion.
8714          */
8715         uint16_t        seq_id;
8716         /*
8717          * The target ID of the command:
8718          * * 0x0-0xFFF8 - The function ID
8719          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8720          * * 0xFFFD - Reserved for user-space HWRM interface
8721          * * 0xFFFF - HWRM
8722          */
8723         uint16_t        target_id;
8724         /*
8725          * A physical address pointer pointing to a host buffer that the
8726          * command's response data will be written. This can be either a host
8727          * physical address (HPA) or a guest physical address (GPA) and must
8728          * point to a physically contiguous block of memory.
8729          */
8730         uint64_t        resp_addr;
8731         /*
8732          * Function ID of the function.
8733          * 0xFF... (All Fs) if the query is for the requesting
8734          * function.
8735          */
8736         uint16_t        fid;
8737         uint8_t unused_0[6];
8738 } __attribute__((packed));
8739
8740 /* hwrm_func_clr_stats_output (size:128b/16B) */
8741 struct hwrm_func_clr_stats_output {
8742         /* The specific error status for the command. */
8743         uint16_t        error_code;
8744         /* The HWRM command request type. */
8745         uint16_t        req_type;
8746         /* The sequence ID from the original command. */
8747         uint16_t        seq_id;
8748         /* The length of the response data in number of bytes. */
8749         uint16_t        resp_len;
8750         uint8_t unused_0[7];
8751         /*
8752          * This field is used in Output records to indicate that the output
8753          * is completely written to RAM.  This field should be read as '1'
8754          * to indicate that the output has been completely written.
8755          * When writing a command completion or response to an internal processor,
8756          * the order of writes has to be such that this field is written last.
8757          */
8758         uint8_t valid;
8759 } __attribute__((packed));
8760
8761 /**************************
8762  * hwrm_func_vf_resc_free *
8763  **************************/
8764
8765
8766 /* hwrm_func_vf_resc_free_input (size:192b/24B) */
8767 struct hwrm_func_vf_resc_free_input {
8768         /* The HWRM command request type. */
8769         uint16_t        req_type;
8770         /*
8771          * The completion ring to send the completion event on. This should
8772          * be the NQ ID returned from the `nq_alloc` HWRM command.
8773          */
8774         uint16_t        cmpl_ring;
8775         /*
8776          * The sequence ID is used by the driver for tracking multiple
8777          * commands. This ID is treated as opaque data by the firmware and
8778          * the value is returned in the `hwrm_resp_hdr` upon completion.
8779          */
8780         uint16_t        seq_id;
8781         /*
8782          * The target ID of the command:
8783          * * 0x0-0xFFF8 - The function ID
8784          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8785          * * 0xFFFD - Reserved for user-space HWRM interface
8786          * * 0xFFFF - HWRM
8787          */
8788         uint16_t        target_id;
8789         /*
8790          * A physical address pointer pointing to a host buffer that the
8791          * command's response data will be written. This can be either a host
8792          * physical address (HPA) or a guest physical address (GPA) and must
8793          * point to a physically contiguous block of memory.
8794          */
8795         uint64_t        resp_addr;
8796         /*
8797          * This value is used to identify a Virtual Function (VF).
8798          * The scope of VF ID is local within a PF.
8799          */
8800         uint16_t        vf_id;
8801         uint8_t unused_0[6];
8802 } __attribute__((packed));
8803
8804 /* hwrm_func_vf_resc_free_output (size:128b/16B) */
8805 struct hwrm_func_vf_resc_free_output {
8806         /* The specific error status for the command. */
8807         uint16_t        error_code;
8808         /* The HWRM command request type. */
8809         uint16_t        req_type;
8810         /* The sequence ID from the original command. */
8811         uint16_t        seq_id;
8812         /* The length of the response data in number of bytes. */
8813         uint16_t        resp_len;
8814         uint8_t unused_0[7];
8815         /*
8816          * This field is used in Output records to indicate that the output
8817          * is completely written to RAM.  This field should be read as '1'
8818          * to indicate that the output has been completely written.
8819          * When writing a command completion or response to an internal processor,
8820          * the order of writes has to be such that this field is written last.
8821          */
8822         uint8_t valid;
8823 } __attribute__((packed));
8824
8825 /**********************
8826  * hwrm_func_drv_rgtr *
8827  **********************/
8828
8829
8830 /* hwrm_func_drv_rgtr_input (size:896b/112B) */
8831 struct hwrm_func_drv_rgtr_input {
8832         /* The HWRM command request type. */
8833         uint16_t        req_type;
8834         /*
8835          * The completion ring to send the completion event on. This should
8836          * be the NQ ID returned from the `nq_alloc` HWRM command.
8837          */
8838         uint16_t        cmpl_ring;
8839         /*
8840          * The sequence ID is used by the driver for tracking multiple
8841          * commands. This ID is treated as opaque data by the firmware and
8842          * the value is returned in the `hwrm_resp_hdr` upon completion.
8843          */
8844         uint16_t        seq_id;
8845         /*
8846          * The target ID of the command:
8847          * * 0x0-0xFFF8 - The function ID
8848          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
8849          * * 0xFFFD - Reserved for user-space HWRM interface
8850          * * 0xFFFF - HWRM
8851          */
8852         uint16_t        target_id;
8853         /*
8854          * A physical address pointer pointing to a host buffer that the
8855          * command's response data will be written. This can be either a host
8856          * physical address (HPA) or a guest physical address (GPA) and must
8857          * point to a physically contiguous block of memory.
8858          */
8859         uint64_t        resp_addr;
8860         uint32_t        flags;
8861         /*
8862          * When this bit is '1', the function driver is requesting
8863          * all requests from its children VF drivers to be
8864          * forwarded to itself.
8865          * This flag can only be set by the PF driver.
8866          * If a VF driver sets this flag, it should be ignored
8867          * by the HWRM.
8868          */
8869         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE \
8870                 UINT32_C(0x1)
8871         /*
8872          * When this bit is '1', the function is requesting none of
8873          * the requests from its children VF drivers to be
8874          * forwarded to itself.
8875          * This flag can only be set by the PF driver.
8876          * If a VF driver sets this flag, it should be ignored
8877          * by the HWRM.
8878          */
8879         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE \
8880                 UINT32_C(0x2)
8881         /*
8882          * When this bit is '1', then ver_maj_8b, ver_min_8b, ver_upd_8b
8883          * fields shall be ignored and ver_maj, ver_min, ver_upd
8884          * and ver_patch shall be used for the driver version information.
8885          * When this bit is '0', then ver_maj_8b, ver_min_8b, ver_upd_8b
8886          * fields shall be used for the driver version information and
8887          * ver_maj, ver_min, ver_upd and ver_patch shall be ignored.
8888          */
8889         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_16BIT_VER_MODE \
8890                 UINT32_C(0x4)
8891         /*
8892          * When this bit is '1', the function is indicating support of
8893          * 64bit flow handle.  The firmware that only supports 64bit flow
8894          * handle should check this bit before allowing processing of
8895          * HWRM_CFA_FLOW_XXX commands from the requesting function as firmware
8896          * with 64bit flow handle support can only be compatible with drivers
8897          * that support 64bit flow handle. The legacy drivers that don't support
8898          * 64bit flow handle won't be able to use HWRM_CFA_FLOW_XXX commands when
8899          * running with new firmware that only supports 64bit flow handle. The new
8900          * firmware support 64bit flow handle returns HWRM_ERR_CODE_CMD_NOT_SUPPORTED
8901          * status to the legacy driver when encounters these commands.
8902          */
8903         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FLOW_HANDLE_64BIT_MODE \
8904                 UINT32_C(0x8)
8905         /*
8906          * When this bit is '1', the function is indicating support of
8907          * Hot Reset. The driver interface will destroy the resources,
8908          * unregister the function and register again up on receiving
8909          * the RESET_NOTIFY Async notification from the core firmware.
8910          * The core firmware will this use flag and trigger the Hot Reset
8911          * process only if all the registered driver instances are capable
8912          * of this support.
8913          */
8914         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT \
8915                 UINT32_C(0x10)
8916         /*
8917          * When this bit is 1, the function is indicating the support of the
8918          * error recovery capability. Error recovery support will be used by
8919          * firmware only if all the driver instances support error recovery
8920          * process. By setting this bit, driver is indicating support for
8921          * corresponding async event completion message. These will be
8922          * delivered to the driver even if they did not register for it.
8923          * If supported, after receiving reset notify async event with fatal
8924          * flag set in event data1, then all the drivers have to tear down
8925          * their resources without sending any HWRM commands to FW.
8926          */
8927         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT \
8928                 UINT32_C(0x20)
8929         /*
8930          * When this bit is 1, the function is indicating the support of the
8931          * Master capability. The Firmware will use this capability to select
8932          * the Master function. The master function will be used to initiate
8933          * designated functionality like error recovery etc. If none of the
8934          * registered PFs or trusted VFs indicate this support, then
8935          * firmware will select the 1st registered PF as Master capable
8936          * instance.
8937          */
8938         #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_MASTER_SUPPORT \
8939                 UINT32_C(0x40)
8940         uint32_t        enables;
8941         /*
8942          * This bit must be '1' for the os_type field to be
8943          * configured.
8944          */
8945         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE \
8946                 UINT32_C(0x1)
8947         /*
8948          * This bit must be '1' for the ver field to be
8949          * configured.
8950          */
8951         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER \
8952                 UINT32_C(0x2)
8953         /*
8954          * This bit must be '1' for the timestamp field to be
8955          * configured.
8956          */
8957         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP \
8958                 UINT32_C(0x4)
8959         /*
8960          * This bit must be '1' for the vf_req_fwd field to be
8961          * configured.
8962          */
8963         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD \
8964                 UINT32_C(0x8)
8965         /*
8966          * This bit must be '1' for the async_event_fwd field to be
8967          * configured.
8968          */
8969         #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
8970                 UINT32_C(0x10)
8971         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
8972         uint16_t        os_type;
8973         /* Unknown */
8974         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
8975         /* Other OS not listed below. */
8976         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER     UINT32_C(0x1)
8977         /* MSDOS OS. */
8978         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
8979         /* Windows OS. */
8980         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
8981         /* Solaris OS. */
8982         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
8983         /* Linux OS. */
8984         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX     UINT32_C(0x24)
8985         /* FreeBSD OS. */
8986         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
8987         /* VMware ESXi OS. */
8988         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI      UINT32_C(0x68)
8989         /* Microsoft Windows 8 64-bit OS. */
8990         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864    UINT32_C(0x73)
8991         /* Microsoft Windows Server 2012 R2 OS. */
8992         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
8993         /* UEFI driver. */
8994         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
8995         #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LAST \
8996                 HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UEFI
8997         /* This is the 8bit major version of the driver. */
8998         uint8_t ver_maj_8b;
8999         /* This is the 8bit minor version of the driver. */
9000         uint8_t ver_min_8b;
9001         /* This is the 8bit update version of the driver. */
9002         uint8_t ver_upd_8b;
9003         uint8_t unused_0[3];
9004         /*
9005          * This is a 32-bit timestamp provided by the driver for
9006          * keep alive.
9007          * The timestamp is in multiples of 1ms.
9008          */
9009         uint32_t        timestamp;
9010         uint8_t unused_1[4];
9011         /*
9012          * This is a 256-bit bit mask provided by the PF driver for
9013          * letting the HWRM know what commands issued by the VF driver
9014          * to the HWRM should be forwarded to the PF driver.
9015          * Nth bit refers to the Nth req_type.
9016          *
9017          * Setting Nth bit to 1 indicates that requests from the
9018          * VF driver with req_type equal to N shall be forwarded to
9019          * the parent PF driver.
9020          *
9021          * This field is not valid for the VF driver.
9022          */
9023         uint32_t        vf_req_fwd[8];
9024         /*
9025          * This is a 256-bit bit mask provided by the function driver
9026          * (PF or VF driver) to indicate the list of asynchronous event
9027          * completions to be forwarded.
9028          *
9029          * Nth bit refers to the Nth event_id.
9030          *
9031          * Setting Nth bit to 1 by the function driver shall result in
9032          * the HWRM forwarding asynchronous event completion with
9033          * event_id equal to N.
9034          *
9035          * If all bits are set to 0 (value of 0), then the HWRM shall
9036          * not forward any asynchronous event completion to this
9037          * function driver.
9038          */
9039         uint32_t        async_event_fwd[8];
9040         /* This is the 16bit major version of the driver. */
9041         uint16_t        ver_maj;
9042         /* This is the 16bit minor version of the driver. */
9043         uint16_t        ver_min;
9044         /* This is the 16bit update version of the driver. */
9045         uint16_t        ver_upd;
9046         /* This is the 16bit patch version of the driver. */
9047         uint16_t        ver_patch;
9048 } __attribute__((packed));
9049
9050 /* hwrm_func_drv_rgtr_output (size:128b/16B) */
9051 struct hwrm_func_drv_rgtr_output {
9052         /* The specific error status for the command. */
9053         uint16_t        error_code;
9054         /* The HWRM command request type. */
9055         uint16_t        req_type;
9056         /* The sequence ID from the original command. */
9057         uint16_t        seq_id;
9058         /* The length of the response data in number of bytes. */
9059         uint16_t        resp_len;
9060         uint32_t        flags;
9061         /*
9062          * When this bit is '1', it indicates that the
9063          * HWRM_FUNC_DRV_IF_CHANGE call is supported.
9064          */
9065         #define HWRM_FUNC_DRV_RGTR_OUTPUT_FLAGS_IF_CHANGE_SUPPORTED \
9066                 UINT32_C(0x1)
9067         uint8_t unused_0[3];
9068         /*
9069          * This field is used in Output records to indicate that the output
9070          * is completely written to RAM.  This field should be read as '1'
9071          * to indicate that the output has been completely written.
9072          * When writing a command completion or response to an internal processor,
9073          * the order of writes has to be such that this field is written last.
9074          */
9075         uint8_t valid;
9076 } __attribute__((packed));
9077
9078 /************************
9079  * hwrm_func_drv_unrgtr *
9080  ************************/
9081
9082
9083 /* hwrm_func_drv_unrgtr_input (size:192b/24B) */
9084 struct hwrm_func_drv_unrgtr_input {
9085         /* The HWRM command request type. */
9086         uint16_t        req_type;
9087         /*
9088          * The completion ring to send the completion event on. This should
9089          * be the NQ ID returned from the `nq_alloc` HWRM command.
9090          */
9091         uint16_t        cmpl_ring;
9092         /*
9093          * The sequence ID is used by the driver for tracking multiple
9094          * commands. This ID is treated as opaque data by the firmware and
9095          * the value is returned in the `hwrm_resp_hdr` upon completion.
9096          */
9097         uint16_t        seq_id;
9098         /*
9099          * The target ID of the command:
9100          * * 0x0-0xFFF8 - The function ID
9101          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9102          * * 0xFFFD - Reserved for user-space HWRM interface
9103          * * 0xFFFF - HWRM
9104          */
9105         uint16_t        target_id;
9106         /*
9107          * A physical address pointer pointing to a host buffer that the
9108          * command's response data will be written. This can be either a host
9109          * physical address (HPA) or a guest physical address (GPA) and must
9110          * point to a physically contiguous block of memory.
9111          */
9112         uint64_t        resp_addr;
9113         uint32_t        flags;
9114         /*
9115          * When this bit is '1', the function driver is notifying
9116          * the HWRM to prepare for the shutdown.
9117          */
9118         #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
9119                 UINT32_C(0x1)
9120         uint8_t unused_0[4];
9121 } __attribute__((packed));
9122
9123 /* hwrm_func_drv_unrgtr_output (size:128b/16B) */
9124 struct hwrm_func_drv_unrgtr_output {
9125         /* The specific error status for the command. */
9126         uint16_t        error_code;
9127         /* The HWRM command request type. */
9128         uint16_t        req_type;
9129         /* The sequence ID from the original command. */
9130         uint16_t        seq_id;
9131         /* The length of the response data in number of bytes. */
9132         uint16_t        resp_len;
9133         uint8_t unused_0[7];
9134         /*
9135          * This field is used in Output records to indicate that the output
9136          * is completely written to RAM.  This field should be read as '1'
9137          * to indicate that the output has been completely written.
9138          * When writing a command completion or response to an internal processor,
9139          * the order of writes has to be such that this field is written last.
9140          */
9141         uint8_t valid;
9142 } __attribute__((packed));
9143
9144 /**********************
9145  * hwrm_func_buf_rgtr *
9146  **********************/
9147
9148
9149 /* hwrm_func_buf_rgtr_input (size:1024b/128B) */
9150 struct hwrm_func_buf_rgtr_input {
9151         /* The HWRM command request type. */
9152         uint16_t        req_type;
9153         /*
9154          * The completion ring to send the completion event on. This should
9155          * be the NQ ID returned from the `nq_alloc` HWRM command.
9156          */
9157         uint16_t        cmpl_ring;
9158         /*
9159          * The sequence ID is used by the driver for tracking multiple
9160          * commands. This ID is treated as opaque data by the firmware and
9161          * the value is returned in the `hwrm_resp_hdr` upon completion.
9162          */
9163         uint16_t        seq_id;
9164         /*
9165          * The target ID of the command:
9166          * * 0x0-0xFFF8 - The function ID
9167          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9168          * * 0xFFFD - Reserved for user-space HWRM interface
9169          * * 0xFFFF - HWRM
9170          */
9171         uint16_t        target_id;
9172         /*
9173          * A physical address pointer pointing to a host buffer that the
9174          * command's response data will be written. This can be either a host
9175          * physical address (HPA) or a guest physical address (GPA) and must
9176          * point to a physically contiguous block of memory.
9177          */
9178         uint64_t        resp_addr;
9179         uint32_t        enables;
9180         /*
9181          * This bit must be '1' for the vf_id field to be
9182          * configured.
9183          */
9184         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID            UINT32_C(0x1)
9185         /*
9186          * This bit must be '1' for the err_buf_addr field to be
9187          * configured.
9188          */
9189         #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR     UINT32_C(0x2)
9190         /*
9191          * This value is used to identify a Virtual Function (VF).
9192          * The scope of VF ID is local within a PF.
9193          */
9194         uint16_t        vf_id;
9195         /*
9196          * This field represents the number of pages used for request
9197          * buffer(s).
9198          */
9199         uint16_t        req_buf_num_pages;
9200         /*
9201          * This field represents the page size used for request
9202          * buffer(s).
9203          */
9204         uint16_t        req_buf_page_size;
9205         /* 16 bytes */
9206         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_16B UINT32_C(0x4)
9207         /* 4 Kbytes */
9208         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4K  UINT32_C(0xc)
9209         /* 8 Kbytes */
9210         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_8K  UINT32_C(0xd)
9211         /* 64 Kbytes */
9212         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_64K UINT32_C(0x10)
9213         /* 2 Mbytes */
9214         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_2M  UINT32_C(0x15)
9215         /* 4 Mbytes */
9216         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_4M  UINT32_C(0x16)
9217         /* 1 Gbytes */
9218         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G  UINT32_C(0x1e)
9219         #define HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_LAST \
9220                 HWRM_FUNC_BUF_RGTR_INPUT_REQ_BUF_PAGE_SIZE_1G
9221         /* The length of the request buffer per VF in bytes. */
9222         uint16_t        req_buf_len;
9223         /* The length of the response buffer in bytes. */
9224         uint16_t        resp_buf_len;
9225         uint8_t unused_0[2];
9226         /* This field represents the page address of page #0. */
9227         uint64_t        req_buf_page_addr0;
9228         /* This field represents the page address of page #1. */
9229         uint64_t        req_buf_page_addr1;
9230         /* This field represents the page address of page #2. */
9231         uint64_t        req_buf_page_addr2;
9232         /* This field represents the page address of page #3. */
9233         uint64_t        req_buf_page_addr3;
9234         /* This field represents the page address of page #4. */
9235         uint64_t        req_buf_page_addr4;
9236         /* This field represents the page address of page #5. */
9237         uint64_t        req_buf_page_addr5;
9238         /* This field represents the page address of page #6. */
9239         uint64_t        req_buf_page_addr6;
9240         /* This field represents the page address of page #7. */
9241         uint64_t        req_buf_page_addr7;
9242         /* This field represents the page address of page #8. */
9243         uint64_t        req_buf_page_addr8;
9244         /* This field represents the page address of page #9. */
9245         uint64_t        req_buf_page_addr9;
9246         /*
9247          * This field is used to receive the error reporting from
9248          * the chipset. Only applicable for PFs.
9249          */
9250         uint64_t        error_buf_addr;
9251         /*
9252          * This field is used to receive the response forwarded by the
9253          * HWRM.
9254          */
9255         uint64_t        resp_buf_addr;
9256 } __attribute__((packed));
9257
9258 /* hwrm_func_buf_rgtr_output (size:128b/16B) */
9259 struct hwrm_func_buf_rgtr_output {
9260         /* The specific error status for the command. */
9261         uint16_t        error_code;
9262         /* The HWRM command request type. */
9263         uint16_t        req_type;
9264         /* The sequence ID from the original command. */
9265         uint16_t        seq_id;
9266         /* The length of the response data in number of bytes. */
9267         uint16_t        resp_len;
9268         uint8_t unused_0[7];
9269         /*
9270          * This field is used in Output records to indicate that the output
9271          * is completely written to RAM.  This field should be read as '1'
9272          * to indicate that the output has been completely written.
9273          * When writing a command completion or response to an internal processor,
9274          * the order of writes has to be such that this field is written last.
9275          */
9276         uint8_t valid;
9277 } __attribute__((packed));
9278
9279 /************************
9280  * hwrm_func_buf_unrgtr *
9281  ************************/
9282
9283
9284 /* hwrm_func_buf_unrgtr_input (size:192b/24B) */
9285 struct hwrm_func_buf_unrgtr_input {
9286         /* The HWRM command request type. */
9287         uint16_t        req_type;
9288         /*
9289          * The completion ring to send the completion event on. This should
9290          * be the NQ ID returned from the `nq_alloc` HWRM command.
9291          */
9292         uint16_t        cmpl_ring;
9293         /*
9294          * The sequence ID is used by the driver for tracking multiple
9295          * commands. This ID is treated as opaque data by the firmware and
9296          * the value is returned in the `hwrm_resp_hdr` upon completion.
9297          */
9298         uint16_t        seq_id;
9299         /*
9300          * The target ID of the command:
9301          * * 0x0-0xFFF8 - The function ID
9302          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9303          * * 0xFFFD - Reserved for user-space HWRM interface
9304          * * 0xFFFF - HWRM
9305          */
9306         uint16_t        target_id;
9307         /*
9308          * A physical address pointer pointing to a host buffer that the
9309          * command's response data will be written. This can be either a host
9310          * physical address (HPA) or a guest physical address (GPA) and must
9311          * point to a physically contiguous block of memory.
9312          */
9313         uint64_t        resp_addr;
9314         uint32_t        enables;
9315         /*
9316          * This bit must be '1' for the vf_id field to be
9317          * configured.
9318          */
9319         #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID     UINT32_C(0x1)
9320         /*
9321          * This value is used to identify a Virtual Function (VF).
9322          * The scope of VF ID is local within a PF.
9323          */
9324         uint16_t        vf_id;
9325         uint8_t unused_0[2];
9326 } __attribute__((packed));
9327
9328 /* hwrm_func_buf_unrgtr_output (size:128b/16B) */
9329 struct hwrm_func_buf_unrgtr_output {
9330         /* The specific error status for the command. */
9331         uint16_t        error_code;
9332         /* The HWRM command request type. */
9333         uint16_t        req_type;
9334         /* The sequence ID from the original command. */
9335         uint16_t        seq_id;
9336         /* The length of the response data in number of bytes. */
9337         uint16_t        resp_len;
9338         uint8_t unused_0[7];
9339         /*
9340          * This field is used in Output records to indicate that the output
9341          * is completely written to RAM.  This field should be read as '1'
9342          * to indicate that the output has been completely written.
9343          * When writing a command completion or response to an internal processor,
9344          * the order of writes has to be such that this field is written last.
9345          */
9346         uint8_t valid;
9347 } __attribute__((packed));
9348
9349 /**********************
9350  * hwrm_func_drv_qver *
9351  **********************/
9352
9353
9354 /* hwrm_func_drv_qver_input (size:192b/24B) */
9355 struct hwrm_func_drv_qver_input {
9356         /* The HWRM command request type. */
9357         uint16_t        req_type;
9358         /*
9359          * The completion ring to send the completion event on. This should
9360          * be the NQ ID returned from the `nq_alloc` HWRM command.
9361          */
9362         uint16_t        cmpl_ring;
9363         /*
9364          * The sequence ID is used by the driver for tracking multiple
9365          * commands. This ID is treated as opaque data by the firmware and
9366          * the value is returned in the `hwrm_resp_hdr` upon completion.
9367          */
9368         uint16_t        seq_id;
9369         /*
9370          * The target ID of the command:
9371          * * 0x0-0xFFF8 - The function ID
9372          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9373          * * 0xFFFD - Reserved for user-space HWRM interface
9374          * * 0xFFFF - HWRM
9375          */
9376         uint16_t        target_id;
9377         /*
9378          * A physical address pointer pointing to a host buffer that the
9379          * command's response data will be written. This can be either a host
9380          * physical address (HPA) or a guest physical address (GPA) and must
9381          * point to a physically contiguous block of memory.
9382          */
9383         uint64_t        resp_addr;
9384         /* Reserved for future use. */
9385         uint32_t        reserved;
9386         /*
9387          * Function ID of the function that is being queried.
9388          * 0xFF... (All Fs) if the query is for the requesting
9389          * function.
9390          */
9391         uint16_t        fid;
9392         uint8_t unused_0[2];
9393 } __attribute__((packed));
9394
9395 /* hwrm_func_drv_qver_output (size:256b/32B) */
9396 struct hwrm_func_drv_qver_output {
9397         /* The specific error status for the command. */
9398         uint16_t        error_code;
9399         /* The HWRM command request type. */
9400         uint16_t        req_type;
9401         /* The sequence ID from the original command. */
9402         uint16_t        seq_id;
9403         /* The length of the response data in number of bytes. */
9404         uint16_t        resp_len;
9405         /* This value indicates the type of OS.  The values are based on CIM_OperatingSystem.mof file as published by the DMTF. */
9406         uint16_t        os_type;
9407         /* Unknown */
9408         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UNKNOWN   UINT32_C(0x0)
9409         /* Other OS not listed below. */
9410         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_OTHER     UINT32_C(0x1)
9411         /* MSDOS OS. */
9412         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_MSDOS     UINT32_C(0xe)
9413         /* Windows OS. */
9414         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WINDOWS   UINT32_C(0x12)
9415         /* Solaris OS. */
9416         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_SOLARIS   UINT32_C(0x1d)
9417         /* Linux OS. */
9418         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LINUX     UINT32_C(0x24)
9419         /* FreeBSD OS. */
9420         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_FREEBSD   UINT32_C(0x2a)
9421         /* VMware ESXi OS. */
9422         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_ESXI      UINT32_C(0x68)
9423         /* Microsoft Windows 8 64-bit OS. */
9424         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN864    UINT32_C(0x73)
9425         /* Microsoft Windows Server 2012 R2 OS. */
9426         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
9427         /* UEFI driver. */
9428         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI      UINT32_C(0x8000)
9429         #define HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_LAST \
9430                 HWRM_FUNC_DRV_QVER_OUTPUT_OS_TYPE_UEFI
9431         /* This is the 8bit major version of the driver. */
9432         uint8_t ver_maj_8b;
9433         /* This is the 8bit minor version of the driver. */
9434         uint8_t ver_min_8b;
9435         /* This is the 8bit update version of the driver. */
9436         uint8_t ver_upd_8b;
9437         uint8_t unused_0[3];
9438         /* This is the 16bit major version of the driver. */
9439         uint16_t        ver_maj;
9440         /* This is the 16bit minor version of the driver. */
9441         uint16_t        ver_min;
9442         /* This is the 16bit update version of the driver. */
9443         uint16_t        ver_upd;
9444         /* This is the 16bit patch version of the driver. */
9445         uint16_t        ver_patch;
9446         uint8_t unused_1[7];
9447         /*
9448          * This field is used in Output records to indicate that the output
9449          * is completely written to RAM.  This field should be read as '1'
9450          * to indicate that the output has been completely written.
9451          * When writing a command completion or response to an internal processor,
9452          * the order of writes has to be such that this field is written last.
9453          */
9454         uint8_t valid;
9455 } __attribute__((packed));
9456
9457 /****************************
9458  * hwrm_func_resource_qcaps *
9459  ****************************/
9460
9461
9462 /* hwrm_func_resource_qcaps_input (size:192b/24B) */
9463 struct hwrm_func_resource_qcaps_input {
9464         /* The HWRM command request type. */
9465         uint16_t        req_type;
9466         /*
9467          * The completion ring to send the completion event on. This should
9468          * be the NQ ID returned from the `nq_alloc` HWRM command.
9469          */
9470         uint16_t        cmpl_ring;
9471         /*
9472          * The sequence ID is used by the driver for tracking multiple
9473          * commands. This ID is treated as opaque data by the firmware and
9474          * the value is returned in the `hwrm_resp_hdr` upon completion.
9475          */
9476         uint16_t        seq_id;
9477         /*
9478          * The target ID of the command:
9479          * * 0x0-0xFFF8 - The function ID
9480          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9481          * * 0xFFFD - Reserved for user-space HWRM interface
9482          * * 0xFFFF - HWRM
9483          */
9484         uint16_t        target_id;
9485         /*
9486          * A physical address pointer pointing to a host buffer that the
9487          * command's response data will be written. This can be either a host
9488          * physical address (HPA) or a guest physical address (GPA) and must
9489          * point to a physically contiguous block of memory.
9490          */
9491         uint64_t        resp_addr;
9492         /*
9493          * Function ID of the function that is being queried.
9494          * 0xFF... (All Fs) if the query is for the requesting
9495          * function.
9496          */
9497         uint16_t        fid;
9498         uint8_t unused_0[6];
9499 } __attribute__((packed));
9500
9501 /* hwrm_func_resource_qcaps_output (size:448b/56B) */
9502 struct hwrm_func_resource_qcaps_output {
9503         /* The specific error status for the command. */
9504         uint16_t        error_code;
9505         /* The HWRM command request type. */
9506         uint16_t        req_type;
9507         /* The sequence ID from the original command. */
9508         uint16_t        seq_id;
9509         /* The length of the response data in number of bytes. */
9510         uint16_t        resp_len;
9511         /* Maximum guaranteed number of VFs supported by PF. Not applicable for VFs. */
9512         uint16_t        max_vfs;
9513         /* Maximum guaranteed number of MSI-X vectors supported by function */
9514         uint16_t        max_msix;
9515         /* Hint of strategy to be used by PF driver to reserve resources for its VF */
9516         uint16_t        vf_reservation_strategy;
9517         /* The PF driver should evenly divide its remaining resources among all VFs. */
9518         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL \
9519                 UINT32_C(0x0)
9520         /* The PF driver should only reserve minimal resources for each VF. */
9521         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL \
9522                 UINT32_C(0x1)
9523         /*
9524          * The PF driver should not reserve any resources for each VF until the
9525          * the VF interface is brought up.
9526          */
9527         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC \
9528                 UINT32_C(0x2)
9529         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_LAST \
9530                 HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
9531         /* Minimum guaranteed number of RSS/COS contexts */
9532         uint16_t        min_rsscos_ctx;
9533         /* Maximum non-guaranteed number of RSS/COS contexts */
9534         uint16_t        max_rsscos_ctx;
9535         /* Minimum guaranteed number of completion rings */
9536         uint16_t        min_cmpl_rings;
9537         /* Maximum non-guaranteed number of completion rings */
9538         uint16_t        max_cmpl_rings;
9539         /* Minimum guaranteed number of transmit rings */
9540         uint16_t        min_tx_rings;
9541         /* Maximum non-guaranteed number of transmit rings */
9542         uint16_t        max_tx_rings;
9543         /* Minimum guaranteed number of receive rings */
9544         uint16_t        min_rx_rings;
9545         /* Maximum non-guaranteed number of receive rings */
9546         uint16_t        max_rx_rings;
9547         /* Minimum guaranteed number of L2 contexts */
9548         uint16_t        min_l2_ctxs;
9549         /* Maximum non-guaranteed number of L2 contexts */
9550         uint16_t        max_l2_ctxs;
9551         /* Minimum guaranteed number of VNICs */
9552         uint16_t        min_vnics;
9553         /* Maximum non-guaranteed number of VNICs */
9554         uint16_t        max_vnics;
9555         /* Minimum guaranteed number of statistic contexts */
9556         uint16_t        min_stat_ctx;
9557         /* Maximum non-guaranteed number of statistic contexts */
9558         uint16_t        max_stat_ctx;
9559         /* Minimum guaranteed number of ring groups */
9560         uint16_t        min_hw_ring_grps;
9561         /* Maximum non-guaranteed number of ring groups */
9562         uint16_t        max_hw_ring_grps;
9563         /*
9564          * Maximum number of inputs into the transmit scheduler for this function.
9565          * The number of TX rings assigned to the function cannot exceed this value.
9566          */
9567         uint16_t        max_tx_scheduler_inputs;
9568         uint16_t        flags;
9569         /*
9570          * When this bit is '1', it indicates that VF_RESOURCE_CFG supports
9571          * feature to reserve all minimum resources when minimum >= 1, otherwise
9572          * returns an error.
9573          */
9574         #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_FLAGS_MIN_GUARANTEED \
9575                 UINT32_C(0x1)
9576         uint8_t unused_0[5];
9577         /*
9578          * This field is used in Output records to indicate that the output
9579          * is completely written to RAM.  This field should be read as '1'
9580          * to indicate that the output has been completely written.
9581          * When writing a command completion or response to an internal processor,
9582          * the order of writes has to be such that this field is written last.
9583          */
9584         uint8_t valid;
9585 } __attribute__((packed));
9586
9587 /*********************************
9588  * hwrm_func_backing_store_qcaps *
9589  *********************************/
9590
9591
9592 /* hwrm_func_backing_store_qcaps_input (size:128b/16B) */
9593 struct hwrm_func_backing_store_qcaps_input {
9594         /* The HWRM command request type. */
9595         uint16_t        req_type;
9596         /*
9597          * The completion ring to send the completion event on. This should
9598          * be the NQ ID returned from the `nq_alloc` HWRM command.
9599          */
9600         uint16_t        cmpl_ring;
9601         /*
9602          * The sequence ID is used by the driver for tracking multiple
9603          * commands. This ID is treated as opaque data by the firmware and
9604          * the value is returned in the `hwrm_resp_hdr` upon completion.
9605          */
9606         uint16_t        seq_id;
9607         /*
9608          * The target ID of the command:
9609          * * 0x0-0xFFF8 - The function ID
9610          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9611          * * 0xFFFD - Reserved for user-space HWRM interface
9612          * * 0xFFFF - HWRM
9613          */
9614         uint16_t        target_id;
9615         /*
9616          * A physical address pointer pointing to a host buffer that the
9617          * command's response data will be written. This can be either a host
9618          * physical address (HPA) or a guest physical address (GPA) and must
9619          * point to a physically contiguous block of memory.
9620          */
9621         uint64_t        resp_addr;
9622 } __attribute__((packed));
9623
9624 /* hwrm_func_backing_store_qcaps_output (size:576b/72B) */
9625 struct hwrm_func_backing_store_qcaps_output {
9626         /* The specific error status for the command. */
9627         uint16_t        error_code;
9628         /* The HWRM command request type. */
9629         uint16_t        req_type;
9630         /* The sequence ID from the original command. */
9631         uint16_t        seq_id;
9632         /* The length of the response data in number of bytes. */
9633         uint16_t        resp_len;
9634         /* Maximum number of QP context entries supported for this function. */
9635         uint32_t        qp_max_entries;
9636         /*
9637          * Minimum number of QP context entries that are needed to be reserved
9638          * for QP1 for the PF and its VFs. PF drivers must allocate at least
9639          * this many QP context entries, even if RoCE will not be used.
9640          */
9641         uint16_t        qp_min_qp1_entries;
9642         /* Maximum number of QP context entries that can be used for L2. */
9643         uint16_t        qp_max_l2_entries;
9644         /* Number of bytes that must be allocated for each context entry. */
9645         uint16_t        qp_entry_size;
9646         /* Maximum number of SRQ context entries that can be used for L2. */
9647         uint16_t        srq_max_l2_entries;
9648         /* Maximum number of SRQ context entries supported for this function. */
9649         uint32_t        srq_max_entries;
9650         /* Number of bytes that must be allocated for each context entry. */
9651         uint16_t        srq_entry_size;
9652         /* Maximum number of CQ context entries that can be used for L2. */
9653         uint16_t        cq_max_l2_entries;
9654         /* Maximum number of CQ context entries supported for this function. */
9655         uint32_t        cq_max_entries;
9656         /* Number of bytes that must be allocated for each context entry. */
9657         uint16_t        cq_entry_size;
9658         /* Maximum number of VNIC context entries supported for this function. */
9659         uint16_t        vnic_max_vnic_entries;
9660         /* Maximum number of Ring table context entries supported for this function. */
9661         uint16_t        vnic_max_ring_table_entries;
9662         /* Number of bytes that must be allocated for each context entry. */
9663         uint16_t        vnic_entry_size;
9664         /* Maximum number of statistic context entries supported for this function. */
9665         uint32_t        stat_max_entries;
9666         /* Number of bytes that must be allocated for each context entry. */
9667         uint16_t        stat_entry_size;
9668         /* Number of bytes that must be allocated for each context entry. */
9669         uint16_t        tqm_entry_size;
9670         /* Minimum number of TQM context entries required per ring. */
9671         uint32_t        tqm_min_entries_per_ring;
9672         /*
9673          * Maximum number of TQM context entries supported per ring. This is
9674          * actually a recommended TQM queue size based on worst case usage of
9675          * the TQM queue.
9676          *
9677          * TQM fastpath rings should be sized large enough to accommodate the
9678          * maximum number of QPs (either L2 or RoCE, or both if shared)
9679          * that can be enqueued to the TQM ring.
9680          *
9681          * TQM slowpath rings should be sized as follows:
9682          *
9683          * num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size
9684          *
9685          * Where:
9686          *   num_vnics is the number of VNICs allocated in the VNIC backing store
9687          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
9688          *   num_roce_qps is the number of RoCE QPs in the QP backing store
9689          *   tqm_min_size is tqm_min_entries_per_ring reported by
9690          *     HWRM_FUNC_BACKING_STORE_QCAPS
9691          *
9692          * Note that TQM ring sizes cannot be extended while the system is
9693          * operational. If a PF driver needs to extend a TQM ring, it needs
9694          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
9695          * the backing store.
9696          */
9697         uint32_t        tqm_max_entries_per_ring;
9698         /*
9699          * Maximum number of MR plus AV context entries supported for this
9700          * function.
9701          */
9702         uint32_t        mrav_max_entries;
9703         /* Number of bytes that must be allocated for each context entry. */
9704         uint16_t        mrav_entry_size;
9705         /* Number of bytes that must be allocated for each context entry. */
9706         uint16_t        tim_entry_size;
9707         /* Maximum number of Timer context entries supported for this function. */
9708         uint32_t        tim_max_entries;
9709         /*
9710          * When this field is zero, the 32b `mrav_num_entries` field in the
9711          * `backing_store_cfg` and `backing_store_qcfg` commands represents
9712          * the total number of MR plus AV entries allowed in the MR/AV backing
9713          * store PBL.
9714          *
9715          * When this field is non-zero, the 32b `mrav_num_entries` field in
9716          * the `backing_store_cfg` and `backing_store_qcfg` commands is
9717          * logically divided into two 16b fields. Bits `[31:16]` represents
9718          * the `mr_num_entries` and bits `[15:0]` represents `av_num_entries`.
9719          * Both of these values are represented in a unit granularity
9720          * specified by this field. For example, if this field is 16 and
9721          * `mrav_num_entries` is `0x02000100`, then the number of MR entries
9722          * is 8192 and the number of AV entries is 4096.
9723          */
9724         uint16_t        mrav_num_entries_units;
9725         /*
9726          * The number of entries specified for any TQM ring must be a
9727          * multiple of this value to prevent any resource allocation
9728          * limitations.
9729          */
9730         uint8_t tqm_entries_multiple;
9731         /*
9732          * This field is used in Output records to indicate that the output
9733          * is completely written to RAM.  This field should be read as '1'
9734          * to indicate that the output has been completely written.
9735          * When writing a command completion or response to an internal processor,
9736          * the order of writes has to be such that this field is written last.
9737          */
9738         uint8_t valid;
9739 } __attribute__((packed));
9740
9741 /*******************************
9742  * hwrm_func_backing_store_cfg *
9743  *******************************/
9744
9745
9746 /* hwrm_func_backing_store_cfg_input (size:2048b/256B) */
9747 struct hwrm_func_backing_store_cfg_input {
9748         /* The HWRM command request type. */
9749         uint16_t        req_type;
9750         /*
9751          * The completion ring to send the completion event on. This should
9752          * be the NQ ID returned from the `nq_alloc` HWRM command.
9753          */
9754         uint16_t        cmpl_ring;
9755         /*
9756          * The sequence ID is used by the driver for tracking multiple
9757          * commands. This ID is treated as opaque data by the firmware and
9758          * the value is returned in the `hwrm_resp_hdr` upon completion.
9759          */
9760         uint16_t        seq_id;
9761         /*
9762          * The target ID of the command:
9763          * * 0x0-0xFFF8 - The function ID
9764          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
9765          * * 0xFFFD - Reserved for user-space HWRM interface
9766          * * 0xFFFF - HWRM
9767          */
9768         uint16_t        target_id;
9769         /*
9770          * A physical address pointer pointing to a host buffer that the
9771          * command's response data will be written. This can be either a host
9772          * physical address (HPA) or a guest physical address (GPA) and must
9773          * point to a physically contiguous block of memory.
9774          */
9775         uint64_t        resp_addr;
9776         uint32_t        flags;
9777         /*
9778          * When set, the firmware only uses on-chip resources and does not
9779          * expect any backing store to be provided by the host driver. This
9780          * mode provides minimal L2 functionality (e.g. limited L2 resources,
9781          * no RoCE).
9782          */
9783         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_PREBOOT_MODE \
9784                 UINT32_C(0x1)
9785         /*
9786          * When set, the 32b `mrav_num_entries` field is logically divided
9787          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
9788          */
9789         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_FLAGS_MRAV_RESERVATION_SPLIT \
9790                 UINT32_C(0x2)
9791         uint32_t        enables;
9792         /*
9793          * This bit must be '1' for the qp fields to be
9794          * configured.
9795          */
9796         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_QP \
9797                 UINT32_C(0x1)
9798         /*
9799          * This bit must be '1' for the srq fields to be
9800          * configured.
9801          */
9802         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_SRQ \
9803                 UINT32_C(0x2)
9804         /*
9805          * This bit must be '1' for the cq fields to be
9806          * configured.
9807          */
9808         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_CQ \
9809                 UINT32_C(0x4)
9810         /*
9811          * This bit must be '1' for the vnic fields to be
9812          * configured.
9813          */
9814         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_VNIC \
9815                 UINT32_C(0x8)
9816         /*
9817          * This bit must be '1' for the stat fields to be
9818          * configured.
9819          */
9820         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT \
9821                 UINT32_C(0x10)
9822         /*
9823          * This bit must be '1' for the tqm_sp fields to be
9824          * configured.
9825          */
9826         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_SP \
9827                 UINT32_C(0x20)
9828         /*
9829          * This bit must be '1' for the tqm_ring0 fields to be
9830          * configured.
9831          */
9832         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING0 \
9833                 UINT32_C(0x40)
9834         /*
9835          * This bit must be '1' for the tqm_ring1 fields to be
9836          * configured.
9837          */
9838         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING1 \
9839                 UINT32_C(0x80)
9840         /*
9841          * This bit must be '1' for the tqm_ring2 fields to be
9842          * configured.
9843          */
9844         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING2 \
9845                 UINT32_C(0x100)
9846         /*
9847          * This bit must be '1' for the tqm_ring3 fields to be
9848          * configured.
9849          */
9850         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING3 \
9851                 UINT32_C(0x200)
9852         /*
9853          * This bit must be '1' for the tqm_ring4 fields to be
9854          * configured.
9855          */
9856         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING4 \
9857                 UINT32_C(0x400)
9858         /*
9859          * This bit must be '1' for the tqm_ring5 fields to be
9860          * configured.
9861          */
9862         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING5 \
9863                 UINT32_C(0x800)
9864         /*
9865          * This bit must be '1' for the tqm_ring6 fields to be
9866          * configured.
9867          */
9868         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING6 \
9869                 UINT32_C(0x1000)
9870         /*
9871          * This bit must be '1' for the tqm_ring7 fields to be
9872          * configured.
9873          */
9874         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TQM_RING7 \
9875                 UINT32_C(0x2000)
9876         /*
9877          * This bit must be '1' for the mrav fields to be
9878          * configured.
9879          */
9880         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_MRAV \
9881                 UINT32_C(0x4000)
9882         /*
9883          * This bit must be '1' for the tim fields to be
9884          * configured.
9885          */
9886         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_TIM \
9887                 UINT32_C(0x8000)
9888         /* QPC page size and level. */
9889         uint8_t qpc_pg_size_qpc_lvl;
9890         /* QPC PBL indirect levels. */
9891         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_MASK \
9892                 UINT32_C(0xf)
9893         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_SFT       0
9894         /* PBL pointer is physical start address. */
9895         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_0 \
9896                 UINT32_C(0x0)
9897         /* PBL pointer points to PTE table. */
9898         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_1 \
9899                 UINT32_C(0x1)
9900         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9901         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2 \
9902                 UINT32_C(0x2)
9903         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LAST \
9904                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_LVL_LVL_2
9905         /* QPC page size. */
9906         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_MASK \
9907                 UINT32_C(0xf0)
9908         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_SFT   4
9909         /* 4KB. */
9910         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_4K \
9911                 (UINT32_C(0x0) << 4)
9912         /* 8KB. */
9913         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8K \
9914                 (UINT32_C(0x1) << 4)
9915         /* 64KB. */
9916         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_64K \
9917                 (UINT32_C(0x2) << 4)
9918         /* 2MB. */
9919         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_2M \
9920                 (UINT32_C(0x3) << 4)
9921         /* 8MB. */
9922         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_8M \
9923                 (UINT32_C(0x4) << 4)
9924         /* 1GB. */
9925         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G \
9926                 (UINT32_C(0x5) << 4)
9927         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_LAST \
9928                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_QPC_PG_SIZE_PG_1G
9929         /* SRQ page size and level. */
9930         uint8_t srq_pg_size_srq_lvl;
9931         /* SRQ PBL indirect levels. */
9932         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_MASK \
9933                 UINT32_C(0xf)
9934         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_SFT       0
9935         /* PBL pointer is physical start address. */
9936         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_0 \
9937                 UINT32_C(0x0)
9938         /* PBL pointer points to PTE table. */
9939         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_1 \
9940                 UINT32_C(0x1)
9941         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9942         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2 \
9943                 UINT32_C(0x2)
9944         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LAST \
9945                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_LVL_LVL_2
9946         /* SRQ page size. */
9947         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_MASK \
9948                 UINT32_C(0xf0)
9949         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_SFT   4
9950         /* 4KB. */
9951         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_4K \
9952                 (UINT32_C(0x0) << 4)
9953         /* 8KB. */
9954         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8K \
9955                 (UINT32_C(0x1) << 4)
9956         /* 64KB. */
9957         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_64K \
9958                 (UINT32_C(0x2) << 4)
9959         /* 2MB. */
9960         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_2M \
9961                 (UINT32_C(0x3) << 4)
9962         /* 8MB. */
9963         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_8M \
9964                 (UINT32_C(0x4) << 4)
9965         /* 1GB. */
9966         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G \
9967                 (UINT32_C(0x5) << 4)
9968         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_LAST \
9969                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_SRQ_PG_SIZE_PG_1G
9970         /* CQ page size and level. */
9971         uint8_t cq_pg_size_cq_lvl;
9972         /* CQ PBL indirect levels. */
9973         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_MASK \
9974                 UINT32_C(0xf)
9975         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_SFT       0
9976         /* PBL pointer is physical start address. */
9977         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_0 \
9978                 UINT32_C(0x0)
9979         /* PBL pointer points to PTE table. */
9980         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_1 \
9981                 UINT32_C(0x1)
9982         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
9983         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2 \
9984                 UINT32_C(0x2)
9985         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LAST \
9986                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_LVL_LVL_2
9987         /* CQ page size. */
9988         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_MASK \
9989                 UINT32_C(0xf0)
9990         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_SFT   4
9991         /* 4KB. */
9992         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_4K \
9993                 (UINT32_C(0x0) << 4)
9994         /* 8KB. */
9995         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8K \
9996                 (UINT32_C(0x1) << 4)
9997         /* 64KB. */
9998         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_64K \
9999                 (UINT32_C(0x2) << 4)
10000         /* 2MB. */
10001         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_2M \
10002                 (UINT32_C(0x3) << 4)
10003         /* 8MB. */
10004         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_8M \
10005                 (UINT32_C(0x4) << 4)
10006         /* 1GB. */
10007         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G \
10008                 (UINT32_C(0x5) << 4)
10009         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_LAST \
10010                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_CQ_PG_SIZE_PG_1G
10011         /* VNIC page size and level. */
10012         uint8_t vnic_pg_size_vnic_lvl;
10013         /* VNIC PBL indirect levels. */
10014         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_MASK \
10015                 UINT32_C(0xf)
10016         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_SFT       0
10017         /* PBL pointer is physical start address. */
10018         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_0 \
10019                 UINT32_C(0x0)
10020         /* PBL pointer points to PTE table. */
10021         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_1 \
10022                 UINT32_C(0x1)
10023         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10024         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2 \
10025                 UINT32_C(0x2)
10026         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LAST \
10027                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_LVL_LVL_2
10028         /* VNIC page size. */
10029         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_MASK \
10030                 UINT32_C(0xf0)
10031         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_SFT   4
10032         /* 4KB. */
10033         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_4K \
10034                 (UINT32_C(0x0) << 4)
10035         /* 8KB. */
10036         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8K \
10037                 (UINT32_C(0x1) << 4)
10038         /* 64KB. */
10039         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_64K \
10040                 (UINT32_C(0x2) << 4)
10041         /* 2MB. */
10042         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_2M \
10043                 (UINT32_C(0x3) << 4)
10044         /* 8MB. */
10045         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_8M \
10046                 (UINT32_C(0x4) << 4)
10047         /* 1GB. */
10048         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G \
10049                 (UINT32_C(0x5) << 4)
10050         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_LAST \
10051                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_VNIC_PG_SIZE_PG_1G
10052         /* Stat page size and level. */
10053         uint8_t stat_pg_size_stat_lvl;
10054         /* Stat PBL indirect levels. */
10055         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_MASK \
10056                 UINT32_C(0xf)
10057         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_SFT       0
10058         /* PBL pointer is physical start address. */
10059         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_0 \
10060                 UINT32_C(0x0)
10061         /* PBL pointer points to PTE table. */
10062         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_1 \
10063                 UINT32_C(0x1)
10064         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10065         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2 \
10066                 UINT32_C(0x2)
10067         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LAST \
10068                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_LVL_LVL_2
10069         /* Stat page size. */
10070         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_MASK \
10071                 UINT32_C(0xf0)
10072         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_SFT   4
10073         /* 4KB. */
10074         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_4K \
10075                 (UINT32_C(0x0) << 4)
10076         /* 8KB. */
10077         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8K \
10078                 (UINT32_C(0x1) << 4)
10079         /* 64KB. */
10080         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_64K \
10081                 (UINT32_C(0x2) << 4)
10082         /* 2MB. */
10083         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_2M \
10084                 (UINT32_C(0x3) << 4)
10085         /* 8MB. */
10086         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_8M \
10087                 (UINT32_C(0x4) << 4)
10088         /* 1GB. */
10089         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G \
10090                 (UINT32_C(0x5) << 4)
10091         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_LAST \
10092                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_STAT_PG_SIZE_PG_1G
10093         /* TQM slow path page size and level. */
10094         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
10095         /* TQM slow path PBL indirect levels. */
10096         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_MASK \
10097                 UINT32_C(0xf)
10098         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_SFT       0
10099         /* PBL pointer is physical start address. */
10100         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_0 \
10101                 UINT32_C(0x0)
10102         /* PBL pointer points to PTE table. */
10103         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_1 \
10104                 UINT32_C(0x1)
10105         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10106         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2 \
10107                 UINT32_C(0x2)
10108         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LAST \
10109                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_LVL_LVL_2
10110         /* TQM slow path page size. */
10111         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_MASK \
10112                 UINT32_C(0xf0)
10113         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_SFT   4
10114         /* 4KB. */
10115         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_4K \
10116                 (UINT32_C(0x0) << 4)
10117         /* 8KB. */
10118         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8K \
10119                 (UINT32_C(0x1) << 4)
10120         /* 64KB. */
10121         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_64K \
10122                 (UINT32_C(0x2) << 4)
10123         /* 2MB. */
10124         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_2M \
10125                 (UINT32_C(0x3) << 4)
10126         /* 8MB. */
10127         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_8M \
10128                 (UINT32_C(0x4) << 4)
10129         /* 1GB. */
10130         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G \
10131                 (UINT32_C(0x5) << 4)
10132         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_LAST \
10133                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_SP_PG_SIZE_PG_1G
10134         /* TQM ring 0 page size and level. */
10135         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
10136         /* TQM ring 0 PBL indirect levels. */
10137         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_MASK \
10138                 UINT32_C(0xf)
10139         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_SFT       0
10140         /* PBL pointer is physical start address. */
10141         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_0 \
10142                 UINT32_C(0x0)
10143         /* PBL pointer points to PTE table. */
10144         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_1 \
10145                 UINT32_C(0x1)
10146         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10147         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2 \
10148                 UINT32_C(0x2)
10149         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LAST \
10150                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_LVL_LVL_2
10151         /* TQM ring 0 page size. */
10152         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_MASK \
10153                 UINT32_C(0xf0)
10154         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_SFT   4
10155         /* 4KB. */
10156         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_4K \
10157                 (UINT32_C(0x0) << 4)
10158         /* 8KB. */
10159         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8K \
10160                 (UINT32_C(0x1) << 4)
10161         /* 64KB. */
10162         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_64K \
10163                 (UINT32_C(0x2) << 4)
10164         /* 2MB. */
10165         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_2M \
10166                 (UINT32_C(0x3) << 4)
10167         /* 8MB. */
10168         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_8M \
10169                 (UINT32_C(0x4) << 4)
10170         /* 1GB. */
10171         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G \
10172                 (UINT32_C(0x5) << 4)
10173         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_LAST \
10174                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING0_PG_SIZE_PG_1G
10175         /* TQM ring 1 page size and level. */
10176         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
10177         /* TQM ring 1 PBL indirect levels. */
10178         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_MASK \
10179                 UINT32_C(0xf)
10180         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_SFT       0
10181         /* PBL pointer is physical start address. */
10182         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_0 \
10183                 UINT32_C(0x0)
10184         /* PBL pointer points to PTE table. */
10185         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_1 \
10186                 UINT32_C(0x1)
10187         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10188         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2 \
10189                 UINT32_C(0x2)
10190         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LAST \
10191                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_LVL_LVL_2
10192         /* TQM ring 1 page size. */
10193         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_MASK \
10194                 UINT32_C(0xf0)
10195         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_SFT   4
10196         /* 4KB. */
10197         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_4K \
10198                 (UINT32_C(0x0) << 4)
10199         /* 8KB. */
10200         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8K \
10201                 (UINT32_C(0x1) << 4)
10202         /* 64KB. */
10203         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_64K \
10204                 (UINT32_C(0x2) << 4)
10205         /* 2MB. */
10206         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_2M \
10207                 (UINT32_C(0x3) << 4)
10208         /* 8MB. */
10209         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_8M \
10210                 (UINT32_C(0x4) << 4)
10211         /* 1GB. */
10212         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G \
10213                 (UINT32_C(0x5) << 4)
10214         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_LAST \
10215                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING1_PG_SIZE_PG_1G
10216         /* TQM ring 2 page size and level. */
10217         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
10218         /* TQM ring 2 PBL indirect levels. */
10219         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_MASK \
10220                 UINT32_C(0xf)
10221         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_SFT       0
10222         /* PBL pointer is physical start address. */
10223         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_0 \
10224                 UINT32_C(0x0)
10225         /* PBL pointer points to PTE table. */
10226         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_1 \
10227                 UINT32_C(0x1)
10228         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10229         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2 \
10230                 UINT32_C(0x2)
10231         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LAST \
10232                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_LVL_LVL_2
10233         /* TQM ring 2 page size. */
10234         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_MASK \
10235                 UINT32_C(0xf0)
10236         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_SFT   4
10237         /* 4KB. */
10238         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_4K \
10239                 (UINT32_C(0x0) << 4)
10240         /* 8KB. */
10241         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8K \
10242                 (UINT32_C(0x1) << 4)
10243         /* 64KB. */
10244         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_64K \
10245                 (UINT32_C(0x2) << 4)
10246         /* 2MB. */
10247         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_2M \
10248                 (UINT32_C(0x3) << 4)
10249         /* 8MB. */
10250         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_8M \
10251                 (UINT32_C(0x4) << 4)
10252         /* 1GB. */
10253         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G \
10254                 (UINT32_C(0x5) << 4)
10255         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_LAST \
10256                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING2_PG_SIZE_PG_1G
10257         /* TQM ring 3 page size and level. */
10258         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
10259         /* TQM ring 3 PBL indirect levels. */
10260         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_MASK \
10261                 UINT32_C(0xf)
10262         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_SFT       0
10263         /* PBL pointer is physical start address. */
10264         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_0 \
10265                 UINT32_C(0x0)
10266         /* PBL pointer points to PTE table. */
10267         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_1 \
10268                 UINT32_C(0x1)
10269         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10270         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2 \
10271                 UINT32_C(0x2)
10272         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LAST \
10273                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_LVL_LVL_2
10274         /* TQM ring 3 page size. */
10275         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_MASK \
10276                 UINT32_C(0xf0)
10277         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_SFT   4
10278         /* 4KB. */
10279         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_4K \
10280                 (UINT32_C(0x0) << 4)
10281         /* 8KB. */
10282         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8K \
10283                 (UINT32_C(0x1) << 4)
10284         /* 64KB. */
10285         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_64K \
10286                 (UINT32_C(0x2) << 4)
10287         /* 2MB. */
10288         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_2M \
10289                 (UINT32_C(0x3) << 4)
10290         /* 8MB. */
10291         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_8M \
10292                 (UINT32_C(0x4) << 4)
10293         /* 1GB. */
10294         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G \
10295                 (UINT32_C(0x5) << 4)
10296         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_LAST \
10297                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING3_PG_SIZE_PG_1G
10298         /* TQM ring 4 page size and level. */
10299         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
10300         /* TQM ring 4 PBL indirect levels. */
10301         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_MASK \
10302                 UINT32_C(0xf)
10303         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_SFT       0
10304         /* PBL pointer is physical start address. */
10305         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_0 \
10306                 UINT32_C(0x0)
10307         /* PBL pointer points to PTE table. */
10308         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_1 \
10309                 UINT32_C(0x1)
10310         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10311         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2 \
10312                 UINT32_C(0x2)
10313         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LAST \
10314                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_LVL_LVL_2
10315         /* TQM ring 4 page size. */
10316         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_MASK \
10317                 UINT32_C(0xf0)
10318         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_SFT   4
10319         /* 4KB. */
10320         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_4K \
10321                 (UINT32_C(0x0) << 4)
10322         /* 8KB. */
10323         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8K \
10324                 (UINT32_C(0x1) << 4)
10325         /* 64KB. */
10326         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_64K \
10327                 (UINT32_C(0x2) << 4)
10328         /* 2MB. */
10329         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_2M \
10330                 (UINT32_C(0x3) << 4)
10331         /* 8MB. */
10332         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_8M \
10333                 (UINT32_C(0x4) << 4)
10334         /* 1GB. */
10335         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G \
10336                 (UINT32_C(0x5) << 4)
10337         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_LAST \
10338                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING4_PG_SIZE_PG_1G
10339         /* TQM ring 5 page size and level. */
10340         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
10341         /* TQM ring 5 PBL indirect levels. */
10342         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_MASK \
10343                 UINT32_C(0xf)
10344         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_SFT       0
10345         /* PBL pointer is physical start address. */
10346         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_0 \
10347                 UINT32_C(0x0)
10348         /* PBL pointer points to PTE table. */
10349         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_1 \
10350                 UINT32_C(0x1)
10351         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10352         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2 \
10353                 UINT32_C(0x2)
10354         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LAST \
10355                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_LVL_LVL_2
10356         /* TQM ring 5 page size. */
10357         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_MASK \
10358                 UINT32_C(0xf0)
10359         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_SFT   4
10360         /* 4KB. */
10361         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_4K \
10362                 (UINT32_C(0x0) << 4)
10363         /* 8KB. */
10364         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8K \
10365                 (UINT32_C(0x1) << 4)
10366         /* 64KB. */
10367         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_64K \
10368                 (UINT32_C(0x2) << 4)
10369         /* 2MB. */
10370         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_2M \
10371                 (UINT32_C(0x3) << 4)
10372         /* 8MB. */
10373         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_8M \
10374                 (UINT32_C(0x4) << 4)
10375         /* 1GB. */
10376         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G \
10377                 (UINT32_C(0x5) << 4)
10378         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_LAST \
10379                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING5_PG_SIZE_PG_1G
10380         /* TQM ring 6 page size and level. */
10381         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
10382         /* TQM ring 6 PBL indirect levels. */
10383         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_MASK \
10384                 UINT32_C(0xf)
10385         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_SFT       0
10386         /* PBL pointer is physical start address. */
10387         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_0 \
10388                 UINT32_C(0x0)
10389         /* PBL pointer points to PTE table. */
10390         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_1 \
10391                 UINT32_C(0x1)
10392         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10393         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2 \
10394                 UINT32_C(0x2)
10395         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LAST \
10396                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_LVL_LVL_2
10397         /* TQM ring 6 page size. */
10398         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_MASK \
10399                 UINT32_C(0xf0)
10400         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_SFT   4
10401         /* 4KB. */
10402         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_4K \
10403                 (UINT32_C(0x0) << 4)
10404         /* 8KB. */
10405         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8K \
10406                 (UINT32_C(0x1) << 4)
10407         /* 64KB. */
10408         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_64K \
10409                 (UINT32_C(0x2) << 4)
10410         /* 2MB. */
10411         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_2M \
10412                 (UINT32_C(0x3) << 4)
10413         /* 8MB. */
10414         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_8M \
10415                 (UINT32_C(0x4) << 4)
10416         /* 1GB. */
10417         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G \
10418                 (UINT32_C(0x5) << 4)
10419         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_LAST \
10420                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING6_PG_SIZE_PG_1G
10421         /* TQM ring 7 page size and level. */
10422         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
10423         /* TQM ring 7 PBL indirect levels. */
10424         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_MASK \
10425                 UINT32_C(0xf)
10426         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_SFT       0
10427         /* PBL pointer is physical start address. */
10428         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_0 \
10429                 UINT32_C(0x0)
10430         /* PBL pointer points to PTE table. */
10431         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_1 \
10432                 UINT32_C(0x1)
10433         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10434         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2 \
10435                 UINT32_C(0x2)
10436         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LAST \
10437                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_LVL_LVL_2
10438         /* TQM ring 7 page size. */
10439         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_MASK \
10440                 UINT32_C(0xf0)
10441         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_SFT   4
10442         /* 4KB. */
10443         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_4K \
10444                 (UINT32_C(0x0) << 4)
10445         /* 8KB. */
10446         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8K \
10447                 (UINT32_C(0x1) << 4)
10448         /* 64KB. */
10449         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_64K \
10450                 (UINT32_C(0x2) << 4)
10451         /* 2MB. */
10452         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_2M \
10453                 (UINT32_C(0x3) << 4)
10454         /* 8MB. */
10455         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_8M \
10456                 (UINT32_C(0x4) << 4)
10457         /* 1GB. */
10458         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G \
10459                 (UINT32_C(0x5) << 4)
10460         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_LAST \
10461                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TQM_RING7_PG_SIZE_PG_1G
10462         /* MR/AV page size and level. */
10463         uint8_t mrav_pg_size_mrav_lvl;
10464         /* MR/AV PBL indirect levels. */
10465         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_MASK \
10466                 UINT32_C(0xf)
10467         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_SFT       0
10468         /* PBL pointer is physical start address. */
10469         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_0 \
10470                 UINT32_C(0x0)
10471         /* PBL pointer points to PTE table. */
10472         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_1 \
10473                 UINT32_C(0x1)
10474         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10475         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2 \
10476                 UINT32_C(0x2)
10477         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LAST \
10478                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_LVL_LVL_2
10479         /* MR/AV page size. */
10480         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_MASK \
10481                 UINT32_C(0xf0)
10482         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_SFT   4
10483         /* 4KB. */
10484         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_4K \
10485                 (UINT32_C(0x0) << 4)
10486         /* 8KB. */
10487         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8K \
10488                 (UINT32_C(0x1) << 4)
10489         /* 64KB. */
10490         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_64K \
10491                 (UINT32_C(0x2) << 4)
10492         /* 2MB. */
10493         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_2M \
10494                 (UINT32_C(0x3) << 4)
10495         /* 8MB. */
10496         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_8M \
10497                 (UINT32_C(0x4) << 4)
10498         /* 1GB. */
10499         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G \
10500                 (UINT32_C(0x5) << 4)
10501         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_LAST \
10502                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_MRAV_PG_SIZE_PG_1G
10503         /* Timer page size and level. */
10504         uint8_t tim_pg_size_tim_lvl;
10505         /* Timer PBL indirect levels. */
10506         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_MASK \
10507                 UINT32_C(0xf)
10508         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_SFT       0
10509         /* PBL pointer is physical start address. */
10510         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_0 \
10511                 UINT32_C(0x0)
10512         /* PBL pointer points to PTE table. */
10513         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_1 \
10514                 UINT32_C(0x1)
10515         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10516         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2 \
10517                 UINT32_C(0x2)
10518         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LAST \
10519                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_LVL_LVL_2
10520         /* Timer page size. */
10521         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_MASK \
10522                 UINT32_C(0xf0)
10523         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_SFT   4
10524         /* 4KB. */
10525         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_4K \
10526                 (UINT32_C(0x0) << 4)
10527         /* 8KB. */
10528         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8K \
10529                 (UINT32_C(0x1) << 4)
10530         /* 64KB. */
10531         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_64K \
10532                 (UINT32_C(0x2) << 4)
10533         /* 2MB. */
10534         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_2M \
10535                 (UINT32_C(0x3) << 4)
10536         /* 8MB. */
10537         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_8M \
10538                 (UINT32_C(0x4) << 4)
10539         /* 1GB. */
10540         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G \
10541                 (UINT32_C(0x5) << 4)
10542         #define HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_LAST \
10543                 HWRM_FUNC_BACKING_STORE_CFG_INPUT_TIM_PG_SIZE_PG_1G
10544         /* QP page directory. */
10545         uint64_t        qpc_page_dir;
10546         /* SRQ page directory. */
10547         uint64_t        srq_page_dir;
10548         /* CQ page directory. */
10549         uint64_t        cq_page_dir;
10550         /* VNIC page directory. */
10551         uint64_t        vnic_page_dir;
10552         /* Stat page directory. */
10553         uint64_t        stat_page_dir;
10554         /* TQM slowpath page directory. */
10555         uint64_t        tqm_sp_page_dir;
10556         /* TQM ring 0 page directory. */
10557         uint64_t        tqm_ring0_page_dir;
10558         /* TQM ring 1 page directory. */
10559         uint64_t        tqm_ring1_page_dir;
10560         /* TQM ring 2 page directory. */
10561         uint64_t        tqm_ring2_page_dir;
10562         /* TQM ring 3 page directory. */
10563         uint64_t        tqm_ring3_page_dir;
10564         /* TQM ring 4 page directory. */
10565         uint64_t        tqm_ring4_page_dir;
10566         /* TQM ring 5 page directory. */
10567         uint64_t        tqm_ring5_page_dir;
10568         /* TQM ring 6 page directory. */
10569         uint64_t        tqm_ring6_page_dir;
10570         /* TQM ring 7 page directory. */
10571         uint64_t        tqm_ring7_page_dir;
10572         /* MR/AV page directory. */
10573         uint64_t        mrav_page_dir;
10574         /* Timer page directory. */
10575         uint64_t        tim_page_dir;
10576         /* Number of QPs. */
10577         uint32_t        qp_num_entries;
10578         /* Number of SRQs. */
10579         uint32_t        srq_num_entries;
10580         /* Number of CQs. */
10581         uint32_t        cq_num_entries;
10582         /* Number of Stats. */
10583         uint32_t        stat_num_entries;
10584         /*
10585          * Number of TQM slowpath entries.
10586          *
10587          * TQM slowpath rings should be sized as follows:
10588          *
10589          * num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size
10590          *
10591          * Where:
10592          *   num_vnics is the number of VNICs allocated in the VNIC backing store
10593          *   num_l2_tx_rings is the number of L2 rings in the QP backing store
10594          *   num_roce_qps is the number of RoCE QPs in the QP backing store
10595          *   tqm_min_size is tqm_min_entries_per_ring reported by
10596          *     HWRM_FUNC_BACKING_STORE_QCAPS
10597          *
10598          * Note that TQM ring sizes cannot be extended while the system is
10599          * operational. If a PF driver needs to extend a TQM ring, it needs
10600          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10601          * the backing store.
10602          */
10603         uint32_t        tqm_sp_num_entries;
10604         /*
10605          * Number of TQM ring 0 entries.
10606          *
10607          * TQM fastpath rings should be sized large enough to accommodate the
10608          * maximum number of QPs (either L2 or RoCE, or both if shared)
10609          * that can be enqueued to the TQM ring.
10610          *
10611          * Note that TQM ring sizes cannot be extended while the system is
10612          * operational. If a PF driver needs to extend a TQM ring, it needs
10613          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10614          * the backing store.
10615          */
10616         uint32_t        tqm_ring0_num_entries;
10617         /*
10618          * Number of TQM ring 1 entries.
10619          *
10620          * TQM fastpath rings should be sized large enough to accommodate the
10621          * maximum number of QPs (either L2 or RoCE, or both if shared)
10622          * that can be enqueued to the TQM ring.
10623          *
10624          * Note that TQM ring sizes cannot be extended while the system is
10625          * operational. If a PF driver needs to extend a TQM ring, it needs
10626          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10627          * the backing store.
10628          */
10629         uint32_t        tqm_ring1_num_entries;
10630         /*
10631          * Number of TQM ring 2 entries.
10632          *
10633          * TQM fastpath rings should be sized large enough to accommodate the
10634          * maximum number of QPs (either L2 or RoCE, or both if shared)
10635          * that can be enqueued to the TQM ring.
10636          *
10637          * Note that TQM ring sizes cannot be extended while the system is
10638          * operational. If a PF driver needs to extend a TQM ring, it needs
10639          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10640          * the backing store.
10641          */
10642         uint32_t        tqm_ring2_num_entries;
10643         /*
10644          * Number of TQM ring 3 entries.
10645          *
10646          * TQM fastpath rings should be sized large enough to accommodate the
10647          * maximum number of QPs (either L2 or RoCE, or both if shared)
10648          * that can be enqueued to the TQM ring.
10649          *
10650          * Note that TQM ring sizes cannot be extended while the system is
10651          * operational. If a PF driver needs to extend a TQM ring, it needs
10652          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10653          * the backing store.
10654          */
10655         uint32_t        tqm_ring3_num_entries;
10656         /*
10657          * Number of TQM ring 4 entries.
10658          *
10659          * TQM fastpath rings should be sized large enough to accommodate the
10660          * maximum number of QPs (either L2 or RoCE, or both if shared)
10661          * that can be enqueued to the TQM ring.
10662          *
10663          * Note that TQM ring sizes cannot be extended while the system is
10664          * operational. If a PF driver needs to extend a TQM ring, it needs
10665          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10666          * the backing store.
10667          */
10668         uint32_t        tqm_ring4_num_entries;
10669         /*
10670          * Number of TQM ring 5 entries.
10671          *
10672          * TQM fastpath rings should be sized large enough to accommodate the
10673          * maximum number of QPs (either L2 or RoCE, or both if shared)
10674          * that can be enqueued to the TQM ring.
10675          *
10676          * Note that TQM ring sizes cannot be extended while the system is
10677          * operational. If a PF driver needs to extend a TQM ring, it needs
10678          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10679          * the backing store.
10680          */
10681         uint32_t        tqm_ring5_num_entries;
10682         /*
10683          * Number of TQM ring 6 entries.
10684          *
10685          * TQM fastpath rings should be sized large enough to accommodate the
10686          * maximum number of QPs (either L2 or RoCE, or both if shared)
10687          * that can be enqueued to the TQM ring.
10688          *
10689          * Note that TQM ring sizes cannot be extended while the system is
10690          * operational. If a PF driver needs to extend a TQM ring, it needs
10691          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10692          * the backing store.
10693          */
10694         uint32_t        tqm_ring6_num_entries;
10695         /*
10696          * Number of TQM ring 7 entries.
10697          *
10698          * TQM fastpath rings should be sized large enough to accommodate the
10699          * maximum number of QPs (either L2 or RoCE, or both if shared)
10700          * that can be enqueued to the TQM ring.
10701          *
10702          * Note that TQM ring sizes cannot be extended while the system is
10703          * operational. If a PF driver needs to extend a TQM ring, it needs
10704          * to reset the function (e.g. HWRM_FUNC_RESET) and then reallocate
10705          * the backing store.
10706          */
10707         uint32_t        tqm_ring7_num_entries;
10708         /*
10709          * If the MR/AV split reservation flag is not set, then this field
10710          * represents the total number of MR plus AV entries. For versions
10711          * of firmware that support the split reservation, when it is not
10712          * specified half of the entries will be reserved for MRs and the
10713          * other half for AVs.
10714          *
10715          * If the MR/AV split reservation flag is set, then this
10716          * field is logically divided into two 16b fields. Bits `[31:16]`
10717          * represents the `mr_num_entries` and bits `[15:0]` represents
10718          * `av_num_entries`. The granularity of these values is defined by
10719          * the `mrav_num_entries_unit` field returned by the
10720          * `backing_store_qcaps` command.
10721          */
10722         uint32_t        mrav_num_entries;
10723         /* Number of Timer entries. */
10724         uint32_t        tim_num_entries;
10725         /* Number of entries to reserve for QP1 */
10726         uint16_t        qp_num_qp1_entries;
10727         /* Number of entries to reserve for L2 */
10728         uint16_t        qp_num_l2_entries;
10729         /* Number of bytes that have been allocated for each context entry. */
10730         uint16_t        qp_entry_size;
10731         /* Number of entries to reserve for L2 */
10732         uint16_t        srq_num_l2_entries;
10733         /* Number of bytes that have been allocated for each context entry. */
10734         uint16_t        srq_entry_size;
10735         /* Number of entries to reserve for L2 */
10736         uint16_t        cq_num_l2_entries;
10737         /* Number of bytes that have been allocated for each context entry. */
10738         uint16_t        cq_entry_size;
10739         /* Number of entries to reserve for VNIC entries */
10740         uint16_t        vnic_num_vnic_entries;
10741         /* Number of entries to reserve for Ring table entries */
10742         uint16_t        vnic_num_ring_table_entries;
10743         /* Number of bytes that have been allocated for each context entry. */
10744         uint16_t        vnic_entry_size;
10745         /* Number of bytes that have been allocated for each context entry. */
10746         uint16_t        stat_entry_size;
10747         /* Number of bytes that have been allocated for each context entry. */
10748         uint16_t        tqm_entry_size;
10749         /* Number of bytes that have been allocated for each context entry. */
10750         uint16_t        mrav_entry_size;
10751         /* Number of bytes that have been allocated for each context entry. */
10752         uint16_t        tim_entry_size;
10753 } __attribute__((packed));
10754
10755 /* hwrm_func_backing_store_cfg_output (size:128b/16B) */
10756 struct hwrm_func_backing_store_cfg_output {
10757         /* The specific error status for the command. */
10758         uint16_t        error_code;
10759         /* The HWRM command request type. */
10760         uint16_t        req_type;
10761         /* The sequence ID from the original command. */
10762         uint16_t        seq_id;
10763         /* The length of the response data in number of bytes. */
10764         uint16_t        resp_len;
10765         uint8_t unused_0[7];
10766         /*
10767          * This field is used in Output records to indicate that the output
10768          * is completely written to RAM.  This field should be read as '1'
10769          * to indicate that the output has been completely written.
10770          * When writing a command completion or response to an internal processor,
10771          * the order of writes has to be such that this field is written last.
10772          */
10773         uint8_t valid;
10774 } __attribute__((packed));
10775
10776 /********************************
10777  * hwrm_func_backing_store_qcfg *
10778  ********************************/
10779
10780
10781 /* hwrm_func_backing_store_qcfg_input (size:128b/16B) */
10782 struct hwrm_func_backing_store_qcfg_input {
10783         /* The HWRM command request type. */
10784         uint16_t        req_type;
10785         /*
10786          * The completion ring to send the completion event on. This should
10787          * be the NQ ID returned from the `nq_alloc` HWRM command.
10788          */
10789         uint16_t        cmpl_ring;
10790         /*
10791          * The sequence ID is used by the driver for tracking multiple
10792          * commands. This ID is treated as opaque data by the firmware and
10793          * the value is returned in the `hwrm_resp_hdr` upon completion.
10794          */
10795         uint16_t        seq_id;
10796         /*
10797          * The target ID of the command:
10798          * * 0x0-0xFFF8 - The function ID
10799          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
10800          * * 0xFFFD - Reserved for user-space HWRM interface
10801          * * 0xFFFF - HWRM
10802          */
10803         uint16_t        target_id;
10804         /*
10805          * A physical address pointer pointing to a host buffer that the
10806          * command's response data will be written. This can be either a host
10807          * physical address (HPA) or a guest physical address (GPA) and must
10808          * point to a physically contiguous block of memory.
10809          */
10810         uint64_t        resp_addr;
10811 } __attribute__((packed));
10812
10813 /* hwrm_func_backing_store_qcfg_output (size:1920b/240B) */
10814 struct hwrm_func_backing_store_qcfg_output {
10815         /* The specific error status for the command. */
10816         uint16_t        error_code;
10817         /* The HWRM command request type. */
10818         uint16_t        req_type;
10819         /* The sequence ID from the original command. */
10820         uint16_t        seq_id;
10821         /* The length of the response data in number of bytes. */
10822         uint16_t        resp_len;
10823         uint32_t        flags;
10824         /*
10825          * When set, the firmware only uses on-chip resources and does not
10826          * expect any backing store to be provided by the host driver. This
10827          * mode provides minimal L2 functionality (e.g. limited L2 resources,
10828          * no RoCE).
10829          */
10830         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_PREBOOT_MODE \
10831                 UINT32_C(0x1)
10832         /*
10833          * When set, the 32b `mrav_num_entries` field is logically divided
10834          * into two 16b fields, `mr_num_entries` and `av_num_entries`.
10835          */
10836         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_FLAGS_MRAV_RESERVATION_SPLIT \
10837                 UINT32_C(0x2)
10838         uint8_t unused_0[4];
10839         /*
10840          * This bit must be '1' for the qp fields to be
10841          * configured.
10842          */
10843         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_QP \
10844                 UINT32_C(0x1)
10845         /*
10846          * This bit must be '1' for the srq fields to be
10847          * configured.
10848          */
10849         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_SRQ \
10850                 UINT32_C(0x2)
10851         /*
10852          * This bit must be '1' for the cq fields to be
10853          * configured.
10854          */
10855         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_CQ \
10856                 UINT32_C(0x4)
10857         /*
10858          * This bit must be '1' for the vnic fields to be
10859          * configured.
10860          */
10861         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_VNIC \
10862                 UINT32_C(0x8)
10863         /*
10864          * This bit must be '1' for the stat fields to be
10865          * configured.
10866          */
10867         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_STAT \
10868                 UINT32_C(0x10)
10869         /*
10870          * This bit must be '1' for the tqm_sp fields to be
10871          * configured.
10872          */
10873         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_SP \
10874                 UINT32_C(0x20)
10875         /*
10876          * This bit must be '1' for the tqm_ring0 fields to be
10877          * configured.
10878          */
10879         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING0 \
10880                 UINT32_C(0x40)
10881         /*
10882          * This bit must be '1' for the tqm_ring1 fields to be
10883          * configured.
10884          */
10885         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING1 \
10886                 UINT32_C(0x80)
10887         /*
10888          * This bit must be '1' for the tqm_ring2 fields to be
10889          * configured.
10890          */
10891         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING2 \
10892                 UINT32_C(0x100)
10893         /*
10894          * This bit must be '1' for the tqm_ring3 fields to be
10895          * configured.
10896          */
10897         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING3 \
10898                 UINT32_C(0x200)
10899         /*
10900          * This bit must be '1' for the tqm_ring4 fields to be
10901          * configured.
10902          */
10903         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING4 \
10904                 UINT32_C(0x400)
10905         /*
10906          * This bit must be '1' for the tqm_ring5 fields to be
10907          * configured.
10908          */
10909         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING5 \
10910                 UINT32_C(0x800)
10911         /*
10912          * This bit must be '1' for the tqm_ring6 fields to be
10913          * configured.
10914          */
10915         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING6 \
10916                 UINT32_C(0x1000)
10917         /*
10918          * This bit must be '1' for the tqm_ring7 fields to be
10919          * configured.
10920          */
10921         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TQM_RING7 \
10922                 UINT32_C(0x2000)
10923         /*
10924          * This bit must be '1' for the mrav fields to be
10925          * configured.
10926          */
10927         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_MRAV \
10928                 UINT32_C(0x4000)
10929         /*
10930          * This bit must be '1' for the tim fields to be
10931          * configured.
10932          */
10933         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_UNUSED_0_TIM \
10934                 UINT32_C(0x8000)
10935         /* QPC page size and level. */
10936         uint8_t qpc_pg_size_qpc_lvl;
10937         /* QPC PBL indirect levels. */
10938         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_MASK \
10939                 UINT32_C(0xf)
10940         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_SFT       0
10941         /* PBL pointer is physical start address. */
10942         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_0 \
10943                 UINT32_C(0x0)
10944         /* PBL pointer points to PTE table. */
10945         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_1 \
10946                 UINT32_C(0x1)
10947         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10948         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2 \
10949                 UINT32_C(0x2)
10950         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LAST \
10951                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_LVL_LVL_2
10952         /* QPC page size. */
10953         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_MASK \
10954                 UINT32_C(0xf0)
10955         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_SFT   4
10956         /* 4KB. */
10957         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_4K \
10958                 (UINT32_C(0x0) << 4)
10959         /* 8KB. */
10960         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8K \
10961                 (UINT32_C(0x1) << 4)
10962         /* 64KB. */
10963         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_64K \
10964                 (UINT32_C(0x2) << 4)
10965         /* 2MB. */
10966         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_2M \
10967                 (UINT32_C(0x3) << 4)
10968         /* 8MB. */
10969         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_8M \
10970                 (UINT32_C(0x4) << 4)
10971         /* 1GB. */
10972         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G \
10973                 (UINT32_C(0x5) << 4)
10974         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_LAST \
10975                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_QPC_PG_SIZE_PG_1G
10976         /* SRQ page size and level. */
10977         uint8_t srq_pg_size_srq_lvl;
10978         /* SRQ PBL indirect levels. */
10979         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_MASK \
10980                 UINT32_C(0xf)
10981         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_SFT       0
10982         /* PBL pointer is physical start address. */
10983         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_0 \
10984                 UINT32_C(0x0)
10985         /* PBL pointer points to PTE table. */
10986         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_1 \
10987                 UINT32_C(0x1)
10988         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
10989         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2 \
10990                 UINT32_C(0x2)
10991         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LAST \
10992                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_LVL_LVL_2
10993         /* SRQ page size. */
10994         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_MASK \
10995                 UINT32_C(0xf0)
10996         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_SFT   4
10997         /* 4KB. */
10998         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_4K \
10999                 (UINT32_C(0x0) << 4)
11000         /* 8KB. */
11001         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8K \
11002                 (UINT32_C(0x1) << 4)
11003         /* 64KB. */
11004         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_64K \
11005                 (UINT32_C(0x2) << 4)
11006         /* 2MB. */
11007         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_2M \
11008                 (UINT32_C(0x3) << 4)
11009         /* 8MB. */
11010         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_8M \
11011                 (UINT32_C(0x4) << 4)
11012         /* 1GB. */
11013         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G \
11014                 (UINT32_C(0x5) << 4)
11015         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_LAST \
11016                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_SRQ_PG_SIZE_PG_1G
11017         /* CQ page size and level. */
11018         uint8_t cq_pg_size_cq_lvl;
11019         /* CQ PBL indirect levels. */
11020         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_MASK \
11021                 UINT32_C(0xf)
11022         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_SFT       0
11023         /* PBL pointer is physical start address. */
11024         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_0 \
11025                 UINT32_C(0x0)
11026         /* PBL pointer points to PTE table. */
11027         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_1 \
11028                 UINT32_C(0x1)
11029         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11030         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2 \
11031                 UINT32_C(0x2)
11032         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LAST \
11033                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_LVL_LVL_2
11034         /* CQ page size. */
11035         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_MASK \
11036                 UINT32_C(0xf0)
11037         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_SFT   4
11038         /* 4KB. */
11039         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_4K \
11040                 (UINT32_C(0x0) << 4)
11041         /* 8KB. */
11042         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8K \
11043                 (UINT32_C(0x1) << 4)
11044         /* 64KB. */
11045         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_64K \
11046                 (UINT32_C(0x2) << 4)
11047         /* 2MB. */
11048         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_2M \
11049                 (UINT32_C(0x3) << 4)
11050         /* 8MB. */
11051         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_8M \
11052                 (UINT32_C(0x4) << 4)
11053         /* 1GB. */
11054         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G \
11055                 (UINT32_C(0x5) << 4)
11056         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_LAST \
11057                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_CQ_PG_SIZE_PG_1G
11058         /* VNIC page size and level. */
11059         uint8_t vnic_pg_size_vnic_lvl;
11060         /* VNIC PBL indirect levels. */
11061         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_MASK \
11062                 UINT32_C(0xf)
11063         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_SFT       0
11064         /* PBL pointer is physical start address. */
11065         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_0 \
11066                 UINT32_C(0x0)
11067         /* PBL pointer points to PTE table. */
11068         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_1 \
11069                 UINT32_C(0x1)
11070         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11071         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2 \
11072                 UINT32_C(0x2)
11073         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LAST \
11074                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_LVL_LVL_2
11075         /* VNIC page size. */
11076         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_MASK \
11077                 UINT32_C(0xf0)
11078         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_SFT   4
11079         /* 4KB. */
11080         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_4K \
11081                 (UINT32_C(0x0) << 4)
11082         /* 8KB. */
11083         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8K \
11084                 (UINT32_C(0x1) << 4)
11085         /* 64KB. */
11086         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_64K \
11087                 (UINT32_C(0x2) << 4)
11088         /* 2MB. */
11089         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_2M \
11090                 (UINT32_C(0x3) << 4)
11091         /* 8MB. */
11092         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_8M \
11093                 (UINT32_C(0x4) << 4)
11094         /* 1GB. */
11095         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G \
11096                 (UINT32_C(0x5) << 4)
11097         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_LAST \
11098                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_VNIC_PG_SIZE_PG_1G
11099         /* Stat page size and level. */
11100         uint8_t stat_pg_size_stat_lvl;
11101         /* Stat PBL indirect levels. */
11102         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_MASK \
11103                 UINT32_C(0xf)
11104         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_SFT       0
11105         /* PBL pointer is physical start address. */
11106         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_0 \
11107                 UINT32_C(0x0)
11108         /* PBL pointer points to PTE table. */
11109         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_1 \
11110                 UINT32_C(0x1)
11111         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11112         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2 \
11113                 UINT32_C(0x2)
11114         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LAST \
11115                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_LVL_LVL_2
11116         /* Stat page size. */
11117         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_MASK \
11118                 UINT32_C(0xf0)
11119         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_SFT   4
11120         /* 4KB. */
11121         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_4K \
11122                 (UINT32_C(0x0) << 4)
11123         /* 8KB. */
11124         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8K \
11125                 (UINT32_C(0x1) << 4)
11126         /* 64KB. */
11127         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_64K \
11128                 (UINT32_C(0x2) << 4)
11129         /* 2MB. */
11130         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_2M \
11131                 (UINT32_C(0x3) << 4)
11132         /* 8MB. */
11133         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_8M \
11134                 (UINT32_C(0x4) << 4)
11135         /* 1GB. */
11136         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G \
11137                 (UINT32_C(0x5) << 4)
11138         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_LAST \
11139                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_STAT_PG_SIZE_PG_1G
11140         /* TQM slow path page size and level. */
11141         uint8_t tqm_sp_pg_size_tqm_sp_lvl;
11142         /* TQM slow path PBL indirect levels. */
11143         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_MASK \
11144                 UINT32_C(0xf)
11145         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_SFT       0
11146         /* PBL pointer is physical start address. */
11147         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_0 \
11148                 UINT32_C(0x0)
11149         /* PBL pointer points to PTE table. */
11150         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_1 \
11151                 UINT32_C(0x1)
11152         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11153         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2 \
11154                 UINT32_C(0x2)
11155         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LAST \
11156                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_LVL_LVL_2
11157         /* TQM slow path page size. */
11158         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_MASK \
11159                 UINT32_C(0xf0)
11160         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_SFT   4
11161         /* 4KB. */
11162         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_4K \
11163                 (UINT32_C(0x0) << 4)
11164         /* 8KB. */
11165         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8K \
11166                 (UINT32_C(0x1) << 4)
11167         /* 64KB. */
11168         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_64K \
11169                 (UINT32_C(0x2) << 4)
11170         /* 2MB. */
11171         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_2M \
11172                 (UINT32_C(0x3) << 4)
11173         /* 8MB. */
11174         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_8M \
11175                 (UINT32_C(0x4) << 4)
11176         /* 1GB. */
11177         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G \
11178                 (UINT32_C(0x5) << 4)
11179         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_LAST \
11180                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_SP_PG_SIZE_PG_1G
11181         /* TQM ring 0 page size and level. */
11182         uint8_t tqm_ring0_pg_size_tqm_ring0_lvl;
11183         /* TQM ring 0 PBL indirect levels. */
11184         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_MASK \
11185                 UINT32_C(0xf)
11186         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_SFT       0
11187         /* PBL pointer is physical start address. */
11188         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_0 \
11189                 UINT32_C(0x0)
11190         /* PBL pointer points to PTE table. */
11191         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_1 \
11192                 UINT32_C(0x1)
11193         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11194         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2 \
11195                 UINT32_C(0x2)
11196         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LAST \
11197                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_LVL_LVL_2
11198         /* TQM ring 0 page size. */
11199         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_MASK \
11200                 UINT32_C(0xf0)
11201         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_SFT   4
11202         /* 4KB. */
11203         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_4K \
11204                 (UINT32_C(0x0) << 4)
11205         /* 8KB. */
11206         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8K \
11207                 (UINT32_C(0x1) << 4)
11208         /* 64KB. */
11209         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_64K \
11210                 (UINT32_C(0x2) << 4)
11211         /* 2MB. */
11212         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_2M \
11213                 (UINT32_C(0x3) << 4)
11214         /* 8MB. */
11215         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_8M \
11216                 (UINT32_C(0x4) << 4)
11217         /* 1GB. */
11218         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G \
11219                 (UINT32_C(0x5) << 4)
11220         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_LAST \
11221                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING0_PG_SIZE_PG_1G
11222         /* TQM ring 1 page size and level. */
11223         uint8_t tqm_ring1_pg_size_tqm_ring1_lvl;
11224         /* TQM ring 1 PBL indirect levels. */
11225         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_MASK \
11226                 UINT32_C(0xf)
11227         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_SFT       0
11228         /* PBL pointer is physical start address. */
11229         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_0 \
11230                 UINT32_C(0x0)
11231         /* PBL pointer points to PTE table. */
11232         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_1 \
11233                 UINT32_C(0x1)
11234         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11235         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2 \
11236                 UINT32_C(0x2)
11237         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LAST \
11238                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_LVL_LVL_2
11239         /* TQM ring 1 page size. */
11240         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_MASK \
11241                 UINT32_C(0xf0)
11242         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_SFT   4
11243         /* 4KB. */
11244         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_4K \
11245                 (UINT32_C(0x0) << 4)
11246         /* 8KB. */
11247         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8K \
11248                 (UINT32_C(0x1) << 4)
11249         /* 64KB. */
11250         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_64K \
11251                 (UINT32_C(0x2) << 4)
11252         /* 2MB. */
11253         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_2M \
11254                 (UINT32_C(0x3) << 4)
11255         /* 8MB. */
11256         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_8M \
11257                 (UINT32_C(0x4) << 4)
11258         /* 1GB. */
11259         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G \
11260                 (UINT32_C(0x5) << 4)
11261         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_LAST \
11262                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING1_PG_SIZE_PG_1G
11263         /* TQM ring 2 page size and level. */
11264         uint8_t tqm_ring2_pg_size_tqm_ring2_lvl;
11265         /* TQM ring 2 PBL indirect levels. */
11266         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_MASK \
11267                 UINT32_C(0xf)
11268         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_SFT       0
11269         /* PBL pointer is physical start address. */
11270         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_0 \
11271                 UINT32_C(0x0)
11272         /* PBL pointer points to PTE table. */
11273         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_1 \
11274                 UINT32_C(0x1)
11275         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11276         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2 \
11277                 UINT32_C(0x2)
11278         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LAST \
11279                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_LVL_LVL_2
11280         /* TQM ring 2 page size. */
11281         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_MASK \
11282                 UINT32_C(0xf0)
11283         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_SFT   4
11284         /* 4KB. */
11285         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_4K \
11286                 (UINT32_C(0x0) << 4)
11287         /* 8KB. */
11288         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8K \
11289                 (UINT32_C(0x1) << 4)
11290         /* 64KB. */
11291         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_64K \
11292                 (UINT32_C(0x2) << 4)
11293         /* 2MB. */
11294         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_2M \
11295                 (UINT32_C(0x3) << 4)
11296         /* 8MB. */
11297         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_8M \
11298                 (UINT32_C(0x4) << 4)
11299         /* 1GB. */
11300         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G \
11301                 (UINT32_C(0x5) << 4)
11302         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_LAST \
11303                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING2_PG_SIZE_PG_1G
11304         /* TQM ring 3 page size and level. */
11305         uint8_t tqm_ring3_pg_size_tqm_ring3_lvl;
11306         /* TQM ring 3 PBL indirect levels. */
11307         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_MASK \
11308                 UINT32_C(0xf)
11309         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_SFT       0
11310         /* PBL pointer is physical start address. */
11311         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_0 \
11312                 UINT32_C(0x0)
11313         /* PBL pointer points to PTE table. */
11314         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_1 \
11315                 UINT32_C(0x1)
11316         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11317         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2 \
11318                 UINT32_C(0x2)
11319         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LAST \
11320                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_LVL_LVL_2
11321         /* TQM ring 3 page size. */
11322         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_MASK \
11323                 UINT32_C(0xf0)
11324         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_SFT   4
11325         /* 4KB. */
11326         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_4K \
11327                 (UINT32_C(0x0) << 4)
11328         /* 8KB. */
11329         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8K \
11330                 (UINT32_C(0x1) << 4)
11331         /* 64KB. */
11332         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_64K \
11333                 (UINT32_C(0x2) << 4)
11334         /* 2MB. */
11335         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_2M \
11336                 (UINT32_C(0x3) << 4)
11337         /* 8MB. */
11338         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_8M \
11339                 (UINT32_C(0x4) << 4)
11340         /* 1GB. */
11341         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G \
11342                 (UINT32_C(0x5) << 4)
11343         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_LAST \
11344                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING3_PG_SIZE_PG_1G
11345         /* TQM ring 4 page size and level. */
11346         uint8_t tqm_ring4_pg_size_tqm_ring4_lvl;
11347         /* TQM ring 4 PBL indirect levels. */
11348         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_MASK \
11349                 UINT32_C(0xf)
11350         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_SFT       0
11351         /* PBL pointer is physical start address. */
11352         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_0 \
11353                 UINT32_C(0x0)
11354         /* PBL pointer points to PTE table. */
11355         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_1 \
11356                 UINT32_C(0x1)
11357         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11358         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2 \
11359                 UINT32_C(0x2)
11360         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LAST \
11361                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_LVL_LVL_2
11362         /* TQM ring 4 page size. */
11363         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_MASK \
11364                 UINT32_C(0xf0)
11365         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_SFT   4
11366         /* 4KB. */
11367         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_4K \
11368                 (UINT32_C(0x0) << 4)
11369         /* 8KB. */
11370         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8K \
11371                 (UINT32_C(0x1) << 4)
11372         /* 64KB. */
11373         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_64K \
11374                 (UINT32_C(0x2) << 4)
11375         /* 2MB. */
11376         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_2M \
11377                 (UINT32_C(0x3) << 4)
11378         /* 8MB. */
11379         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_8M \
11380                 (UINT32_C(0x4) << 4)
11381         /* 1GB. */
11382         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G \
11383                 (UINT32_C(0x5) << 4)
11384         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_LAST \
11385                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING4_PG_SIZE_PG_1G
11386         /* TQM ring 5 page size and level. */
11387         uint8_t tqm_ring5_pg_size_tqm_ring5_lvl;
11388         /* TQM ring 5 PBL indirect levels. */
11389         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_MASK \
11390                 UINT32_C(0xf)
11391         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_SFT       0
11392         /* PBL pointer is physical start address. */
11393         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_0 \
11394                 UINT32_C(0x0)
11395         /* PBL pointer points to PTE table. */
11396         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_1 \
11397                 UINT32_C(0x1)
11398         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11399         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2 \
11400                 UINT32_C(0x2)
11401         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LAST \
11402                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_LVL_LVL_2
11403         /* TQM ring 5 page size. */
11404         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_MASK \
11405                 UINT32_C(0xf0)
11406         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_SFT   4
11407         /* 4KB. */
11408         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_4K \
11409                 (UINT32_C(0x0) << 4)
11410         /* 8KB. */
11411         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8K \
11412                 (UINT32_C(0x1) << 4)
11413         /* 64KB. */
11414         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_64K \
11415                 (UINT32_C(0x2) << 4)
11416         /* 2MB. */
11417         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_2M \
11418                 (UINT32_C(0x3) << 4)
11419         /* 8MB. */
11420         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_8M \
11421                 (UINT32_C(0x4) << 4)
11422         /* 1GB. */
11423         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G \
11424                 (UINT32_C(0x5) << 4)
11425         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_LAST \
11426                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING5_PG_SIZE_PG_1G
11427         /* TQM ring 6 page size and level. */
11428         uint8_t tqm_ring6_pg_size_tqm_ring6_lvl;
11429         /* TQM ring 6 PBL indirect levels. */
11430         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_MASK \
11431                 UINT32_C(0xf)
11432         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_SFT       0
11433         /* PBL pointer is physical start address. */
11434         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_0 \
11435                 UINT32_C(0x0)
11436         /* PBL pointer points to PTE table. */
11437         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_1 \
11438                 UINT32_C(0x1)
11439         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11440         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2 \
11441                 UINT32_C(0x2)
11442         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LAST \
11443                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_LVL_LVL_2
11444         /* TQM ring 6 page size. */
11445         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_MASK \
11446                 UINT32_C(0xf0)
11447         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_SFT   4
11448         /* 4KB. */
11449         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_4K \
11450                 (UINT32_C(0x0) << 4)
11451         /* 8KB. */
11452         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8K \
11453                 (UINT32_C(0x1) << 4)
11454         /* 64KB. */
11455         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_64K \
11456                 (UINT32_C(0x2) << 4)
11457         /* 2MB. */
11458         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_2M \
11459                 (UINT32_C(0x3) << 4)
11460         /* 8MB. */
11461         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_8M \
11462                 (UINT32_C(0x4) << 4)
11463         /* 1GB. */
11464         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G \
11465                 (UINT32_C(0x5) << 4)
11466         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_LAST \
11467                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING6_PG_SIZE_PG_1G
11468         /* TQM ring 7 page size and level. */
11469         uint8_t tqm_ring7_pg_size_tqm_ring7_lvl;
11470         /* TQM ring 7 PBL indirect levels. */
11471         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_MASK \
11472                 UINT32_C(0xf)
11473         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_SFT       0
11474         /* PBL pointer is physical start address. */
11475         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_0 \
11476                 UINT32_C(0x0)
11477         /* PBL pointer points to PTE table. */
11478         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_1 \
11479                 UINT32_C(0x1)
11480         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11481         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2 \
11482                 UINT32_C(0x2)
11483         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LAST \
11484                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_LVL_LVL_2
11485         /* TQM ring 7 page size. */
11486         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_MASK \
11487                 UINT32_C(0xf0)
11488         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_SFT   4
11489         /* 4KB. */
11490         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_4K \
11491                 (UINT32_C(0x0) << 4)
11492         /* 8KB. */
11493         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8K \
11494                 (UINT32_C(0x1) << 4)
11495         /* 64KB. */
11496         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_64K \
11497                 (UINT32_C(0x2) << 4)
11498         /* 2MB. */
11499         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_2M \
11500                 (UINT32_C(0x3) << 4)
11501         /* 8MB. */
11502         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_8M \
11503                 (UINT32_C(0x4) << 4)
11504         /* 1GB. */
11505         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G \
11506                 (UINT32_C(0x5) << 4)
11507         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_LAST \
11508                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TQM_RING7_PG_SIZE_PG_1G
11509         /* MR/AV page size and level. */
11510         uint8_t mrav_pg_size_mrav_lvl;
11511         /* MR/AV PBL indirect levels. */
11512         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_MASK \
11513                 UINT32_C(0xf)
11514         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_SFT       0
11515         /* PBL pointer is physical start address. */
11516         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_0 \
11517                 UINT32_C(0x0)
11518         /* PBL pointer points to PTE table. */
11519         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_1 \
11520                 UINT32_C(0x1)
11521         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11522         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2 \
11523                 UINT32_C(0x2)
11524         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LAST \
11525                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_LVL_LVL_2
11526         /* MR/AV page size. */
11527         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_MASK \
11528                 UINT32_C(0xf0)
11529         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_SFT   4
11530         /* 4KB. */
11531         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_4K \
11532                 (UINT32_C(0x0) << 4)
11533         /* 8KB. */
11534         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8K \
11535                 (UINT32_C(0x1) << 4)
11536         /* 64KB. */
11537         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_64K \
11538                 (UINT32_C(0x2) << 4)
11539         /* 2MB. */
11540         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_2M \
11541                 (UINT32_C(0x3) << 4)
11542         /* 8MB. */
11543         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_8M \
11544                 (UINT32_C(0x4) << 4)
11545         /* 1GB. */
11546         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G \
11547                 (UINT32_C(0x5) << 4)
11548         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_LAST \
11549                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_MRAV_PG_SIZE_PG_1G
11550         /* Timer page size and level. */
11551         uint8_t tim_pg_size_tim_lvl;
11552         /* Timer PBL indirect levels. */
11553         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_MASK \
11554                 UINT32_C(0xf)
11555         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_SFT       0
11556         /* PBL pointer is physical start address. */
11557         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_0 \
11558                 UINT32_C(0x0)
11559         /* PBL pointer points to PTE table. */
11560         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_1 \
11561                 UINT32_C(0x1)
11562         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
11563         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2 \
11564                 UINT32_C(0x2)
11565         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LAST \
11566                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_LVL_LVL_2
11567         /* Timer page size. */
11568         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_MASK \
11569                 UINT32_C(0xf0)
11570         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_SFT   4
11571         /* 4KB. */
11572         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_4K \
11573                 (UINT32_C(0x0) << 4)
11574         /* 8KB. */
11575         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8K \
11576                 (UINT32_C(0x1) << 4)
11577         /* 64KB. */
11578         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_64K \
11579                 (UINT32_C(0x2) << 4)
11580         /* 2MB. */
11581         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_2M \
11582                 (UINT32_C(0x3) << 4)
11583         /* 8MB. */
11584         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_8M \
11585                 (UINT32_C(0x4) << 4)
11586         /* 1GB. */
11587         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G \
11588                 (UINT32_C(0x5) << 4)
11589         #define HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_LAST \
11590                 HWRM_FUNC_BACKING_STORE_QCFG_OUTPUT_TIM_PG_SIZE_PG_1G
11591         /* QP page directory. */
11592         uint64_t        qpc_page_dir;
11593         /* SRQ page directory. */
11594         uint64_t        srq_page_dir;
11595         /* CQ page directory. */
11596         uint64_t        cq_page_dir;
11597         /* VNIC page directory. */
11598         uint64_t        vnic_page_dir;
11599         /* Stat page directory. */
11600         uint64_t        stat_page_dir;
11601         /* TQM slowpath page directory. */
11602         uint64_t        tqm_sp_page_dir;
11603         /* TQM ring 0 page directory. */
11604         uint64_t        tqm_ring0_page_dir;
11605         /* TQM ring 1 page directory. */
11606         uint64_t        tqm_ring1_page_dir;
11607         /* TQM ring 2 page directory. */
11608         uint64_t        tqm_ring2_page_dir;
11609         /* TQM ring 3 page directory. */
11610         uint64_t        tqm_ring3_page_dir;
11611         /* TQM ring 4 page directory. */
11612         uint64_t        tqm_ring4_page_dir;
11613         /* TQM ring 5 page directory. */
11614         uint64_t        tqm_ring5_page_dir;
11615         /* TQM ring 6 page directory. */
11616         uint64_t        tqm_ring6_page_dir;
11617         /* TQM ring 7 page directory. */
11618         uint64_t        tqm_ring7_page_dir;
11619         /* MR/AV page directory. */
11620         uint64_t        mrav_page_dir;
11621         /* Timer page directory. */
11622         uint64_t        tim_page_dir;
11623         /* Number of entries to reserve for QP1 */
11624         uint16_t        qp_num_qp1_entries;
11625         /* Number of entries to reserve for L2 */
11626         uint16_t        qp_num_l2_entries;
11627         /* Number of QPs. */
11628         uint32_t        qp_num_entries;
11629         /* Number of SRQs. */
11630         uint32_t        srq_num_entries;
11631         /* Number of entries to reserve for L2 */
11632         uint16_t        srq_num_l2_entries;
11633         /* Number of entries to reserve for L2 */
11634         uint16_t        cq_num_l2_entries;
11635         /* Number of CQs. */
11636         uint32_t        cq_num_entries;
11637         /* Number of entries to reserve for VNIC entries */
11638         uint16_t        vnic_num_vnic_entries;
11639         /* Number of entries to reserve for Ring table entries */
11640         uint16_t        vnic_num_ring_table_entries;
11641         /* Number of Stats. */
11642         uint32_t        stat_num_entries;
11643         /* Number of TQM slowpath entries. */
11644         uint32_t        tqm_sp_num_entries;
11645         /* Number of TQM ring 0 entries. */
11646         uint32_t        tqm_ring0_num_entries;
11647         /* Number of TQM ring 1 entries. */
11648         uint32_t        tqm_ring1_num_entries;
11649         /* Number of TQM ring 2 entries. */
11650         uint32_t        tqm_ring2_num_entries;
11651         /* Number of TQM ring 3 entries. */
11652         uint32_t        tqm_ring3_num_entries;
11653         /* Number of TQM ring 4 entries. */
11654         uint32_t        tqm_ring4_num_entries;
11655         /* Number of TQM ring 5 entries. */
11656         uint32_t        tqm_ring5_num_entries;
11657         /* Number of TQM ring 6 entries. */
11658         uint32_t        tqm_ring6_num_entries;
11659         /* Number of TQM ring 7 entries. */
11660         uint32_t        tqm_ring7_num_entries;
11661         /*
11662          * If the MR/AV split reservation flag is not set, then this field
11663          * represents the total number of MR plus AV entries. For versions
11664          * of firmware that support the split reservation, when it is not
11665          * specified half of the entries will be reserved for MRs and the
11666          * other half for AVs.
11667          *
11668          * If the MR/AV split reservation flag is set, then this
11669          * field is logically divided into two 16b fields. Bits `[31:16]`
11670          * represents the `mr_num_entries` and bits `[15:0]` represents
11671          * `av_num_entries`. The granularity of these values is defined by
11672          * the `mrav_num_entries_unit` field returned by the
11673          * `backing_store_qcaps` command.
11674          */
11675         uint32_t        mrav_num_entries;
11676         /* Number of Timer entries. */
11677         uint32_t        tim_num_entries;
11678         uint8_t unused_1[7];
11679         /*
11680          * This field is used in Output records to indicate that the output
11681          * is completely written to RAM.  This field should be read as 1
11682          * to indicate that the output has been completely written.
11683          * When writing a command completion or response to an internal
11684          * processor, the order of writes has to be such that this field
11685          * is written last.
11686          */
11687         uint8_t valid;
11688 } __attribute__((packed));
11689
11690 /****************************
11691  * hwrm_error_recovery_qcfg *
11692  ****************************/
11693
11694
11695 /* hwrm_error_recovery_qcfg_input (size:192b/24B) */
11696 struct hwrm_error_recovery_qcfg_input {
11697         /* The HWRM command request type. */
11698         uint16_t        req_type;
11699         /*
11700          * The completion ring to send the completion event on. This should
11701          * be the NQ ID returned from the `nq_alloc` HWRM command.
11702          */
11703         uint16_t        cmpl_ring;
11704         /*
11705          * The sequence ID is used by the driver for tracking multiple
11706          * commands. This ID is treated as opaque data by the firmware and
11707          * the value is returned in the `hwrm_resp_hdr` upon completion.
11708          */
11709         uint16_t        seq_id;
11710         /*
11711          * The target ID of the command:
11712          * * 0x0-0xFFF8 - The function ID
11713          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
11714          * * 0xFFFD - Reserved for user-space HWRM interface
11715          * * 0xFFFF - HWRM
11716          */
11717         uint16_t        target_id;
11718         /*
11719          * A physical address pointer pointing to a host buffer that the
11720          * command's response data will be written. This can be either a host
11721          * physical address (HPA) or a guest physical address (GPA) and must
11722          * point to a physically contiguous block of memory.
11723          */
11724         uint64_t        resp_addr;
11725         uint8_t unused_0[8];
11726 } __attribute__((packed));
11727
11728 /* hwrm_error_recovery_qcfg_output (size:1664b/208B) */
11729 struct hwrm_error_recovery_qcfg_output {
11730         /* The specific error status for the command. */
11731         uint16_t        error_code;
11732         /* The HWRM command request type. */
11733         uint16_t        req_type;
11734         /* The sequence ID from the original command. */
11735         uint16_t        seq_id;
11736         /* The length of the response data in number of bytes. */
11737         uint16_t        resp_len;
11738         uint32_t        flags;
11739         /*
11740          * When this flag is set to 1, error recovery will be initiated
11741          * through master function driver.
11742          */
11743         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST       UINT32_C(0x1)
11744         /*
11745          * When this flag is set to 1, error recovery will be performed
11746          * through Co processor.
11747          */
11748         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU     UINT32_C(0x2)
11749         /*
11750          * Driver Polling frequency. This value is in units of 100msec.
11751          * Typical value would be 10 to indicate 1sec.
11752          * Drivers can poll FW health status, Heartbeat, reset_counter with
11753          * this frequency.
11754          */
11755         uint32_t        driver_polling_freq;
11756         /*
11757          * This value is in units of 100msec.
11758          * Typical value would be 30 to indicate 3sec.
11759          * Master function wait period from detecting a fatal error to
11760          * initiating reset. In this time period Master PF expects every
11761          * active driver will detect fatal error.
11762          */
11763         uint32_t        master_func_wait_period;
11764         /*
11765          * This value is in units of 100msec.
11766          * Typical value would be 50 to indicate 5sec.
11767          * Normal function wait period from fatal error detection to
11768          * polling FW health status. In this time period, drivers should not
11769          * do any PCIe MMIO transaction and should not send any HWRM commands.
11770          */
11771         uint32_t        normal_func_wait_period;
11772         /*
11773          * This value is in units of 100msec.
11774          * Typical value would be 20 to indicate 2sec.
11775          * This field indicates that, master function wait period after chip
11776          * reset. After this time, master function should reinitialize with
11777          * FW.
11778          */
11779         uint32_t        master_func_wait_period_after_reset;
11780         /*
11781          * This value is in units of 100msec.
11782          * Typical value would be 60 to indicate 6sec.
11783          * This field is applicable to both master and normal functions.
11784          * Even after chip reset, if FW status not changed to ready,
11785          * then all the functions can poll for this much time and bailout.
11786          */
11787         uint32_t        max_bailout_time_after_reset;
11788         /*
11789          * FW health status register.
11790          * Lower 2 bits indicates address space location and upper 30 bits
11791          * indicates upper 30bits of the register address.
11792          * A value of 0xFFFF-FFFF indicates this register does not exist.
11793          */
11794         uint32_t        fw_health_status_reg;
11795         /* Lower 2 bits indicates address space location. */
11796         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_MASK \
11797                 UINT32_C(0x3)
11798         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_SFT \
11799                 0
11800         /*
11801          * If value is 0, this register is located in PCIe config space.
11802          * Drivers have to map appropriate window to access this
11803          * register.
11804          */
11805         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_PCIE_CFG \
11806                 UINT32_C(0x0)
11807         /*
11808          * If value is 1, this register is located in GRC address space.
11809          * Drivers have to map appropriate window to access this
11810          * register.
11811          */
11812         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_GRC \
11813                 UINT32_C(0x1)
11814         /*
11815          * If value is 2, this register is located in first BAR address
11816          * space. 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_BAR0 \
11820                 UINT32_C(0x2)
11821         /*
11822          * If value is 3, this register is located in second BAR address
11823          * space. Drivers have to map appropriate window to access this
11824          * Drivers have to map appropriate window to access this
11825          * register.
11826          */
11827         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1 \
11828                 UINT32_C(0x3)
11829         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_LAST \
11830                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SPACE_BAR1
11831         /* Upper 30bits of the register address. */
11832         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_MASK \
11833                 UINT32_C(0xfffffffc)
11834         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEALTH_STATUS_REG_ADDR_SFT \
11835                 2
11836         /*
11837          * FW HeartBeat register.
11838          * Lower 2 bits indicates address space location and upper 30 bits
11839          * indicates actual address.
11840          * A value of 0xFFFF-FFFF indicates this register does not exist.
11841          */
11842         uint32_t        fw_heartbeat_reg;
11843         /* Lower 2 bits indicates address space location. */
11844         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_MASK \
11845                 UINT32_C(0x3)
11846         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_SFT \
11847                 0
11848         /*
11849          * If value is 0, this register is located in PCIe config space.
11850          * Drivers have to map appropriate window to access this
11851          * register.
11852          */
11853         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_PCIE_CFG \
11854                 UINT32_C(0x0)
11855         /*
11856          * If value is 1, this register is located in GRC address space.
11857          * Drivers have to map appropriate window to access this
11858          * register.
11859          */
11860         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_GRC \
11861                 UINT32_C(0x1)
11862         /*
11863          * If value is 2, this register is located in first BAR address
11864          * space. Drivers have to map appropriate window to access this
11865          * register.
11866          */
11867         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR0 \
11868                 UINT32_C(0x2)
11869         /*
11870          * If value is 3, this register is located in second BAR address
11871          * space. Drivers have to map appropriate window to access this
11872          * register.
11873          */
11874         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1 \
11875                 UINT32_C(0x3)
11876         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_LAST \
11877                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SPACE_BAR1
11878         /* Upper 30bits of the register address. */
11879         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_MASK \
11880                 UINT32_C(0xfffffffc)
11881         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_HEARTBEAT_REG_ADDR_SFT \
11882                 2
11883         /*
11884          * FW reset counter.
11885          * Lower 2 bits indicates address space location and upper 30 bits
11886          * indicates actual address.
11887          * A value of 0xFFFF-FFFF indicates this register does not exist.
11888          */
11889         uint32_t        fw_reset_cnt_reg;
11890         /* Lower 2 bits indicates address space location. */
11891         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_MASK \
11892                 UINT32_C(0x3)
11893         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_SFT \
11894                 0
11895         /*
11896          * If value is 0, this register is located in PCIe config space.
11897          * Drivers have to map appropriate window to access this
11898          * register.
11899          */
11900         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_PCIE_CFG \
11901                 UINT32_C(0x0)
11902         /*
11903          * If value is 1, this register is located in GRC address space.
11904          * Drivers have to map appropriate window to access this
11905          * register.
11906          */
11907         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_GRC \
11908                 UINT32_C(0x1)
11909         /*
11910          * If value is 2, this register is located in first BAR address
11911          * space. Drivers have to map appropriate window to access this
11912          * register.
11913          */
11914         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR0 \
11915                 UINT32_C(0x2)
11916         /*
11917          * If value is 3, this register is located in second BAR address
11918          * space. Drivers have to map appropriate window to access this
11919          * register.
11920          */
11921         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1 \
11922                 UINT32_C(0x3)
11923         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_LAST \
11924                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SPACE_BAR1
11925         /* Upper 30bits of the register address. */
11926         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_MASK \
11927                 UINT32_C(0xfffffffc)
11928         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FW_RESET_CNT_REG_ADDR_SFT \
11929                 2
11930         /*
11931          * Reset Inprogress Register address for PFs.
11932          * Lower 2 bits indicates address space location and upper 30 bits
11933          * indicates actual address.
11934          * A value of 0xFFFF-FFFF indicates this register does not exist.
11935          */
11936         uint32_t        reset_inprogress_reg;
11937         /* Lower 2 bits indicates address space location. */
11938         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_MASK \
11939                 UINT32_C(0x3)
11940         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_SFT \
11941                 0
11942         /*
11943          * If value is 0, this register is located in PCIe config space.
11944          * Drivers have to map appropriate window to access this
11945          * register.
11946          */
11947         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_PCIE_CFG \
11948                 UINT32_C(0x0)
11949         /*
11950          * If value is 1, this register is located in GRC address space.
11951          * Drivers have to map appropriate window to access this
11952          * register.
11953          */
11954         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_GRC \
11955                 UINT32_C(0x1)
11956         /*
11957          * If value is 2, this register is located in first BAR address
11958          * space. Drivers have to map appropriate window to access this
11959          * register.
11960          */
11961         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR0 \
11962                 UINT32_C(0x2)
11963         /*
11964          * If value is 3, this register is located in second BAR address
11965          * space. Drivers have to map appropriate window to access this
11966          * register.
11967          */
11968         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1 \
11969                 UINT32_C(0x3)
11970         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_LAST \
11971                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SPACE_BAR1
11972         /* Upper 30bits of the register address. */
11973         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_MASK \
11974                 UINT32_C(0xfffffffc)
11975         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_INPROGRESS_REG_ADDR_SFT \
11976                 2
11977         /* This field indicates the mask value for reset_inprogress_reg. */
11978         uint32_t        reset_inprogress_reg_mask;
11979         uint8_t unused_0[3];
11980         /*
11981          * Array of registers and value count to reset the Chip
11982          * Each array count has reset_reg, reset_reg_val, delay_after_reset
11983          * in TLV format. Depending upon Chip type, number of reset registers
11984          * will vary. Drivers have to write reset_reg_val in the reset_reg
11985          * location in the same sequence in order to recover from a fatal
11986          * error.
11987          */
11988         uint8_t reg_array_cnt;
11989         /*
11990          * Reset register.
11991          * Lower 2 bits indicates address space location and upper 30 bits
11992          * indicates actual address.
11993          * A value of 0xFFFF-FFFF indicates this register does not exist.
11994          */
11995         uint32_t        reset_reg[16];
11996         /* Lower 2 bits indicates address space location. */
11997         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_MASK \
11998                 UINT32_C(0x3)
11999         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_SFT     0
12000         /*
12001          * If value is 0, this register is located in PCIe config space.
12002          * Drivers have to map appropriate window to access this
12003          * register.
12004          */
12005         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_PCIE_CFG \
12006                 UINT32_C(0x0)
12007         /*
12008          * If value is 1, this register is located in GRC address space.
12009          * Drivers have to map appropriate window to access this
12010          * register.
12011          */
12012         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_GRC \
12013                 UINT32_C(0x1)
12014         /*
12015          * If value is 2, this register is located in first BAR address
12016          * space. Drivers have to map appropriate window to access this
12017          * register.
12018          */
12019         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR0 \
12020                 UINT32_C(0x2)
12021         /*
12022          * If value is 3, this register is located in second BAR address
12023          * space. Drivers have to map appropriate window to access this
12024          * register.
12025          */
12026         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1 \
12027                 UINT32_C(0x3)
12028         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_LAST \
12029                 HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SPACE_BAR1
12030         /* Upper 30bits of the register address. */
12031         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_MASK \
12032                 UINT32_C(0xfffffffc)
12033         #define HWRM_ERROR_RECOVERY_QCFG_OUTPUT_RESET_REG_ADDR_SFT           2
12034         /* Value to be written in reset_reg to reset the controller. */
12035         uint32_t        reset_reg_val[16];
12036         /*
12037          * This value is in units of 1msec.
12038          * Typical value would be 10 to indicate 10msec.
12039          * Some of the operations like Core reset require delay before
12040          * accessing PCIE MMIO register space.
12041          * If this value is non-zero, drivers have to wait for
12042          * this much time after writing reset_reg_val in reset_reg.
12043          */
12044         uint8_t delay_after_reset[16];
12045         uint8_t unused_1[7];
12046         /*
12047          * This field is used in Output records to indicate that the output
12048          * is completely written to RAM.  This field should be read as '1'
12049          * to indicate that the output has been completely written.
12050          * When writing a command completion or response to an internal
12051          * processor, the order of writes has to be such that this field
12052          * is written last.
12053          */
12054         uint8_t valid;
12055 } __attribute__((packed));
12056
12057 /***********************
12058  * hwrm_func_vlan_qcfg *
12059  ***********************/
12060
12061
12062 /* hwrm_func_vlan_qcfg_input (size:192b/24B) */
12063 struct hwrm_func_vlan_qcfg_input {
12064         /* The HWRM command request type. */
12065         uint16_t        req_type;
12066         /*
12067          * The completion ring to send the completion event on. This should
12068          * be the NQ ID returned from the `nq_alloc` HWRM command.
12069          */
12070         uint16_t        cmpl_ring;
12071         /*
12072          * The sequence ID is used by the driver for tracking multiple
12073          * commands. This ID is treated as opaque data by the firmware and
12074          * the value is returned in the `hwrm_resp_hdr` upon completion.
12075          */
12076         uint16_t        seq_id;
12077         /*
12078          * The target ID of the command:
12079          * * 0x0-0xFFF8 - The function ID
12080          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12081          * * 0xFFFD - Reserved for user-space HWRM interface
12082          * * 0xFFFF - HWRM
12083          */
12084         uint16_t        target_id;
12085         /*
12086          * A physical address pointer pointing to a host buffer that the
12087          * command's response data will be written. This can be either a host
12088          * physical address (HPA) or a guest physical address (GPA) and must
12089          * point to a physically contiguous block of memory.
12090          */
12091         uint64_t        resp_addr;
12092         /*
12093          * Function ID of the function that is being
12094          * configured.
12095          * If set to 0xFF... (All Fs), then the configuration is
12096          * for the requesting function.
12097          */
12098         uint16_t        fid;
12099         uint8_t unused_0[6];
12100 } __attribute__((packed));
12101
12102 /* hwrm_func_vlan_qcfg_output (size:320b/40B) */
12103 struct hwrm_func_vlan_qcfg_output {
12104         /* The specific error status for the command. */
12105         uint16_t        error_code;
12106         /* The HWRM command request type. */
12107         uint16_t        req_type;
12108         /* The sequence ID from the original command. */
12109         uint16_t        seq_id;
12110         /* The length of the response data in number of bytes. */
12111         uint16_t        resp_len;
12112         uint64_t        unused_0;
12113         /* S-TAG VLAN identifier configured for the function. */
12114         uint16_t        stag_vid;
12115         /* S-TAG PCP value configured for the function. */
12116         uint8_t stag_pcp;
12117         uint8_t unused_1;
12118         /*
12119          * S-TAG TPID value configured for the function. This field is specified in
12120          * network byte order.
12121          */
12122         uint16_t        stag_tpid;
12123         /* C-TAG VLAN identifier configured for the function. */
12124         uint16_t        ctag_vid;
12125         /* C-TAG PCP value configured for the function. */
12126         uint8_t ctag_pcp;
12127         uint8_t unused_2;
12128         /*
12129          * C-TAG TPID value configured for the function. This field is specified in
12130          * network byte order.
12131          */
12132         uint16_t        ctag_tpid;
12133         /* Future use. */
12134         uint32_t        rsvd2;
12135         /* Future use. */
12136         uint32_t        rsvd3;
12137         uint8_t unused_3[3];
12138         /*
12139          * This field is used in Output records to indicate that the output
12140          * is completely written to RAM.  This field should be read as '1'
12141          * to indicate that the output has been completely written.
12142          * When writing a command completion or response to an internal processor,
12143          * the order of writes has to be such that this field is written last.
12144          */
12145         uint8_t valid;
12146 } __attribute__((packed));
12147
12148 /**********************
12149  * hwrm_func_vlan_cfg *
12150  **********************/
12151
12152
12153 /* hwrm_func_vlan_cfg_input (size:384b/48B) */
12154 struct hwrm_func_vlan_cfg_input {
12155         /* The HWRM command request type. */
12156         uint16_t        req_type;
12157         /*
12158          * The completion ring to send the completion event on. This should
12159          * be the NQ ID returned from the `nq_alloc` HWRM command.
12160          */
12161         uint16_t        cmpl_ring;
12162         /*
12163          * The sequence ID is used by the driver for tracking multiple
12164          * commands. This ID is treated as opaque data by the firmware and
12165          * the value is returned in the `hwrm_resp_hdr` upon completion.
12166          */
12167         uint16_t        seq_id;
12168         /*
12169          * The target ID of the command:
12170          * * 0x0-0xFFF8 - The function ID
12171          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12172          * * 0xFFFD - Reserved for user-space HWRM interface
12173          * * 0xFFFF - HWRM
12174          */
12175         uint16_t        target_id;
12176         /*
12177          * A physical address pointer pointing to a host buffer that the
12178          * command's response data will be written. This can be either a host
12179          * physical address (HPA) or a guest physical address (GPA) and must
12180          * point to a physically contiguous block of memory.
12181          */
12182         uint64_t        resp_addr;
12183         /*
12184          * Function ID of the function that is being
12185          * configured.
12186          * If set to 0xFF... (All Fs), then the configuration is
12187          * for the requesting function.
12188          */
12189         uint16_t        fid;
12190         uint8_t unused_0[2];
12191         uint32_t        enables;
12192         /*
12193          * This bit must be '1' for the stag_vid field to be
12194          * configured.
12195          */
12196         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID      UINT32_C(0x1)
12197         /*
12198          * This bit must be '1' for the ctag_vid field to be
12199          * configured.
12200          */
12201         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID      UINT32_C(0x2)
12202         /*
12203          * This bit must be '1' for the stag_pcp field to be
12204          * configured.
12205          */
12206         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP      UINT32_C(0x4)
12207         /*
12208          * This bit must be '1' for the ctag_pcp field to be
12209          * configured.
12210          */
12211         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP      UINT32_C(0x8)
12212         /*
12213          * This bit must be '1' for the stag_tpid field to be
12214          * configured.
12215          */
12216         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID     UINT32_C(0x10)
12217         /*
12218          * This bit must be '1' for the ctag_tpid field to be
12219          * configured.
12220          */
12221         #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID     UINT32_C(0x20)
12222         /* S-TAG VLAN identifier configured for the function. */
12223         uint16_t        stag_vid;
12224         /* S-TAG PCP value configured for the function. */
12225         uint8_t stag_pcp;
12226         uint8_t unused_1;
12227         /*
12228          * S-TAG TPID value configured for the function. This field is specified in
12229          * network byte order.
12230          */
12231         uint16_t        stag_tpid;
12232         /* C-TAG VLAN identifier configured for the function. */
12233         uint16_t        ctag_vid;
12234         /* C-TAG PCP value configured for the function. */
12235         uint8_t ctag_pcp;
12236         uint8_t unused_2;
12237         /*
12238          * C-TAG TPID value configured for the function. This field is specified in
12239          * network byte order.
12240          */
12241         uint16_t        ctag_tpid;
12242         /* Future use. */
12243         uint32_t        rsvd1;
12244         /* Future use. */
12245         uint32_t        rsvd2;
12246         uint8_t unused_3[4];
12247 } __attribute__((packed));
12248
12249 /* hwrm_func_vlan_cfg_output (size:128b/16B) */
12250 struct hwrm_func_vlan_cfg_output {
12251         /* The specific error status for the command. */
12252         uint16_t        error_code;
12253         /* The HWRM command request type. */
12254         uint16_t        req_type;
12255         /* The sequence ID from the original command. */
12256         uint16_t        seq_id;
12257         /* The length of the response data in number of bytes. */
12258         uint16_t        resp_len;
12259         uint8_t unused_0[7];
12260         /*
12261          * This field is used in Output records to indicate that the output
12262          * is completely written to RAM.  This field should be read as '1'
12263          * to indicate that the output has been completely written.
12264          * When writing a command completion or response to an internal processor,
12265          * the order of writes has to be such that this field is written last.
12266          */
12267         uint8_t valid;
12268 } __attribute__((packed));
12269
12270 /*******************************
12271  * hwrm_func_vf_vnic_ids_query *
12272  *******************************/
12273
12274
12275 /* hwrm_func_vf_vnic_ids_query_input (size:256b/32B) */
12276 struct hwrm_func_vf_vnic_ids_query_input {
12277         /* The HWRM command request type. */
12278         uint16_t        req_type;
12279         /*
12280          * The completion ring to send the completion event on. This should
12281          * be the NQ ID returned from the `nq_alloc` HWRM command.
12282          */
12283         uint16_t        cmpl_ring;
12284         /*
12285          * The sequence ID is used by the driver for tracking multiple
12286          * commands. This ID is treated as opaque data by the firmware and
12287          * the value is returned in the `hwrm_resp_hdr` upon completion.
12288          */
12289         uint16_t        seq_id;
12290         /*
12291          * The target ID of the command:
12292          * * 0x0-0xFFF8 - The function ID
12293          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12294          * * 0xFFFD - Reserved for user-space HWRM interface
12295          * * 0xFFFF - HWRM
12296          */
12297         uint16_t        target_id;
12298         /*
12299          * A physical address pointer pointing to a host buffer that the
12300          * command's response data will be written. This can be either a host
12301          * physical address (HPA) or a guest physical address (GPA) and must
12302          * point to a physically contiguous block of memory.
12303          */
12304         uint64_t        resp_addr;
12305         /*
12306          * This value is used to identify a Virtual Function (VF).
12307          * The scope of VF ID is local within a PF.
12308          */
12309         uint16_t        vf_id;
12310         uint8_t unused_0[2];
12311         /* Max number of vnic ids in vnic id table */
12312         uint32_t        max_vnic_id_cnt;
12313         /* This is the address for VF VNIC ID table */
12314         uint64_t        vnic_id_tbl_addr;
12315 } __attribute__((packed));
12316
12317 /* hwrm_func_vf_vnic_ids_query_output (size:128b/16B) */
12318 struct hwrm_func_vf_vnic_ids_query_output {
12319         /* The specific error status for the command. */
12320         uint16_t        error_code;
12321         /* The HWRM command request type. */
12322         uint16_t        req_type;
12323         /* The sequence ID from the original command. */
12324         uint16_t        seq_id;
12325         /* The length of the response data in number of bytes. */
12326         uint16_t        resp_len;
12327         /*
12328          * Actual number of vnic ids
12329          *
12330          * Each VNIC ID is written as a 32-bit number.
12331          */
12332         uint32_t        vnic_id_cnt;
12333         uint8_t unused_0[3];
12334         /*
12335          * This field is used in Output records to indicate that the output
12336          * is completely written to RAM.  This field should be read as '1'
12337          * to indicate that the output has been completely written.
12338          * When writing a command completion or response to an internal processor,
12339          * the order of writes has to be such that this field is written last.
12340          */
12341         uint8_t valid;
12342 } __attribute__((packed));
12343
12344 /***********************
12345  * hwrm_func_vf_bw_cfg *
12346  ***********************/
12347
12348
12349 /* hwrm_func_vf_bw_cfg_input (size:960b/120B) */
12350 struct hwrm_func_vf_bw_cfg_input {
12351         /* The HWRM command request type. */
12352         uint16_t        req_type;
12353         /*
12354          * The completion ring to send the completion event on. This should
12355          * be the NQ ID returned from the `nq_alloc` HWRM command.
12356          */
12357         uint16_t        cmpl_ring;
12358         /*
12359          * The sequence ID is used by the driver for tracking multiple
12360          * commands. This ID is treated as opaque data by the firmware and
12361          * the value is returned in the `hwrm_resp_hdr` upon completion.
12362          */
12363         uint16_t        seq_id;
12364         /*
12365          * The target ID of the command:
12366          * * 0x0-0xFFF8 - The function ID
12367          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12368          * * 0xFFFD - Reserved for user-space HWRM interface
12369          * * 0xFFFF - HWRM
12370          */
12371         uint16_t        target_id;
12372         /*
12373          * A physical address pointer pointing to a host buffer that the
12374          * command's response data will be written. This can be either a host
12375          * physical address (HPA) or a guest physical address (GPA) and must
12376          * point to a physically contiguous block of memory.
12377          */
12378         uint64_t        resp_addr;
12379         /*
12380          * The number of VF functions that are being configured.
12381          * The cmd space allows up to 50 VFs' BW to be configured with one cmd.
12382          */
12383         uint16_t        num_vfs;
12384         uint16_t        unused[3];
12385         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
12386         uint16_t        vfn[48];
12387         /* The physical VF id the adjustment will be made to. */
12388         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_MASK     UINT32_C(0xfff)
12389         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_VFID_SFT      0
12390         /*
12391          * This field configures the rate scale percentage of the VF as specified
12392          * by the physical VF id.
12393          */
12394         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_MASK     UINT32_C(0xf000)
12395         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_SFT      12
12396         /* 0% of the max tx rate */
12397         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_0 \
12398                 (UINT32_C(0x0) << 12)
12399         /* 6.66% of the max tx rate */
12400         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_6_66 \
12401                 (UINT32_C(0x1) << 12)
12402         /* 13.33% of the max tx rate */
12403         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_13_33 \
12404                 (UINT32_C(0x2) << 12)
12405         /* 20% of the max tx rate */
12406         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_20 \
12407                 (UINT32_C(0x3) << 12)
12408         /* 26.66% of the max tx rate */
12409         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_26_66 \
12410                 (UINT32_C(0x4) << 12)
12411         /* 33% of the max tx rate */
12412         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_33_33 \
12413                 (UINT32_C(0x5) << 12)
12414         /* 40% of the max tx rate */
12415         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_40 \
12416                 (UINT32_C(0x6) << 12)
12417         /* 46.66% of the max tx rate */
12418         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_46_66 \
12419                 (UINT32_C(0x7) << 12)
12420         /* 53.33% of the max tx rate */
12421         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_53_33 \
12422                 (UINT32_C(0x8) << 12)
12423         /* 60% of the max tx rate */
12424         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_60 \
12425                 (UINT32_C(0x9) << 12)
12426         /* 66.66% of the max tx rate */
12427         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_66_66 \
12428                 (UINT32_C(0xa) << 12)
12429         /* 53.33% of the max tx rate */
12430         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_73_33 \
12431                 (UINT32_C(0xb) << 12)
12432         /* 80% of the max tx rate */
12433         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_80 \
12434                 (UINT32_C(0xc) << 12)
12435         /* 86.66% of the max tx rate */
12436         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_86_66 \
12437                 (UINT32_C(0xd) << 12)
12438         /* 93.33% of the max tx rate */
12439         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_93_33 \
12440                 (UINT32_C(0xe) << 12)
12441         /* 100% of the max tx rate */
12442         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100 \
12443                 (UINT32_C(0xf) << 12)
12444         #define HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_LAST \
12445                 HWRM_FUNC_VF_BW_CFG_INPUT_VFN_RATE_PCT_100
12446 } __attribute__((packed));
12447
12448 /* hwrm_func_vf_bw_cfg_output (size:128b/16B) */
12449 struct hwrm_func_vf_bw_cfg_output {
12450         /* The specific error status for the command. */
12451         uint16_t        error_code;
12452         /* The HWRM command request type. */
12453         uint16_t        req_type;
12454         /* The sequence ID from the original command. */
12455         uint16_t        seq_id;
12456         /* The length of the response data in number of bytes. */
12457         uint16_t        resp_len;
12458         uint8_t unused_0[7];
12459         /*
12460          * This field is used in Output records to indicate that the output
12461          * is completely written to RAM.  This field should be read as '1'
12462          * to indicate that the output has been completely written.
12463          * When writing a command completion or response to an internal processor,
12464          * the order of writes has to be such that this field is written last.
12465          */
12466         uint8_t valid;
12467 } __attribute__((packed));
12468
12469 /************************
12470  * hwrm_func_vf_bw_qcfg *
12471  ************************/
12472
12473
12474 /* hwrm_func_vf_bw_qcfg_input (size:960b/120B) */
12475 struct hwrm_func_vf_bw_qcfg_input {
12476         /* The HWRM command request type. */
12477         uint16_t        req_type;
12478         /*
12479          * The completion ring to send the completion event on. This should
12480          * be the NQ ID returned from the `nq_alloc` HWRM command.
12481          */
12482         uint16_t        cmpl_ring;
12483         /*
12484          * The sequence ID is used by the driver for tracking multiple
12485          * commands. This ID is treated as opaque data by the firmware and
12486          * the value is returned in the `hwrm_resp_hdr` upon completion.
12487          */
12488         uint16_t        seq_id;
12489         /*
12490          * The target ID of the command:
12491          * * 0x0-0xFFF8 - The function ID
12492          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12493          * * 0xFFFD - Reserved for user-space HWRM interface
12494          * * 0xFFFF - HWRM
12495          */
12496         uint16_t        target_id;
12497         /*
12498          * A physical address pointer pointing to a host buffer that the
12499          * command's response data will be written. This can be either a host
12500          * physical address (HPA) or a guest physical address (GPA) and must
12501          * point to a physically contiguous block of memory.
12502          */
12503         uint64_t        resp_addr;
12504         /*
12505          * The number of VF functions that are being queried.
12506          * The inline response space allows the host to query up to 50 VFs'
12507          * rate scale percentage
12508          */
12509         uint16_t        num_vfs;
12510         uint16_t        unused[3];
12511         /* These 16-bit fields contain the VF fid */
12512         uint16_t        vfn[48];
12513         /* The physical VF id of interest */
12514         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_MASK UINT32_C(0xfff)
12515         #define HWRM_FUNC_VF_BW_QCFG_INPUT_VFN_VFID_SFT 0
12516 } __attribute__((packed));
12517
12518 /* hwrm_func_vf_bw_qcfg_output (size:960b/120B) */
12519 struct hwrm_func_vf_bw_qcfg_output {
12520         /* The specific error status for the command. */
12521         uint16_t        error_code;
12522         /* The HWRM command request type. */
12523         uint16_t        req_type;
12524         /* The sequence ID from the original command. */
12525         uint16_t        seq_id;
12526         /* The length of the response data in number of bytes. */
12527         uint16_t        resp_len;
12528         /*
12529          * The number of VF functions that are being queried.
12530          * The inline response space allows the host to query up to 50 VFs' rate
12531          * scale percentage
12532          */
12533         uint16_t        num_vfs;
12534         uint16_t        unused[3];
12535         /* These 16-bit fields contain the VF fid and the rate scale percentage. */
12536         uint16_t        vfn[48];
12537         /* The physical VF id the adjustment will be made to. */
12538         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_MASK     UINT32_C(0xfff)
12539         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_VFID_SFT      0
12540         /*
12541          * This field configures the rate scale percentage of the VF as specified
12542          * by the physical VF id.
12543          */
12544         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_MASK     UINT32_C(0xf000)
12545         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_SFT      12
12546         /* 0% of the max tx rate */
12547         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_0 \
12548                 (UINT32_C(0x0) << 12)
12549         /* 6.66% of the max tx rate */
12550         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_6_66 \
12551                 (UINT32_C(0x1) << 12)
12552         /* 13.33% of the max tx rate */
12553         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_13_33 \
12554                 (UINT32_C(0x2) << 12)
12555         /* 20% of the max tx rate */
12556         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_20 \
12557                 (UINT32_C(0x3) << 12)
12558         /* 26.66% of the max tx rate */
12559         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_26_66 \
12560                 (UINT32_C(0x4) << 12)
12561         /* 33% of the max tx rate */
12562         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_33_33 \
12563                 (UINT32_C(0x5) << 12)
12564         /* 40% of the max tx rate */
12565         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_40 \
12566                 (UINT32_C(0x6) << 12)
12567         /* 46.66% of the max tx rate */
12568         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_46_66 \
12569                 (UINT32_C(0x7) << 12)
12570         /* 53.33% of the max tx rate */
12571         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_53_33 \
12572                 (UINT32_C(0x8) << 12)
12573         /* 60% of the max tx rate */
12574         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_60 \
12575                 (UINT32_C(0x9) << 12)
12576         /* 66.66% of the max tx rate */
12577         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_66_66 \
12578                 (UINT32_C(0xa) << 12)
12579         /* 53.33% of the max tx rate */
12580         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_73_33 \
12581                 (UINT32_C(0xb) << 12)
12582         /* 80% of the max tx rate */
12583         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_80 \
12584                 (UINT32_C(0xc) << 12)
12585         /* 86.66% of the max tx rate */
12586         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_86_66 \
12587                 (UINT32_C(0xd) << 12)
12588         /* 93.33% of the max tx rate */
12589         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_93_33 \
12590                 (UINT32_C(0xe) << 12)
12591         /* 100% of the max tx rate */
12592         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100 \
12593                 (UINT32_C(0xf) << 12)
12594         #define HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_LAST \
12595                 HWRM_FUNC_VF_BW_QCFG_OUTPUT_VFN_RATE_PCT_100
12596         uint8_t unused_0[7];
12597         /*
12598          * This field is used in Output records to indicate that the output
12599          * is completely written to RAM.  This field should be read as '1'
12600          * to indicate that the output has been completely written.
12601          * When writing a command completion or response to an internal processor,
12602          * the order of writes has to be such that this field is written last.
12603          */
12604         uint8_t valid;
12605 } __attribute__((packed));
12606
12607 /***************************
12608  * hwrm_func_drv_if_change *
12609  ***************************/
12610
12611
12612 /* hwrm_func_drv_if_change_input (size:192b/24B) */
12613 struct hwrm_func_drv_if_change_input {
12614         /* The HWRM command request type. */
12615         uint16_t        req_type;
12616         /*
12617          * The completion ring to send the completion event on. This should
12618          * be the NQ ID returned from the `nq_alloc` HWRM command.
12619          */
12620         uint16_t        cmpl_ring;
12621         /*
12622          * The sequence ID is used by the driver for tracking multiple
12623          * commands. This ID is treated as opaque data by the firmware and
12624          * the value is returned in the `hwrm_resp_hdr` upon completion.
12625          */
12626         uint16_t        seq_id;
12627         /*
12628          * The target ID of the command:
12629          * * 0x0-0xFFF8 - The function ID
12630          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12631          * * 0xFFFD - Reserved for user-space HWRM interface
12632          * * 0xFFFF - HWRM
12633          */
12634         uint16_t        target_id;
12635         /*
12636          * A physical address pointer pointing to a host buffer that the
12637          * command's response data will be written. This can be either a host
12638          * physical address (HPA) or a guest physical address (GPA) and must
12639          * point to a physically contiguous block of memory.
12640          */
12641         uint64_t        resp_addr;
12642         uint32_t        flags;
12643         /*
12644          * When this bit is '1', the function driver is indicating
12645          * that the IF state is changing to UP state.  The call should
12646          * be made at the beginning of the driver's open call before
12647          * resources are allocated.  After making the call, the driver
12648          * should check the response to see if any resources may have
12649          * changed (see the response below).  If the driver fails
12650          * the open call, the driver should make this call again with
12651          * this bit cleared to indicate that the IF state is not UP.
12652          * During the driver's close call when the IF state is changing
12653          * to DOWN, the driver should make this call with the bit cleared
12654          * after all resources have been freed.
12655          */
12656         #define HWRM_FUNC_DRV_IF_CHANGE_INPUT_FLAGS_UP     UINT32_C(0x1)
12657         uint32_t        unused;
12658 } __attribute__((packed));
12659
12660 /* hwrm_func_drv_if_change_output (size:128b/16B) */
12661 struct hwrm_func_drv_if_change_output {
12662         /* The specific error status for the command. */
12663         uint16_t        error_code;
12664         /* The HWRM command request type. */
12665         uint16_t        req_type;
12666         /* The sequence ID from the original command. */
12667         uint16_t        seq_id;
12668         /* The length of the response data in number of bytes. */
12669         uint16_t        resp_len;
12670         uint32_t        flags;
12671         /*
12672          * When this bit is '1', it indicates that the resources reserved
12673          * for this function may have changed.  The driver should check
12674          * resource capabilities and reserve resources again before
12675          * allocating resources.
12676          */
12677         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_RESC_CHANGE \
12678                 UINT32_C(0x1)
12679         /*
12680          * When this bit is '1', it indicates that the firmware got changed / reset.
12681          * The driver should do complete re-initialization when that bit is set.
12682          */
12683         #define HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE \
12684                 UINT32_C(0x2)
12685         uint8_t unused_0[3];
12686         /*
12687          * This field is used in Output records to indicate that the output
12688          * is completely written to RAM.  This field should be read as '1'
12689          * to indicate that the output has been completely written.
12690          * When writing a command completion or response to an internal processor,
12691          * the order of writes has to be such that this field is written last.
12692          */
12693         uint8_t valid;
12694 } __attribute__((packed));
12695
12696 /*******************************
12697  * hwrm_func_host_pf_ids_query *
12698  *******************************/
12699
12700
12701 /* hwrm_func_host_pf_ids_query_input (size:192b/24B) */
12702 struct hwrm_func_host_pf_ids_query_input {
12703         /* The HWRM command request type. */
12704         uint16_t        req_type;
12705         /*
12706          * The completion ring to send the completion event on. This should
12707          * be the NQ ID returned from the `nq_alloc` HWRM command.
12708          */
12709         uint16_t        cmpl_ring;
12710         /*
12711          * The sequence ID is used by the driver for tracking multiple
12712          * commands. This ID is treated as opaque data by the firmware and
12713          * the value is returned in the `hwrm_resp_hdr` upon completion.
12714          */
12715         uint16_t        seq_id;
12716         /*
12717          * The target ID of the command:
12718          * * 0x0-0xFFF8 - The function ID
12719          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12720          * * 0xFFFD - Reserved for user-space HWRM interface
12721          * * 0xFFFF - HWRM
12722          */
12723         uint16_t        target_id;
12724         /*
12725          * A physical address pointer pointing to a host buffer that the
12726          * command's response data will be written. This can be either a host
12727          * physical address (HPA) or a guest physical address (GPA) and must
12728          * point to a physically contiguous block of memory.
12729          */
12730         uint64_t        resp_addr;
12731         uint8_t host;
12732         /*
12733          * # If this bit is set to '1', the query will contain PF(s)
12734          * belongs to SOC host.
12735          */
12736         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_SOC      UINT32_C(0x1)
12737         /*
12738          * # If this bit is set to '1', the query will contain PF(s)
12739          * belongs to EP0 host.
12740          */
12741         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_0     UINT32_C(0x2)
12742         /*
12743          * # If this bit is set to '1', the query will contain PF(s)
12744          * belongs to EP1 host.
12745          */
12746         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_1     UINT32_C(0x4)
12747         /*
12748          * # If this bit is set to '1', the query will contain PF(s)
12749          * belongs to EP2 host.
12750          */
12751         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_2     UINT32_C(0x8)
12752         /*
12753          * # If this bit is set to '1', the query will contain PF(s)
12754          * belongs to EP3 host.
12755          */
12756         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_HOST_EP_3     UINT32_C(0x10)
12757         /*
12758          * This provides a filter of what PF(s) will be returned in the
12759          * query..
12760          */
12761         uint8_t filter;
12762         /*
12763          * all available PF(s) belong to the host(s) (defined in the
12764          * host field). This includes the hidden PFs.
12765          */
12766         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ALL  UINT32_C(0x0)
12767         /*
12768          * all available PF(s) belong to the host(s) (defined in the
12769          * host field) that is available for L2 traffic.
12770          */
12771         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_L2   UINT32_C(0x1)
12772         /*
12773          * all available PF(s) belong to the host(s) (defined in the
12774          * host field) that is available for ROCE traffic.
12775          */
12776         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE UINT32_C(0x2)
12777         #define HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_LAST \
12778                 HWRM_FUNC_HOST_PF_IDS_QUERY_INPUT_FILTER_ROCE
12779         uint8_t unused_1[6];
12780 } __attribute__((packed));
12781
12782 /* hwrm_func_host_pf_ids_query_output (size:128b/16B) */
12783 struct hwrm_func_host_pf_ids_query_output {
12784         /* The specific error status for the command. */
12785         uint16_t        error_code;
12786         /* The HWRM command request type. */
12787         uint16_t        req_type;
12788         /* The sequence ID from the original command. */
12789         uint16_t        seq_id;
12790         /* The length of the response data in number of bytes. */
12791         uint16_t        resp_len;
12792         /* This provides the first PF ID of the device. */
12793         uint16_t        first_pf_id;
12794         uint16_t        pf_ordinal_mask;
12795         /*
12796          * When this bit is '1', it indicates first PF belongs to one of
12797          * the hosts defined in the input request.
12798          */
12799         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_0 \
12800                 UINT32_C(0x1)
12801         /*
12802          * When this bit is '1', it indicates 2nd PF belongs to one of the
12803          * hosts defined in the input request.
12804          */
12805         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_1 \
12806                 UINT32_C(0x2)
12807         /*
12808          * When this bit is '1', it indicates 3rd PF belongs to one of the
12809          * hosts defined in the input request.
12810          */
12811         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_2 \
12812                 UINT32_C(0x4)
12813         /*
12814          * When this bit is '1', it indicates 4th PF belongs to one of the
12815          * hosts defined in the input request.
12816          */
12817         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_3 \
12818                 UINT32_C(0x8)
12819         /*
12820          * When this bit is '1', it indicates 5th PF belongs to one of the
12821          * hosts defined in the input request.
12822          */
12823         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_4 \
12824                 UINT32_C(0x10)
12825         /*
12826          * When this bit is '1', it indicates 6th PF belongs to one of the
12827          * hosts defined in the input request.
12828          */
12829         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_5 \
12830                 UINT32_C(0x20)
12831         /*
12832          * When this bit is '1', it indicates 7th PF belongs to one of the
12833          * hosts defined in the input request.
12834          */
12835         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_6 \
12836                 UINT32_C(0x40)
12837         /*
12838          * When this bit is '1', it indicates 8th PF belongs to one of the
12839          * hosts defined in the input request.
12840          */
12841         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_7 \
12842                 UINT32_C(0x80)
12843         /*
12844          * When this bit is '1', it indicates 9th PF belongs to one of the
12845          * hosts defined in the input request.
12846          */
12847         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_8 \
12848                 UINT32_C(0x100)
12849         /*
12850          * When this bit is '1', it indicates 10th PF belongs to one of the
12851          * hosts defined in the input request.
12852          */
12853         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_9 \
12854                 UINT32_C(0x200)
12855         /*
12856          * When this bit is '1', it indicates 11th PF belongs to one of the
12857          * hosts defined in the input request.
12858          */
12859         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_10 \
12860                 UINT32_C(0x400)
12861         /*
12862          * When this bit is '1', it indicates 12th PF belongs to one of the
12863          * hosts defined in the input request.
12864          */
12865         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_11 \
12866                 UINT32_C(0x800)
12867         /*
12868          * When this bit is '1', it indicates 13th PF belongs to one of the
12869          * hosts defined in the input request.
12870          */
12871         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_12 \
12872                 UINT32_C(0x1000)
12873         /*
12874          * When this bit is '1', it indicates 14th PF belongs to one of the
12875          * hosts defined in the input request.
12876          */
12877         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_13 \
12878                 UINT32_C(0x2000)
12879         /*
12880          * When this bit is '1', it indicates 15th PF belongs to one of the
12881          * hosts defined in the input request.
12882          */
12883         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_14 \
12884                 UINT32_C(0x4000)
12885         /*
12886          * When this bit is '1', it indicates 16th PF belongs to one of the
12887          * hosts defined in the input request.
12888          */
12889         #define HWRM_FUNC_HOST_PF_IDS_QUERY_OUTPUT_PF_ORDINAL_MASK_FUNC_15 \
12890                 UINT32_C(0x8000)
12891         uint8_t unused_1[3];
12892         /*
12893          * This field is used in Output records to indicate that the output
12894          * is completely written to RAM.  This field should be read as '1'
12895          * to indicate that the output has been completely written.
12896          * When writing a command completion or response to an internal processor,
12897          * the order of writes has to be such that this field is written last.
12898          */
12899         uint8_t valid;
12900 } __attribute__((packed));
12901
12902 /*********************
12903  * hwrm_port_phy_cfg *
12904  *********************/
12905
12906
12907 /* hwrm_port_phy_cfg_input (size:448b/56B) */
12908 struct hwrm_port_phy_cfg_input {
12909         /* The HWRM command request type. */
12910         uint16_t        req_type;
12911         /*
12912          * The completion ring to send the completion event on. This should
12913          * be the NQ ID returned from the `nq_alloc` HWRM command.
12914          */
12915         uint16_t        cmpl_ring;
12916         /*
12917          * The sequence ID is used by the driver for tracking multiple
12918          * commands. This ID is treated as opaque data by the firmware and
12919          * the value is returned in the `hwrm_resp_hdr` upon completion.
12920          */
12921         uint16_t        seq_id;
12922         /*
12923          * The target ID of the command:
12924          * * 0x0-0xFFF8 - The function ID
12925          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
12926          * * 0xFFFD - Reserved for user-space HWRM interface
12927          * * 0xFFFF - HWRM
12928          */
12929         uint16_t        target_id;
12930         /*
12931          * A physical address pointer pointing to a host buffer that the
12932          * command's response data will be written. This can be either a host
12933          * physical address (HPA) or a guest physical address (GPA) and must
12934          * point to a physically contiguous block of memory.
12935          */
12936         uint64_t        resp_addr;
12937         uint32_t        flags;
12938         /*
12939          * When this bit is set to '1', the PHY for the port shall
12940          * be reset.
12941          *
12942          * # If this bit is set to 1, then the HWRM shall reset the
12943          * PHY after applying PHY configuration changes specified
12944          * in this command.
12945          * # In order to guarantee that PHY configuration changes
12946          * specified in this command take effect, the HWRM
12947          * client should set this flag to 1.
12948          * # If this bit is not set to 1, then the HWRM may reset
12949          * the PHY depending on the current PHY configuration and
12950          * settings specified in this command.
12951          */
12952         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY \
12953                 UINT32_C(0x1)
12954         /* deprecated bit.  Do not use!!! */
12955         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED \
12956                 UINT32_C(0x2)
12957         /*
12958          * When this bit is set to '1', the link shall be forced to
12959          * the force_link_speed value.
12960          *
12961          * When this bit is set to '1', the HWRM client should
12962          * not enable any of the auto negotiation related
12963          * fields represented by auto_XXX fields in this command.
12964          * When this bit is set to '1' and the HWRM client has
12965          * enabled a auto_XXX field in this command, then the
12966          * HWRM shall ignore the enabled auto_XXX field.
12967          *
12968          * When this bit is set to zero, the link
12969          * shall be allowed to autoneg.
12970          */
12971         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE \
12972                 UINT32_C(0x4)
12973         /*
12974          * When this bit is set to '1', the auto-negotiation process
12975          * shall be restarted on the link.
12976          */
12977         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG \
12978                 UINT32_C(0x8)
12979         /*
12980          * When this bit is set to '1', Energy Efficient Ethernet
12981          * (EEE) is requested to be enabled 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_ENABLE \
12986                 UINT32_C(0x10)
12987         /*
12988          * When this bit is set to '1', Energy Efficient Ethernet
12989          * (EEE) is requested to be disabled on this link.
12990          * If EEE is not supported on this port, then this flag
12991          * shall be ignored by the HWRM.
12992          */
12993         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE \
12994                 UINT32_C(0x20)
12995         /*
12996          * When this bit is set to '1' and EEE is enabled on this
12997          * link, then TX LPI is requested to be enabled on the link.
12998          * If EEE is not supported on this port, then this flag
12999          * shall be ignored by the HWRM.
13000          * If EEE is disabled on this port, then this flag shall be
13001          * ignored by the HWRM.
13002          */
13003         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE \
13004                 UINT32_C(0x40)
13005         /*
13006          * When this bit is set to '1' and EEE is enabled on this
13007          * link, then TX LPI is requested to be disabled on the link.
13008          * If EEE is not supported on this port, then this flag
13009          * shall be ignored by the HWRM.
13010          * If EEE is disabled on this port, then this flag shall be
13011          * ignored by the HWRM.
13012          */
13013         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE \
13014                 UINT32_C(0x80)
13015         /*
13016          * When set to 1, then the HWRM shall enable FEC autonegotitation
13017          * on this port if supported.
13018          * When set to 0, then this flag shall be ignored.
13019          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
13020          * flag.
13021          */
13022         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE \
13023                 UINT32_C(0x100)
13024         /*
13025          * When set to 1, then the HWRM shall disable FEC autonegotiation
13026          * on this port if supported.
13027          * When set to 0, then this flag shall be ignored.
13028          * If FEC autonegotiation is not supported, then the HWRM shall ignore this
13029          * flag.
13030          */
13031         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
13032                 UINT32_C(0x200)
13033         /*
13034          * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire Code)
13035          * on this port if supported.
13036          * When set to 0, then this flag shall be ignored.
13037          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
13038          * flag.
13039          */
13040         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
13041                 UINT32_C(0x400)
13042         /*
13043          * When set to 1, then the HWRM shall disable FEC CLAUSE 74 (Fire Code)
13044          * on this port if supported.
13045          * When set to 0, then this flag shall be ignored.
13046          * If FEC CLAUSE 74 is not supported, then the HWRM shall ignore this
13047          * flag.
13048          */
13049         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
13050                 UINT32_C(0x800)
13051         /*
13052          * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed Solomon)
13053          * on this port if supported.
13054          * When set to 0, then this flag shall be ignored.
13055          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
13056          * flag.
13057          */
13058         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
13059                 UINT32_C(0x1000)
13060         /*
13061          * When set to 1, then the HWRM shall disable FEC CLAUSE 91 (Reed Solomon)
13062          * on this port if supported.
13063          * When set to 0, then this flag shall be ignored.
13064          * If FEC CLAUSE 91 is not supported, then the HWRM shall ignore this
13065          * flag.
13066          */
13067         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
13068                 UINT32_C(0x2000)
13069         /*
13070          * When this bit is set to '1', the link shall be forced to
13071          * be taken down.
13072          *
13073          * # When this bit is set to '1", all other
13074          * command input settings related to the link speed shall
13075          * be ignored.
13076          * Once the link state is forced down, it can be
13077          * explicitly cleared from that state by setting this flag
13078          * to '0'.
13079          * # If this flag is set to '0', then the link shall be
13080          * cleared from forced down state if the link is in forced
13081          * down state.
13082          * There may be conditions (e.g. out-of-band or sideband
13083          * configuration changes for the link) outside the scope
13084          * of the HWRM implementation that may clear forced down
13085          * link state.
13086          */
13087         #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN \
13088                 UINT32_C(0x4000)
13089         uint32_t        enables;
13090         /*
13091          * This bit must be '1' for the auto_mode field to be
13092          * configured.
13093          */
13094         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE \
13095                 UINT32_C(0x1)
13096         /*
13097          * This bit must be '1' for the auto_duplex field to be
13098          * configured.
13099          */
13100         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX \
13101                 UINT32_C(0x2)
13102         /*
13103          * This bit must be '1' for the auto_pause field to be
13104          * configured.
13105          */
13106         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE \
13107                 UINT32_C(0x4)
13108         /*
13109          * This bit must be '1' for the auto_link_speed field to be
13110          * configured.
13111          */
13112         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED \
13113                 UINT32_C(0x8)
13114         /*
13115          * This bit must be '1' for the auto_link_speed_mask field to be
13116          * configured.
13117          */
13118         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
13119                 UINT32_C(0x10)
13120         /*
13121          * This bit must be '1' for the wirespeed field to be
13122          * configured.
13123          */
13124         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED \
13125                 UINT32_C(0x20)
13126         /*
13127          * This bit must be '1' for the lpbk field to be
13128          * configured.
13129          */
13130         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK \
13131                 UINT32_C(0x40)
13132         /*
13133          * This bit must be '1' for the preemphasis field to be
13134          * configured.
13135          */
13136         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS \
13137                 UINT32_C(0x80)
13138         /*
13139          * This bit must be '1' for the force_pause field to be
13140          * configured.
13141          */
13142         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE \
13143                 UINT32_C(0x100)
13144         /*
13145          * This bit must be '1' for the eee_link_speed_mask field to be
13146          * configured.
13147          */
13148         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
13149                 UINT32_C(0x200)
13150         /*
13151          * This bit must be '1' for the tx_lpi_timer field to be
13152          * configured.
13153          */
13154         #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER \
13155                 UINT32_C(0x400)
13156         /* Port ID of port that is to be configured. */
13157         uint16_t        port_id;
13158         /*
13159          * This is the speed that will be used if the force
13160          * bit is '1'.  If unsupported speed is selected, an error
13161          * will be generated.
13162          */
13163         uint16_t        force_link_speed;
13164         /* 100Mb link speed */
13165         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
13166         /* 1Gb link speed */
13167         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
13168         /* 2Gb link speed */
13169         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
13170         /* 25Gb link speed */
13171         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
13172         /* 10Gb link speed */
13173         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
13174         /* 20Mb link speed */
13175         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
13176         /* 25Gb link speed */
13177         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
13178         /* 40Gb link speed */
13179         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB  UINT32_C(0x190)
13180         /* 50Gb link speed */
13181         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB  UINT32_C(0x1f4)
13182         /* 100Gb link speed */
13183         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
13184         /* 200Gb link speed */
13185         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_200GB UINT32_C(0x7d0)
13186         /* 10Mb link speed */
13187         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB  UINT32_C(0xffff)
13188         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_LAST \
13189                 HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB
13190         /*
13191          * This value is used to identify what autoneg mode is
13192          * used when the link speed is not being forced.
13193          */
13194         uint8_t auto_mode;
13195         /* Disable autoneg or autoneg disabled. No speeds are selected. */
13196         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE         UINT32_C(0x0)
13197         /* Select all possible speeds for autoneg mode. */
13198         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
13199         /*
13200          * Select only the auto_link_speed speed for autoneg mode. This mode has
13201          * been DEPRECATED. An HWRM client should not use this mode.
13202          */
13203         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
13204         /*
13205          * Select the auto_link_speed or any speed below that speed for autoneg.
13206          * This mode has been DEPRECATED. An HWRM client should not use this mode.
13207          */
13208         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
13209         /*
13210          * Select the speeds based on the corresponding link speed mask value
13211          * that is provided.
13212          */
13213         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
13214         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_LAST \
13215                 HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK
13216         /*
13217          * This is the duplex setting that will be used if the autoneg_mode
13218          * is "one_speed" or "one_or_below".
13219          */
13220         uint8_t auto_duplex;
13221         /* Half Duplex will be requested. */
13222         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
13223         /* Full duplex will be requested. */
13224         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
13225         /* Both Half and Full dupex will be requested. */
13226         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
13227         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_LAST \
13228                 HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH
13229         /*
13230          * This value is used to configure the pause that will be
13231          * used for autonegotiation.
13232          * Add text on the usage of auto_pause and force_pause.
13233          */
13234         uint8_t auto_pause;
13235         /*
13236          * When this bit is '1', Generation of tx pause messages
13237          * has been requested. Disabled otherwise.
13238          */
13239         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX \
13240                 UINT32_C(0x1)
13241         /*
13242          * When this bit is '1', Reception of rx pause messages
13243          * has been requested. Disabled otherwise.
13244          */
13245         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX \
13246                 UINT32_C(0x2)
13247         /*
13248          * When set to 1, the advertisement of pause is enabled.
13249          *
13250          * # When the auto_mode is not set to none and this flag is
13251          * set to 1, then the auto_pause bits on this port are being
13252          * advertised and autoneg pause results are being interpreted.
13253          * # When the auto_mode is not set to none and this
13254          * flag is set to 0, the pause is forced as indicated in
13255          * force_pause, and also advertised as auto_pause bits, but
13256          * the autoneg results are not interpreted since the pause
13257          * configuration is being forced.
13258          * # When the auto_mode is set to none and this flag is set to
13259          * 1, auto_pause bits should be ignored and should be set to 0.
13260          */
13261         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE \
13262                 UINT32_C(0x4)
13263         uint8_t unused_0;
13264         /*
13265          * This is the speed that will be used if the autoneg_mode
13266          * is "one_speed" or "one_or_below".  If an unsupported speed
13267          * is selected, an error will be generated.
13268          */
13269         uint16_t        auto_link_speed;
13270         /* 100Mb link speed */
13271         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
13272         /* 1Gb link speed */
13273         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
13274         /* 2Gb link speed */
13275         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
13276         /* 25Gb link speed */
13277         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
13278         /* 10Gb link speed */
13279         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
13280         /* 20Mb link speed */
13281         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
13282         /* 25Gb link speed */
13283         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
13284         /* 40Gb link speed */
13285         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
13286         /* 50Gb link speed */
13287         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
13288         /* 100Gb link speed */
13289         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
13290         /* 200Gb link speed */
13291         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_200GB UINT32_C(0x7d0)
13292         /* 10Mb link speed */
13293         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB  UINT32_C(0xffff)
13294         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_LAST \
13295                 HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB
13296         /*
13297          * This is a mask of link speeds that will be used if
13298          * autoneg_mode is "mask".  If unsupported speed is enabled
13299          * an error will be generated.
13300          */
13301         uint16_t        auto_link_speed_mask;
13302         /* 100Mb link speed (Half-duplex) */
13303         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
13304                 UINT32_C(0x1)
13305         /* 100Mb link speed (Full-duplex) */
13306         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
13307                 UINT32_C(0x2)
13308         /* 1Gb link speed (Half-duplex) */
13309         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
13310                 UINT32_C(0x4)
13311         /* 1Gb link speed (Full-duplex) */
13312         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
13313                 UINT32_C(0x8)
13314         /* 2Gb link speed */
13315         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
13316                 UINT32_C(0x10)
13317         /* 25Gb link speed */
13318         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
13319                 UINT32_C(0x20)
13320         /* 10Gb link speed */
13321         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
13322                 UINT32_C(0x40)
13323         /* 20Gb link speed */
13324         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
13325                 UINT32_C(0x80)
13326         /* 25Gb link speed */
13327         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
13328                 UINT32_C(0x100)
13329         /* 40Gb link speed */
13330         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
13331                 UINT32_C(0x200)
13332         /* 50Gb link speed */
13333         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
13334                 UINT32_C(0x400)
13335         /* 100Gb link speed */
13336         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
13337                 UINT32_C(0x800)
13338         /* 10Mb link speed (Half-duplex) */
13339         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
13340                 UINT32_C(0x1000)
13341         /* 10Mb link speed (Full-duplex) */
13342         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
13343                 UINT32_C(0x2000)
13344         /* 200Gb link speed */
13345         #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_200GB \
13346                 UINT32_C(0x4000)
13347         /* This value controls the wirespeed feature. */
13348         uint8_t wirespeed;
13349         /* Wirespeed feature is disabled. */
13350         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF UINT32_C(0x0)
13351         /* Wirespeed feature is enabled. */
13352         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON  UINT32_C(0x1)
13353         #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_LAST \
13354                 HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON
13355         /* This value controls the loopback setting for the PHY. */
13356         uint8_t lpbk;
13357         /* No loopback is selected.  Normal operation. */
13358         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE     UINT32_C(0x0)
13359         /*
13360          * The HW will be configured with local loopback such that
13361          * host data is sent back to the host without modification.
13362          */
13363         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL    UINT32_C(0x1)
13364         /*
13365          * The HW will be configured with remote loopback such that
13366          * port logic will send packets back out the transmitter that
13367          * are received.
13368          */
13369         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE   UINT32_C(0x2)
13370         /*
13371          * The HW will be configured with external loopback such that
13372          * host data is sent on the trasmitter and based on the external
13373          * loopback connection the data will be received without modification.
13374          */
13375         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL UINT32_C(0x3)
13376         #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LAST \
13377                 HWRM_PORT_PHY_CFG_INPUT_LPBK_EXTERNAL
13378         /*
13379          * This value is used to configure the pause that will be
13380          * used for force mode.
13381          */
13382         uint8_t force_pause;
13383         /*
13384          * When this bit is '1', Generation of tx pause messages
13385          * is supported. Disabled otherwise.
13386          */
13387         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
13388         /*
13389          * When this bit is '1', Reception of rx pause messages
13390          * is supported. Disabled otherwise.
13391          */
13392         #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
13393         uint8_t unused_1;
13394         /*
13395          * This value controls the pre-emphasis to be used for the
13396          * link.  Driver should not set this value (use
13397          * enable.preemphasis = 0) unless driver is sure of setting.
13398          * Normally HWRM FW will determine proper pre-emphasis.
13399          */
13400         uint32_t        preemphasis;
13401         /*
13402          * Setting for link speed mask that is used to
13403          * advertise speeds during autonegotiation when EEE is enabled.
13404          * This field is valid only when EEE is enabled.
13405          * The speeds specified in this field shall be a subset of
13406          * speeds specified in auto_link_speed_mask.
13407          * If EEE is enabled,then at least one speed shall be provided
13408          * in this mask.
13409          */
13410         uint16_t        eee_link_speed_mask;
13411         /* Reserved */
13412         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 \
13413                 UINT32_C(0x1)
13414         /* 100Mb link speed (Full-duplex) */
13415         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB \
13416                 UINT32_C(0x2)
13417         /* Reserved */
13418         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 \
13419                 UINT32_C(0x4)
13420         /* 1Gb link speed (Full-duplex) */
13421         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB \
13422                 UINT32_C(0x8)
13423         /* Reserved */
13424         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
13425                 UINT32_C(0x10)
13426         /* Reserved */
13427         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
13428                 UINT32_C(0x20)
13429         /* 10Gb link speed */
13430         #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
13431                 UINT32_C(0x40)
13432         uint8_t unused_2[2];
13433         /*
13434          * Reuested setting of TX LPI timer in microseconds.
13435          * This field is valid only when EEE is enabled and TX LPI is
13436          * enabled.
13437          */
13438         uint32_t        tx_lpi_timer;
13439         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
13440         #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
13441         uint32_t        unused_3;
13442 } __attribute__((packed));
13443
13444 /* hwrm_port_phy_cfg_output (size:128b/16B) */
13445 struct hwrm_port_phy_cfg_output {
13446         /* The specific error status for the command. */
13447         uint16_t        error_code;
13448         /* The HWRM command request type. */
13449         uint16_t        req_type;
13450         /* The sequence ID from the original command. */
13451         uint16_t        seq_id;
13452         /* The length of the response data in number of bytes. */
13453         uint16_t        resp_len;
13454         uint8_t unused_0[7];
13455         /*
13456          * This field is used in Output records to indicate that the output
13457          * is completely written to RAM.  This field should be read as '1'
13458          * to indicate that the output has been completely written.
13459          * When writing a command completion or response to an internal processor,
13460          * the order of writes has to be such that this field is written last.
13461          */
13462         uint8_t valid;
13463 } __attribute__((packed));
13464
13465 /* hwrm_port_phy_cfg_cmd_err (size:64b/8B) */
13466 struct hwrm_port_phy_cfg_cmd_err {
13467         /*
13468          * command specific error codes that goes to
13469          * the cmd_err field in Common HWRM Error Response.
13470          */
13471         uint8_t code;
13472         /* Unknown error */
13473         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
13474         /* Unable to complete operation due to invalid speed */
13475         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_ILLEGAL_SPEED UINT32_C(0x1)
13476         /*
13477          * retry the command since the phy is not ready.
13478          * retry count is returned in opaque_0.
13479          * This is only valid for the first command and
13480          * this value will not change for successive calls.
13481          * but if a 0 is returned at any time then this should
13482          * be treated as an un recoverable failure,
13483          *
13484          * retry interval in milli seconds is returned in opaque_1.
13485          * This specifies the time that user should wait before
13486          * issuing the next port_phy_cfg command.
13487          */
13488         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY         UINT32_C(0x2)
13489         #define HWRM_PORT_PHY_CFG_CMD_ERR_CODE_LAST \
13490                 HWRM_PORT_PHY_CFG_CMD_ERR_CODE_RETRY
13491         uint8_t unused_0[7];
13492 } __attribute__((packed));
13493
13494 /**********************
13495  * hwrm_port_phy_qcfg *
13496  **********************/
13497
13498
13499 /* hwrm_port_phy_qcfg_input (size:192b/24B) */
13500 struct hwrm_port_phy_qcfg_input {
13501         /* The HWRM command request type. */
13502         uint16_t        req_type;
13503         /*
13504          * The completion ring to send the completion event on. This should
13505          * be the NQ ID returned from the `nq_alloc` HWRM command.
13506          */
13507         uint16_t        cmpl_ring;
13508         /*
13509          * The sequence ID is used by the driver for tracking multiple
13510          * commands. This ID is treated as opaque data by the firmware and
13511          * the value is returned in the `hwrm_resp_hdr` upon completion.
13512          */
13513         uint16_t        seq_id;
13514         /*
13515          * The target ID of the command:
13516          * * 0x0-0xFFF8 - The function ID
13517          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
13518          * * 0xFFFD - Reserved for user-space HWRM interface
13519          * * 0xFFFF - HWRM
13520          */
13521         uint16_t        target_id;
13522         /*
13523          * A physical address pointer pointing to a host buffer that the
13524          * command's response data will be written. This can be either a host
13525          * physical address (HPA) or a guest physical address (GPA) and must
13526          * point to a physically contiguous block of memory.
13527          */
13528         uint64_t        resp_addr;
13529         /* Port ID of port that is to be queried. */
13530         uint16_t        port_id;
13531         uint8_t unused_0[6];
13532 } __attribute__((packed));
13533
13534 /* hwrm_port_phy_qcfg_output (size:768b/96B) */
13535 struct hwrm_port_phy_qcfg_output {
13536         /* The specific error status for the command. */
13537         uint16_t        error_code;
13538         /* The HWRM command request type. */
13539         uint16_t        req_type;
13540         /* The sequence ID from the original command. */
13541         uint16_t        seq_id;
13542         /* The length of the response data in number of bytes. */
13543         uint16_t        resp_len;
13544         /* This value indicates the current link status. */
13545         uint8_t link;
13546         /* There is no link or cable detected. */
13547         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
13548         /* There is no link, but a cable has been detected. */
13549         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL  UINT32_C(0x1)
13550         /* There is a link. */
13551         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK    UINT32_C(0x2)
13552         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LAST \
13553                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK
13554         uint8_t unused_0;
13555         /* This value indicates the current link speed of the connection. */
13556         uint16_t        link_speed;
13557         /* 100Mb link speed */
13558         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
13559         /* 1Gb link speed */
13560         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB   UINT32_C(0xa)
13561         /* 2Gb link speed */
13562         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB   UINT32_C(0x14)
13563         /* 25Gb link speed */
13564         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
13565         /* 10Gb link speed */
13566         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB  UINT32_C(0x64)
13567         /* 20Mb link speed */
13568         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB  UINT32_C(0xc8)
13569         /* 25Gb link speed */
13570         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB  UINT32_C(0xfa)
13571         /* 40Gb link speed */
13572         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB  UINT32_C(0x190)
13573         /* 50Gb link speed */
13574         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB  UINT32_C(0x1f4)
13575         /* 100Gb link speed */
13576         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
13577         /* 200Gb link speed */
13578         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_200GB UINT32_C(0x7d0)
13579         /* 10Mb link speed */
13580         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB  UINT32_C(0xffff)
13581         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_LAST \
13582                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB
13583         /*
13584          * This value is indicates the duplex of the current
13585          * configuration.
13586          */
13587         uint8_t duplex_cfg;
13588         /* Half Duplex connection. */
13589         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_HALF UINT32_C(0x0)
13590         /* Full duplex connection. */
13591         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL UINT32_C(0x1)
13592         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_LAST \
13593                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_CFG_FULL
13594         /*
13595          * This value is used to indicate the current
13596          * pause configuration. When autoneg is enabled, this value
13597          * represents the autoneg results of pause configuration.
13598          */
13599         uint8_t pause;
13600         /*
13601          * When this bit is '1', Generation of tx pause messages
13602          * is supported. Disabled otherwise.
13603          */
13604         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX     UINT32_C(0x1)
13605         /*
13606          * When this bit is '1', Reception of rx pause messages
13607          * is supported. Disabled otherwise.
13608          */
13609         #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX     UINT32_C(0x2)
13610         /*
13611          * The supported speeds for the port. This is a bit mask.
13612          * For each speed that is supported, the corrresponding
13613          * bit will be set to '1'.
13614          */
13615         uint16_t        support_speeds;
13616         /* 100Mb link speed (Half-duplex) */
13617         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD \
13618                 UINT32_C(0x1)
13619         /* 100Mb link speed (Full-duplex) */
13620         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB \
13621                 UINT32_C(0x2)
13622         /* 1Gb link speed (Half-duplex) */
13623         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD \
13624                 UINT32_C(0x4)
13625         /* 1Gb link speed (Full-duplex) */
13626         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB \
13627                 UINT32_C(0x8)
13628         /* 2Gb link speed */
13629         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB \
13630                 UINT32_C(0x10)
13631         /* 25Gb link speed */
13632         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB \
13633                 UINT32_C(0x20)
13634         /* 10Gb link speed */
13635         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB \
13636                 UINT32_C(0x40)
13637         /* 20Gb link speed */
13638         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB \
13639                 UINT32_C(0x80)
13640         /* 25Gb link speed */
13641         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB \
13642                 UINT32_C(0x100)
13643         /* 40Gb link speed */
13644         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB \
13645                 UINT32_C(0x200)
13646         /* 50Gb link speed */
13647         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB \
13648                 UINT32_C(0x400)
13649         /* 100Gb link speed */
13650         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB \
13651                 UINT32_C(0x800)
13652         /* 10Mb link speed (Half-duplex) */
13653         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD \
13654                 UINT32_C(0x1000)
13655         /* 10Mb link speed (Full-duplex) */
13656         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB \
13657                 UINT32_C(0x2000)
13658         /* 200Gb link speed */
13659         #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_200GB \
13660                 UINT32_C(0x4000)
13661         /*
13662          * Current setting of forced link speed.
13663          * When the link speed is not being forced, this
13664          * value shall be set to 0.
13665          */
13666         uint16_t        force_link_speed;
13667         /* 100Mb link speed */
13668         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
13669         /* 1Gb link speed */
13670         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB   UINT32_C(0xa)
13671         /* 2Gb link speed */
13672         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB   UINT32_C(0x14)
13673         /* 25Gb link speed */
13674         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
13675         /* 10Gb link speed */
13676         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB  UINT32_C(0x64)
13677         /* 20Mb link speed */
13678         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB  UINT32_C(0xc8)
13679         /* 25Gb link speed */
13680         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB  UINT32_C(0xfa)
13681         /* 40Gb link speed */
13682         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB \
13683                 UINT32_C(0x190)
13684         /* 50Gb link speed */
13685         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB \
13686                 UINT32_C(0x1f4)
13687         /* 100Gb link speed */
13688         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB \
13689                 UINT32_C(0x3e8)
13690         /* 200Gb link speed */
13691         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_200GB \
13692                 UINT32_C(0x7d0)
13693         /* 10Mb link speed */
13694         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB \
13695                 UINT32_C(0xffff)
13696         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_LAST \
13697                 HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB
13698         /* Current setting of auto negotiation mode. */
13699         uint8_t auto_mode;
13700         /* Disable autoneg or autoneg disabled. No speeds are selected. */
13701         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE         UINT32_C(0x0)
13702         /* Select all possible speeds for autoneg mode. */
13703         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS   UINT32_C(0x1)
13704         /*
13705          * Select only the auto_link_speed speed for autoneg mode. This mode has
13706          * been DEPRECATED. An HWRM client should not use this mode.
13707          */
13708         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED    UINT32_C(0x2)
13709         /*
13710          * Select the auto_link_speed or any speed below that speed for autoneg.
13711          * This mode has been DEPRECATED. An HWRM client should not use this mode.
13712          */
13713         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
13714         /*
13715          * Select the speeds based on the corresponding link speed mask value
13716          * that is provided.
13717          */
13718         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK   UINT32_C(0x4)
13719         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_LAST \
13720                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK
13721         /*
13722          * Current setting of pause autonegotiation.
13723          * Move autoneg_pause flag here.
13724          */
13725         uint8_t auto_pause;
13726         /*
13727          * When this bit is '1', Generation of tx pause messages
13728          * has been requested. Disabled otherwise.
13729          */
13730         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX \
13731                 UINT32_C(0x1)
13732         /*
13733          * When this bit is '1', Reception of rx pause messages
13734          * has been requested. Disabled otherwise.
13735          */
13736         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX \
13737                 UINT32_C(0x2)
13738         /*
13739          * When set to 1, the advertisement of pause is enabled.
13740          *
13741          * # When the auto_mode is not set to none and this flag is
13742          * set to 1, then the auto_pause bits on this port are being
13743          * advertised and autoneg pause results are being interpreted.
13744          * # When the auto_mode is not set to none and this
13745          * flag is set to 0, the pause is forced as indicated in
13746          * force_pause, and also advertised as auto_pause bits, but
13747          * the autoneg results are not interpreted since the pause
13748          * configuration is being forced.
13749          * # When the auto_mode is set to none and this flag is set to
13750          * 1, auto_pause bits should be ignored and should be set to 0.
13751          */
13752         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE \
13753                 UINT32_C(0x4)
13754         /*
13755          * Current setting for auto_link_speed. This field is only
13756          * valid when auto_mode is set to "one_speed" or "one_or_below".
13757          */
13758         uint16_t        auto_link_speed;
13759         /* 100Mb link speed */
13760         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
13761         /* 1Gb link speed */
13762         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB   UINT32_C(0xa)
13763         /* 2Gb link speed */
13764         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB   UINT32_C(0x14)
13765         /* 25Gb link speed */
13766         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
13767         /* 10Gb link speed */
13768         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB  UINT32_C(0x64)
13769         /* 20Mb link speed */
13770         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB  UINT32_C(0xc8)
13771         /* 25Gb link speed */
13772         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB  UINT32_C(0xfa)
13773         /* 40Gb link speed */
13774         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB  UINT32_C(0x190)
13775         /* 50Gb link speed */
13776         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB  UINT32_C(0x1f4)
13777         /* 100Gb link speed */
13778         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
13779         /* 200Gb link speed */
13780         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_200GB UINT32_C(0x7d0)
13781         /* 10Mb link speed */
13782         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB \
13783                 UINT32_C(0xffff)
13784         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_LAST \
13785                 HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB
13786         /*
13787          * Current setting for auto_link_speed_mask that is used to
13788          * advertise speeds during autonegotiation.
13789          * This field is only valid when auto_mode is set to "mask".
13790          * The speeds specified in this field shall be a subset of
13791          * supported speeds on this port.
13792          */
13793         uint16_t        auto_link_speed_mask;
13794         /* 100Mb link speed (Half-duplex) */
13795         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
13796                 UINT32_C(0x1)
13797         /* 100Mb link speed (Full-duplex) */
13798         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
13799                 UINT32_C(0x2)
13800         /* 1Gb link speed (Half-duplex) */
13801         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
13802                 UINT32_C(0x4)
13803         /* 1Gb link speed (Full-duplex) */
13804         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB \
13805                 UINT32_C(0x8)
13806         /* 2Gb link speed */
13807         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
13808                 UINT32_C(0x10)
13809         /* 25Gb link speed */
13810         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
13811                 UINT32_C(0x20)
13812         /* 10Gb link speed */
13813         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
13814                 UINT32_C(0x40)
13815         /* 20Gb link speed */
13816         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
13817                 UINT32_C(0x80)
13818         /* 25Gb link speed */
13819         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
13820                 UINT32_C(0x100)
13821         /* 40Gb link speed */
13822         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
13823                 UINT32_C(0x200)
13824         /* 50Gb link speed */
13825         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
13826                 UINT32_C(0x400)
13827         /* 100Gb link speed */
13828         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
13829                 UINT32_C(0x800)
13830         /* 10Mb link speed (Half-duplex) */
13831         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
13832                 UINT32_C(0x1000)
13833         /* 10Mb link speed (Full-duplex) */
13834         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
13835                 UINT32_C(0x2000)
13836         /* 200Gb link speed */
13837         #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_200GB \
13838                 UINT32_C(0x4000)
13839         /* Current setting for wirespeed. */
13840         uint8_t wirespeed;
13841         /* Wirespeed feature is disabled. */
13842         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF UINT32_C(0x0)
13843         /* Wirespeed feature is enabled. */
13844         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON  UINT32_C(0x1)
13845         #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_LAST \
13846                 HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON
13847         /* Current setting for loopback. */
13848         uint8_t lpbk;
13849         /* No loopback is selected.  Normal operation. */
13850         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE     UINT32_C(0x0)
13851         /*
13852          * The HW will be configured with local loopback such that
13853          * host data is sent back to the host without modification.
13854          */
13855         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL    UINT32_C(0x1)
13856         /*
13857          * The HW will be configured with remote loopback such that
13858          * port logic will send packets back out the transmitter that
13859          * are received.
13860          */
13861         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE   UINT32_C(0x2)
13862         /*
13863          * The HW will be configured with external loopback such that
13864          * host data is sent on the trasmitter and based on the external
13865          * loopback connection the data will be received without modification.
13866          */
13867         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL UINT32_C(0x3)
13868         #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LAST \
13869                 HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_EXTERNAL
13870         /*
13871          * Current setting of forced pause.
13872          * When the pause configuration is not being forced, then
13873          * this value shall be set to 0.
13874          */
13875         uint8_t force_pause;
13876         /*
13877          * When this bit is '1', Generation of tx pause messages
13878          * is supported. Disabled otherwise.
13879          */
13880         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX     UINT32_C(0x1)
13881         /*
13882          * When this bit is '1', Reception of rx pause messages
13883          * is supported. Disabled otherwise.
13884          */
13885         #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX     UINT32_C(0x2)
13886         /*
13887          * This value indicates the current status of the optics module on
13888          * this port.
13889          */
13890         uint8_t module_status;
13891         /* Module is inserted and accepted */
13892         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE \
13893                 UINT32_C(0x0)
13894         /* Module is rejected and transmit side Laser is disabled. */
13895         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX \
13896                 UINT32_C(0x1)
13897         /* Module mismatch warning. */
13898         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG \
13899                 UINT32_C(0x2)
13900         /* Module is rejected and powered down. */
13901         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN \
13902                 UINT32_C(0x3)
13903         /* Module is not inserted. */
13904         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
13905                 UINT32_C(0x4)
13906         /* Module status is not applicable. */
13907         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
13908                 UINT32_C(0xff)
13909         #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_LAST \
13910                 HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE
13911         /* Current setting for preemphasis. */
13912         uint32_t        preemphasis;
13913         /* This field represents the major version of the PHY. */
13914         uint8_t phy_maj;
13915         /* This field represents the minor version of the PHY. */
13916         uint8_t phy_min;
13917         /* This field represents the build version of the PHY. */
13918         uint8_t phy_bld;
13919         /* This value represents a PHY type. */
13920         uint8_t phy_type;
13921         /* Unknown */
13922         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN \
13923                 UINT32_C(0x0)
13924         /* BASE-CR */
13925         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR \
13926                 UINT32_C(0x1)
13927         /* BASE-KR4 (Deprecated) */
13928         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 \
13929                 UINT32_C(0x2)
13930         /* BASE-LR */
13931         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR \
13932                 UINT32_C(0x3)
13933         /* BASE-SR */
13934         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR \
13935                 UINT32_C(0x4)
13936         /* BASE-KR2 (Deprecated) */
13937         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 \
13938                 UINT32_C(0x5)
13939         /* BASE-KX */
13940         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX \
13941                 UINT32_C(0x6)
13942         /* BASE-KR */
13943         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR \
13944                 UINT32_C(0x7)
13945         /* BASE-T */
13946         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET \
13947                 UINT32_C(0x8)
13948         /* EEE capable BASE-T */
13949         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE \
13950                 UINT32_C(0x9)
13951         /* SGMII connected external PHY */
13952         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY \
13953                 UINT32_C(0xa)
13954         /* 25G_BASECR_CA_L */
13955         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L \
13956                 UINT32_C(0xb)
13957         /* 25G_BASECR_CA_S */
13958         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S \
13959                 UINT32_C(0xc)
13960         /* 25G_BASECR_CA_N */
13961         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N \
13962                 UINT32_C(0xd)
13963         /* 25G_BASESR */
13964         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR \
13965                 UINT32_C(0xe)
13966         /* 100G_BASECR4 */
13967         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 \
13968                 UINT32_C(0xf)
13969         /* 100G_BASESR4 */
13970         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 \
13971                 UINT32_C(0x10)
13972         /* 100G_BASELR4 */
13973         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 \
13974                 UINT32_C(0x11)
13975         /* 100G_BASEER4 */
13976         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 \
13977                 UINT32_C(0x12)
13978         /* 100G_BASESR10 */
13979         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 \
13980                 UINT32_C(0x13)
13981         /* 40G_BASECR4 */
13982         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 \
13983                 UINT32_C(0x14)
13984         /* 40G_BASESR4 */
13985         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 \
13986                 UINT32_C(0x15)
13987         /* 40G_BASELR4 */
13988         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 \
13989                 UINT32_C(0x16)
13990         /* 40G_BASEER4 */
13991         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 \
13992                 UINT32_C(0x17)
13993         /* 40G_ACTIVE_CABLE */
13994         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
13995                 UINT32_C(0x18)
13996         /* 1G_baseT */
13997         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET \
13998                 UINT32_C(0x19)
13999         /* 1G_baseSX */
14000         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASESX \
14001                 UINT32_C(0x1a)
14002         /* 1G_baseCX */
14003         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX \
14004                 UINT32_C(0x1b)
14005         /* 100G_BASECR4 */
14006         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASECR4 \
14007                 UINT32_C(0x1c)
14008         /* 100G_BASESR4 */
14009         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASESR4 \
14010                 UINT32_C(0x1d)
14011         /* 100G_BASELR4 */
14012         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASELR4 \
14013                 UINT32_C(0x1e)
14014         /* 100G_BASEER4 */
14015         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4 \
14016                 UINT32_C(0x1f)
14017         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_LAST \
14018                 HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_200G_BASEER4
14019         /* This value represents a media type. */
14020         uint8_t media_type;
14021         /* Unknown */
14022         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
14023         /* Twisted Pair */
14024         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP      UINT32_C(0x1)
14025         /* Direct Attached Copper */
14026         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC     UINT32_C(0x2)
14027         /* Fiber */
14028         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE   UINT32_C(0x3)
14029         #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_LAST \
14030                 HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE
14031         /* This value represents a transceiver type. */
14032         uint8_t xcvr_pkg_type;
14033         /* PHY and MAC are in the same package */
14034         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
14035                 UINT32_C(0x1)
14036         /* PHY and MAC are in different packages */
14037         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
14038                 UINT32_C(0x2)
14039         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_LAST \
14040                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL
14041         uint8_t eee_config_phy_addr;
14042         /* This field represents PHY address. */
14043         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK \
14044                 UINT32_C(0x1f)
14045         #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT               0
14046         /*
14047          * This field represents flags related to EEE configuration.
14048          * These EEE configuration flags are valid only when the
14049          * auto_mode is not set to none (in other words autonegotiation
14050          * is enabled).
14051          */
14052         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK \
14053                 UINT32_C(0xe0)
14054         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT             5
14055         /*
14056          * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
14057          * Speeds for autoneg with EEE mode enabled
14058          * are based on eee_link_speed_mask.
14059          */
14060         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED \
14061                 UINT32_C(0x20)
14062         /*
14063          * This flag is valid only when eee_enabled is set to 1.
14064          *
14065          * # If eee_enabled is set to 0, then EEE mode is disabled
14066          * and this flag shall be ignored.
14067          * # If eee_enabled is set to 1 and this flag is set to 1,
14068          * then Energy Efficient Ethernet (EEE) mode is enabled
14069          * and in use.
14070          * # If eee_enabled is set to 1 and this flag is set to 0,
14071          * then Energy Efficient Ethernet (EEE) mode is enabled
14072          * but is currently not in use.
14073          */
14074         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE \
14075                 UINT32_C(0x40)
14076         /*
14077          * This flag is valid only when eee_enabled is set to 1.
14078          *
14079          * # If eee_enabled is set to 0, then EEE mode is disabled
14080          * and this flag shall be ignored.
14081          * # If eee_enabled is set to 1 and this flag is set to 1,
14082          * then Energy Efficient Ethernet (EEE) mode is enabled
14083          * and TX LPI is enabled.
14084          * # If eee_enabled is set to 1 and this flag is set to 0,
14085          * then Energy Efficient Ethernet (EEE) mode is enabled
14086          * but TX LPI is disabled.
14087          */
14088         #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI \
14089                 UINT32_C(0x80)
14090         /*
14091          * When set to 1, the parallel detection is used to determine
14092          * the speed of the link partner.
14093          *
14094          * Parallel detection is used when a autonegotiation capable
14095          * device is connected to a link parter that is not capable
14096          * of autonegotiation.
14097          */
14098         uint8_t parallel_detect;
14099         /*
14100          * When set to 1, the parallel detection is used to determine
14101          * the speed of the link partner.
14102          *
14103          * Parallel detection is used when a autonegotiation capable
14104          * device is connected to a link parter that is not capable
14105          * of autonegotiation.
14106          */
14107         #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT     UINT32_C(0x1)
14108         /*
14109          * The advertised speeds for the port by the link partner.
14110          * Each advertised speed will be set to '1'.
14111          */
14112         uint16_t        link_partner_adv_speeds;
14113         /* 100Mb link speed (Half-duplex) */
14114         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
14115                 UINT32_C(0x1)
14116         /* 100Mb link speed (Full-duplex) */
14117         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
14118                 UINT32_C(0x2)
14119         /* 1Gb link speed (Half-duplex) */
14120         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
14121                 UINT32_C(0x4)
14122         /* 1Gb link speed (Full-duplex) */
14123         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
14124                 UINT32_C(0x8)
14125         /* 2Gb link speed */
14126         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
14127                 UINT32_C(0x10)
14128         /* 25Gb link speed */
14129         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
14130                 UINT32_C(0x20)
14131         /* 10Gb link speed */
14132         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
14133                 UINT32_C(0x40)
14134         /* 20Gb link speed */
14135         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
14136                 UINT32_C(0x80)
14137         /* 25Gb link speed */
14138         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
14139                 UINT32_C(0x100)
14140         /* 40Gb link speed */
14141         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
14142                 UINT32_C(0x200)
14143         /* 50Gb link speed */
14144         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
14145                 UINT32_C(0x400)
14146         /* 100Gb link speed */
14147         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
14148                 UINT32_C(0x800)
14149         /* 10Mb link speed (Half-duplex) */
14150         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
14151                 UINT32_C(0x1000)
14152         /* 10Mb link speed (Full-duplex) */
14153         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
14154                 UINT32_C(0x2000)
14155         /*
14156          * The advertised autoneg for the port by the link partner.
14157          * This field is deprecated and should be set to 0.
14158          */
14159         uint8_t link_partner_adv_auto_mode;
14160         /* Disable autoneg or autoneg disabled. No speeds are selected. */
14161         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
14162                 UINT32_C(0x0)
14163         /* Select all possible speeds for autoneg mode. */
14164         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
14165                 UINT32_C(0x1)
14166         /*
14167          * Select only the auto_link_speed speed for autoneg mode. This mode has
14168          * been DEPRECATED. An HWRM client should not use this mode.
14169          */
14170         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
14171                 UINT32_C(0x2)
14172         /*
14173          * Select the auto_link_speed or any speed below that speed for autoneg.
14174          * This mode has been DEPRECATED. An HWRM client should not use this mode.
14175          */
14176         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
14177                 UINT32_C(0x3)
14178         /*
14179          * Select the speeds based on the corresponding link speed mask value
14180          * that is provided.
14181          */
14182         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
14183                 UINT32_C(0x4)
14184         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_LAST \
14185                 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK
14186         /* The advertised pause settings on the port by the link partner. */
14187         uint8_t link_partner_adv_pause;
14188         /*
14189          * When this bit is '1', Generation of tx pause messages
14190          * is supported. Disabled otherwise.
14191          */
14192         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
14193                 UINT32_C(0x1)
14194         /*
14195          * When this bit is '1', Reception of rx pause messages
14196          * is supported. Disabled otherwise.
14197          */
14198         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
14199                 UINT32_C(0x2)
14200         /*
14201          * Current setting for link speed mask that is used to
14202          * advertise speeds during autonegotiation when EEE is enabled.
14203          * This field is valid only when eee_enabled flags is set to 1.
14204          * The speeds specified in this field shall be a subset of
14205          * speeds specified in auto_link_speed_mask.
14206          */
14207         uint16_t        adv_eee_link_speed_mask;
14208         /* Reserved */
14209         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
14210                 UINT32_C(0x1)
14211         /* 100Mb link speed (Full-duplex) */
14212         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
14213                 UINT32_C(0x2)
14214         /* Reserved */
14215         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
14216                 UINT32_C(0x4)
14217         /* 1Gb link speed (Full-duplex) */
14218         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
14219                 UINT32_C(0x8)
14220         /* Reserved */
14221         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
14222                 UINT32_C(0x10)
14223         /* Reserved */
14224         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
14225                 UINT32_C(0x20)
14226         /* 10Gb link speed */
14227         #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
14228                 UINT32_C(0x40)
14229         /*
14230          * Current setting for link speed mask that is advertised by
14231          * the link partner when EEE is enabled.
14232          * This field is valid only when eee_enabled flags is set to 1.
14233          */
14234         uint16_t        link_partner_adv_eee_link_speed_mask;
14235         /* Reserved */
14236         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
14237                 UINT32_C(0x1)
14238         /* 100Mb link speed (Full-duplex) */
14239         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
14240                 UINT32_C(0x2)
14241         /* Reserved */
14242         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
14243                 UINT32_C(0x4)
14244         /* 1Gb link speed (Full-duplex) */
14245         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
14246                 UINT32_C(0x8)
14247         /* Reserved */
14248         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
14249                 UINT32_C(0x10)
14250         /* Reserved */
14251         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
14252                 UINT32_C(0x20)
14253         /* 10Gb link speed */
14254         #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
14255                 UINT32_C(0x40)
14256         uint32_t        xcvr_identifier_type_tx_lpi_timer;
14257         /*
14258          * Current setting of TX LPI timer in microseconds.
14259          * This field is valid only when_eee_enabled flag is set to 1
14260          * and tx_lpi_enabled is set to 1.
14261          */
14262         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK \
14263                 UINT32_C(0xffffff)
14264         #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT             0
14265         /* This value represents transceiver identifier type. */
14266         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
14267                 UINT32_C(0xff000000)
14268         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT     24
14269         /* Unknown */
14270         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
14271                 (UINT32_C(0x0) << 24)
14272         /* SFP/SFP+/SFP28 */
14273         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
14274                 (UINT32_C(0x3) << 24)
14275         /* QSFP+ */
14276         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
14277                 (UINT32_C(0xc) << 24)
14278         /* QSFP+ */
14279         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
14280                 (UINT32_C(0xd) << 24)
14281         /* QSFP28 */
14282         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
14283                 (UINT32_C(0x11) << 24)
14284         #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_LAST \
14285                 HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28
14286         /*
14287          * This value represents the current configuration of
14288          * Forward Error Correction (FEC) on the port.
14289          */
14290         uint16_t        fec_cfg;
14291         /*
14292          * When set to 1, then FEC is not supported on this port. If this flag
14293          * is set to 1, then all other FEC configuration flags shall be ignored.
14294          * When set to 0, then FEC is supported as indicated by other
14295          * configuration flags.
14296          * If no cable is attached and the HWRM does not yet know the FEC
14297          * capability, then the HWRM shall set this flag to 1 when reporting
14298          * FEC capability.
14299          */
14300         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
14301                 UINT32_C(0x1)
14302         /*
14303          * When set to 1, then FEC autonegotiation is supported on this port.
14304          * When set to 0, then FEC autonegotiation is not supported on this port.
14305          */
14306         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
14307                 UINT32_C(0x2)
14308         /*
14309          * When set to 1, then FEC autonegotiation is enabled on this port.
14310          * When set to 0, then FEC autonegotiation is disabled if supported.
14311          * This flag should be ignored if FEC autonegotiation is not supported on this port.
14312          */
14313         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
14314                 UINT32_C(0x4)
14315         /*
14316          * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on this port.
14317          * When set to 0, then FEC CLAUSE 74 (Fire Code) is not supported on this port.
14318          */
14319         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
14320                 UINT32_C(0x8)
14321         /*
14322          * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on this port.
14323          * When set to 0, then FEC CLAUSE 74 (Fire Code) is disabled if supported.
14324          * This flag should be ignored if FEC CLAUSE 74 is not supported on this port.
14325          */
14326         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
14327                 UINT32_C(0x10)
14328         /*
14329          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported on this port.
14330          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is not supported on this port.
14331          */
14332         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
14333                 UINT32_C(0x20)
14334         /*
14335          * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled on this port.
14336          * When set to 0, then FEC CLAUSE 91 (Reed Solomon) is disabled if supported.
14337          * This flag should be ignored if FEC CLAUSE 91 is not supported on this port.
14338          */
14339         #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
14340                 UINT32_C(0x40)
14341         /*
14342          * This value is indicates the duplex of the current
14343          * connection state.
14344          */
14345         uint8_t duplex_state;
14346         /* Half Duplex connection. */
14347         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_HALF UINT32_C(0x0)
14348         /* Full duplex connection. */
14349         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL UINT32_C(0x1)
14350         #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_LAST \
14351                 HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_STATE_FULL
14352         /* Option flags fields. */
14353         uint8_t option_flags;
14354         /* When this bit is '1', Media auto detect is enabled. */
14355         #define HWRM_PORT_PHY_QCFG_OUTPUT_OPTION_FLAGS_MEDIA_AUTO_DETECT \
14356                 UINT32_C(0x1)
14357         /*
14358          * Up to 16 bytes of null padded ASCII string representing
14359          * PHY vendor.
14360          * If the string is set to null, then the vendor name is not
14361          * available.
14362          */
14363         char    phy_vendor_name[16];
14364         /*
14365          * Up to 16 bytes of null padded ASCII string that
14366          * identifies vendor specific part number of the PHY.
14367          * If the string is set to null, then the vendor specific
14368          * part number is not available.
14369          */
14370         char    phy_vendor_partnumber[16];
14371         uint8_t unused_2[7];
14372         /*
14373          * This field is used in Output records to indicate that the output
14374          * is completely written to RAM.  This field should be read as '1'
14375          * to indicate that the output has been completely written.
14376          * When writing a command completion or response to an internal processor,
14377          * the order of writes has to be such that this field is written last.
14378          */
14379         uint8_t valid;
14380 } __attribute__((packed));
14381
14382 /*********************
14383  * hwrm_port_mac_cfg *
14384  *********************/
14385
14386
14387 /* hwrm_port_mac_cfg_input (size:384b/48B) */
14388 struct hwrm_port_mac_cfg_input {
14389         /* The HWRM command request type. */
14390         uint16_t        req_type;
14391         /*
14392          * The completion ring to send the completion event on. This should
14393          * be the NQ ID returned from the `nq_alloc` HWRM command.
14394          */
14395         uint16_t        cmpl_ring;
14396         /*
14397          * The sequence ID is used by the driver for tracking multiple
14398          * commands. This ID is treated as opaque data by the firmware and
14399          * the value is returned in the `hwrm_resp_hdr` upon completion.
14400          */
14401         uint16_t        seq_id;
14402         /*
14403          * The target ID of the command:
14404          * * 0x0-0xFFF8 - The function ID
14405          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14406          * * 0xFFFD - Reserved for user-space HWRM interface
14407          * * 0xFFFF - HWRM
14408          */
14409         uint16_t        target_id;
14410         /*
14411          * A physical address pointer pointing to a host buffer that the
14412          * command's response data will be written. This can be either a host
14413          * physical address (HPA) or a guest physical address (GPA) and must
14414          * point to a physically contiguous block of memory.
14415          */
14416         uint64_t        resp_addr;
14417         /*
14418          * In this field, there are a number of CoS mappings related flags
14419          * that are used to configure CoS mappings and their corresponding
14420          * priorities in the hardware.
14421          * For the priorities of CoS mappings, the HWRM uses the following
14422          * priority order (high to low) by default:
14423          * # vlan pri
14424          * # ip_dscp
14425          * # tunnel_vlan_pri
14426          * # default cos
14427          *
14428          * A subset of CoS mappings can be enabled.
14429          * If a priority is not specified for an enabled CoS mapping, the
14430          * priority will be assigned in the above order for the enabled CoS
14431          * mappings. For example, if vlan_pri and ip_dscp CoS mappings are
14432          * enabled and their priorities are not specified, the following
14433          * priority order (high to low) will be used by the HWRM:
14434          * # vlan_pri
14435          * # ip_dscp
14436          * # default cos
14437          *
14438          * vlan_pri CoS mapping together with default CoS with lower priority
14439          * are enabled by default by the HWRM.
14440          */
14441         uint32_t        flags;
14442         /*
14443          * When this bit is '1', this command will configure
14444          * the MAC to match the current link state of the PHY.
14445          * If the link is not established on the PHY, then this
14446          * bit has no effect.
14447          */
14448         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_MATCH_LINK \
14449                 UINT32_C(0x1)
14450         /*
14451          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
14452          * is requested to be enabled.
14453          */
14454         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_ENABLE \
14455                 UINT32_C(0x2)
14456         /*
14457          * When this bit is set to '1', tunnel VLAN PRI field to
14458          * CoS mapping is requested to be enabled.
14459          */
14460         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
14461                 UINT32_C(0x4)
14462         /*
14463          * When this bit is set to '1', the IP DSCP to CoS mapping is
14464          * requested to be enabled.
14465          */
14466         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_ENABLE \
14467                 UINT32_C(0x8)
14468         /*
14469          * When this bit is '1', the HWRM is requested to
14470          * enable timestamp capture capability on the receive side
14471          * of this port.
14472          */
14473         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
14474                 UINT32_C(0x10)
14475         /*
14476          * When this bit is '1', the HWRM is requested to
14477          * disable timestamp capture capability on the receive side
14478          * of this port.
14479          */
14480         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_RX_TS_CAPTURE_DISABLE \
14481                 UINT32_C(0x20)
14482         /*
14483          * When this bit is '1', the HWRM is requested to
14484          * enable timestamp capture capability on the transmit side
14485          * of this port.
14486          */
14487         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
14488                 UINT32_C(0x40)
14489         /*
14490          * When this bit is '1', the HWRM is requested to
14491          * disable timestamp capture capability on the transmit side
14492          * of this port.
14493          */
14494         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_TX_TS_CAPTURE_DISABLE \
14495                 UINT32_C(0x80)
14496         /*
14497          * When this bit is '1', the Out-Of-Box WoL is requested to
14498          * be enabled on this port.
14499          */
14500         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_ENABLE \
14501                 UINT32_C(0x100)
14502         /*
14503          * When this bit is '1', the the Out-Of-Box WoL is requested to
14504          * be disabled on this port.
14505          */
14506         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_OOB_WOL_DISABLE \
14507                 UINT32_C(0x200)
14508         /*
14509          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
14510          * is requested to be disabled.
14511          */
14512         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_VLAN_PRI2COS_DISABLE \
14513                 UINT32_C(0x400)
14514         /*
14515          * When this bit is set to '1', tunnel VLAN PRI field to
14516          * CoS mapping is requested to be disabled.
14517          */
14518         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_TUNNEL_PRI2COS_DISABLE \
14519                 UINT32_C(0x800)
14520         /*
14521          * When this bit is set to '1', the IP DSCP to CoS mapping is
14522          * requested to be disabled.
14523          */
14524         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_IP_DSCP2COS_DISABLE \
14525                 UINT32_C(0x1000)
14526         /*
14527          * When this bit is set to '1', and the ptp_tx_ts_capture_enable
14528          * bit is set, then the device uses one step Tx timestamping.
14529          * This bit is temporary and used for experimental purposes.
14530          */
14531         #define HWRM_PORT_MAC_CFG_INPUT_FLAGS_PTP_ONE_STEP_TX_TS \
14532                 UINT32_C(0x2000)
14533         uint32_t        enables;
14534         /*
14535          * This bit must be '1' for the ipg field to be
14536          * configured.
14537          */
14538         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_IPG \
14539                 UINT32_C(0x1)
14540         /*
14541          * This bit must be '1' for the lpbk field to be
14542          * configured.
14543          */
14544         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_LPBK \
14545                 UINT32_C(0x2)
14546         /*
14547          * This bit must be '1' for the vlan_pri2cos_map_pri field to be
14548          * configured.
14549          */
14550         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_VLAN_PRI2COS_MAP_PRI \
14551                 UINT32_C(0x4)
14552         /*
14553          * This bit must be '1' for the tunnel_pri2cos_map_pri field to be
14554          * configured.
14555          */
14556         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TUNNEL_PRI2COS_MAP_PRI \
14557                 UINT32_C(0x10)
14558         /*
14559          * This bit must be '1' for the dscp2cos_map_pri field to be
14560          * configured.
14561          */
14562         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_DSCP2COS_MAP_PRI \
14563                 UINT32_C(0x20)
14564         /*
14565          * This bit must be '1' for the rx_ts_capture_ptp_msg_type field to be
14566          * configured.
14567          */
14568         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE \
14569                 UINT32_C(0x40)
14570         /*
14571          * This bit must be '1' for the tx_ts_capture_ptp_msg_type field to be
14572          * configured.
14573          */
14574         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE \
14575                 UINT32_C(0x80)
14576         /*
14577          * This bit must be '1' for the cos_field_cfg field to be
14578          * configured.
14579          */
14580         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_COS_FIELD_CFG \
14581                 UINT32_C(0x100)
14582         /*
14583          * This bit must be '1' for the ptp_freq_adj_ppb field to be
14584          * configured.
14585          */
14586         #define HWRM_PORT_MAC_CFG_INPUT_ENABLES_PTP_FREQ_ADJ_PPB \
14587                 UINT32_C(0x200)
14588         /* Port ID of port that is to be configured. */
14589         uint16_t        port_id;
14590         /*
14591          * This value is used to configure the minimum IPG that will
14592          * be sent between packets by this port.
14593          */
14594         uint8_t ipg;
14595         /* This value controls the loopback setting for the MAC. */
14596         uint8_t lpbk;
14597         /* No loopback is selected.  Normal operation. */
14598         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_NONE   UINT32_C(0x0)
14599         /*
14600          * The HW will be configured with local loopback such that
14601          * host data is sent back to the host without modification.
14602          */
14603         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LOCAL  UINT32_C(0x1)
14604         /*
14605          * The HW will be configured with remote loopback such that
14606          * port logic will send packets back out the transmitter that
14607          * are received.
14608          */
14609         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
14610         #define HWRM_PORT_MAC_CFG_INPUT_LPBK_LAST \
14611                 HWRM_PORT_MAC_CFG_INPUT_LPBK_REMOTE
14612         /*
14613          * This value controls the priority setting of VLAN PRI to CoS
14614          * mapping based on VLAN Tags of inner packet headers of
14615          * tunneled packets or packet headers of non-tunneled packets.
14616          *
14617          * # Each XXX_pri variable shall have a unique priority value
14618          * when it is being specified.
14619          * # When comparing priorities of mappings, higher value
14620          * indicates higher priority.
14621          * For example, a value of 0-3 is returned where 0 is being
14622          * the lowest priority and 3 is being the highest priority.
14623          */
14624         uint8_t vlan_pri2cos_map_pri;
14625         /* Reserved field. */
14626         uint8_t reserved1;
14627         /*
14628          * This value controls the priority setting of VLAN PRI to CoS
14629          * mapping based on VLAN Tags of tunneled header.
14630          * This mapping only applies when tunneled headers
14631          * are present.
14632          *
14633          * # Each XXX_pri variable shall have a unique priority value
14634          * when it is being specified.
14635          * # When comparing priorities of mappings, higher value
14636          * indicates higher priority.
14637          * For example, a value of 0-3 is returned where 0 is being
14638          * the lowest priority and 3 is being the highest priority.
14639          */
14640         uint8_t tunnel_pri2cos_map_pri;
14641         /*
14642          * This value controls the priority setting of IP DSCP to CoS
14643          * mapping based on inner IP header of tunneled packets or
14644          * IP header of non-tunneled packets.
14645          *
14646          * # Each XXX_pri variable shall have a unique priority value
14647          * when it is being specified.
14648          * # When comparing priorities of mappings, higher value
14649          * indicates higher priority.
14650          * For example, a value of 0-3 is returned where 0 is being
14651          * the lowest priority and 3 is being the highest priority.
14652          */
14653         uint8_t dscp2pri_map_pri;
14654         /*
14655          * This is a 16-bit bit mask that is used to request a
14656          * specific configuration of time stamp capture of PTP messages
14657          * on the receive side of this port.
14658          * This field shall be ignored if the ptp_rx_ts_capture_enable
14659          * flag is not set in this command.
14660          * Otherwise, if bit 'i' is set, then the HWRM is being
14661          * requested to configure the receive side of the port to
14662          * capture the time stamp of every received PTP message
14663          * with messageType field value set to i.
14664          */
14665         uint16_t        rx_ts_capture_ptp_msg_type;
14666         /*
14667          * This is a 16-bit bit mask that is used to request a
14668          * specific configuration of time stamp capture of PTP messages
14669          * on the transmit side of this port.
14670          * This field shall be ignored if the ptp_tx_ts_capture_enable
14671          * flag is not set in this command.
14672          * Otherwise, if bit 'i' is set, then the HWRM is being
14673          * requested to configure the transmit sied of the port to
14674          * capture the time stamp of every transmitted PTP message
14675          * with messageType field value set to i.
14676          */
14677         uint16_t        tx_ts_capture_ptp_msg_type;
14678         /* Configuration of CoS fields. */
14679         uint8_t cos_field_cfg;
14680         /* Reserved */
14681         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_RSVD1 \
14682                 UINT32_C(0x1)
14683         /*
14684          * This field is used to specify selection of VLAN PRI value
14685          * based on whether one or two VLAN Tags are present in
14686          * the inner packet headers of tunneled packets or
14687          * non-tunneled packets.
14688          * This field is valid only if inner VLAN PRI to CoS mapping
14689          * is enabled.
14690          * If VLAN PRI to CoS mapping is not enabled, then this
14691          * field shall be ignored.
14692          */
14693         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
14694                 UINT32_C(0x6)
14695         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
14696                 1
14697         /*
14698          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
14699          * present in the inner packet headers
14700          */
14701         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
14702                 (UINT32_C(0x0) << 1)
14703         /*
14704          * Select outer VLAN Tag PRI when 2 VLAN Tags are
14705          * present in the inner packet headers.
14706          * No VLAN PRI shall be selected for this configuration
14707          * if only one VLAN Tag is present in the inner
14708          * packet headers.
14709          */
14710         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
14711                 (UINT32_C(0x1) << 1)
14712         /*
14713          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
14714          * are present in the inner packet headers
14715          */
14716         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
14717                 (UINT32_C(0x2) << 1)
14718         /* Unspecified */
14719         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
14720                 (UINT32_C(0x3) << 1)
14721         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
14722                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
14723         /*
14724          * This field is used to specify selection of tunnel VLAN
14725          * PRI value based on whether one or two VLAN Tags are
14726          * present in tunnel headers.
14727          * This field is valid only if tunnel VLAN PRI to CoS mapping
14728          * is enabled.
14729          * If tunnel VLAN PRI to CoS mapping is not enabled, then this
14730          * field shall be ignored.
14731          */
14732         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
14733                 UINT32_C(0x18)
14734         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
14735                 3
14736         /*
14737          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
14738          * present in the tunnel packet headers
14739          */
14740         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
14741                 (UINT32_C(0x0) << 3)
14742         /*
14743          * Select outer VLAN Tag PRI when 2 VLAN Tags are
14744          * present in the tunnel packet headers.
14745          * No tunnel VLAN PRI shall be selected for this
14746          * configuration if only one VLAN Tag is present in
14747          * the tunnel packet headers.
14748          */
14749         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
14750                 (UINT32_C(0x1) << 3)
14751         /*
14752          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
14753          * are present in the tunnel packet headers
14754          */
14755         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
14756                 (UINT32_C(0x2) << 3)
14757         /* Unspecified */
14758         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
14759                 (UINT32_C(0x3) << 3)
14760         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
14761                 HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
14762         /*
14763          * This field shall be used to provide default CoS value
14764          * that has been configured on this port.
14765          * This field is valid only if default CoS mapping
14766          * is enabled.
14767          * If default CoS mapping is not enabled, then this
14768          * field shall be ignored.
14769          */
14770         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
14771                 UINT32_C(0xe0)
14772         #define HWRM_PORT_MAC_CFG_INPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
14773                 5
14774         uint8_t unused_0[3];
14775         /*
14776          * This signed field specifies by how much to adjust the frequency
14777          * of sync timer updates (measured in parts per billion).
14778          */
14779         int32_t ptp_freq_adj_ppb;
14780         uint8_t unused_1[4];
14781 } __attribute__((packed));
14782
14783 /* hwrm_port_mac_cfg_output (size:128b/16B) */
14784 struct hwrm_port_mac_cfg_output {
14785         /* The specific error status for the command. */
14786         uint16_t        error_code;
14787         /* The HWRM command request type. */
14788         uint16_t        req_type;
14789         /* The sequence ID from the original command. */
14790         uint16_t        seq_id;
14791         /* The length of the response data in number of bytes. */
14792         uint16_t        resp_len;
14793         /*
14794          * This is the configured maximum length of Ethernet packet
14795          * payload that is allowed to be received on the port.
14796          * This value does not include the number of bytes used by
14797          * Ethernet header and trailer (CRC).
14798          */
14799         uint16_t        mru;
14800         /*
14801          * This is the configured maximum length of Ethernet packet
14802          * payload that is allowed to be transmitted on the port.
14803          * This value does not include the number of bytes used by
14804          * Ethernet header and trailer (CRC).
14805          */
14806         uint16_t        mtu;
14807         /* Current configuration of the IPG value. */
14808         uint8_t ipg;
14809         /* Current value of the loopback value. */
14810         uint8_t lpbk;
14811         /* No loopback is selected.  Normal operation. */
14812         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
14813         /*
14814          * The HW will be configured with local loopback such that
14815          * host data is sent back to the host without modification.
14816          */
14817         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
14818         /*
14819          * The HW will be configured with remote loopback such that
14820          * port logic will send packets back out the transmitter that
14821          * are received.
14822          */
14823         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
14824         #define HWRM_PORT_MAC_CFG_OUTPUT_LPBK_LAST \
14825                 HWRM_PORT_MAC_CFG_OUTPUT_LPBK_REMOTE
14826         uint8_t unused_0;
14827         /*
14828          * This field is used in Output records to indicate that the output
14829          * is completely written to RAM.  This field should be read as '1'
14830          * to indicate that the output has been completely written.
14831          * When writing a command completion or response to an internal processor,
14832          * the order of writes has to be such that this field is written last.
14833          */
14834         uint8_t valid;
14835 } __attribute__((packed));
14836
14837 /**********************
14838  * hwrm_port_mac_qcfg *
14839  **********************/
14840
14841
14842 /* hwrm_port_mac_qcfg_input (size:192b/24B) */
14843 struct hwrm_port_mac_qcfg_input {
14844         /* The HWRM command request type. */
14845         uint16_t        req_type;
14846         /*
14847          * The completion ring to send the completion event on. This should
14848          * be the NQ ID returned from the `nq_alloc` HWRM command.
14849          */
14850         uint16_t        cmpl_ring;
14851         /*
14852          * The sequence ID is used by the driver for tracking multiple
14853          * commands. This ID is treated as opaque data by the firmware and
14854          * the value is returned in the `hwrm_resp_hdr` upon completion.
14855          */
14856         uint16_t        seq_id;
14857         /*
14858          * The target ID of the command:
14859          * * 0x0-0xFFF8 - The function ID
14860          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
14861          * * 0xFFFD - Reserved for user-space HWRM interface
14862          * * 0xFFFF - HWRM
14863          */
14864         uint16_t        target_id;
14865         /*
14866          * A physical address pointer pointing to a host buffer that the
14867          * command's response data will be written. This can be either a host
14868          * physical address (HPA) or a guest physical address (GPA) and must
14869          * point to a physically contiguous block of memory.
14870          */
14871         uint64_t        resp_addr;
14872         /* Port ID of port that is to be configured. */
14873         uint16_t        port_id;
14874         uint8_t unused_0[6];
14875 } __attribute__((packed));
14876
14877 /* hwrm_port_mac_qcfg_output (size:192b/24B) */
14878 struct hwrm_port_mac_qcfg_output {
14879         /* The specific error status for the command. */
14880         uint16_t        error_code;
14881         /* The HWRM command request type. */
14882         uint16_t        req_type;
14883         /* The sequence ID from the original command. */
14884         uint16_t        seq_id;
14885         /* The length of the response data in number of bytes. */
14886         uint16_t        resp_len;
14887         /*
14888          * This is the configured maximum length of Ethernet packet
14889          * payload that is allowed to be received on the port.
14890          * This value does not include the number of bytes used by the
14891          * Ethernet header and trailer (CRC).
14892          */
14893         uint16_t        mru;
14894         /*
14895          * This is the configured maximum length of Ethernet packet
14896          * payload that is allowed to be transmitted on the port.
14897          * This value does not include the number of bytes used by the
14898          * Ethernet header and trailer (CRC).
14899          */
14900         uint16_t        mtu;
14901         /*
14902          * The minimum IPG that will
14903          * be sent between packets by this port.
14904          */
14905         uint8_t ipg;
14906         /* The loopback setting for the MAC. */
14907         uint8_t lpbk;
14908         /* No loopback is selected.  Normal operation. */
14909         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_NONE   UINT32_C(0x0)
14910         /*
14911          * The HW will be configured with local loopback such that
14912          * host data is sent back to the host without modification.
14913          */
14914         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LOCAL  UINT32_C(0x1)
14915         /*
14916          * The HW will be configured with remote loopback such that
14917          * port logic will send packets back out the transmitter that
14918          * are received.
14919          */
14920         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
14921         #define HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_LAST \
14922                 HWRM_PORT_MAC_QCFG_OUTPUT_LPBK_REMOTE
14923         /*
14924          * Priority setting for VLAN PRI to CoS mapping.
14925          * # Each XXX_pri variable shall have a unique priority value
14926          * when it is being used.
14927          * # When comparing priorities of mappings, higher value
14928          * indicates higher priority.
14929          * For example, a value of 0-3 is returned where 0 is being
14930          * the lowest priority and 3 is being the highest priority.
14931          * # If the correspoding CoS mapping is not enabled, then this
14932          * field should be ignored.
14933          * # This value indicates the normalized priority value retained
14934          * in the HWRM.
14935          */
14936         uint8_t vlan_pri2cos_map_pri;
14937         /*
14938          * In this field, a number of CoS mappings related flags
14939          * are used to indicate configured CoS mappings.
14940          */
14941         uint8_t flags;
14942         /*
14943          * When this bit is set to '1', the inner VLAN PRI to CoS mapping
14944          * is enabled.
14945          */
14946         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_VLAN_PRI2COS_ENABLE \
14947                 UINT32_C(0x1)
14948         /*
14949          * When this bit is set to '1', tunnel VLAN PRI field to
14950          * CoS mapping is enabled.
14951          */
14952         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_TUNNEL_PRI2COS_ENABLE \
14953                 UINT32_C(0x2)
14954         /*
14955          * When this bit is set to '1', the IP DSCP to CoS mapping is
14956          * enabled.
14957          */
14958         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_IP_DSCP2COS_ENABLE \
14959                 UINT32_C(0x4)
14960         /*
14961          * When this bit is '1', the Out-Of-Box WoL is enabled on this
14962          * port.
14963          */
14964         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_OOB_WOL_ENABLE \
14965                 UINT32_C(0x8)
14966         /* When this bit is '1', PTP is enabled for RX on this port. */
14967         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_RX_TS_CAPTURE_ENABLE \
14968                 UINT32_C(0x10)
14969         /* When this bit is '1', PTP is enabled for TX on this port. */
14970         #define HWRM_PORT_MAC_QCFG_OUTPUT_FLAGS_PTP_TX_TS_CAPTURE_ENABLE \
14971                 UINT32_C(0x20)
14972         /*
14973          * Priority setting for tunnel VLAN PRI to CoS mapping.
14974          * # Each XXX_pri variable shall have a unique priority value
14975          * when it is being used.
14976          * # When comparing priorities of mappings, higher value
14977          * indicates higher priority.
14978          * For example, a value of 0-3 is returned where 0 is being
14979          * the lowest priority and 3 is being the highest priority.
14980          * # If the correspoding CoS mapping is not enabled, then this
14981          * field should be ignored.
14982          * # This value indicates the normalized priority value retained
14983          * in the HWRM.
14984          */
14985         uint8_t tunnel_pri2cos_map_pri;
14986         /*
14987          * Priority setting for DSCP to PRI mapping.
14988          * # Each XXX_pri variable shall have a unique priority value
14989          * when it is being used.
14990          * # When comparing priorities of mappings, higher value
14991          * indicates higher priority.
14992          * For example, a value of 0-3 is returned where 0 is being
14993          * the lowest priority and 3 is being the highest priority.
14994          * # If the correspoding CoS mapping is not enabled, then this
14995          * field should be ignored.
14996          * # This value indicates the normalized priority value retained
14997          * in the HWRM.
14998          */
14999         uint8_t dscp2pri_map_pri;
15000         /*
15001          * This is a 16-bit bit mask that represents the
15002          * current configuration of time stamp capture of PTP messages
15003          * on the receive side of this port.
15004          * If bit 'i' is set, then the receive side of the port
15005          * is configured to capture the time stamp of every
15006          * received PTP message with messageType field value set
15007          * to i.
15008          * If all bits are set to 0 (i.e. field value set 0),
15009          * then the receive side of the port is not configured
15010          * to capture timestamp for PTP messages.
15011          * If all bits are set to 1, then the receive side of the
15012          * port is configured to capture timestamp for all PTP
15013          * messages.
15014          */
15015         uint16_t        rx_ts_capture_ptp_msg_type;
15016         /*
15017          * This is a 16-bit bit mask that represents the
15018          * current configuration of time stamp capture of PTP messages
15019          * on the transmit side of this port.
15020          * If bit 'i' is set, then the transmit side of the port
15021          * is configured to capture the time stamp of every
15022          * received PTP message with messageType field value set
15023          * to i.
15024          * If all bits are set to 0 (i.e. field value set 0),
15025          * then the transmit side of the port is not configured
15026          * to capture timestamp for PTP messages.
15027          * If all bits are set to 1, then the transmit side of the
15028          * port is configured to capture timestamp for all PTP
15029          * messages.
15030          */
15031         uint16_t        tx_ts_capture_ptp_msg_type;
15032         /* Configuration of CoS fields. */
15033         uint8_t cos_field_cfg;
15034         /* Reserved */
15035         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_RSVD \
15036                 UINT32_C(0x1)
15037         /*
15038          * This field is used for selecting VLAN PRI value
15039          * based on whether one or two VLAN Tags are present in
15040          * the inner packet headers of tunneled packets or
15041          * non-tunneled packets.
15042          */
15043         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_MASK \
15044                 UINT32_C(0x6)
15045         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_SFT \
15046                 1
15047         /*
15048          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
15049          * present in the inner packet headers
15050          */
15051         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_INNERMOST \
15052                 (UINT32_C(0x0) << 1)
15053         /*
15054          * Select outer VLAN Tag PRI when 2 VLAN Tags are
15055          * present in the inner packet headers.
15056          * No VLAN PRI is selected for this configuration
15057          * if only one VLAN Tag is present in the inner
15058          * packet headers.
15059          */
15060         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTER \
15061                 (UINT32_C(0x1) << 1)
15062         /*
15063          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
15064          * are present in the inner packet headers
15065          */
15066         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_OUTERMOST \
15067                 (UINT32_C(0x2) << 1)
15068         /* Unspecified */
15069         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED \
15070                 (UINT32_C(0x3) << 1)
15071         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_LAST \
15072                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_VLAN_PRI_SEL_UNSPECIFIED
15073         /*
15074          * This field is used for selecting tunnel VLAN PRI value
15075          * based on whether one or two VLAN Tags are present in
15076          * the tunnel headers of tunneled packets. This selection
15077          * does not apply to non-tunneled packets.
15078          */
15079         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_MASK \
15080                 UINT32_C(0x18)
15081         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_SFT \
15082                 3
15083         /*
15084          * Select inner VLAN PRI when 1 or 2 VLAN Tags are
15085          * present in the tunnel packet headers
15086          */
15087         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_INNERMOST \
15088                 (UINT32_C(0x0) << 3)
15089         /*
15090          * Select outer VLAN Tag PRI when 2 VLAN Tags are
15091          * present in the tunnel packet headers.
15092          * No VLAN PRI is selected for this configuration
15093          * if only one VLAN Tag is present in the tunnel
15094          * packet headers.
15095          */
15096         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTER \
15097                 (UINT32_C(0x1) << 3)
15098         /*
15099          * Select outermost VLAN PRI when 1 or 2 VLAN Tags
15100          * are present in the tunnel packet headers
15101          */
15102         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_OUTERMOST \
15103                 (UINT32_C(0x2) << 3)
15104         /* Unspecified */
15105         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED \
15106                 (UINT32_C(0x3) << 3)
15107         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_LAST \
15108                 HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_T_VLAN_PRI_SEL_UNSPECIFIED
15109         /*
15110          * This field is used to provide default CoS value that
15111          * has been configured on this port.
15112          */
15113         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_MASK \
15114                 UINT32_C(0xe0)
15115         #define HWRM_PORT_MAC_QCFG_OUTPUT_COS_FIELD_CFG_DEFAULT_COS_SFT \
15116                 5
15117         /*
15118          * This field is used in Output records to indicate that the output
15119          * is completely written to RAM.  This field should be read as '1'
15120          * to indicate that the output has been completely written.
15121          * When writing a command completion or response to an internal processor,
15122          * the order of writes has to be such that this field is written last.
15123          */
15124         uint8_t valid;
15125 } __attribute__((packed));
15126
15127 /**************************
15128  * hwrm_port_mac_ptp_qcfg *
15129  **************************/
15130
15131
15132 /* hwrm_port_mac_ptp_qcfg_input (size:192b/24B) */
15133 struct hwrm_port_mac_ptp_qcfg_input {
15134         /* The HWRM command request type. */
15135         uint16_t        req_type;
15136         /*
15137          * The completion ring to send the completion event on. This should
15138          * be the NQ ID returned from the `nq_alloc` HWRM command.
15139          */
15140         uint16_t        cmpl_ring;
15141         /*
15142          * The sequence ID is used by the driver for tracking multiple
15143          * commands. This ID is treated as opaque data by the firmware and
15144          * the value is returned in the `hwrm_resp_hdr` upon completion.
15145          */
15146         uint16_t        seq_id;
15147         /*
15148          * The target ID of the command:
15149          * * 0x0-0xFFF8 - The function ID
15150          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15151          * * 0xFFFD - Reserved for user-space HWRM interface
15152          * * 0xFFFF - HWRM
15153          */
15154         uint16_t        target_id;
15155         /*
15156          * A physical address pointer pointing to a host buffer that the
15157          * command's response data will be written. This can be either a host
15158          * physical address (HPA) or a guest physical address (GPA) and must
15159          * point to a physically contiguous block of memory.
15160          */
15161         uint64_t        resp_addr;
15162         /* Port ID of port that is being queried. */
15163         uint16_t        port_id;
15164         uint8_t unused_0[6];
15165 } __attribute__((packed));
15166
15167 /* hwrm_port_mac_ptp_qcfg_output (size:640b/80B) */
15168 struct hwrm_port_mac_ptp_qcfg_output {
15169         /* The specific error status for the command. */
15170         uint16_t        error_code;
15171         /* The HWRM command request type. */
15172         uint16_t        req_type;
15173         /* The sequence ID from the original command. */
15174         uint16_t        seq_id;
15175         /* The length of the response data in number of bytes. */
15176         uint16_t        resp_len;
15177         /*
15178          * In this field, a number of PTP related flags
15179          * are used to indicate configured PTP capabilities.
15180          */
15181         uint8_t flags;
15182         /*
15183          * When this bit is set to '1', the PTP related registers are
15184          * directly accessible by the host.
15185          */
15186         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS \
15187                 UINT32_C(0x1)
15188         /*
15189          * When this bit is set to '1', the PTP information is accessible
15190          * via HWRM commands.
15191          */
15192         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS \
15193                 UINT32_C(0x2)
15194         /*
15195          * When this bit is set to '1', the device supports one-step
15196          * Tx timestamping.
15197          */
15198         #define HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS \
15199                 UINT32_C(0x4)
15200         uint8_t unused_0[3];
15201         /* Offset of the PTP register for the lower 32 bits of timestamp for RX. */
15202         uint32_t        rx_ts_reg_off_lower;
15203         /* Offset of the PTP register for the upper 32 bits of timestamp for RX. */
15204         uint32_t        rx_ts_reg_off_upper;
15205         /* Offset of the PTP register for the sequence ID for RX. */
15206         uint32_t        rx_ts_reg_off_seq_id;
15207         /* Offset of the first PTP source ID for RX. */
15208         uint32_t        rx_ts_reg_off_src_id_0;
15209         /* Offset of the second PTP source ID for RX. */
15210         uint32_t        rx_ts_reg_off_src_id_1;
15211         /* Offset of the third PTP source ID for RX. */
15212         uint32_t        rx_ts_reg_off_src_id_2;
15213         /* Offset of the domain ID for RX. */
15214         uint32_t        rx_ts_reg_off_domain_id;
15215         /* Offset of the PTP FIFO register for RX. */
15216         uint32_t        rx_ts_reg_off_fifo;
15217         /* Offset of the PTP advance FIFO register for RX. */
15218         uint32_t        rx_ts_reg_off_fifo_adv;
15219         /* PTP timestamp granularity for RX. */
15220         uint32_t        rx_ts_reg_off_granularity;
15221         /* Offset of the PTP register for the lower 32 bits of timestamp for TX. */
15222         uint32_t        tx_ts_reg_off_lower;
15223         /* Offset of the PTP register for the upper 32 bits of timestamp for TX. */
15224         uint32_t        tx_ts_reg_off_upper;
15225         /* Offset of the PTP register for the sequence ID for TX. */
15226         uint32_t        tx_ts_reg_off_seq_id;
15227         /* Offset of the PTP FIFO register for TX. */
15228         uint32_t        tx_ts_reg_off_fifo;
15229         /* PTP timestamp granularity for TX. */
15230         uint32_t        tx_ts_reg_off_granularity;
15231         uint8_t unused_1[7];
15232         /*
15233          * This field is used in Output records to indicate that the output
15234          * is completely written to RAM.  This field should be read as '1'
15235          * to indicate that the output has been completely written.
15236          * When writing a command completion or response to an internal processor,
15237          * the order of writes has to be such that this field is written last.
15238          */
15239         uint8_t valid;
15240 } __attribute__((packed));
15241
15242 /* Port Tx Statistics Formats */
15243 /* tx_port_stats (size:3264b/408B) */
15244 struct tx_port_stats {
15245         /* Total Number of 64 Bytes frames transmitted */
15246         uint64_t        tx_64b_frames;
15247         /* Total Number of 65-127 Bytes frames transmitted */
15248         uint64_t        tx_65b_127b_frames;
15249         /* Total Number of 128-255 Bytes frames transmitted */
15250         uint64_t        tx_128b_255b_frames;
15251         /* Total Number of 256-511 Bytes frames transmitted */
15252         uint64_t        tx_256b_511b_frames;
15253         /* Total Number of 512-1023 Bytes frames transmitted */
15254         uint64_t        tx_512b_1023b_frames;
15255         /* Total Number of 1024-1518 Bytes frames transmitted */
15256         uint64_t        tx_1024b_1518b_frames;
15257         /*
15258          * Total Number of each good VLAN (exludes FCS errors)
15259          * frame transmitted which is 1519 to 1522 bytes in length
15260          * inclusive (excluding framing bits but including FCS bytes).
15261          */
15262         uint64_t        tx_good_vlan_frames;
15263         /* Total Number of 1519-2047 Bytes frames transmitted */
15264         uint64_t        tx_1519b_2047b_frames;
15265         /* Total Number of 2048-4095 Bytes frames transmitted */
15266         uint64_t        tx_2048b_4095b_frames;
15267         /* Total Number of 4096-9216 Bytes frames transmitted */
15268         uint64_t        tx_4096b_9216b_frames;
15269         /* Total Number of 9217-16383 Bytes frames transmitted */
15270         uint64_t        tx_9217b_16383b_frames;
15271         /* Total Number of good frames transmitted */
15272         uint64_t        tx_good_frames;
15273         /* Total Number of frames transmitted */
15274         uint64_t        tx_total_frames;
15275         /* Total number of unicast frames transmitted */
15276         uint64_t        tx_ucast_frames;
15277         /* Total number of multicast frames transmitted */
15278         uint64_t        tx_mcast_frames;
15279         /* Total number of broadcast frames transmitted */
15280         uint64_t        tx_bcast_frames;
15281         /* Total number of PAUSE control frames transmitted */
15282         uint64_t        tx_pause_frames;
15283         /*
15284          * Total number of PFC/per-priority PAUSE
15285          * control frames transmitted
15286          */
15287         uint64_t        tx_pfc_frames;
15288         /* Total number of jabber frames transmitted */
15289         uint64_t        tx_jabber_frames;
15290         /* Total number of frames transmitted with FCS error */
15291         uint64_t        tx_fcs_err_frames;
15292         /* Total number of control frames transmitted */
15293         uint64_t        tx_control_frames;
15294         /* Total number of over-sized frames transmitted */
15295         uint64_t        tx_oversz_frames;
15296         /* Total number of frames with single deferral */
15297         uint64_t        tx_single_dfrl_frames;
15298         /* Total number of frames with multiple deferrals */
15299         uint64_t        tx_multi_dfrl_frames;
15300         /* Total number of frames with single collision */
15301         uint64_t        tx_single_coll_frames;
15302         /* Total number of frames with multiple collisions */
15303         uint64_t        tx_multi_coll_frames;
15304         /* Total number of frames with late collisions */
15305         uint64_t        tx_late_coll_frames;
15306         /* Total number of frames with excessive collisions */
15307         uint64_t        tx_excessive_coll_frames;
15308         /* Total number of fragmented frames transmitted */
15309         uint64_t        tx_frag_frames;
15310         /* Total number of transmit errors */
15311         uint64_t        tx_err;
15312         /* Total number of single VLAN tagged frames transmitted */
15313         uint64_t        tx_tagged_frames;
15314         /* Total number of double VLAN tagged frames transmitted */
15315         uint64_t        tx_dbl_tagged_frames;
15316         /* Total number of runt frames transmitted */
15317         uint64_t        tx_runt_frames;
15318         /* Total number of TX FIFO under runs */
15319         uint64_t        tx_fifo_underruns;
15320         /*
15321          * Total number of PFC frames with PFC enabled bit for
15322          * Pri 0 transmitted
15323          */
15324         uint64_t        tx_pfc_ena_frames_pri0;
15325         /*
15326          * Total number of PFC frames with PFC enabled bit for
15327          * Pri 1 transmitted
15328          */
15329         uint64_t        tx_pfc_ena_frames_pri1;
15330         /*
15331          * Total number of PFC frames with PFC enabled bit for
15332          * Pri 2 transmitted
15333          */
15334         uint64_t        tx_pfc_ena_frames_pri2;
15335         /*
15336          * Total number of PFC frames with PFC enabled bit for
15337          * Pri 3 transmitted
15338          */
15339         uint64_t        tx_pfc_ena_frames_pri3;
15340         /*
15341          * Total number of PFC frames with PFC enabled bit for
15342          * Pri 4 transmitted
15343          */
15344         uint64_t        tx_pfc_ena_frames_pri4;
15345         /*
15346          * Total number of PFC frames with PFC enabled bit for
15347          * Pri 5 transmitted
15348          */
15349         uint64_t        tx_pfc_ena_frames_pri5;
15350         /*
15351          * Total number of PFC frames with PFC enabled bit for
15352          * Pri 6 transmitted
15353          */
15354         uint64_t        tx_pfc_ena_frames_pri6;
15355         /*
15356          * Total number of PFC frames with PFC enabled bit for
15357          * Pri 7 transmitted
15358          */
15359         uint64_t        tx_pfc_ena_frames_pri7;
15360         /* Total number of EEE LPI Events on TX */
15361         uint64_t        tx_eee_lpi_events;
15362         /* EEE LPI Duration Counter on TX */
15363         uint64_t        tx_eee_lpi_duration;
15364         /*
15365          * Total number of Link Level Flow Control (LLFC) messages
15366          * transmitted
15367          */
15368         uint64_t        tx_llfc_logical_msgs;
15369         /* Total number of HCFC messages transmitted */
15370         uint64_t        tx_hcfc_msgs;
15371         /* Total number of TX collisions */
15372         uint64_t        tx_total_collisions;
15373         /* Total number of transmitted bytes */
15374         uint64_t        tx_bytes;
15375         /* Total number of end-to-end HOL frames */
15376         uint64_t        tx_xthol_frames;
15377         /* Total Tx Drops per Port reported by STATS block */
15378         uint64_t        tx_stat_discard;
15379         /* Total Tx Error Drops per Port reported by STATS block */
15380         uint64_t        tx_stat_error;
15381 } __attribute__((packed));
15382
15383 /* Port Rx Statistics Formats */
15384 /* rx_port_stats (size:4224b/528B) */
15385 struct rx_port_stats {
15386         /* Total Number of 64 Bytes frames received */
15387         uint64_t        rx_64b_frames;
15388         /* Total Number of 65-127 Bytes frames received */
15389         uint64_t        rx_65b_127b_frames;
15390         /* Total Number of 128-255 Bytes frames received */
15391         uint64_t        rx_128b_255b_frames;
15392         /* Total Number of 256-511 Bytes frames received */
15393         uint64_t        rx_256b_511b_frames;
15394         /* Total Number of 512-1023 Bytes frames received */
15395         uint64_t        rx_512b_1023b_frames;
15396         /* Total Number of 1024-1518 Bytes frames received */
15397         uint64_t        rx_1024b_1518b_frames;
15398         /*
15399          * Total Number of each good VLAN (exludes FCS errors)
15400          * frame received which is 1519 to 1522 bytes in length
15401          * inclusive (excluding framing bits but including FCS bytes).
15402          */
15403         uint64_t        rx_good_vlan_frames;
15404         /* Total Number of 1519-2047 Bytes frames received */
15405         uint64_t        rx_1519b_2047b_frames;
15406         /* Total Number of 2048-4095 Bytes frames received */
15407         uint64_t        rx_2048b_4095b_frames;
15408         /* Total Number of 4096-9216 Bytes frames received */
15409         uint64_t        rx_4096b_9216b_frames;
15410         /* Total Number of 9217-16383 Bytes frames received */
15411         uint64_t        rx_9217b_16383b_frames;
15412         /* Total number of frames received */
15413         uint64_t        rx_total_frames;
15414         /* Total number of unicast frames received */
15415         uint64_t        rx_ucast_frames;
15416         /* Total number of multicast frames received */
15417         uint64_t        rx_mcast_frames;
15418         /* Total number of broadcast frames received */
15419         uint64_t        rx_bcast_frames;
15420         /* Total number of received frames with FCS error */
15421         uint64_t        rx_fcs_err_frames;
15422         /* Total number of control frames received */
15423         uint64_t        rx_ctrl_frames;
15424         /* Total number of PAUSE frames received */
15425         uint64_t        rx_pause_frames;
15426         /* Total number of PFC frames received */
15427         uint64_t        rx_pfc_frames;
15428         /*
15429          * Total number of frames received with an unsupported
15430          * opcode
15431          */
15432         uint64_t        rx_unsupported_opcode_frames;
15433         /*
15434          * Total number of frames received with an unsupported
15435          * DA for pause and PFC
15436          */
15437         uint64_t        rx_unsupported_da_pausepfc_frames;
15438         /* Total number of frames received with an unsupported SA */
15439         uint64_t        rx_wrong_sa_frames;
15440         /* Total number of received packets with alignment error */
15441         uint64_t        rx_align_err_frames;
15442         /* Total number of received frames with out-of-range length */
15443         uint64_t        rx_oor_len_frames;
15444         /* Total number of received frames with error termination */
15445         uint64_t        rx_code_err_frames;
15446         /*
15447          * Total number of received frames with a false carrier is
15448          * detected during idle, as defined by RX_ER samples active
15449          * and RXD is 0xE. The event is reported along with the
15450          * statistics generated on the next received frame. Only
15451          * one false carrier condition can be detected and logged
15452          * between frames.
15453          *
15454          * Carrier event, valid for 10M/100M speed modes only.
15455          */
15456         uint64_t        rx_false_carrier_frames;
15457         /* Total number of over-sized frames received */
15458         uint64_t        rx_ovrsz_frames;
15459         /* Total number of jabber packets received */
15460         uint64_t        rx_jbr_frames;
15461         /* Total number of received frames with MTU error */
15462         uint64_t        rx_mtu_err_frames;
15463         /* Total number of received frames with CRC match */
15464         uint64_t        rx_match_crc_frames;
15465         /* Total number of frames received promiscuously */
15466         uint64_t        rx_promiscuous_frames;
15467         /*
15468          * Total number of received frames with one or two VLAN
15469          * tags
15470          */
15471         uint64_t        rx_tagged_frames;
15472         /* Total number of received frames with two VLAN tags */
15473         uint64_t        rx_double_tagged_frames;
15474         /* Total number of truncated frames received */
15475         uint64_t        rx_trunc_frames;
15476         /* Total number of good frames (without errors) received */
15477         uint64_t        rx_good_frames;
15478         /*
15479          * Total number of received PFC frames with transition from
15480          * XON to XOFF on Pri 0
15481          */
15482         uint64_t        rx_pfc_xon2xoff_frames_pri0;
15483         /*
15484          * Total number of received PFC frames with transition from
15485          * XON to XOFF on Pri 1
15486          */
15487         uint64_t        rx_pfc_xon2xoff_frames_pri1;
15488         /*
15489          * Total number of received PFC frames with transition from
15490          * XON to XOFF on Pri 2
15491          */
15492         uint64_t        rx_pfc_xon2xoff_frames_pri2;
15493         /*
15494          * Total number of received PFC frames with transition from
15495          * XON to XOFF on Pri 3
15496          */
15497         uint64_t        rx_pfc_xon2xoff_frames_pri3;
15498         /*
15499          * Total number of received PFC frames with transition from
15500          * XON to XOFF on Pri 4
15501          */
15502         uint64_t        rx_pfc_xon2xoff_frames_pri4;
15503         /*
15504          * Total number of received PFC frames with transition from
15505          * XON to XOFF on Pri 5
15506          */
15507         uint64_t        rx_pfc_xon2xoff_frames_pri5;
15508         /*
15509          * Total number of received PFC frames with transition from
15510          * XON to XOFF on Pri 6
15511          */
15512         uint64_t        rx_pfc_xon2xoff_frames_pri6;
15513         /*
15514          * Total number of received PFC frames with transition from
15515          * XON to XOFF on Pri 7
15516          */
15517         uint64_t        rx_pfc_xon2xoff_frames_pri7;
15518         /*
15519          * Total number of received PFC frames with PFC enabled
15520          * bit for Pri 0
15521          */
15522         uint64_t        rx_pfc_ena_frames_pri0;
15523         /*
15524          * Total number of received PFC frames with PFC enabled
15525          * bit for Pri 1
15526          */
15527         uint64_t        rx_pfc_ena_frames_pri1;
15528         /*
15529          * Total number of received PFC frames with PFC enabled
15530          * bit for Pri 2
15531          */
15532         uint64_t        rx_pfc_ena_frames_pri2;
15533         /*
15534          * Total number of received PFC frames with PFC enabled
15535          * bit for Pri 3
15536          */
15537         uint64_t        rx_pfc_ena_frames_pri3;
15538         /*
15539          * Total number of received PFC frames with PFC enabled
15540          * bit for Pri 4
15541          */
15542         uint64_t        rx_pfc_ena_frames_pri4;
15543         /*
15544          * Total number of received PFC frames with PFC enabled
15545          * bit for Pri 5
15546          */
15547         uint64_t        rx_pfc_ena_frames_pri5;
15548         /*
15549          * Total number of received PFC frames with PFC enabled
15550          * bit for Pri 6
15551          */
15552         uint64_t        rx_pfc_ena_frames_pri6;
15553         /*
15554          * Total number of received PFC frames with PFC enabled
15555          * bit for Pri 7
15556          */
15557         uint64_t        rx_pfc_ena_frames_pri7;
15558         /* Total Number of frames received with SCH CRC error */
15559         uint64_t        rx_sch_crc_err_frames;
15560         /* Total Number of under-sized frames received */
15561         uint64_t        rx_undrsz_frames;
15562         /* Total Number of fragmented frames received */
15563         uint64_t        rx_frag_frames;
15564         /* Total number of RX EEE LPI Events */
15565         uint64_t        rx_eee_lpi_events;
15566         /* EEE LPI Duration Counter on RX */
15567         uint64_t        rx_eee_lpi_duration;
15568         /*
15569          * Total number of physical type Link Level Flow Control
15570          * (LLFC) messages received
15571          */
15572         uint64_t        rx_llfc_physical_msgs;
15573         /*
15574          * Total number of logical type Link Level Flow Control
15575          * (LLFC) messages received
15576          */
15577         uint64_t        rx_llfc_logical_msgs;
15578         /*
15579          * Total number of logical type Link Level Flow Control
15580          * (LLFC) messages received with CRC error
15581          */
15582         uint64_t        rx_llfc_msgs_with_crc_err;
15583         /* Total number of HCFC messages received */
15584         uint64_t        rx_hcfc_msgs;
15585         /* Total number of HCFC messages received with CRC error */
15586         uint64_t        rx_hcfc_msgs_with_crc_err;
15587         /* Total number of received bytes */
15588         uint64_t        rx_bytes;
15589         /* Total number of bytes received in runt frames */
15590         uint64_t        rx_runt_bytes;
15591         /* Total number of runt frames received */
15592         uint64_t        rx_runt_frames;
15593         /* Total Rx Discards per Port reported by STATS block */
15594         uint64_t        rx_stat_discard;
15595         uint64_t        rx_stat_err;
15596 } __attribute__((packed));
15597
15598 /********************
15599  * hwrm_port_qstats *
15600  ********************/
15601
15602
15603 /* hwrm_port_qstats_input (size:320b/40B) */
15604 struct hwrm_port_qstats_input {
15605         /* The HWRM command request type. */
15606         uint16_t        req_type;
15607         /*
15608          * The completion ring to send the completion event on. This should
15609          * be the NQ ID returned from the `nq_alloc` HWRM command.
15610          */
15611         uint16_t        cmpl_ring;
15612         /*
15613          * The sequence ID is used by the driver for tracking multiple
15614          * commands. This ID is treated as opaque data by the firmware and
15615          * the value is returned in the `hwrm_resp_hdr` upon completion.
15616          */
15617         uint16_t        seq_id;
15618         /*
15619          * The target ID of the command:
15620          * * 0x0-0xFFF8 - The function ID
15621          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15622          * * 0xFFFD - Reserved for user-space HWRM interface
15623          * * 0xFFFF - HWRM
15624          */
15625         uint16_t        target_id;
15626         /*
15627          * A physical address pointer pointing to a host buffer that the
15628          * command's response data will be written. This can be either a host
15629          * physical address (HPA) or a guest physical address (GPA) and must
15630          * point to a physically contiguous block of memory.
15631          */
15632         uint64_t        resp_addr;
15633         /* Port ID of port that is being queried. */
15634         uint16_t        port_id;
15635         uint8_t unused_0[6];
15636         /*
15637          * This is the host address where
15638          * Tx port statistics will be stored
15639          */
15640         uint64_t        tx_stat_host_addr;
15641         /*
15642          * This is the host address where
15643          * Rx port statistics will be stored
15644          */
15645         uint64_t        rx_stat_host_addr;
15646 } __attribute__((packed));
15647
15648 /* hwrm_port_qstats_output (size:128b/16B) */
15649 struct hwrm_port_qstats_output {
15650         /* The specific error status for the command. */
15651         uint16_t        error_code;
15652         /* The HWRM command request type. */
15653         uint16_t        req_type;
15654         /* The sequence ID from the original command. */
15655         uint16_t        seq_id;
15656         /* The length of the response data in number of bytes. */
15657         uint16_t        resp_len;
15658         /* The size of TX port statistics block in bytes. */
15659         uint16_t        tx_stat_size;
15660         /* The size of RX port statistics block in bytes. */
15661         uint16_t        rx_stat_size;
15662         uint8_t unused_0[3];
15663         /*
15664          * This field is used in Output records to indicate that the output
15665          * is completely written to RAM.  This field should be read as '1'
15666          * to indicate that the output has been completely written.
15667          * When writing a command completion or response to an internal processor,
15668          * the order of writes has to be such that this field is written last.
15669          */
15670         uint8_t valid;
15671 } __attribute__((packed));
15672
15673 /* Port Tx Statistics extended Formats */
15674 /* tx_port_stats_ext (size:2048b/256B) */
15675 struct tx_port_stats_ext {
15676         /* Total number of tx bytes count on cos queue 0 */
15677         uint64_t        tx_bytes_cos0;
15678         /* Total number of tx bytes count on cos queue 1 */
15679         uint64_t        tx_bytes_cos1;
15680         /* Total number of tx bytes count on cos queue 2 */
15681         uint64_t        tx_bytes_cos2;
15682         /* Total number of tx bytes count on cos queue 3 */
15683         uint64_t        tx_bytes_cos3;
15684         /* Total number of tx bytes count on cos queue 4 */
15685         uint64_t        tx_bytes_cos4;
15686         /* Total number of tx bytes count on cos queue 5 */
15687         uint64_t        tx_bytes_cos5;
15688         /* Total number of tx bytes count on cos queue 6 */
15689         uint64_t        tx_bytes_cos6;
15690         /* Total number of tx bytes count on cos queue 7 */
15691         uint64_t        tx_bytes_cos7;
15692         /* Total number of tx packets count on cos queue 0 */
15693         uint64_t        tx_packets_cos0;
15694         /* Total number of tx packets count on cos queue 1 */
15695         uint64_t        tx_packets_cos1;
15696         /* Total number of tx packets count on cos queue 2 */
15697         uint64_t        tx_packets_cos2;
15698         /* Total number of tx packets count on cos queue 3 */
15699         uint64_t        tx_packets_cos3;
15700         /* Total number of tx packets count on cos queue 4 */
15701         uint64_t        tx_packets_cos4;
15702         /* Total number of tx packets count on cos queue 5 */
15703         uint64_t        tx_packets_cos5;
15704         /* Total number of tx packets count on cos queue 6 */
15705         uint64_t        tx_packets_cos6;
15706         /* Total number of tx packets count on cos queue 7 */
15707         uint64_t        tx_packets_cos7;
15708         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
15709         uint64_t        pfc_pri0_tx_duration_us;
15710         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
15711         uint64_t        pfc_pri0_tx_transitions;
15712         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
15713         uint64_t        pfc_pri1_tx_duration_us;
15714         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
15715         uint64_t        pfc_pri1_tx_transitions;
15716         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
15717         uint64_t        pfc_pri2_tx_duration_us;
15718         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
15719         uint64_t        pfc_pri2_tx_transitions;
15720         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
15721         uint64_t        pfc_pri3_tx_duration_us;
15722         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
15723         uint64_t        pfc_pri3_tx_transitions;
15724         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
15725         uint64_t        pfc_pri4_tx_duration_us;
15726         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
15727         uint64_t        pfc_pri4_tx_transitions;
15728         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
15729         uint64_t        pfc_pri5_tx_duration_us;
15730         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
15731         uint64_t        pfc_pri5_tx_transitions;
15732         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
15733         uint64_t        pfc_pri6_tx_duration_us;
15734         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
15735         uint64_t        pfc_pri6_tx_transitions;
15736         /* time duration between transmitting a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
15737         uint64_t        pfc_pri7_tx_duration_us;
15738         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
15739         uint64_t        pfc_pri7_tx_transitions;
15740 } __attribute__((packed));
15741
15742 /* Port Rx Statistics extended Formats */
15743 /* rx_port_stats_ext (size:3648b/456B) */
15744 struct rx_port_stats_ext {
15745         /* Number of times link state changed to down */
15746         uint64_t        link_down_events;
15747         /* Number of times the idle rings with pause bit are found */
15748         uint64_t        continuous_pause_events;
15749         /* Number of times the active rings pause bit resumed back */
15750         uint64_t        resume_pause_events;
15751         /* Number of times, the ROCE cos queue PFC is disabled to avoid pause flood/burst */
15752         uint64_t        continuous_roce_pause_events;
15753         /* Number of times, the ROCE cos queue PFC is enabled back */
15754         uint64_t        resume_roce_pause_events;
15755         /* Total number of rx bytes count on cos queue 0 */
15756         uint64_t        rx_bytes_cos0;
15757         /* Total number of rx bytes count on cos queue 1 */
15758         uint64_t        rx_bytes_cos1;
15759         /* Total number of rx bytes count on cos queue 2 */
15760         uint64_t        rx_bytes_cos2;
15761         /* Total number of rx bytes count on cos queue 3 */
15762         uint64_t        rx_bytes_cos3;
15763         /* Total number of rx bytes count on cos queue 4 */
15764         uint64_t        rx_bytes_cos4;
15765         /* Total number of rx bytes count on cos queue 5 */
15766         uint64_t        rx_bytes_cos5;
15767         /* Total number of rx bytes count on cos queue 6 */
15768         uint64_t        rx_bytes_cos6;
15769         /* Total number of rx bytes count on cos queue 7 */
15770         uint64_t        rx_bytes_cos7;
15771         /* Total number of rx packets count on cos queue 0 */
15772         uint64_t        rx_packets_cos0;
15773         /* Total number of rx packets count on cos queue 1 */
15774         uint64_t        rx_packets_cos1;
15775         /* Total number of rx packets count on cos queue 2 */
15776         uint64_t        rx_packets_cos2;
15777         /* Total number of rx packets count on cos queue 3 */
15778         uint64_t        rx_packets_cos3;
15779         /* Total number of rx packets count on cos queue 4 */
15780         uint64_t        rx_packets_cos4;
15781         /* Total number of rx packets count on cos queue 5 */
15782         uint64_t        rx_packets_cos5;
15783         /* Total number of rx packets count on cos queue 6 */
15784         uint64_t        rx_packets_cos6;
15785         /* Total number of rx packets count on cos queue 7 */
15786         uint64_t        rx_packets_cos7;
15787         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 0 */
15788         uint64_t        pfc_pri0_rx_duration_us;
15789         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 0 */
15790         uint64_t        pfc_pri0_rx_transitions;
15791         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 1 */
15792         uint64_t        pfc_pri1_rx_duration_us;
15793         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 1 */
15794         uint64_t        pfc_pri1_rx_transitions;
15795         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 2 */
15796         uint64_t        pfc_pri2_rx_duration_us;
15797         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 2 */
15798         uint64_t        pfc_pri2_rx_transitions;
15799         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 3 */
15800         uint64_t        pfc_pri3_rx_duration_us;
15801         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 3 */
15802         uint64_t        pfc_pri3_rx_transitions;
15803         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 4 */
15804         uint64_t        pfc_pri4_rx_duration_us;
15805         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 4 */
15806         uint64_t        pfc_pri4_rx_transitions;
15807         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 5 */
15808         uint64_t        pfc_pri5_rx_duration_us;
15809         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 5 */
15810         uint64_t        pfc_pri5_rx_transitions;
15811         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 6 */
15812         uint64_t        pfc_pri6_rx_duration_us;
15813         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 6 */
15814         uint64_t        pfc_pri6_rx_transitions;
15815         /* time duration receiving a XON -> XOFF and a subsequent XOFF -> XON for priority 7 */
15816         uint64_t        pfc_pri7_rx_duration_us;
15817         /* Number of times, a XON -> XOFF and XOFF -> XON transitions occur for priority 7 */
15818         uint64_t        pfc_pri7_rx_transitions;
15819         /* Total number of received bits */
15820         uint64_t        rx_bits;
15821         /* The number of events where the port receive buffer was over 85% full */
15822         uint64_t        rx_buffer_passed_threshold;
15823         /*
15824          * The number of symbol errors that wasn't corrected by FEC correction
15825          * alogirithm
15826          */
15827         uint64_t        rx_pcs_symbol_err;
15828         /* The number of corrected bits on the port according to active FEC */
15829         uint64_t        rx_corrected_bits;
15830         /* Total number of rx discard bytes count on cos queue 0 */
15831         uint64_t        rx_discard_bytes_cos0;
15832         /* Total number of rx discard bytes count on cos queue 1 */
15833         uint64_t        rx_discard_bytes_cos1;
15834         /* Total number of rx discard bytes count on cos queue 2 */
15835         uint64_t        rx_discard_bytes_cos2;
15836         /* Total number of rx discard bytes count on cos queue 3 */
15837         uint64_t        rx_discard_bytes_cos3;
15838         /* Total number of rx discard bytes count on cos queue 4 */
15839         uint64_t        rx_discard_bytes_cos4;
15840         /* Total number of rx discard bytes count on cos queue 5 */
15841         uint64_t        rx_discard_bytes_cos5;
15842         /* Total number of rx discard bytes count on cos queue 6 */
15843         uint64_t        rx_discard_bytes_cos6;
15844         /* Total number of rx discard bytes count on cos queue 7 */
15845         uint64_t        rx_discard_bytes_cos7;
15846         /* Total number of rx discard packets count on cos queue 0 */
15847         uint64_t        rx_discard_packets_cos0;
15848         /* Total number of rx discard packets count on cos queue 1 */
15849         uint64_t        rx_discard_packets_cos1;
15850         /* Total number of rx discard packets count on cos queue 2 */
15851         uint64_t        rx_discard_packets_cos2;
15852         /* Total number of rx discard packets count on cos queue 3 */
15853         uint64_t        rx_discard_packets_cos3;
15854         /* Total number of rx discard packets count on cos queue 4 */
15855         uint64_t        rx_discard_packets_cos4;
15856         /* Total number of rx discard packets count on cos queue 5 */
15857         uint64_t        rx_discard_packets_cos5;
15858         /* Total number of rx discard packets count on cos queue 6 */
15859         uint64_t        rx_discard_packets_cos6;
15860         /* Total number of rx discard packets count on cos queue 7 */
15861         uint64_t        rx_discard_packets_cos7;
15862 } __attribute__((packed));
15863
15864 /************************
15865  * hwrm_port_qstats_ext *
15866  ************************/
15867
15868
15869 /* hwrm_port_qstats_ext_input (size:320b/40B) */
15870 struct hwrm_port_qstats_ext_input {
15871         /* The HWRM command request type. */
15872         uint16_t        req_type;
15873         /*
15874          * The completion ring to send the completion event on. This should
15875          * be the NQ ID returned from the `nq_alloc` HWRM command.
15876          */
15877         uint16_t        cmpl_ring;
15878         /*
15879          * The sequence ID is used by the driver for tracking multiple
15880          * commands. This ID is treated as opaque data by the firmware and
15881          * the value is returned in the `hwrm_resp_hdr` upon completion.
15882          */
15883         uint16_t        seq_id;
15884         /*
15885          * The target ID of the command:
15886          * * 0x0-0xFFF8 - The function ID
15887          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15888          * * 0xFFFD - Reserved for user-space HWRM interface
15889          * * 0xFFFF - HWRM
15890          */
15891         uint16_t        target_id;
15892         /*
15893          * A physical address pointer pointing to a host buffer that the
15894          * command's response data will be written. This can be either a host
15895          * physical address (HPA) or a guest physical address (GPA) and must
15896          * point to a physically contiguous block of memory.
15897          */
15898         uint64_t        resp_addr;
15899         /* Port ID of port that is being queried. */
15900         uint16_t        port_id;
15901         /*
15902          * The size of TX port extended
15903          * statistics block in bytes.
15904          */
15905         uint16_t        tx_stat_size;
15906         /*
15907          * The size of RX port extended
15908          * statistics block in bytes
15909          */
15910         uint16_t        rx_stat_size;
15911         uint8_t unused_0[2];
15912         /*
15913          * This is the host address where
15914          * Tx port statistics will be stored
15915          */
15916         uint64_t        tx_stat_host_addr;
15917         /*
15918          * This is the host address where
15919          * Rx port statistics will be stored
15920          */
15921         uint64_t        rx_stat_host_addr;
15922 } __attribute__((packed));
15923
15924 /* hwrm_port_qstats_ext_output (size:128b/16B) */
15925 struct hwrm_port_qstats_ext_output {
15926         /* The specific error status for the command. */
15927         uint16_t        error_code;
15928         /* The HWRM command request type. */
15929         uint16_t        req_type;
15930         /* The sequence ID from the original command. */
15931         uint16_t        seq_id;
15932         /* The length of the response data in number of bytes. */
15933         uint16_t        resp_len;
15934         /* The size of TX port statistics block in bytes. */
15935         uint16_t        tx_stat_size;
15936         /* The size of RX port statistics block in bytes. */
15937         uint16_t        rx_stat_size;
15938         /* Total number of active cos queues available. */
15939         uint16_t        total_active_cos_queues;
15940         uint8_t flags;
15941         /*
15942          * If set to 1, then this field indicates that clear
15943          * roce specific counters is supported.
15944          */
15945         #define HWRM_PORT_QSTATS_EXT_OUTPUT_FLAGS_CLEAR_ROCE_COUNTERS_SUPPORTED \
15946                 UINT32_C(0x1)
15947         /*
15948          * This field is used in Output records to indicate that the output
15949          * is completely written to RAM.  This field should be read as '1'
15950          * to indicate that the output has been completely written.
15951          * When writing a command completion or response to an internal processor,
15952          * the order of writes has to be such that this field is written last.
15953          */
15954         uint8_t valid;
15955 } __attribute__((packed));
15956
15957 /*************************
15958  * hwrm_port_lpbk_qstats *
15959  *************************/
15960
15961
15962 /* hwrm_port_lpbk_qstats_input (size:128b/16B) */
15963 struct hwrm_port_lpbk_qstats_input {
15964         /* The HWRM command request type. */
15965         uint16_t        req_type;
15966         /*
15967          * The completion ring to send the completion event on. This should
15968          * be the NQ ID returned from the `nq_alloc` HWRM command.
15969          */
15970         uint16_t        cmpl_ring;
15971         /*
15972          * The sequence ID is used by the driver for tracking multiple
15973          * commands. This ID is treated as opaque data by the firmware and
15974          * the value is returned in the `hwrm_resp_hdr` upon completion.
15975          */
15976         uint16_t        seq_id;
15977         /*
15978          * The target ID of the command:
15979          * * 0x0-0xFFF8 - The function ID
15980          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
15981          * * 0xFFFD - Reserved for user-space HWRM interface
15982          * * 0xFFFF - HWRM
15983          */
15984         uint16_t        target_id;
15985         /*
15986          * A physical address pointer pointing to a host buffer that the
15987          * command's response data will be written. This can be either a host
15988          * physical address (HPA) or a guest physical address (GPA) and must
15989          * point to a physically contiguous block of memory.
15990          */
15991         uint64_t        resp_addr;
15992 } __attribute__((packed));
15993
15994 /* hwrm_port_lpbk_qstats_output (size:768b/96B) */
15995 struct hwrm_port_lpbk_qstats_output {
15996         /* The specific error status for the command. */
15997         uint16_t        error_code;
15998         /* The HWRM command request type. */
15999         uint16_t        req_type;
16000         /* The sequence ID from the original command. */
16001         uint16_t        seq_id;
16002         /* The length of the response data in number of bytes. */
16003         uint16_t        resp_len;
16004         /* Number of transmitted unicast frames */
16005         uint64_t        lpbk_ucast_frames;
16006         /* Number of transmitted multicast frames */
16007         uint64_t        lpbk_mcast_frames;
16008         /* Number of transmitted broadcast frames */
16009         uint64_t        lpbk_bcast_frames;
16010         /* Number of transmitted bytes for unicast traffic */
16011         uint64_t        lpbk_ucast_bytes;
16012         /* Number of transmitted bytes for multicast traffic */
16013         uint64_t        lpbk_mcast_bytes;
16014         /* Number of transmitted bytes for broadcast traffic */
16015         uint64_t        lpbk_bcast_bytes;
16016         /* Total Tx Drops for loopback traffic reported by STATS block */
16017         uint64_t        tx_stat_discard;
16018         /* Total Tx Error Drops for loopback traffic reported by STATS block */
16019         uint64_t        tx_stat_error;
16020         /* Total Rx Drops for loopback traffic reported by STATS block */
16021         uint64_t        rx_stat_discard;
16022         /* Total Rx Error Drops for loopback traffic reported by STATS block */
16023         uint64_t        rx_stat_error;
16024         uint8_t unused_0[7];
16025         /*
16026          * This field is used in Output records to indicate that the output
16027          * is completely written to RAM.  This field should be read as '1'
16028          * to indicate that the output has been completely written.
16029          * When writing a command completion or response to an internal processor,
16030          * the order of writes has to be such that this field is written last.
16031          */
16032         uint8_t valid;
16033 } __attribute__((packed));
16034
16035 /***********************
16036  * hwrm_port_clr_stats *
16037  ***********************/
16038
16039
16040 /* hwrm_port_clr_stats_input (size:192b/24B) */
16041 struct hwrm_port_clr_stats_input {
16042         /* The HWRM command request type. */
16043         uint16_t        req_type;
16044         /*
16045          * The completion ring to send the completion event on. This should
16046          * be the NQ ID returned from the `nq_alloc` HWRM command.
16047          */
16048         uint16_t        cmpl_ring;
16049         /*
16050          * The sequence ID is used by the driver for tracking multiple
16051          * commands. This ID is treated as opaque data by the firmware and
16052          * the value is returned in the `hwrm_resp_hdr` upon completion.
16053          */
16054         uint16_t        seq_id;
16055         /*
16056          * The target ID of the command:
16057          * * 0x0-0xFFF8 - The function ID
16058          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16059          * * 0xFFFD - Reserved for user-space HWRM interface
16060          * * 0xFFFF - HWRM
16061          */
16062         uint16_t        target_id;
16063         /*
16064          * A physical address pointer pointing to a host buffer that the
16065          * command's response data will be written. This can be either a host
16066          * physical address (HPA) or a guest physical address (GPA) and must
16067          * point to a physically contiguous block of memory.
16068          */
16069         uint64_t        resp_addr;
16070         /* Port ID of port that is being queried. */
16071         uint16_t        port_id;
16072         uint8_t flags;
16073         /*
16074          * If set to 1, then this field indicates clear the following RoCE
16075          * specific counters.
16076          * RoCE associated TX/RX cos counters
16077          * CNP associated TX/RX cos counters
16078          * RoCE/CNP specific TX/RX flow counters
16079          * Firmware will determine the RoCE/CNP cos queue based on qos profile.
16080          * This flag is honored only when RoCE is enabled on that port.
16081          */
16082         #define HWRM_PORT_CLR_STATS_INPUT_FLAGS_ROCE_COUNTERS     UINT32_C(0x1)
16083         uint8_t unused_0[5];
16084 } __attribute__((packed));
16085
16086 /* hwrm_port_clr_stats_output (size:128b/16B) */
16087 struct hwrm_port_clr_stats_output {
16088         /* The specific error status for the command. */
16089         uint16_t        error_code;
16090         /* The HWRM command request type. */
16091         uint16_t        req_type;
16092         /* The sequence ID from the original command. */
16093         uint16_t        seq_id;
16094         /* The length of the response data in number of bytes. */
16095         uint16_t        resp_len;
16096         uint8_t unused_0[7];
16097         /*
16098          * This field is used in Output records to indicate that the output
16099          * is completely written to RAM.  This field should be read as '1'
16100          * to indicate that the output has been completely written.
16101          * When writing a command completion or response to an internal processor,
16102          * the order of writes has to be such that this field is written last.
16103          */
16104         uint8_t valid;
16105 } __attribute__((packed));
16106
16107 /***********************
16108  * hwrm_port_phy_qcaps *
16109  ***********************/
16110
16111
16112 /* hwrm_port_phy_qcaps_input (size:192b/24B) */
16113 struct hwrm_port_phy_qcaps_input {
16114         /* The HWRM command request type. */
16115         uint16_t        req_type;
16116         /*
16117          * The completion ring to send the completion event on. This should
16118          * be the NQ ID returned from the `nq_alloc` HWRM command.
16119          */
16120         uint16_t        cmpl_ring;
16121         /*
16122          * The sequence ID is used by the driver for tracking multiple
16123          * commands. This ID is treated as opaque data by the firmware and
16124          * the value is returned in the `hwrm_resp_hdr` upon completion.
16125          */
16126         uint16_t        seq_id;
16127         /*
16128          * The target ID of the command:
16129          * * 0x0-0xFFF8 - The function ID
16130          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16131          * * 0xFFFD - Reserved for user-space HWRM interface
16132          * * 0xFFFF - HWRM
16133          */
16134         uint16_t        target_id;
16135         /*
16136          * A physical address pointer pointing to a host buffer that the
16137          * command's response data will be written. This can be either a host
16138          * physical address (HPA) or a guest physical address (GPA) and must
16139          * point to a physically contiguous block of memory.
16140          */
16141         uint64_t        resp_addr;
16142         /* Port ID of port that is being queried. */
16143         uint16_t        port_id;
16144         uint8_t unused_0[6];
16145 } __attribute__((packed));
16146
16147 /* hwrm_port_phy_qcaps_output (size:192b/24B) */
16148 struct hwrm_port_phy_qcaps_output {
16149         /* The specific error status for the command. */
16150         uint16_t        error_code;
16151         /* The HWRM command request type. */
16152         uint16_t        req_type;
16153         /* The sequence ID from the original command. */
16154         uint16_t        seq_id;
16155         /* The length of the response data in number of bytes. */
16156         uint16_t        resp_len;
16157         /* PHY capability flags */
16158         uint8_t flags;
16159         /*
16160          * If set to 1, then this field indicates that the
16161          * link is capable of supporting EEE.
16162          */
16163         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EEE_SUPPORTED \
16164                 UINT32_C(0x1)
16165         /*
16166          * If set to 1, then this field indicates that the
16167          * PHY is capable of supporting external loopback.
16168          */
16169         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_EXTERNAL_LPBK_SUPPORTED \
16170                 UINT32_C(0x2)
16171         /*
16172          * Reserved field. The HWRM shall set this field to 0.
16173          * An HWRM client shall ignore this field.
16174          */
16175         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_MASK \
16176                 UINT32_C(0xfc)
16177         #define HWRM_PORT_PHY_QCAPS_OUTPUT_FLAGS_RSVD1_SFT                   2
16178         /* Number of front panel ports for this device. */
16179         uint8_t port_cnt;
16180         /* Not supported or unknown */
16181         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_UNKNOWN UINT32_C(0x0)
16182         /* single port device */
16183         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_1       UINT32_C(0x1)
16184         /* 2-port device */
16185         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_2       UINT32_C(0x2)
16186         /* 3-port device */
16187         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_3       UINT32_C(0x3)
16188         /* 4-port device */
16189         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4       UINT32_C(0x4)
16190         #define HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_LAST \
16191                 HWRM_PORT_PHY_QCAPS_OUTPUT_PORT_CNT_4
16192         /*
16193          * This is a bit mask to indicate what speeds are supported
16194          * as forced speeds on this link.
16195          * For each speed that can be forced on this link, the
16196          * corresponding mask bit shall be set to '1'.
16197          */
16198         uint16_t        supported_speeds_force_mode;
16199         /* 100Mb link speed (Half-duplex) */
16200         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD \
16201                 UINT32_C(0x1)
16202         /* 100Mb link speed (Full-duplex) */
16203         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100MB \
16204                 UINT32_C(0x2)
16205         /* 1Gb link speed (Half-duplex) */
16206         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD \
16207                 UINT32_C(0x4)
16208         /* 1Gb link speed (Full-duplex) */
16209         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_1GB \
16210                 UINT32_C(0x8)
16211         /* 2Gb link speed */
16212         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2GB \
16213                 UINT32_C(0x10)
16214         /* 25Gb link speed */
16215         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB \
16216                 UINT32_C(0x20)
16217         /* 10Gb link speed */
16218         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10GB \
16219                 UINT32_C(0x40)
16220         /* 20Gb link speed */
16221         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_20GB \
16222                 UINT32_C(0x80)
16223         /* 25Gb link speed */
16224         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_25GB \
16225                 UINT32_C(0x100)
16226         /* 40Gb link speed */
16227         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_40GB \
16228                 UINT32_C(0x200)
16229         /* 50Gb link speed */
16230         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_50GB \
16231                 UINT32_C(0x400)
16232         /* 100Gb link speed */
16233         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_100GB \
16234                 UINT32_C(0x800)
16235         /* 10Mb link speed (Half-duplex) */
16236         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD \
16237                 UINT32_C(0x1000)
16238         /* 10Mb link speed (Full-duplex) */
16239         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_10MB \
16240                 UINT32_C(0x2000)
16241         /* 200Gb link speed */
16242         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_FORCE_MODE_200GB \
16243                 UINT32_C(0x4000)
16244         /*
16245          * This is a bit mask to indicate what speeds are supported
16246          * for autonegotiation on this link.
16247          * For each speed that can be autonegotiated on this link, the
16248          * corresponding mask bit shall be set to '1'.
16249          */
16250         uint16_t        supported_speeds_auto_mode;
16251         /* 100Mb link speed (Half-duplex) */
16252         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD \
16253                 UINT32_C(0x1)
16254         /* 100Mb link speed (Full-duplex) */
16255         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100MB \
16256                 UINT32_C(0x2)
16257         /* 1Gb link speed (Half-duplex) */
16258         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD \
16259                 UINT32_C(0x4)
16260         /* 1Gb link speed (Full-duplex) */
16261         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_1GB \
16262                 UINT32_C(0x8)
16263         /* 2Gb link speed */
16264         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2GB \
16265                 UINT32_C(0x10)
16266         /* 25Gb link speed */
16267         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB \
16268                 UINT32_C(0x20)
16269         /* 10Gb link speed */
16270         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10GB \
16271                 UINT32_C(0x40)
16272         /* 20Gb link speed */
16273         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_20GB \
16274                 UINT32_C(0x80)
16275         /* 25Gb link speed */
16276         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_25GB \
16277                 UINT32_C(0x100)
16278         /* 40Gb link speed */
16279         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_40GB \
16280                 UINT32_C(0x200)
16281         /* 50Gb link speed */
16282         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_50GB \
16283                 UINT32_C(0x400)
16284         /* 100Gb link speed */
16285         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_100GB \
16286                 UINT32_C(0x800)
16287         /* 10Mb link speed (Half-duplex) */
16288         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD \
16289                 UINT32_C(0x1000)
16290         /* 10Mb link speed (Full-duplex) */
16291         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_10MB \
16292                 UINT32_C(0x2000)
16293         /* 200Gb link speed */
16294         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_AUTO_MODE_200GB \
16295                 UINT32_C(0x4000)
16296         /*
16297          * This is a bit mask to indicate what speeds are supported
16298          * for EEE on this link.
16299          * For each speed that can be autonegotiated when EEE is enabled
16300          * on this link, the corresponding mask bit shall be set to '1'.
16301          * This field is only valid when the eee_suppotred is set to '1'.
16302          */
16303         uint16_t        supported_speeds_eee_mode;
16304         /* Reserved */
16305         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 \
16306                 UINT32_C(0x1)
16307         /* 100Mb link speed (Full-duplex) */
16308         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_100MB \
16309                 UINT32_C(0x2)
16310         /* Reserved */
16311         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 \
16312                 UINT32_C(0x4)
16313         /* 1Gb link speed (Full-duplex) */
16314         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_1GB \
16315                 UINT32_C(0x8)
16316         /* Reserved */
16317         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 \
16318                 UINT32_C(0x10)
16319         /* Reserved */
16320         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 \
16321                 UINT32_C(0x20)
16322         /* 10Gb link speed */
16323         #define HWRM_PORT_PHY_QCAPS_OUTPUT_SUPPORTED_SPEEDS_EEE_MODE_10GB \
16324                 UINT32_C(0x40)
16325         uint32_t        tx_lpi_timer_low;
16326         /*
16327          * The lowest value of TX LPI timer that can be set on this link
16328          * when EEE is enabled. This value is in microseconds.
16329          * This field is valid only when_eee_supported is set to '1'.
16330          */
16331         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_MASK \
16332                 UINT32_C(0xffffff)
16333         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_LOW_SFT 0
16334         /*
16335          * Reserved field. The HWRM shall set this field to 0.
16336          * An HWRM client shall ignore this field.
16337          */
16338         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_MASK \
16339                 UINT32_C(0xff000000)
16340         #define HWRM_PORT_PHY_QCAPS_OUTPUT_RSVD2_SFT            24
16341         uint32_t        valid_tx_lpi_timer_high;
16342         /*
16343          * The highest value of TX LPI timer that can be set on this link
16344          * when EEE is enabled. This value is in microseconds.
16345          * This field is valid only when_eee_supported is set to '1'.
16346          */
16347         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_MASK \
16348                 UINT32_C(0xffffff)
16349         #define HWRM_PORT_PHY_QCAPS_OUTPUT_TX_LPI_TIMER_HIGH_SFT 0
16350         /*
16351          * This field is used in Output records to indicate that the output
16352          * is completely written to RAM.  This field should be read as '1'
16353          * to indicate that the output has been completely written.
16354          * When writing a command completion or response to an internal processor,
16355          * the order of writes has to be such that this field is written last.
16356          */
16357         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_MASK \
16358                 UINT32_C(0xff000000)
16359         #define HWRM_PORT_PHY_QCAPS_OUTPUT_VALID_SFT             24
16360 } __attribute__((packed));
16361
16362 /****************************
16363  * hwrm_port_phy_mdio_write *
16364  ****************************/
16365
16366
16367 /* hwrm_port_phy_mdio_write_input (size:320b/40B) */
16368 struct hwrm_port_phy_mdio_write_input {
16369         /* The HWRM command request type. */
16370         uint16_t        req_type;
16371         /*
16372          * The completion ring to send the completion event on. This should
16373          * be the NQ ID returned from the `nq_alloc` HWRM command.
16374          */
16375         uint16_t        cmpl_ring;
16376         /*
16377          * The sequence ID is used by the driver for tracking multiple
16378          * commands. This ID is treated as opaque data by the firmware and
16379          * the value is returned in the `hwrm_resp_hdr` upon completion.
16380          */
16381         uint16_t        seq_id;
16382         /*
16383          * The target ID of the command:
16384          * * 0x0-0xFFF8 - The function ID
16385          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16386          * * 0xFFFD - Reserved for user-space HWRM interface
16387          * * 0xFFFF - HWRM
16388          */
16389         uint16_t        target_id;
16390         /*
16391          * A physical address pointer pointing to a host buffer that the
16392          * command's response data will be written. This can be either a host
16393          * physical address (HPA) or a guest physical address (GPA) and must
16394          * point to a physically contiguous block of memory.
16395          */
16396         uint64_t        resp_addr;
16397         /* Reserved for future use. */
16398         uint32_t        unused_0[2];
16399         /* Port ID of port. */
16400         uint16_t        port_id;
16401         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
16402         uint8_t phy_addr;
16403         /* 8-bit device address. */
16404         uint8_t dev_addr;
16405         /* 16-bit register address. */
16406         uint16_t        reg_addr;
16407         /* 16-bit register data. */
16408         uint16_t        reg_data;
16409         /*
16410          * When this bit is set to 1 a Clause 45 mdio access is done.
16411          * when this bit is set to 0 a Clause 22 mdio access is done.
16412          */
16413         uint8_t cl45_mdio;
16414         /*  */
16415         uint8_t unused_1[7];
16416 } __attribute__((packed));
16417
16418 /* hwrm_port_phy_mdio_write_output (size:128b/16B) */
16419 struct hwrm_port_phy_mdio_write_output {
16420         /* The specific error status for the command. */
16421         uint16_t        error_code;
16422         /* The HWRM command request type. */
16423         uint16_t        req_type;
16424         /* The sequence ID from the original command. */
16425         uint16_t        seq_id;
16426         /* The length of the response data in number of bytes. */
16427         uint16_t        resp_len;
16428         uint8_t unused_0[7];
16429         /*
16430          * This field is used in Output records to indicate that the output
16431          * is completely written to RAM.  This field should be read as '1'
16432          * to indicate that the output has been completely written.
16433          * When writing a command completion or response to an internal processor,
16434          * the order of writes has to be such that this field is written last.
16435          */
16436         uint8_t valid;
16437 } __attribute__((packed));
16438
16439 /***************************
16440  * hwrm_port_phy_mdio_read *
16441  ***************************/
16442
16443
16444 /* hwrm_port_phy_mdio_read_input (size:256b/32B) */
16445 struct hwrm_port_phy_mdio_read_input {
16446         /* The HWRM command request type. */
16447         uint16_t        req_type;
16448         /*
16449          * The completion ring to send the completion event on. This should
16450          * be the NQ ID returned from the `nq_alloc` HWRM command.
16451          */
16452         uint16_t        cmpl_ring;
16453         /*
16454          * The sequence ID is used by the driver for tracking multiple
16455          * commands. This ID is treated as opaque data by the firmware and
16456          * the value is returned in the `hwrm_resp_hdr` upon completion.
16457          */
16458         uint16_t        seq_id;
16459         /*
16460          * The target ID of the command:
16461          * * 0x0-0xFFF8 - The function ID
16462          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16463          * * 0xFFFD - Reserved for user-space HWRM interface
16464          * * 0xFFFF - HWRM
16465          */
16466         uint16_t        target_id;
16467         /*
16468          * A physical address pointer pointing to a host buffer that the
16469          * command's response data will be written. This can be either a host
16470          * physical address (HPA) or a guest physical address (GPA) and must
16471          * point to a physically contiguous block of memory.
16472          */
16473         uint64_t        resp_addr;
16474         /* Reserved for future use. */
16475         uint32_t        unused_0[2];
16476         /* Port ID of port. */
16477         uint16_t        port_id;
16478         /* If phy_address is 0xFF, port_id will be used to derive phy_addr. */
16479         uint8_t phy_addr;
16480         /* 8-bit device address. */
16481         uint8_t dev_addr;
16482         /* 16-bit register address. */
16483         uint16_t        reg_addr;
16484         /*
16485          * When this bit is set to 1 a Clause 45 mdio access is done.
16486          * when this bit is set to 0 a Clause 22 mdio access is done.
16487          */
16488         uint8_t cl45_mdio;
16489         /*  */
16490         uint8_t unused_1;
16491 } __attribute__((packed));
16492
16493 /* hwrm_port_phy_mdio_read_output (size:128b/16B) */
16494 struct hwrm_port_phy_mdio_read_output {
16495         /* The specific error status for the command. */
16496         uint16_t        error_code;
16497         /* The HWRM command request type. */
16498         uint16_t        req_type;
16499         /* The sequence ID from the original command. */
16500         uint16_t        seq_id;
16501         /* The length of the response data in number of bytes. */
16502         uint16_t        resp_len;
16503         /* 16-bit register data. */
16504         uint16_t        reg_data;
16505         uint8_t unused_0[5];
16506         /*
16507          * This field is used in Output records to indicate that the output
16508          * is completely written to RAM.  This field should be read as '1'
16509          * to indicate that the output has been completely written.
16510          * When writing a command completion or response to an internal processor,
16511          * the order of writes has to be such that this field is written last.
16512          */
16513         uint8_t valid;
16514 } __attribute__((packed));
16515
16516 /*********************
16517  * hwrm_port_led_cfg *
16518  *********************/
16519
16520
16521 /* hwrm_port_led_cfg_input (size:512b/64B) */
16522 struct hwrm_port_led_cfg_input {
16523         /* The HWRM command request type. */
16524         uint16_t        req_type;
16525         /*
16526          * The completion ring to send the completion event on. This should
16527          * be the NQ ID returned from the `nq_alloc` HWRM command.
16528          */
16529         uint16_t        cmpl_ring;
16530         /*
16531          * The sequence ID is used by the driver for tracking multiple
16532          * commands. This ID is treated as opaque data by the firmware and
16533          * the value is returned in the `hwrm_resp_hdr` upon completion.
16534          */
16535         uint16_t        seq_id;
16536         /*
16537          * The target ID of the command:
16538          * * 0x0-0xFFF8 - The function ID
16539          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16540          * * 0xFFFD - Reserved for user-space HWRM interface
16541          * * 0xFFFF - HWRM
16542          */
16543         uint16_t        target_id;
16544         /*
16545          * A physical address pointer pointing to a host buffer that the
16546          * command's response data will be written. This can be either a host
16547          * physical address (HPA) or a guest physical address (GPA) and must
16548          * point to a physically contiguous block of memory.
16549          */
16550         uint64_t        resp_addr;
16551         uint32_t        enables;
16552         /*
16553          * This bit must be '1' for the led0_id field to be
16554          * configured.
16555          */
16556         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID \
16557                 UINT32_C(0x1)
16558         /*
16559          * This bit must be '1' for the led0_state field to be
16560          * configured.
16561          */
16562         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE \
16563                 UINT32_C(0x2)
16564         /*
16565          * This bit must be '1' for the led0_color field to be
16566          * configured.
16567          */
16568         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR \
16569                 UINT32_C(0x4)
16570         /*
16571          * This bit must be '1' for the led0_blink_on field to be
16572          * configured.
16573          */
16574         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON \
16575                 UINT32_C(0x8)
16576         /*
16577          * This bit must be '1' for the led0_blink_off field to be
16578          * configured.
16579          */
16580         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF \
16581                 UINT32_C(0x10)
16582         /*
16583          * This bit must be '1' for the led0_group_id field to be
16584          * configured.
16585          */
16586         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID \
16587                 UINT32_C(0x20)
16588         /*
16589          * This bit must be '1' for the led1_id field to be
16590          * configured.
16591          */
16592         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID \
16593                 UINT32_C(0x40)
16594         /*
16595          * This bit must be '1' for the led1_state field to be
16596          * configured.
16597          */
16598         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE \
16599                 UINT32_C(0x80)
16600         /*
16601          * This bit must be '1' for the led1_color field to be
16602          * configured.
16603          */
16604         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR \
16605                 UINT32_C(0x100)
16606         /*
16607          * This bit must be '1' for the led1_blink_on field to be
16608          * configured.
16609          */
16610         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON \
16611                 UINT32_C(0x200)
16612         /*
16613          * This bit must be '1' for the led1_blink_off field to be
16614          * configured.
16615          */
16616         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF \
16617                 UINT32_C(0x400)
16618         /*
16619          * This bit must be '1' for the led1_group_id field to be
16620          * configured.
16621          */
16622         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID \
16623                 UINT32_C(0x800)
16624         /*
16625          * This bit must be '1' for the led2_id field to be
16626          * configured.
16627          */
16628         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID \
16629                 UINT32_C(0x1000)
16630         /*
16631          * This bit must be '1' for the led2_state field to be
16632          * configured.
16633          */
16634         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE \
16635                 UINT32_C(0x2000)
16636         /*
16637          * This bit must be '1' for the led2_color field to be
16638          * configured.
16639          */
16640         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR \
16641                 UINT32_C(0x4000)
16642         /*
16643          * This bit must be '1' for the led2_blink_on field to be
16644          * configured.
16645          */
16646         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON \
16647                 UINT32_C(0x8000)
16648         /*
16649          * This bit must be '1' for the led2_blink_off field to be
16650          * configured.
16651          */
16652         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF \
16653                 UINT32_C(0x10000)
16654         /*
16655          * This bit must be '1' for the led2_group_id field to be
16656          * configured.
16657          */
16658         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID \
16659                 UINT32_C(0x20000)
16660         /*
16661          * This bit must be '1' for the led3_id field to be
16662          * configured.
16663          */
16664         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID \
16665                 UINT32_C(0x40000)
16666         /*
16667          * This bit must be '1' for the led3_state field to be
16668          * configured.
16669          */
16670         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE \
16671                 UINT32_C(0x80000)
16672         /*
16673          * This bit must be '1' for the led3_color field to be
16674          * configured.
16675          */
16676         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR \
16677                 UINT32_C(0x100000)
16678         /*
16679          * This bit must be '1' for the led3_blink_on field to be
16680          * configured.
16681          */
16682         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON \
16683                 UINT32_C(0x200000)
16684         /*
16685          * This bit must be '1' for the led3_blink_off field to be
16686          * configured.
16687          */
16688         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \
16689                 UINT32_C(0x400000)
16690         /*
16691          * This bit must be '1' for the led3_group_id field to be
16692          * configured.
16693          */
16694         #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID \
16695                 UINT32_C(0x800000)
16696         /* Port ID of port whose LEDs are configured. */
16697         uint16_t        port_id;
16698         /*
16699          * The number of LEDs that are being configured.
16700          * Up to 4 LEDs can be configured with this command.
16701          */
16702         uint8_t num_leds;
16703         /* Reserved field. */
16704         uint8_t rsvd;
16705         /* An identifier for the LED #0. */
16706         uint8_t led0_id;
16707         /* The requested state of the LED #0. */
16708         uint8_t led0_state;
16709         /* Default state of the LED */
16710         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
16711         /* Off */
16712         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF      UINT32_C(0x1)
16713         /* On */
16714         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON       UINT32_C(0x2)
16715         /* Blink */
16716         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK    UINT32_C(0x3)
16717         /* Blink Alternately */
16718         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
16719         #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_LAST \
16720                 HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT
16721         /* The requested color of LED #0. */
16722         uint8_t led0_color;
16723         /* Default */
16724         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
16725         /* Amber */
16726         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
16727         /* Green */
16728         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
16729         /* Green or Amber */
16730         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
16731         #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_LAST \
16732                 HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER
16733         uint8_t unused_0;
16734         /*
16735          * If the LED #0 state is "blink" or "blinkalt", then
16736          * this field represents the requested time in milliseconds
16737          * to keep LED on between cycles.
16738          */
16739         uint16_t        led0_blink_on;
16740         /*
16741          * If the LED #0 state is "blink" or "blinkalt", then
16742          * this field represents the requested time in milliseconds
16743          * to keep LED off between cycles.
16744          */
16745         uint16_t        led0_blink_off;
16746         /*
16747          * An identifier for the group of LEDs that LED #0 belongs
16748          * to.
16749          * If set to 0, then the LED #0 shall not be grouped and
16750          * shall be treated as an individual resource.
16751          * For all other non-zero values of this field, LED #0 shall
16752          * be grouped together with the LEDs with the same group ID
16753          * value.
16754          */
16755         uint8_t led0_group_id;
16756         /* Reserved field. */
16757         uint8_t rsvd0;
16758         /* An identifier for the LED #1. */
16759         uint8_t led1_id;
16760         /* The requested state of the LED #1. */
16761         uint8_t led1_state;
16762         /* Default state of the LED */
16763         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
16764         /* Off */
16765         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF      UINT32_C(0x1)
16766         /* On */
16767         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON       UINT32_C(0x2)
16768         /* Blink */
16769         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK    UINT32_C(0x3)
16770         /* Blink Alternately */
16771         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
16772         #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_LAST \
16773                 HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT
16774         /* The requested color of LED #1. */
16775         uint8_t led1_color;
16776         /* Default */
16777         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
16778         /* Amber */
16779         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
16780         /* Green */
16781         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
16782         /* Green or Amber */
16783         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
16784         #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_LAST \
16785                 HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER
16786         uint8_t unused_1;
16787         /*
16788          * If the LED #1 state is "blink" or "blinkalt", then
16789          * this field represents the requested time in milliseconds
16790          * to keep LED on between cycles.
16791          */
16792         uint16_t        led1_blink_on;
16793         /*
16794          * If the LED #1 state is "blink" or "blinkalt", then
16795          * this field represents the requested time in milliseconds
16796          * to keep LED off between cycles.
16797          */
16798         uint16_t        led1_blink_off;
16799         /*
16800          * An identifier for the group of LEDs that LED #1 belongs
16801          * to.
16802          * If set to 0, then the LED #1 shall not be grouped and
16803          * shall be treated as an individual resource.
16804          * For all other non-zero values of this field, LED #1 shall
16805          * be grouped together with the LEDs with the same group ID
16806          * value.
16807          */
16808         uint8_t led1_group_id;
16809         /* Reserved field. */
16810         uint8_t rsvd1;
16811         /* An identifier for the LED #2. */
16812         uint8_t led2_id;
16813         /* The requested state of the LED #2. */
16814         uint8_t led2_state;
16815         /* Default state of the LED */
16816         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
16817         /* Off */
16818         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF      UINT32_C(0x1)
16819         /* On */
16820         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON       UINT32_C(0x2)
16821         /* Blink */
16822         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK    UINT32_C(0x3)
16823         /* Blink Alternately */
16824         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
16825         #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_LAST \
16826                 HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT
16827         /* The requested color of LED #2. */
16828         uint8_t led2_color;
16829         /* Default */
16830         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
16831         /* Amber */
16832         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
16833         /* Green */
16834         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
16835         /* Green or Amber */
16836         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
16837         #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_LAST \
16838                 HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER
16839         uint8_t unused_2;
16840         /*
16841          * If the LED #2 state is "blink" or "blinkalt", then
16842          * this field represents the requested time in milliseconds
16843          * to keep LED on between cycles.
16844          */
16845         uint16_t        led2_blink_on;
16846         /*
16847          * If the LED #2 state is "blink" or "blinkalt", then
16848          * this field represents the requested time in milliseconds
16849          * to keep LED off between cycles.
16850          */
16851         uint16_t        led2_blink_off;
16852         /*
16853          * An identifier for the group of LEDs that LED #2 belongs
16854          * to.
16855          * If set to 0, then the LED #2 shall not be grouped and
16856          * shall be treated as an individual resource.
16857          * For all other non-zero values of this field, LED #2 shall
16858          * be grouped together with the LEDs with the same group ID
16859          * value.
16860          */
16861         uint8_t led2_group_id;
16862         /* Reserved field. */
16863         uint8_t rsvd2;
16864         /* An identifier for the LED #3. */
16865         uint8_t led3_id;
16866         /* The requested state of the LED #3. */
16867         uint8_t led3_state;
16868         /* Default state of the LED */
16869         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
16870         /* Off */
16871         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF      UINT32_C(0x1)
16872         /* On */
16873         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON       UINT32_C(0x2)
16874         /* Blink */
16875         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK    UINT32_C(0x3)
16876         /* Blink Alternately */
16877         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
16878         #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_LAST \
16879                 HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT
16880         /* The requested color of LED #3. */
16881         uint8_t led3_color;
16882         /* Default */
16883         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
16884         /* Amber */
16885         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
16886         /* Green */
16887         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
16888         /* Green or Amber */
16889         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
16890         #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_LAST \
16891                 HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER
16892         uint8_t unused_3;
16893         /*
16894          * If the LED #3 state is "blink" or "blinkalt", then
16895          * this field represents the requested time in milliseconds
16896          * to keep LED on between cycles.
16897          */
16898         uint16_t        led3_blink_on;
16899         /*
16900          * If the LED #3 state is "blink" or "blinkalt", then
16901          * this field represents the requested time in milliseconds
16902          * to keep LED off between cycles.
16903          */
16904         uint16_t        led3_blink_off;
16905         /*
16906          * An identifier for the group of LEDs that LED #3 belongs
16907          * to.
16908          * If set to 0, then the LED #3 shall not be grouped and
16909          * shall be treated as an individual resource.
16910          * For all other non-zero values of this field, LED #3 shall
16911          * be grouped together with the LEDs with the same group ID
16912          * value.
16913          */
16914         uint8_t led3_group_id;
16915         /* Reserved field. */
16916         uint8_t rsvd3;
16917 } __attribute__((packed));
16918
16919 /* hwrm_port_led_cfg_output (size:128b/16B) */
16920 struct hwrm_port_led_cfg_output {
16921         /* The specific error status for the command. */
16922         uint16_t        error_code;
16923         /* The HWRM command request type. */
16924         uint16_t        req_type;
16925         /* The sequence ID from the original command. */
16926         uint16_t        seq_id;
16927         /* The length of the response data in number of bytes. */
16928         uint16_t        resp_len;
16929         uint8_t unused_0[7];
16930         /*
16931          * This field is used in Output records to indicate that the output
16932          * is completely written to RAM.  This field should be read as '1'
16933          * to indicate that the output has been completely written.
16934          * When writing a command completion or response to an internal processor,
16935          * the order of writes has to be such that this field is written last.
16936          */
16937         uint8_t valid;
16938 } __attribute__((packed));
16939
16940 /**********************
16941  * hwrm_port_led_qcfg *
16942  **********************/
16943
16944
16945 /* hwrm_port_led_qcfg_input (size:192b/24B) */
16946 struct hwrm_port_led_qcfg_input {
16947         /* The HWRM command request type. */
16948         uint16_t        req_type;
16949         /*
16950          * The completion ring to send the completion event on. This should
16951          * be the NQ ID returned from the `nq_alloc` HWRM command.
16952          */
16953         uint16_t        cmpl_ring;
16954         /*
16955          * The sequence ID is used by the driver for tracking multiple
16956          * commands. This ID is treated as opaque data by the firmware and
16957          * the value is returned in the `hwrm_resp_hdr` upon completion.
16958          */
16959         uint16_t        seq_id;
16960         /*
16961          * The target ID of the command:
16962          * * 0x0-0xFFF8 - The function ID
16963          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
16964          * * 0xFFFD - Reserved for user-space HWRM interface
16965          * * 0xFFFF - HWRM
16966          */
16967         uint16_t        target_id;
16968         /*
16969          * A physical address pointer pointing to a host buffer that the
16970          * command's response data will be written. This can be either a host
16971          * physical address (HPA) or a guest physical address (GPA) and must
16972          * point to a physically contiguous block of memory.
16973          */
16974         uint64_t        resp_addr;
16975         /* Port ID of port whose LED configuration is being queried. */
16976         uint16_t        port_id;
16977         uint8_t unused_0[6];
16978 } __attribute__((packed));
16979
16980 /* hwrm_port_led_qcfg_output (size:448b/56B) */
16981 struct hwrm_port_led_qcfg_output {
16982         /* The specific error status for the command. */
16983         uint16_t        error_code;
16984         /* The HWRM command request type. */
16985         uint16_t        req_type;
16986         /* The sequence ID from the original command. */
16987         uint16_t        seq_id;
16988         /* The length of the response data in number of bytes. */
16989         uint16_t        resp_len;
16990         /*
16991          * The number of LEDs that are configured on this port.
16992          * Up to 4 LEDs can be returned in the response.
16993          */
16994         uint8_t num_leds;
16995         /* An identifier for the LED #0. */
16996         uint8_t led0_id;
16997         /* The type of LED #0. */
16998         uint8_t led0_type;
16999         /* Speed LED */
17000         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
17001         /* Activity LED */
17002         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
17003         /* Invalid */
17004         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
17005         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_LAST \
17006                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID
17007         /* The current state of the LED #0. */
17008         uint8_t led0_state;
17009         /* Default state of the LED */
17010         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT  UINT32_C(0x0)
17011         /* Off */
17012         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF      UINT32_C(0x1)
17013         /* On */
17014         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON       UINT32_C(0x2)
17015         /* Blink */
17016         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK    UINT32_C(0x3)
17017         /* Blink Alternately */
17018         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
17019         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_LAST \
17020                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT
17021         /* The color of LED #0. */
17022         uint8_t led0_color;
17023         /* Default */
17024         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT    UINT32_C(0x0)
17025         /* Amber */
17026         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER      UINT32_C(0x1)
17027         /* Green */
17028         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN      UINT32_C(0x2)
17029         /* Green or Amber */
17030         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
17031         #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_LAST \
17032                 HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER
17033         uint8_t unused_0;
17034         /*
17035          * If the LED #0 state is "blink" or "blinkalt", then
17036          * this field represents the requested time in milliseconds
17037          * to keep LED on between cycles.
17038          */
17039         uint16_t        led0_blink_on;
17040         /*
17041          * If the LED #0 state is "blink" or "blinkalt", then
17042          * this field represents the requested time in milliseconds
17043          * to keep LED off between cycles.
17044          */
17045         uint16_t        led0_blink_off;
17046         /*
17047          * An identifier for the group of LEDs that LED #0 belongs
17048          * to.
17049          * If set to 0, then the LED #0 is not grouped.
17050          * For all other non-zero values of this field, LED #0 is
17051          * grouped together with the LEDs with the same group ID
17052          * value.
17053          */
17054         uint8_t led0_group_id;
17055         /* An identifier for the LED #1. */
17056         uint8_t led1_id;
17057         /* The type of LED #1. */
17058         uint8_t led1_type;
17059         /* Speed LED */
17060         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
17061         /* Activity LED */
17062         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
17063         /* Invalid */
17064         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
17065         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_LAST \
17066                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID
17067         /* The current state of the LED #1. */
17068         uint8_t led1_state;
17069         /* Default state of the LED */
17070         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT  UINT32_C(0x0)
17071         /* Off */
17072         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF      UINT32_C(0x1)
17073         /* On */
17074         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON       UINT32_C(0x2)
17075         /* Blink */
17076         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK    UINT32_C(0x3)
17077         /* Blink Alternately */
17078         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
17079         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_LAST \
17080                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT
17081         /* The color of LED #1. */
17082         uint8_t led1_color;
17083         /* Default */
17084         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT    UINT32_C(0x0)
17085         /* Amber */
17086         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER      UINT32_C(0x1)
17087         /* Green */
17088         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN      UINT32_C(0x2)
17089         /* Green or Amber */
17090         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
17091         #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_LAST \
17092                 HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER
17093         uint8_t unused_1;
17094         /*
17095          * If the LED #1 state is "blink" or "blinkalt", then
17096          * this field represents the requested time in milliseconds
17097          * to keep LED on between cycles.
17098          */
17099         uint16_t        led1_blink_on;
17100         /*
17101          * If the LED #1 state is "blink" or "blinkalt", then
17102          * this field represents the requested time in milliseconds
17103          * to keep LED off between cycles.
17104          */
17105         uint16_t        led1_blink_off;
17106         /*
17107          * An identifier for the group of LEDs that LED #1 belongs
17108          * to.
17109          * If set to 0, then the LED #1 is not grouped.
17110          * For all other non-zero values of this field, LED #1 is
17111          * grouped together with the LEDs with the same group ID
17112          * value.
17113          */
17114         uint8_t led1_group_id;
17115         /* An identifier for the LED #2. */
17116         uint8_t led2_id;
17117         /* The type of LED #2. */
17118         uint8_t led2_type;
17119         /* Speed LED */
17120         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
17121         /* Activity LED */
17122         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
17123         /* Invalid */
17124         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
17125         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_LAST \
17126                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID
17127         /* The current state of the LED #2. */
17128         uint8_t led2_state;
17129         /* Default state of the LED */
17130         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT  UINT32_C(0x0)
17131         /* Off */
17132         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF      UINT32_C(0x1)
17133         /* On */
17134         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON       UINT32_C(0x2)
17135         /* Blink */
17136         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK    UINT32_C(0x3)
17137         /* Blink Alternately */
17138         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
17139         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_LAST \
17140                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT
17141         /* The color of LED #2. */
17142         uint8_t led2_color;
17143         /* Default */
17144         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT    UINT32_C(0x0)
17145         /* Amber */
17146         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER      UINT32_C(0x1)
17147         /* Green */
17148         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN      UINT32_C(0x2)
17149         /* Green or Amber */
17150         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
17151         #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_LAST \
17152                 HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER
17153         uint8_t unused_2;
17154         /*
17155          * If the LED #2 state is "blink" or "blinkalt", then
17156          * this field represents the requested time in milliseconds
17157          * to keep LED on between cycles.
17158          */
17159         uint16_t        led2_blink_on;
17160         /*
17161          * If the LED #2 state is "blink" or "blinkalt", then
17162          * this field represents the requested time in milliseconds
17163          * to keep LED off between cycles.
17164          */
17165         uint16_t        led2_blink_off;
17166         /*
17167          * An identifier for the group of LEDs that LED #2 belongs
17168          * to.
17169          * If set to 0, then the LED #2 is not grouped.
17170          * For all other non-zero values of this field, LED #2 is
17171          * grouped together with the LEDs with the same group ID
17172          * value.
17173          */
17174         uint8_t led2_group_id;
17175         /* An identifier for the LED #3. */
17176         uint8_t led3_id;
17177         /* The type of LED #3. */
17178         uint8_t led3_type;
17179         /* Speed LED */
17180         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
17181         /* Activity LED */
17182         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
17183         /* Invalid */
17184         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
17185         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_LAST \
17186                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID
17187         /* The current state of the LED #3. */
17188         uint8_t led3_state;
17189         /* Default state of the LED */
17190         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT  UINT32_C(0x0)
17191         /* Off */
17192         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF      UINT32_C(0x1)
17193         /* On */
17194         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON       UINT32_C(0x2)
17195         /* Blink */
17196         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK    UINT32_C(0x3)
17197         /* Blink Alternately */
17198         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
17199         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_LAST \
17200                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT
17201         /* The color of LED #3. */
17202         uint8_t led3_color;
17203         /* Default */
17204         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT    UINT32_C(0x0)
17205         /* Amber */
17206         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER      UINT32_C(0x1)
17207         /* Green */
17208         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN      UINT32_C(0x2)
17209         /* Green or Amber */
17210         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
17211         #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_LAST \
17212                 HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER
17213         uint8_t unused_3;
17214         /*
17215          * If the LED #3 state is "blink" or "blinkalt", then
17216          * this field represents the requested time in milliseconds
17217          * to keep LED on between cycles.
17218          */
17219         uint16_t        led3_blink_on;
17220         /*
17221          * If the LED #3 state is "blink" or "blinkalt", then
17222          * this field represents the requested time in milliseconds
17223          * to keep LED off between cycles.
17224          */
17225         uint16_t        led3_blink_off;
17226         /*
17227          * An identifier for the group of LEDs that LED #3 belongs
17228          * to.
17229          * If set to 0, then the LED #3 is not grouped.
17230          * For all other non-zero values of this field, LED #3 is
17231          * grouped together with the LEDs with the same group ID
17232          * value.
17233          */
17234         uint8_t led3_group_id;
17235         uint8_t unused_4[6];
17236         /*
17237          * This field is used in Output records to indicate that the output
17238          * is completely written to RAM.  This field should be read as '1'
17239          * to indicate that the output has been completely written.
17240          * When writing a command completion or response to an internal processor,
17241          * the order of writes has to be such that this field is written last.
17242          */
17243         uint8_t valid;
17244 } __attribute__((packed));
17245
17246 /***********************
17247  * hwrm_port_led_qcaps *
17248  ***********************/
17249
17250
17251 /* hwrm_port_led_qcaps_input (size:192b/24B) */
17252 struct hwrm_port_led_qcaps_input {
17253         /* The HWRM command request type. */
17254         uint16_t        req_type;
17255         /*
17256          * The completion ring to send the completion event on. This should
17257          * be the NQ ID returned from the `nq_alloc` HWRM command.
17258          */
17259         uint16_t        cmpl_ring;
17260         /*
17261          * The sequence ID is used by the driver for tracking multiple
17262          * commands. This ID is treated as opaque data by the firmware and
17263          * the value is returned in the `hwrm_resp_hdr` upon completion.
17264          */
17265         uint16_t        seq_id;
17266         /*
17267          * The target ID of the command:
17268          * * 0x0-0xFFF8 - The function ID
17269          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17270          * * 0xFFFD - Reserved for user-space HWRM interface
17271          * * 0xFFFF - HWRM
17272          */
17273         uint16_t        target_id;
17274         /*
17275          * A physical address pointer pointing to a host buffer that the
17276          * command's response data will be written. This can be either a host
17277          * physical address (HPA) or a guest physical address (GPA) and must
17278          * point to a physically contiguous block of memory.
17279          */
17280         uint64_t        resp_addr;
17281         /* Port ID of port whose LED configuration is being queried. */
17282         uint16_t        port_id;
17283         uint8_t unused_0[6];
17284 } __attribute__((packed));
17285
17286 /* hwrm_port_led_qcaps_output (size:384b/48B) */
17287 struct hwrm_port_led_qcaps_output {
17288         /* The specific error status for the command. */
17289         uint16_t        error_code;
17290         /* The HWRM command request type. */
17291         uint16_t        req_type;
17292         /* The sequence ID from the original command. */
17293         uint16_t        seq_id;
17294         /* The length of the response data in number of bytes. */
17295         uint16_t        resp_len;
17296         /*
17297          * The number of LEDs that are configured on this port.
17298          * Up to 4 LEDs can be returned in the response.
17299          */
17300         uint8_t num_leds;
17301         /* Reserved for future use. */
17302         uint8_t unused[3];
17303         /* An identifier for the LED #0. */
17304         uint8_t led0_id;
17305         /* The type of LED #0. */
17306         uint8_t led0_type;
17307         /* Speed LED */
17308         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED    UINT32_C(0x0)
17309         /* Activity LED */
17310         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
17311         /* Invalid */
17312         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID  UINT32_C(0xff)
17313         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_LAST \
17314                 HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID
17315         /*
17316          * An identifier for the group of LEDs that LED #0 belongs
17317          * to.
17318          * If set to 0, then the LED #0 cannot be grouped.
17319          * For all other non-zero values of this field, LED #0 is
17320          * grouped together with the LEDs with the same group ID
17321          * value.
17322          */
17323         uint8_t led0_group_id;
17324         uint8_t unused_0;
17325         /* The states supported by LED #0. */
17326         uint16_t        led0_state_caps;
17327         /*
17328          * If set to 1, this LED is enabled.
17329          * If set to 0, this LED is disabled.
17330          */
17331         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED \
17332                 UINT32_C(0x1)
17333         /*
17334          * If set to 1, off state is supported on this LED.
17335          * If set to 0, off state is not supported on this LED.
17336          */
17337         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \
17338                 UINT32_C(0x2)
17339         /*
17340          * If set to 1, on state is supported on this LED.
17341          * If set to 0, on state is not supported on this LED.
17342          */
17343         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \
17344                 UINT32_C(0x4)
17345         /*
17346          * If set to 1, blink state is supported on this LED.
17347          * If set to 0, blink state is not supported on this LED.
17348          */
17349         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \
17350                 UINT32_C(0x8)
17351         /*
17352          * If set to 1, blink_alt state is supported on this LED.
17353          * If set to 0, blink_alt state is not supported on this LED.
17354          */
17355         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \
17356                 UINT32_C(0x10)
17357         /* The colors supported by LED #0. */
17358         uint16_t        led0_color_caps;
17359         /* reserved. */
17360         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD \
17361                 UINT32_C(0x1)
17362         /*
17363          * If set to 1, Amber color is supported on this LED.
17364          * If set to 0, Amber color is not supported on this LED.
17365          */
17366         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \
17367                 UINT32_C(0x2)
17368         /*
17369          * If set to 1, Green color is supported on this LED.
17370          * If set to 0, Green color is not supported on this LED.
17371          */
17372         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \
17373                 UINT32_C(0x4)
17374         /* An identifier for the LED #1. */
17375         uint8_t led1_id;
17376         /* The type of LED #1. */
17377         uint8_t led1_type;
17378         /* Speed LED */
17379         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED    UINT32_C(0x0)
17380         /* Activity LED */
17381         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
17382         /* Invalid */
17383         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID  UINT32_C(0xff)
17384         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_LAST \
17385                 HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID
17386         /*
17387          * An identifier for the group of LEDs that LED #1 belongs
17388          * to.
17389          * If set to 0, then the LED #0 cannot be grouped.
17390          * For all other non-zero values of this field, LED #0 is
17391          * grouped together with the LEDs with the same group ID
17392          * value.
17393          */
17394         uint8_t led1_group_id;
17395         uint8_t unused_1;
17396         /* The states supported by LED #1. */
17397         uint16_t        led1_state_caps;
17398         /*
17399          * If set to 1, this LED is enabled.
17400          * If set to 0, this LED is disabled.
17401          */
17402         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED \
17403                 UINT32_C(0x1)
17404         /*
17405          * If set to 1, off state is supported on this LED.
17406          * If set to 0, off state is not supported on this LED.
17407          */
17408         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \
17409                 UINT32_C(0x2)
17410         /*
17411          * If set to 1, on state is supported on this LED.
17412          * If set to 0, on state is not supported on this LED.
17413          */
17414         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \
17415                 UINT32_C(0x4)
17416         /*
17417          * If set to 1, blink state is supported on this LED.
17418          * If set to 0, blink state is not supported on this LED.
17419          */
17420         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \
17421                 UINT32_C(0x8)
17422         /*
17423          * If set to 1, blink_alt state is supported on this LED.
17424          * If set to 0, blink_alt state is not supported on this LED.
17425          */
17426         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \
17427                 UINT32_C(0x10)
17428         /* The colors supported by LED #1. */
17429         uint16_t        led1_color_caps;
17430         /* reserved. */
17431         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD \
17432                 UINT32_C(0x1)
17433         /*
17434          * If set to 1, Amber color is supported on this LED.
17435          * If set to 0, Amber color is not supported on this LED.
17436          */
17437         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \
17438                 UINT32_C(0x2)
17439         /*
17440          * If set to 1, Green color is supported on this LED.
17441          * If set to 0, Green color is not supported on this LED.
17442          */
17443         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \
17444                 UINT32_C(0x4)
17445         /* An identifier for the LED #2. */
17446         uint8_t led2_id;
17447         /* The type of LED #2. */
17448         uint8_t led2_type;
17449         /* Speed LED */
17450         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED    UINT32_C(0x0)
17451         /* Activity LED */
17452         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
17453         /* Invalid */
17454         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID  UINT32_C(0xff)
17455         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_LAST \
17456                 HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID
17457         /*
17458          * An identifier for the group of LEDs that LED #0 belongs
17459          * to.
17460          * If set to 0, then the LED #0 cannot be grouped.
17461          * For all other non-zero values of this field, LED #0 is
17462          * grouped together with the LEDs with the same group ID
17463          * value.
17464          */
17465         uint8_t led2_group_id;
17466         uint8_t unused_2;
17467         /* The states supported by LED #2. */
17468         uint16_t        led2_state_caps;
17469         /*
17470          * If set to 1, this LED is enabled.
17471          * If set to 0, this LED is disabled.
17472          */
17473         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED \
17474                 UINT32_C(0x1)
17475         /*
17476          * If set to 1, off state is supported on this LED.
17477          * If set to 0, off state is not supported on this LED.
17478          */
17479         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \
17480                 UINT32_C(0x2)
17481         /*
17482          * If set to 1, on state is supported on this LED.
17483          * If set to 0, on state is not supported on this LED.
17484          */
17485         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \
17486                 UINT32_C(0x4)
17487         /*
17488          * If set to 1, blink state is supported on this LED.
17489          * If set to 0, blink state is not supported on this LED.
17490          */
17491         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \
17492                 UINT32_C(0x8)
17493         /*
17494          * If set to 1, blink_alt state is supported on this LED.
17495          * If set to 0, blink_alt state is not supported on this LED.
17496          */
17497         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \
17498                 UINT32_C(0x10)
17499         /* The colors supported by LED #2. */
17500         uint16_t        led2_color_caps;
17501         /* reserved. */
17502         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD \
17503                 UINT32_C(0x1)
17504         /*
17505          * If set to 1, Amber color is supported on this LED.
17506          * If set to 0, Amber color is not supported on this LED.
17507          */
17508         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \
17509                 UINT32_C(0x2)
17510         /*
17511          * If set to 1, Green color is supported on this LED.
17512          * If set to 0, Green color is not supported on this LED.
17513          */
17514         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \
17515                 UINT32_C(0x4)
17516         /* An identifier for the LED #3. */
17517         uint8_t led3_id;
17518         /* The type of LED #3. */
17519         uint8_t led3_type;
17520         /* Speed LED */
17521         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED    UINT32_C(0x0)
17522         /* Activity LED */
17523         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
17524         /* Invalid */
17525         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID  UINT32_C(0xff)
17526         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_LAST \
17527                 HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID
17528         /*
17529          * An identifier for the group of LEDs that LED #3 belongs
17530          * to.
17531          * If set to 0, then the LED #0 cannot be grouped.
17532          * For all other non-zero values of this field, LED #0 is
17533          * grouped together with the LEDs with the same group ID
17534          * value.
17535          */
17536         uint8_t led3_group_id;
17537         uint8_t unused_3;
17538         /* The states supported by LED #3. */
17539         uint16_t        led3_state_caps;
17540         /*
17541          * If set to 1, this LED is enabled.
17542          * If set to 0, this LED is disabled.
17543          */
17544         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED \
17545                 UINT32_C(0x1)
17546         /*
17547          * If set to 1, off state is supported on this LED.
17548          * If set to 0, off state is not supported on this LED.
17549          */
17550         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \
17551                 UINT32_C(0x2)
17552         /*
17553          * If set to 1, on state is supported on this LED.
17554          * If set to 0, on state is not supported on this LED.
17555          */
17556         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \
17557                 UINT32_C(0x4)
17558         /*
17559          * If set to 1, blink state is supported on this LED.
17560          * If set to 0, blink state is not supported on this LED.
17561          */
17562         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \
17563                 UINT32_C(0x8)
17564         /*
17565          * If set to 1, blink_alt state is supported on this LED.
17566          * If set to 0, blink_alt state is not supported on this LED.
17567          */
17568         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \
17569                 UINT32_C(0x10)
17570         /* The colors supported by LED #3. */
17571         uint16_t        led3_color_caps;
17572         /* reserved. */
17573         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD \
17574                 UINT32_C(0x1)
17575         /*
17576          * If set to 1, Amber color is supported on this LED.
17577          * If set to 0, Amber color is not supported on this LED.
17578          */
17579         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \
17580                 UINT32_C(0x2)
17581         /*
17582          * If set to 1, Green color is supported on this LED.
17583          * If set to 0, Green color is not supported on this LED.
17584          */
17585         #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \
17586                 UINT32_C(0x4)
17587         uint8_t unused_4[3];
17588         /*
17589          * This field is used in Output records to indicate that the output
17590          * is completely written to RAM.  This field should be read as '1'
17591          * to indicate that the output has been completely written.
17592          * When writing a command completion or response to an internal processor,
17593          * the order of writes has to be such that this field is written last.
17594          */
17595         uint8_t valid;
17596 } __attribute__((packed));
17597
17598 /***********************
17599  * hwrm_port_prbs_test *
17600  ***********************/
17601
17602
17603 /* hwrm_port_prbs_test_input (size:384b/48B) */
17604 struct hwrm_port_prbs_test_input {
17605         /* The HWRM command request type. */
17606         uint16_t        req_type;
17607         /*
17608          * The completion ring to send the completion event on. This should
17609          * be the NQ ID returned from the `nq_alloc` HWRM command.
17610          */
17611         uint16_t        cmpl_ring;
17612         /*
17613          * The sequence ID is used by the driver for tracking multiple
17614          * commands. This ID is treated as opaque data by the firmware and
17615          * the value is returned in the `hwrm_resp_hdr` upon completion.
17616          */
17617         uint16_t        seq_id;
17618         /*
17619          * The target ID of the command:
17620          * * 0x0-0xFFF8 - The function ID
17621          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17622          * * 0xFFFD - Reserved for user-space HWRM interface
17623          * * 0xFFFF - HWRM
17624          */
17625         uint16_t        target_id;
17626         /*
17627          * A physical address pointer pointing to a host buffer that the
17628          * command's response data will be written. This can be either a host
17629          * physical address (HPA) or a guest physical address (GPA) and must
17630          * point to a physically contiguous block of memory.
17631          */
17632         uint64_t        resp_addr;
17633         /* Host address data is to DMA'd to. */
17634         uint64_t        resp_data_addr;
17635         /*
17636          * Size of the buffer pointed to by resp_data_addr. The firmware may
17637          * use this entire buffer or less than the entire buffer, but never more.
17638          */
17639         uint16_t        data_len;
17640         uint16_t        unused_0;
17641         uint32_t        unused_1;
17642         /* Port ID of port where PRBS test to be run. */
17643         uint16_t        port_id;
17644         /* Polynomial selection for PRBS test. */
17645         uint16_t        poly;
17646         /* PRBS7 */
17647         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS7   UINT32_C(0x0)
17648         /* PRBS9 */
17649         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS9   UINT32_C(0x1)
17650         /* PRBS11 */
17651         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS11  UINT32_C(0x2)
17652         /* PRBS15 */
17653         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS15  UINT32_C(0x3)
17654         /* PRBS23 */
17655         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS23  UINT32_C(0x4)
17656         /* PRBS31 */
17657         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS31  UINT32_C(0x5)
17658         /* PRBS58 */
17659         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_PRBS58  UINT32_C(0x6)
17660         /* Invalid */
17661         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID UINT32_C(0xff)
17662         #define HWRM_PORT_PRBS_TEST_INPUT_POLY_LAST \
17663                 HWRM_PORT_PRBS_TEST_INPUT_POLY_INVALID
17664         /*
17665          * Configuration bits for PRBS test.
17666          * Use enable bit to start/stop test.
17667          * Use tx/rx lane map bits to run test on specific lanes,
17668          * if set to 0 test will be run on all lanes.
17669          */
17670         uint16_t        prbs_config;
17671         /*
17672          * Set 0 to stop test currently in progress
17673          * Set 1 to start test with configuration provided.
17674          */
17675         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_START_STOP \
17676                 UINT32_C(0x1)
17677         /*
17678          * If set to 1, tx_lane_map bitmap should have lane bits set.
17679          * If set to 0, test will be run on all lanes for this port.
17680          */
17681         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_TX_LANE_MAP_VALID \
17682                 UINT32_C(0x2)
17683         /*
17684          * If set to 1, rx_lane_map bitmap should have lane bits set.
17685          * If set to 0, test will be run on all lanes for this port.
17686          */
17687         #define HWRM_PORT_PRBS_TEST_INPUT_PRBS_CONFIG_RX_LANE_MAP_VALID \
17688                 UINT32_C(0x4)
17689         /* Duration in seconds to run the PRBS test. */
17690         uint16_t        timeout;
17691         /*
17692          * If tx_lane_map_valid is set to 1, this field is a bitmap
17693          * of tx lanes to run PRBS test. bit0 = lane0,
17694          * bit1 = lane1 ..bit31 = lane31
17695          */
17696         uint32_t        tx_lane_map;
17697         /*
17698          * If rx_lane_map_valid is set to 1, this field is a bitmap
17699          * of rx lanes to run PRBS test. bit0 = lane0,
17700          * bit1 = lane1 ..bit31 = lane31
17701          */
17702         uint32_t        rx_lane_map;
17703 } __attribute__((packed));
17704
17705 /* hwrm_port_prbs_test_output (size:128b/16B) */
17706 struct hwrm_port_prbs_test_output {
17707         /* The specific error status for the command. */
17708         uint16_t        error_code;
17709         /* The HWRM command request type. */
17710         uint16_t        req_type;
17711         /* The sequence ID from the original command. */
17712         uint16_t        seq_id;
17713         /* The length of the response data in number of bytes. */
17714         uint16_t        resp_len;
17715         /* Total length of stored data. */
17716         uint16_t        total_data_len;
17717         uint16_t        unused_0;
17718         uint8_t unused_1[3];
17719         /*
17720          * This field is used in Output records to indicate that the output
17721          * is completely written to RAM.  This field should be read as '1'
17722          * to indicate that the output has been completely written.
17723          * When writing a command completion or response to an internal processor,
17724          * the order of writes has to be such that this field is written last.
17725          */
17726         uint8_t valid;
17727 } __attribute__((packed));
17728
17729 /***********************
17730  * hwrm_queue_qportcfg *
17731  ***********************/
17732
17733
17734 /* hwrm_queue_qportcfg_input (size:192b/24B) */
17735 struct hwrm_queue_qportcfg_input {
17736         /* The HWRM command request type. */
17737         uint16_t        req_type;
17738         /*
17739          * The completion ring to send the completion event on. This should
17740          * be the NQ ID returned from the `nq_alloc` HWRM command.
17741          */
17742         uint16_t        cmpl_ring;
17743         /*
17744          * The sequence ID is used by the driver for tracking multiple
17745          * commands. This ID is treated as opaque data by the firmware and
17746          * the value is returned in the `hwrm_resp_hdr` upon completion.
17747          */
17748         uint16_t        seq_id;
17749         /*
17750          * The target ID of the command:
17751          * * 0x0-0xFFF8 - The function ID
17752          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
17753          * * 0xFFFD - Reserved for user-space HWRM interface
17754          * * 0xFFFF - HWRM
17755          */
17756         uint16_t        target_id;
17757         /*
17758          * A physical address pointer pointing to a host buffer that the
17759          * command's response data will be written. This can be either a host
17760          * physical address (HPA) or a guest physical address (GPA) and must
17761          * point to a physically contiguous block of memory.
17762          */
17763         uint64_t        resp_addr;
17764         uint32_t        flags;
17765         /*
17766          * Enumeration denoting the RX, TX type of the resource.
17767          * This enumeration is used for resources that are similar for both
17768          * TX and RX paths of the chip.
17769          */
17770         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
17771         /* tx path */
17772         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
17773         /* rx path */
17774         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
17775         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
17776                 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
17777         /*
17778          * Port ID of port for which the queue configuration is being
17779          * queried.  This field is only required when sent by IPC.
17780          */
17781         uint16_t        port_id;
17782         /*
17783          * Drivers will set this capability when it can use
17784          * queue_idx_service_profile to map the queues to application.
17785          */
17786         uint8_t drv_qmap_cap;
17787         /* disabled */
17788         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
17789         /* enabled */
17790         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
17791         #define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
17792                 HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
17793         uint8_t unused_0;
17794 } __attribute__((packed));
17795
17796 /* hwrm_queue_qportcfg_output (size:256b/32B) */
17797 struct hwrm_queue_qportcfg_output {
17798         /* The specific error status for the command. */
17799         uint16_t        error_code;
17800         /* The HWRM command request type. */
17801         uint16_t        req_type;
17802         /* The sequence ID from the original command. */
17803         uint16_t        seq_id;
17804         /* The length of the response data in number of bytes. */
17805         uint16_t        resp_len;
17806         /*
17807          * The maximum number of queues that can be configured on this
17808          * port.
17809          * Valid values range from 1 through 8.
17810          */
17811         uint8_t max_configurable_queues;
17812         /*
17813          * The maximum number of lossless queues that can be configured
17814          * on this port.
17815          * Valid values range from 0 through 8.
17816          */
17817         uint8_t max_configurable_lossless_queues;
17818         /*
17819          * Bitmask indicating which queues can be configured by the
17820          * hwrm_queue_cfg command.
17821          *
17822          * Each bit represents a specific queue where bit 0 represents
17823          * queue 0 and bit 7 represents queue 7.
17824          * # A value of 0 indicates that the queue is not configurable
17825          * by the hwrm_queue_cfg command.
17826          * # A value of 1 indicates that the queue is configurable.
17827          * # A hwrm_queue_cfg command shall return error when trying to
17828          * configure a queue not configurable.
17829          */
17830         uint8_t queue_cfg_allowed;
17831         /* Information about queue configuration. */
17832         uint8_t queue_cfg_info;
17833         /*
17834          * If this flag is set to '1', then the queues are
17835          * configured asymmetrically on TX and RX sides.
17836          * If this flag is set to '0', then the queues are
17837          * configured symmetrically on TX and RX sides. For
17838          * symmetric configuration, the queue configuration
17839          * including queue ids and service profiles on the
17840          * TX side is the same as the corresponding queue
17841          * configuration on the RX side.
17842          */
17843         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
17844                 UINT32_C(0x1)
17845         /*
17846          * Bitmask indicating which queues can be configured by the
17847          * hwrm_queue_pfcenable_cfg command.
17848          *
17849          * Each bit represents a specific priority where bit 0 represents
17850          * priority 0 and bit 7 represents priority 7.
17851          * # A value of 0 indicates that the priority is not configurable by
17852          * the hwrm_queue_pfcenable_cfg command.
17853          * # A value of 1 indicates that the priority is configurable.
17854          * # A hwrm_queue_pfcenable_cfg command shall return error when
17855          * trying to configure a priority that is not configurable.
17856          */
17857         uint8_t queue_pfcenable_cfg_allowed;
17858         /*
17859          * Bitmask indicating which queues can be configured by the
17860          * hwrm_queue_pri2cos_cfg command.
17861          *
17862          * Each bit represents a specific queue where bit 0 represents
17863          * queue 0 and bit 7 represents queue 7.
17864          * # A value of 0 indicates that the queue is not configurable
17865          * by the hwrm_queue_pri2cos_cfg command.
17866          * # A value of 1 indicates that the queue is configurable.
17867          * # A hwrm_queue_pri2cos_cfg command shall return error when
17868          * trying to configure a queue that is not configurable.
17869          */
17870         uint8_t queue_pri2cos_cfg_allowed;
17871         /*
17872          * Bitmask indicating which queues can be configured by the
17873          * hwrm_queue_pri2cos_cfg command.
17874          *
17875          * Each bit represents a specific queue where bit 0 represents
17876          * queue 0 and bit 7 represents queue 7.
17877          * # A value of 0 indicates that the queue is not configurable
17878          * by the hwrm_queue_pri2cos_cfg command.
17879          * # A value of 1 indicates that the queue is configurable.
17880          * # A hwrm_queue_pri2cos_cfg command shall return error when
17881          * trying to configure a queue not configurable.
17882          */
17883         uint8_t queue_cos2bw_cfg_allowed;
17884         /*
17885          * ID of CoS Queue 0.
17886          * FF - Invalid id
17887          *
17888          * # This ID can be used on any subsequent call to an hwrm command
17889          * that takes a queue id.
17890          * # IDs must always be queried by this command before any use
17891          * by the driver or software.
17892          * # Any driver or software should not make any assumptions about
17893          * queue IDs.
17894          * # A value of 0xff indicates that the queue is not available.
17895          * # Available queues may not be in sequential order.
17896          */
17897         uint8_t queue_id0;
17898         /* This value is applicable to CoS queues only. */
17899         uint8_t queue_id0_service_profile;
17900         /* Lossy (best-effort) */
17901         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
17902                 UINT32_C(0x0)
17903         /* Lossless (legacy) */
17904         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
17905                 UINT32_C(0x1)
17906         /* Lossless RoCE */
17907         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \
17908                 UINT32_C(0x1)
17909         /* Lossy RoCE CNP */
17910         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \
17911                 UINT32_C(0x2)
17912         /* Lossless NIC */
17913         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \
17914                 UINT32_C(0x3)
17915         /* Set to 0xFF... (All Fs) if there is no service profile specified */
17916         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
17917                 UINT32_C(0xff)
17918         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \
17919                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
17920         /*
17921          * ID of CoS Queue 1.
17922          * FF - Invalid id
17923          *
17924          * # This ID can be used on any subsequent call to an hwrm command
17925          * that takes a queue id.
17926          * # IDs must always be queried by this command before any use
17927          * by the driver or software.
17928          * # Any driver or software should not make any assumptions about
17929          * queue IDs.
17930          * # A value of 0xff indicates that the queue is not available.
17931          * # Available queues may not be in sequential order.
17932          */
17933         uint8_t queue_id1;
17934         /* This value is applicable to CoS queues only. */
17935         uint8_t queue_id1_service_profile;
17936         /* Lossy (best-effort) */
17937         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
17938                 UINT32_C(0x0)
17939         /* Lossless (legacy) */
17940         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
17941                 UINT32_C(0x1)
17942         /* Lossless RoCE */
17943         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \
17944                 UINT32_C(0x1)
17945         /* Lossy RoCE CNP */
17946         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \
17947                 UINT32_C(0x2)
17948         /* Lossless NIC */
17949         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \
17950                 UINT32_C(0x3)
17951         /* Set to 0xFF... (All Fs) if there is no service profile specified */
17952         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
17953                 UINT32_C(0xff)
17954         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \
17955                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
17956         /*
17957          * ID of CoS Queue 2.
17958          * FF - Invalid id
17959          *
17960          * # This ID can be used on any subsequent call to an hwrm command
17961          * that takes a queue id.
17962          * # IDs must always be queried by this command before any use
17963          * by the driver or software.
17964          * # Any driver or software should not make any assumptions about
17965          * queue IDs.
17966          * # A value of 0xff indicates that the queue is not available.
17967          * # Available queues may not be in sequential order.
17968          */
17969         uint8_t queue_id2;
17970         /* This value is applicable to CoS queues only. */
17971         uint8_t queue_id2_service_profile;
17972         /* Lossy (best-effort) */
17973         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
17974                 UINT32_C(0x0)
17975         /* Lossless (legacy) */
17976         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
17977                 UINT32_C(0x1)
17978         /* Lossless RoCE */
17979         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \
17980                 UINT32_C(0x1)
17981         /* Lossy RoCE CNP */
17982         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \
17983                 UINT32_C(0x2)
17984         /* Lossless NIC */
17985         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \
17986                 UINT32_C(0x3)
17987         /* Set to 0xFF... (All Fs) if there is no service profile specified */
17988         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
17989                 UINT32_C(0xff)
17990         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \
17991                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
17992         /*
17993          * ID of CoS Queue 3.
17994          * FF - Invalid id
17995          *
17996          * # This ID can be used on any subsequent call to an hwrm command
17997          * that takes a queue id.
17998          * # IDs must always be queried by this command before any use
17999          * by the driver or software.
18000          * # Any driver or software should not make any assumptions about
18001          * queue IDs.
18002          * # A value of 0xff indicates that the queue is not available.
18003          * # Available queues may not be in sequential order.
18004          */
18005         uint8_t queue_id3;
18006         /* This value is applicable to CoS queues only. */
18007         uint8_t queue_id3_service_profile;
18008         /* Lossy (best-effort) */
18009         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
18010                 UINT32_C(0x0)
18011         /* Lossless (legacy) */
18012         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
18013                 UINT32_C(0x1)
18014         /* Lossless RoCE */
18015         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \
18016                 UINT32_C(0x1)
18017         /* Lossy RoCE CNP */
18018         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18019                 UINT32_C(0x2)
18020         /* Lossless NIC */
18021         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \
18022                 UINT32_C(0x3)
18023         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18024         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
18025                 UINT32_C(0xff)
18026         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \
18027                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
18028         /*
18029          * ID of CoS Queue 4.
18030          * FF - Invalid id
18031          *
18032          * # This ID can be used on any subsequent call to an hwrm command
18033          * that takes a queue id.
18034          * # IDs must always be queried by this command before any use
18035          * by the driver or software.
18036          * # Any driver or software should not make any assumptions about
18037          * queue IDs.
18038          * # A value of 0xff indicates that the queue is not available.
18039          * # Available queues may not be in sequential order.
18040          */
18041         uint8_t queue_id4;
18042         /* This value is applicable to CoS queues only. */
18043         uint8_t queue_id4_service_profile;
18044         /* Lossy (best-effort) */
18045         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
18046                 UINT32_C(0x0)
18047         /* Lossless (legacy) */
18048         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
18049                 UINT32_C(0x1)
18050         /* Lossless RoCE */
18051         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \
18052                 UINT32_C(0x1)
18053         /* Lossy RoCE CNP */
18054         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18055                 UINT32_C(0x2)
18056         /* Lossless NIC */
18057         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \
18058                 UINT32_C(0x3)
18059         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18060         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
18061                 UINT32_C(0xff)
18062         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \
18063                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
18064         /*
18065          * ID of CoS Queue 5.
18066          * FF - Invalid id
18067          *
18068          * # This ID can be used on any subsequent call to an hwrm command
18069          * that takes a queue id.
18070          * # IDs must always be queried by this command before any use
18071          * by the driver or software.
18072          * # Any driver or software should not make any assumptions about
18073          * queue IDs.
18074          * # A value of 0xff indicates that the queue is not available.
18075          * # Available queues may not be in sequential order.
18076          */
18077         uint8_t queue_id5;
18078         /* This value is applicable to CoS queues only. */
18079         uint8_t queue_id5_service_profile;
18080         /* Lossy (best-effort) */
18081         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
18082                 UINT32_C(0x0)
18083         /* Lossless (legacy) */
18084         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
18085                 UINT32_C(0x1)
18086         /* Lossless RoCE */
18087         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \
18088                 UINT32_C(0x1)
18089         /* Lossy RoCE CNP */
18090         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18091                 UINT32_C(0x2)
18092         /* Lossless NIC */
18093         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \
18094                 UINT32_C(0x3)
18095         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18096         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
18097                 UINT32_C(0xff)
18098         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \
18099                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
18100         /*
18101          * ID of CoS Queue 6.
18102          * FF - Invalid id
18103          *
18104          * # This ID can be used on any subsequent call to an hwrm command
18105          * that takes a queue id.
18106          * # IDs must always be queried by this command before any use
18107          * by the driver or software.
18108          * # Any driver or software should not make any assumptions about
18109          * queue IDs.
18110          * # A value of 0xff indicates that the queue is not available.
18111          * # Available queues may not be in sequential order.
18112          */
18113         uint8_t queue_id6;
18114         /* This value is applicable to CoS queues only. */
18115         uint8_t queue_id6_service_profile;
18116         /* Lossy (best-effort) */
18117         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
18118                 UINT32_C(0x0)
18119         /* Lossless (legacy) */
18120         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
18121                 UINT32_C(0x1)
18122         /* Lossless RoCE */
18123         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \
18124                 UINT32_C(0x1)
18125         /* Lossy RoCE CNP */
18126         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18127                 UINT32_C(0x2)
18128         /* Lossless NIC */
18129         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \
18130                 UINT32_C(0x3)
18131         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18132         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
18133                 UINT32_C(0xff)
18134         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \
18135                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
18136         /*
18137          * ID of CoS Queue 7.
18138          * FF - Invalid id
18139          *
18140          * # This ID can be used on any subsequent call to an hwrm command
18141          * that takes a queue id.
18142          * # IDs must always be queried by this command before any use
18143          * by the driver or software.
18144          * # Any driver or software should not make any assumptions about
18145          * queue IDs.
18146          * # A value of 0xff indicates that the queue is not available.
18147          * # Available queues may not be in sequential order.
18148          */
18149         uint8_t queue_id7;
18150         /* This value is applicable to CoS queues only. */
18151         uint8_t queue_id7_service_profile;
18152         /* Lossy (best-effort) */
18153         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
18154                 UINT32_C(0x0)
18155         /* Lossless (legacy) */
18156         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
18157                 UINT32_C(0x1)
18158         /* Lossless RoCE */
18159         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \
18160                 UINT32_C(0x1)
18161         /* Lossy RoCE CNP */
18162         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \
18163                 UINT32_C(0x2)
18164         /* Lossless NIC */
18165         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \
18166                 UINT32_C(0x3)
18167         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18168         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
18169                 UINT32_C(0xff)
18170         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \
18171                 HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
18172         /*
18173          * This field is used in Output records to indicate that the output
18174          * is completely written to RAM.  This field should be read as '1'
18175          * to indicate that the output has been completely written.
18176          * When writing a command completion or response to an internal processor,
18177          * the order of writes has to be such that this field is written last.
18178          */
18179         uint8_t valid;
18180 } __attribute__((packed));
18181
18182 /*******************
18183  * hwrm_queue_qcfg *
18184  *******************/
18185
18186
18187 /* hwrm_queue_qcfg_input (size:192b/24B) */
18188 struct hwrm_queue_qcfg_input {
18189         /* The HWRM command request type. */
18190         uint16_t        req_type;
18191         /*
18192          * The completion ring to send the completion event on. This should
18193          * be the NQ ID returned from the `nq_alloc` HWRM command.
18194          */
18195         uint16_t        cmpl_ring;
18196         /*
18197          * The sequence ID is used by the driver for tracking multiple
18198          * commands. This ID is treated as opaque data by the firmware and
18199          * the value is returned in the `hwrm_resp_hdr` upon completion.
18200          */
18201         uint16_t        seq_id;
18202         /*
18203          * The target ID of the command:
18204          * * 0x0-0xFFF8 - The function ID
18205          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18206          * * 0xFFFD - Reserved for user-space HWRM interface
18207          * * 0xFFFF - HWRM
18208          */
18209         uint16_t        target_id;
18210         /*
18211          * A physical address pointer pointing to a host buffer that the
18212          * command's response data will be written. This can be either a host
18213          * physical address (HPA) or a guest physical address (GPA) and must
18214          * point to a physically contiguous block of memory.
18215          */
18216         uint64_t        resp_addr;
18217         uint32_t        flags;
18218         /*
18219          * Enumeration denoting the RX, TX type of the resource.
18220          * This enumeration is used for resources that are similar for both
18221          * TX and RX paths of the chip.
18222          */
18223         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
18224         /* tx path */
18225         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
18226         /* rx path */
18227         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
18228         #define HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_LAST \
18229                 HWRM_QUEUE_QCFG_INPUT_FLAGS_PATH_RX
18230         /* Queue ID of the queue. */
18231         uint32_t        queue_id;
18232 } __attribute__((packed));
18233
18234 /* hwrm_queue_qcfg_output (size:128b/16B) */
18235 struct hwrm_queue_qcfg_output {
18236         /* The specific error status for the command. */
18237         uint16_t        error_code;
18238         /* The HWRM command request type. */
18239         uint16_t        req_type;
18240         /* The sequence ID from the original command. */
18241         uint16_t        seq_id;
18242         /* The length of the response data in number of bytes. */
18243         uint16_t        resp_len;
18244         /*
18245          * This value is a the estimate packet length used in the
18246          * TX arbiter.
18247          */
18248         uint32_t        queue_len;
18249         /* This value is applicable to CoS queues only. */
18250         uint8_t service_profile;
18251         /* Lossy (best-effort) */
18252         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
18253         /* Lossless */
18254         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
18255         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18256         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
18257         #define HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_LAST \
18258                 HWRM_QUEUE_QCFG_OUTPUT_SERVICE_PROFILE_UNKNOWN
18259         /* Information about queue configuration. */
18260         uint8_t queue_cfg_info;
18261         /*
18262          * If this flag is set to '1', then the queue is
18263          * configured asymmetrically on TX and RX sides.
18264          * If this flag is set to '0', then this queue is
18265          * configured symmetrically on TX and RX sides.
18266          */
18267         #define HWRM_QUEUE_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
18268                 UINT32_C(0x1)
18269         uint8_t unused_0;
18270         /*
18271          * This field is used in Output records to indicate that the output
18272          * is completely written to RAM.  This field should be read as '1'
18273          * to indicate that the output has been completely written.
18274          * When writing a command completion or response to an internal processor,
18275          * the order of writes has to be such that this field is written last.
18276          */
18277         uint8_t valid;
18278 } __attribute__((packed));
18279
18280 /******************
18281  * hwrm_queue_cfg *
18282  ******************/
18283
18284
18285 /* hwrm_queue_cfg_input (size:320b/40B) */
18286 struct hwrm_queue_cfg_input {
18287         /* The HWRM command request type. */
18288         uint16_t        req_type;
18289         /*
18290          * The completion ring to send the completion event on. This should
18291          * be the NQ ID returned from the `nq_alloc` HWRM command.
18292          */
18293         uint16_t        cmpl_ring;
18294         /*
18295          * The sequence ID is used by the driver for tracking multiple
18296          * commands. This ID is treated as opaque data by the firmware and
18297          * the value is returned in the `hwrm_resp_hdr` upon completion.
18298          */
18299         uint16_t        seq_id;
18300         /*
18301          * The target ID of the command:
18302          * * 0x0-0xFFF8 - The function ID
18303          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18304          * * 0xFFFD - Reserved for user-space HWRM interface
18305          * * 0xFFFF - HWRM
18306          */
18307         uint16_t        target_id;
18308         /*
18309          * A physical address pointer pointing to a host buffer that the
18310          * command's response data will be written. This can be either a host
18311          * physical address (HPA) or a guest physical address (GPA) and must
18312          * point to a physically contiguous block of memory.
18313          */
18314         uint64_t        resp_addr;
18315         uint32_t        flags;
18316         /*
18317          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
18318          * This enumeration is used for resources that are similar for both
18319          * TX and RX paths of the chip.
18320          */
18321         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
18322         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_SFT  0
18323         /* tx path */
18324         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
18325         /* rx path */
18326         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
18327         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
18328         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
18329         #define HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_LAST \
18330                 HWRM_QUEUE_CFG_INPUT_FLAGS_PATH_BIDIR
18331         uint32_t        enables;
18332         /*
18333          * This bit must be '1' for the dflt_len field to be
18334          * configured.
18335          */
18336         #define HWRM_QUEUE_CFG_INPUT_ENABLES_DFLT_LEN            UINT32_C(0x1)
18337         /*
18338          * This bit must be '1' for the service_profile field to be
18339          * configured.
18340          */
18341         #define HWRM_QUEUE_CFG_INPUT_ENABLES_SERVICE_PROFILE     UINT32_C(0x2)
18342         /* Queue ID of queue that is to be configured by this function. */
18343         uint32_t        queue_id;
18344         /*
18345          * This value is a the estimate packet length used in the
18346          * TX arbiter.
18347          * Set to 0xFF... (All Fs) to not adjust this value.
18348          */
18349         uint32_t        dflt_len;
18350         /* This value is applicable to CoS queues only. */
18351         uint8_t service_profile;
18352         /* Lossy (best-effort) */
18353         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSY    UINT32_C(0x0)
18354         /* Lossless */
18355         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LOSSLESS UINT32_C(0x1)
18356         /* Set to 0xFF... (All Fs) if there is no service profile specified */
18357         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN  UINT32_C(0xff)
18358         #define HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_LAST \
18359                 HWRM_QUEUE_CFG_INPUT_SERVICE_PROFILE_UNKNOWN
18360         uint8_t unused_0[7];
18361 } __attribute__((packed));
18362
18363 /* hwrm_queue_cfg_output (size:128b/16B) */
18364 struct hwrm_queue_cfg_output {
18365         /* The specific error status for the command. */
18366         uint16_t        error_code;
18367         /* The HWRM command request type. */
18368         uint16_t        req_type;
18369         /* The sequence ID from the original command. */
18370         uint16_t        seq_id;
18371         /* The length of the response data in number of bytes. */
18372         uint16_t        resp_len;
18373         uint8_t unused_0[7];
18374         /*
18375          * This field is used in Output records to indicate that the output
18376          * is completely written to RAM.  This field should be read as '1'
18377          * to indicate that the output has been completely written.
18378          * When writing a command completion or response to an internal processor,
18379          * the order of writes has to be such that this field is written last.
18380          */
18381         uint8_t valid;
18382 } __attribute__((packed));
18383
18384 /*****************************
18385  * hwrm_queue_pfcenable_qcfg *
18386  *****************************/
18387
18388
18389 /* hwrm_queue_pfcenable_qcfg_input (size:192b/24B) */
18390 struct hwrm_queue_pfcenable_qcfg_input {
18391         /* The HWRM command request type. */
18392         uint16_t        req_type;
18393         /*
18394          * The completion ring to send the completion event on. This should
18395          * be the NQ ID returned from the `nq_alloc` HWRM command.
18396          */
18397         uint16_t        cmpl_ring;
18398         /*
18399          * The sequence ID is used by the driver for tracking multiple
18400          * commands. This ID is treated as opaque data by the firmware and
18401          * the value is returned in the `hwrm_resp_hdr` upon completion.
18402          */
18403         uint16_t        seq_id;
18404         /*
18405          * The target ID of the command:
18406          * * 0x0-0xFFF8 - The function ID
18407          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18408          * * 0xFFFD - Reserved for user-space HWRM interface
18409          * * 0xFFFF - HWRM
18410          */
18411         uint16_t        target_id;
18412         /*
18413          * A physical address pointer pointing to a host buffer that the
18414          * command's response data will be written. This can be either a host
18415          * physical address (HPA) or a guest physical address (GPA) and must
18416          * point to a physically contiguous block of memory.
18417          */
18418         uint64_t        resp_addr;
18419         /*
18420          * Port ID of port for which the table is being configured.
18421          * The HWRM needs to check whether this function is allowed
18422          * to configure pri2cos mapping on this port.
18423          */
18424         uint16_t        port_id;
18425         uint8_t unused_0[6];
18426 } __attribute__((packed));
18427
18428 /* hwrm_queue_pfcenable_qcfg_output (size:128b/16B) */
18429 struct hwrm_queue_pfcenable_qcfg_output {
18430         /* The specific error status for the command. */
18431         uint16_t        error_code;
18432         /* The HWRM command request type. */
18433         uint16_t        req_type;
18434         /* The sequence ID from the original command. */
18435         uint16_t        seq_id;
18436         /* The length of the response data in number of bytes. */
18437         uint16_t        resp_len;
18438         uint32_t        flags;
18439         /* If set to 1, then PFC is enabled on PRI 0. */
18440         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI0_PFC_ENABLED \
18441                 UINT32_C(0x1)
18442         /* If set to 1, then PFC is enabled on PRI 1. */
18443         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI1_PFC_ENABLED \
18444                 UINT32_C(0x2)
18445         /* If set to 1, then PFC is enabled on PRI 2. */
18446         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI2_PFC_ENABLED \
18447                 UINT32_C(0x4)
18448         /* If set to 1, then PFC is enabled on PRI 3. */
18449         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI3_PFC_ENABLED \
18450                 UINT32_C(0x8)
18451         /* If set to 1, then PFC is enabled on PRI 4. */
18452         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI4_PFC_ENABLED \
18453                 UINT32_C(0x10)
18454         /* If set to 1, then PFC is enabled on PRI 5. */
18455         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI5_PFC_ENABLED \
18456                 UINT32_C(0x20)
18457         /* If set to 1, then PFC is enabled on PRI 6. */
18458         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI6_PFC_ENABLED \
18459                 UINT32_C(0x40)
18460         /* If set to 1, then PFC is enabled on PRI 7. */
18461         #define HWRM_QUEUE_PFCENABLE_QCFG_OUTPUT_FLAGS_PRI7_PFC_ENABLED \
18462                 UINT32_C(0x80)
18463         uint8_t unused_0[3];
18464         /*
18465          * This field is used in Output records to indicate that the output
18466          * is completely written to RAM.  This field should be read as '1'
18467          * to indicate that the output has been completely written.
18468          * When writing a command completion or response to an internal processor,
18469          * the order of writes has to be such that this field is written last.
18470          */
18471         uint8_t valid;
18472 } __attribute__((packed));
18473
18474 /****************************
18475  * hwrm_queue_pfcenable_cfg *
18476  ****************************/
18477
18478
18479 /* hwrm_queue_pfcenable_cfg_input (size:192b/24B) */
18480 struct hwrm_queue_pfcenable_cfg_input {
18481         /* The HWRM command request type. */
18482         uint16_t        req_type;
18483         /*
18484          * The completion ring to send the completion event on. This should
18485          * be the NQ ID returned from the `nq_alloc` HWRM command.
18486          */
18487         uint16_t        cmpl_ring;
18488         /*
18489          * The sequence ID is used by the driver for tracking multiple
18490          * commands. This ID is treated as opaque data by the firmware and
18491          * the value is returned in the `hwrm_resp_hdr` upon completion.
18492          */
18493         uint16_t        seq_id;
18494         /*
18495          * The target ID of the command:
18496          * * 0x0-0xFFF8 - The function ID
18497          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18498          * * 0xFFFD - Reserved for user-space HWRM interface
18499          * * 0xFFFF - HWRM
18500          */
18501         uint16_t        target_id;
18502         /*
18503          * A physical address pointer pointing to a host buffer that the
18504          * command's response data will be written. This can be either a host
18505          * physical address (HPA) or a guest physical address (GPA) and must
18506          * point to a physically contiguous block of memory.
18507          */
18508         uint64_t        resp_addr;
18509         uint32_t        flags;
18510         /* If set to 1, then PFC is requested to be enabled on PRI 0. */
18511         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI0_PFC_ENABLED \
18512                 UINT32_C(0x1)
18513         /* If set to 1, then PFC is requested to be enabled on PRI 1. */
18514         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI1_PFC_ENABLED \
18515                 UINT32_C(0x2)
18516         /* If set to 1, then PFC is requested to  be enabled on PRI 2. */
18517         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI2_PFC_ENABLED \
18518                 UINT32_C(0x4)
18519         /* If set to 1, then PFC is requested to  be enabled on PRI 3. */
18520         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI3_PFC_ENABLED \
18521                 UINT32_C(0x8)
18522         /* If set to 1, then PFC is requested to  be enabled on PRI 4. */
18523         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI4_PFC_ENABLED \
18524                 UINT32_C(0x10)
18525         /* If set to 1, then PFC is requested to  be enabled on PRI 5. */
18526         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI5_PFC_ENABLED \
18527                 UINT32_C(0x20)
18528         /* If set to 1, then PFC is requested to  be enabled on PRI 6. */
18529         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI6_PFC_ENABLED \
18530                 UINT32_C(0x40)
18531         /* If set to 1, then PFC is requested to  be enabled on PRI 7. */
18532         #define HWRM_QUEUE_PFCENABLE_CFG_INPUT_FLAGS_PRI7_PFC_ENABLED \
18533                 UINT32_C(0x80)
18534         /*
18535          * Port ID of port for which the table is being configured.
18536          * The HWRM needs to check whether this function is allowed
18537          * to configure pri2cos mapping on this port.
18538          */
18539         uint16_t        port_id;
18540         uint8_t unused_0[2];
18541 } __attribute__((packed));
18542
18543 /* hwrm_queue_pfcenable_cfg_output (size:128b/16B) */
18544 struct hwrm_queue_pfcenable_cfg_output {
18545         /* The specific error status for the command. */
18546         uint16_t        error_code;
18547         /* The HWRM command request type. */
18548         uint16_t        req_type;
18549         /* The sequence ID from the original command. */
18550         uint16_t        seq_id;
18551         /* The length of the response data in number of bytes. */
18552         uint16_t        resp_len;
18553         uint8_t unused_0[7];
18554         /*
18555          * This field is used in Output records to indicate that the output
18556          * is completely written to RAM.  This field should be read as '1'
18557          * to indicate that the output has been completely written.
18558          * When writing a command completion or response to an internal processor,
18559          * the order of writes has to be such that this field is written last.
18560          */
18561         uint8_t valid;
18562 } __attribute__((packed));
18563
18564 /***************************
18565  * hwrm_queue_pri2cos_qcfg *
18566  ***************************/
18567
18568
18569 /* hwrm_queue_pri2cos_qcfg_input (size:192b/24B) */
18570 struct hwrm_queue_pri2cos_qcfg_input {
18571         /* The HWRM command request type. */
18572         uint16_t        req_type;
18573         /*
18574          * The completion ring to send the completion event on. This should
18575          * be the NQ ID returned from the `nq_alloc` HWRM command.
18576          */
18577         uint16_t        cmpl_ring;
18578         /*
18579          * The sequence ID is used by the driver for tracking multiple
18580          * commands. This ID is treated as opaque data by the firmware and
18581          * the value is returned in the `hwrm_resp_hdr` upon completion.
18582          */
18583         uint16_t        seq_id;
18584         /*
18585          * The target ID of the command:
18586          * * 0x0-0xFFF8 - The function ID
18587          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18588          * * 0xFFFD - Reserved for user-space HWRM interface
18589          * * 0xFFFF - HWRM
18590          */
18591         uint16_t        target_id;
18592         /*
18593          * A physical address pointer pointing to a host buffer that the
18594          * command's response data will be written. This can be either a host
18595          * physical address (HPA) or a guest physical address (GPA) and must
18596          * point to a physically contiguous block of memory.
18597          */
18598         uint64_t        resp_addr;
18599         uint32_t        flags;
18600         /*
18601          * Enumeration denoting the RX, TX type of the resource.
18602          * This enumeration is used for resources that are similar for both
18603          * TX and RX paths of the chip.
18604          */
18605         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH      UINT32_C(0x1)
18606         /* tx path */
18607         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
18608         /* rx path */
18609         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
18610         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_LAST \
18611                 HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_PATH_RX
18612         /*
18613          * When this bit is set to '0', the query is
18614          * for VLAN PRI field in tunnel headers.
18615          * When this bit is set to '1', the query is
18616          * for VLAN PRI field in inner packet headers.
18617          */
18618         #define HWRM_QUEUE_PRI2COS_QCFG_INPUT_FLAGS_IVLAN     UINT32_C(0x2)
18619         /*
18620          * Port ID of port for which the table is being configured.
18621          * The HWRM needs to check whether this function is allowed
18622          * to configure pri2cos mapping on this port.
18623          */
18624         uint8_t port_id;
18625         uint8_t unused_0[3];
18626 } __attribute__((packed));
18627
18628 /* hwrm_queue_pri2cos_qcfg_output (size:192b/24B) */
18629 struct hwrm_queue_pri2cos_qcfg_output {
18630         /* The specific error status for the command. */
18631         uint16_t        error_code;
18632         /* The HWRM command request type. */
18633         uint16_t        req_type;
18634         /* The sequence ID from the original command. */
18635         uint16_t        seq_id;
18636         /* The length of the response data in number of bytes. */
18637         uint16_t        resp_len;
18638         /*
18639          * CoS Queue assigned to priority 0.  This value can only
18640          * be changed before traffic has started.
18641          * A value of 0xff indicates that no CoS queue is assigned to the
18642          * specified priority.
18643          */
18644         uint8_t pri0_cos_queue_id;
18645         /*
18646          * CoS Queue assigned to priority 1.  This value can only
18647          * be changed before traffic has started.
18648          * A value of 0xff indicates that no CoS queue is assigned to the
18649          * specified priority.
18650          */
18651         uint8_t pri1_cos_queue_id;
18652         /*
18653          * CoS Queue assigned to priority 2  This value can only
18654          * be changed before traffic has started.
18655          * A value of 0xff indicates that no CoS queue is assigned to the
18656          * specified priority.
18657          */
18658         uint8_t pri2_cos_queue_id;
18659         /*
18660          * CoS Queue assigned to priority 3.  This value can only
18661          * be changed before traffic has started.
18662          * A value of 0xff indicates that no CoS queue is assigned to the
18663          * specified priority.
18664          */
18665         uint8_t pri3_cos_queue_id;
18666         /*
18667          * CoS Queue assigned to priority 4.  This value can only
18668          * be changed before traffic has started.
18669          * A value of 0xff indicates that no CoS queue is assigned to the
18670          * specified priority.
18671          */
18672         uint8_t pri4_cos_queue_id;
18673         /*
18674          * CoS Queue assigned to priority 5.  This value can only
18675          * be changed before traffic has started.
18676          * A value of 0xff indicates that no CoS queue is assigned to the
18677          * specified priority.
18678          */
18679         uint8_t pri5_cos_queue_id;
18680         /*
18681          * CoS Queue assigned to priority 6.  This value can only
18682          * be changed before traffic has started.
18683          * A value of 0xff indicates that no CoS queue is assigned to the
18684          * specified priority.
18685          */
18686         uint8_t pri6_cos_queue_id;
18687         /*
18688          * CoS Queue assigned to priority 7.  This value can only
18689          * be changed before traffic has started.
18690          * A value of 0xff indicates that no CoS queue is assigned to the
18691          * specified priority.
18692          */
18693         uint8_t pri7_cos_queue_id;
18694         /* Information about queue configuration. */
18695         uint8_t queue_cfg_info;
18696         /*
18697          * If this flag is set to '1', then the PRI to CoS
18698          * configuration is asymmetric on TX and RX sides.
18699          * If this flag is set to '0', then PRI to CoS configuration
18700          * is symmetric on TX and RX sides.
18701          */
18702         #define HWRM_QUEUE_PRI2COS_QCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
18703                 UINT32_C(0x1)
18704         uint8_t unused_0[6];
18705         /*
18706          * This field is used in Output records to indicate that the output
18707          * is completely written to RAM.  This field should be read as '1'
18708          * to indicate that the output has been completely written.
18709          * When writing a command completion or response to an internal processor,
18710          * the order of writes has to be such that this field is written last.
18711          */
18712         uint8_t valid;
18713 } __attribute__((packed));
18714
18715 /**************************
18716  * hwrm_queue_pri2cos_cfg *
18717  **************************/
18718
18719
18720 /* hwrm_queue_pri2cos_cfg_input (size:320b/40B) */
18721 struct hwrm_queue_pri2cos_cfg_input {
18722         /* The HWRM command request type. */
18723         uint16_t        req_type;
18724         /*
18725          * The completion ring to send the completion event on. This should
18726          * be the NQ ID returned from the `nq_alloc` HWRM command.
18727          */
18728         uint16_t        cmpl_ring;
18729         /*
18730          * The sequence ID is used by the driver for tracking multiple
18731          * commands. This ID is treated as opaque data by the firmware and
18732          * the value is returned in the `hwrm_resp_hdr` upon completion.
18733          */
18734         uint16_t        seq_id;
18735         /*
18736          * The target ID of the command:
18737          * * 0x0-0xFFF8 - The function ID
18738          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18739          * * 0xFFFD - Reserved for user-space HWRM interface
18740          * * 0xFFFF - HWRM
18741          */
18742         uint16_t        target_id;
18743         /*
18744          * A physical address pointer pointing to a host buffer that the
18745          * command's response data will be written. This can be either a host
18746          * physical address (HPA) or a guest physical address (GPA) and must
18747          * point to a physically contiguous block of memory.
18748          */
18749         uint64_t        resp_addr;
18750         uint32_t        flags;
18751         /*
18752          * Enumeration denoting the RX, TX, or both directions applicable to the resource.
18753          * This enumeration is used for resources that are similar for both
18754          * TX and RX paths of the chip.
18755          */
18756         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_MASK UINT32_C(0x3)
18757         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_SFT  0
18758         /* tx path */
18759         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x0)
18760         /* rx path */
18761         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x1)
18762         /* Bi-directional (Symmetrically applicable to TX and RX paths) */
18763         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR  UINT32_C(0x2)
18764         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_LAST \
18765                 HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_PATH_BIDIR
18766         /*
18767          * When this bit is set to '0', the mapping is requested
18768          * for VLAN PRI field in tunnel headers.
18769          * When this bit is set to '1', the mapping is requested
18770          * for VLAN PRI field in inner packet headers.
18771          */
18772         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_FLAGS_IVLAN     UINT32_C(0x4)
18773         uint32_t        enables;
18774         /*
18775          * This bit must be '1' for the pri0_cos_queue_id field to be
18776          * configured.
18777          */
18778         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI0_COS_QUEUE_ID \
18779                 UINT32_C(0x1)
18780         /*
18781          * This bit must be '1' for the pri1_cos_queue_id field to be
18782          * configured.
18783          */
18784         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI1_COS_QUEUE_ID \
18785                 UINT32_C(0x2)
18786         /*
18787          * This bit must be '1' for the pri2_cos_queue_id field to be
18788          * configured.
18789          */
18790         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI2_COS_QUEUE_ID \
18791                 UINT32_C(0x4)
18792         /*
18793          * This bit must be '1' for the pri3_cos_queue_id field to be
18794          * configured.
18795          */
18796         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI3_COS_QUEUE_ID \
18797                 UINT32_C(0x8)
18798         /*
18799          * This bit must be '1' for the pri4_cos_queue_id field to be
18800          * configured.
18801          */
18802         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI4_COS_QUEUE_ID \
18803                 UINT32_C(0x10)
18804         /*
18805          * This bit must be '1' for the pri5_cos_queue_id field to be
18806          * configured.
18807          */
18808         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI5_COS_QUEUE_ID \
18809                 UINT32_C(0x20)
18810         /*
18811          * This bit must be '1' for the pri6_cos_queue_id field to be
18812          * configured.
18813          */
18814         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI6_COS_QUEUE_ID \
18815                 UINT32_C(0x40)
18816         /*
18817          * This bit must be '1' for the pri7_cos_queue_id field to be
18818          * configured.
18819          */
18820         #define HWRM_QUEUE_PRI2COS_CFG_INPUT_ENABLES_PRI7_COS_QUEUE_ID \
18821                 UINT32_C(0x80)
18822         /*
18823          * Port ID of port for which the table is being configured.
18824          * The HWRM needs to check whether this function is allowed
18825          * to configure pri2cos mapping on this port.
18826          */
18827         uint8_t port_id;
18828         /*
18829          * CoS Queue assigned to priority 0.  This value can only
18830          * be changed before traffic has started.
18831          */
18832         uint8_t pri0_cos_queue_id;
18833         /*
18834          * CoS Queue assigned to priority 1.  This value can only
18835          * be changed before traffic has started.
18836          */
18837         uint8_t pri1_cos_queue_id;
18838         /*
18839          * CoS Queue assigned to priority 2  This value can only
18840          * be changed before traffic has started.
18841          */
18842         uint8_t pri2_cos_queue_id;
18843         /*
18844          * CoS Queue assigned to priority 3.  This value can only
18845          * be changed before traffic has started.
18846          */
18847         uint8_t pri3_cos_queue_id;
18848         /*
18849          * CoS Queue assigned to priority 4.  This value can only
18850          * be changed before traffic has started.
18851          */
18852         uint8_t pri4_cos_queue_id;
18853         /*
18854          * CoS Queue assigned to priority 5.  This value can only
18855          * be changed before traffic has started.
18856          */
18857         uint8_t pri5_cos_queue_id;
18858         /*
18859          * CoS Queue assigned to priority 6.  This value can only
18860          * be changed before traffic has started.
18861          */
18862         uint8_t pri6_cos_queue_id;
18863         /*
18864          * CoS Queue assigned to priority 7.  This value can only
18865          * be changed before traffic has started.
18866          */
18867         uint8_t pri7_cos_queue_id;
18868         uint8_t unused_0[7];
18869 } __attribute__((packed));
18870
18871 /* hwrm_queue_pri2cos_cfg_output (size:128b/16B) */
18872 struct hwrm_queue_pri2cos_cfg_output {
18873         /* The specific error status for the command. */
18874         uint16_t        error_code;
18875         /* The HWRM command request type. */
18876         uint16_t        req_type;
18877         /* The sequence ID from the original command. */
18878         uint16_t        seq_id;
18879         /* The length of the response data in number of bytes. */
18880         uint16_t        resp_len;
18881         uint8_t unused_0[7];
18882         /*
18883          * This field is used in Output records to indicate that the output
18884          * is completely written to RAM.  This field should be read as '1'
18885          * to indicate that the output has been completely written.
18886          * When writing a command completion or response to an internal processor,
18887          * the order of writes has to be such that this field is written last.
18888          */
18889         uint8_t valid;
18890 } __attribute__((packed));
18891
18892 /**************************
18893  * hwrm_queue_cos2bw_qcfg *
18894  **************************/
18895
18896
18897 /* hwrm_queue_cos2bw_qcfg_input (size:192b/24B) */
18898 struct hwrm_queue_cos2bw_qcfg_input {
18899         /* The HWRM command request type. */
18900         uint16_t        req_type;
18901         /*
18902          * The completion ring to send the completion event on. This should
18903          * be the NQ ID returned from the `nq_alloc` HWRM command.
18904          */
18905         uint16_t        cmpl_ring;
18906         /*
18907          * The sequence ID is used by the driver for tracking multiple
18908          * commands. This ID is treated as opaque data by the firmware and
18909          * the value is returned in the `hwrm_resp_hdr` upon completion.
18910          */
18911         uint16_t        seq_id;
18912         /*
18913          * The target ID of the command:
18914          * * 0x0-0xFFF8 - The function ID
18915          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
18916          * * 0xFFFD - Reserved for user-space HWRM interface
18917          * * 0xFFFF - HWRM
18918          */
18919         uint16_t        target_id;
18920         /*
18921          * A physical address pointer pointing to a host buffer that the
18922          * command's response data will be written. This can be either a host
18923          * physical address (HPA) or a guest physical address (GPA) and must
18924          * point to a physically contiguous block of memory.
18925          */
18926         uint64_t        resp_addr;
18927         /*
18928          * Port ID of port for which the table is being configured.
18929          * The HWRM needs to check whether this function is allowed
18930          * to configure TC BW assignment on this port.
18931          */
18932         uint16_t        port_id;
18933         uint8_t unused_0[6];
18934 } __attribute__((packed));
18935
18936 /* hwrm_queue_cos2bw_qcfg_output (size:896b/112B) */
18937 struct hwrm_queue_cos2bw_qcfg_output {
18938         /* The specific error status for the command. */
18939         uint16_t        error_code;
18940         /* The HWRM command request type. */
18941         uint16_t        req_type;
18942         /* The sequence ID from the original command. */
18943         uint16_t        seq_id;
18944         /* The length of the response data in number of bytes. */
18945         uint16_t        resp_len;
18946         /* ID of CoS Queue 0. */
18947         uint8_t queue_id0;
18948         uint8_t unused_0;
18949         uint16_t        unused_1;
18950         /*
18951          * Minimum BW allocated to CoS Queue.
18952          * The HWRM will translate this value into byte counter and
18953          * time interval used for this COS inside the device.
18954          */
18955         uint32_t        queue_id0_min_bw;
18956         /* The bandwidth value. */
18957         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
18958                 UINT32_C(0xfffffff)
18959         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
18960                 0
18961         /* The granularity of the value (bits or bytes). */
18962         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE \
18963                 UINT32_C(0x10000000)
18964         /* Value is in bits. */
18965         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
18966                 (UINT32_C(0x0) << 28)
18967         /* Value is in bytes. */
18968         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
18969                 (UINT32_C(0x1) << 28)
18970         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
18971                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
18972         /* bw_value_unit is 3 b */
18973         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
18974                 UINT32_C(0xe0000000)
18975         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
18976                 29
18977         /* Value is in Mb or MB (base 10). */
18978         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
18979                 (UINT32_C(0x0) << 29)
18980         /* Value is in Kb or KB (base 10). */
18981         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
18982                 (UINT32_C(0x2) << 29)
18983         /* Value is in bits or bytes. */
18984         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
18985                 (UINT32_C(0x4) << 29)
18986         /* Value is in Gb or GB (base 10). */
18987         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
18988                 (UINT32_C(0x6) << 29)
18989         /* Value is in 1/100th of a percentage of total bandwidth. */
18990         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
18991                 (UINT32_C(0x1) << 29)
18992         /* Invalid unit */
18993         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
18994                 (UINT32_C(0x7) << 29)
18995         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
18996                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
18997         /*
18998          * Maximum BW allocated to CoS Queue.
18999          * The HWRM will translate this value into byte counter and
19000          * time interval used for this COS inside the device.
19001          */
19002         uint32_t        queue_id0_max_bw;
19003         /* The bandwidth value. */
19004         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
19005                 UINT32_C(0xfffffff)
19006         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
19007                 0
19008         /* The granularity of the value (bits or bytes). */
19009         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE \
19010                 UINT32_C(0x10000000)
19011         /* Value is in bits. */
19012         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
19013                 (UINT32_C(0x0) << 28)
19014         /* Value is in bytes. */
19015         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
19016                 (UINT32_C(0x1) << 28)
19017         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
19018                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
19019         /* bw_value_unit is 3 b */
19020         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
19021                 UINT32_C(0xe0000000)
19022         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
19023                 29
19024         /* Value is in Mb or MB (base 10). */
19025         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
19026                 (UINT32_C(0x0) << 29)
19027         /* Value is in Kb or KB (base 10). */
19028         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
19029                 (UINT32_C(0x2) << 29)
19030         /* Value is in bits or bytes. */
19031         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
19032                 (UINT32_C(0x4) << 29)
19033         /* Value is in Gb or GB (base 10). */
19034         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
19035                 (UINT32_C(0x6) << 29)
19036         /* Value is in 1/100th of a percentage of total bandwidth. */
19037         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19038                 (UINT32_C(0x1) << 29)
19039         /* Invalid unit */
19040         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
19041                 (UINT32_C(0x7) << 29)
19042         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
19043                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
19044         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19045         uint8_t queue_id0_tsa_assign;
19046         /* Strict Priority */
19047         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_SP \
19048                 UINT32_C(0x0)
19049         /* Enhanced Transmission Selection */
19050         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
19051                 UINT32_C(0x1)
19052         /* reserved. */
19053         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
19054                 UINT32_C(0x2)
19055         /* reserved. */
19056         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
19057                 UINT32_C(0xff)
19058         /*
19059          * Priority level for strict priority. Valid only when the
19060          * tsa_assign is 0 - Strict Priority (SP)
19061          * 0..7 - Valid values.
19062          * 8..255 - Reserved.
19063          */
19064         uint8_t queue_id0_pri_lvl;
19065         /*
19066          * Weight used to allocate remaining BW for this COS after
19067          * servicing guaranteed bandwidths for all COS.
19068          */
19069         uint8_t queue_id0_bw_weight;
19070         /* ID of CoS Queue 1. */
19071         uint8_t queue_id1;
19072         /*
19073          * Minimum BW allocated to CoS Queue.
19074          * The HWRM will translate this value into byte counter and
19075          * time interval used for this COS inside the device.
19076          */
19077         uint32_t        queue_id1_min_bw;
19078         /* The bandwidth value. */
19079         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
19080                 UINT32_C(0xfffffff)
19081         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
19082                 0
19083         /* The granularity of the value (bits or bytes). */
19084         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE \
19085                 UINT32_C(0x10000000)
19086         /* Value is in bits. */
19087         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
19088                 (UINT32_C(0x0) << 28)
19089         /* Value is in bytes. */
19090         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
19091                 (UINT32_C(0x1) << 28)
19092         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
19093                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
19094         /* bw_value_unit is 3 b */
19095         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
19096                 UINT32_C(0xe0000000)
19097         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
19098                 29
19099         /* Value is in Mb or MB (base 10). */
19100         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
19101                 (UINT32_C(0x0) << 29)
19102         /* Value is in Kb or KB (base 10). */
19103         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
19104                 (UINT32_C(0x2) << 29)
19105         /* Value is in bits or bytes. */
19106         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
19107                 (UINT32_C(0x4) << 29)
19108         /* Value is in Gb or GB (base 10). */
19109         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
19110                 (UINT32_C(0x6) << 29)
19111         /* Value is in 1/100th of a percentage of total bandwidth. */
19112         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19113                 (UINT32_C(0x1) << 29)
19114         /* Invalid unit */
19115         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
19116                 (UINT32_C(0x7) << 29)
19117         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
19118                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
19119         /*
19120          * Maximum BW allocated to CoS queue.
19121          * The HWRM will translate this value into byte counter and
19122          * time interval used for this COS inside the device.
19123          */
19124         uint32_t        queue_id1_max_bw;
19125         /* The bandwidth value. */
19126         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
19127                 UINT32_C(0xfffffff)
19128         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
19129                 0
19130         /* The granularity of the value (bits or bytes). */
19131         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE \
19132                 UINT32_C(0x10000000)
19133         /* Value is in bits. */
19134         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
19135                 (UINT32_C(0x0) << 28)
19136         /* Value is in bytes. */
19137         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
19138                 (UINT32_C(0x1) << 28)
19139         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
19140                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
19141         /* bw_value_unit is 3 b */
19142         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
19143                 UINT32_C(0xe0000000)
19144         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
19145                 29
19146         /* Value is in Mb or MB (base 10). */
19147         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
19148                 (UINT32_C(0x0) << 29)
19149         /* Value is in Kb or KB (base 10). */
19150         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
19151                 (UINT32_C(0x2) << 29)
19152         /* Value is in bits or bytes. */
19153         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
19154                 (UINT32_C(0x4) << 29)
19155         /* Value is in Gb or GB (base 10). */
19156         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
19157                 (UINT32_C(0x6) << 29)
19158         /* Value is in 1/100th of a percentage of total bandwidth. */
19159         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19160                 (UINT32_C(0x1) << 29)
19161         /* Invalid unit */
19162         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
19163                 (UINT32_C(0x7) << 29)
19164         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
19165                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
19166         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19167         uint8_t queue_id1_tsa_assign;
19168         /* Strict Priority */
19169         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_SP \
19170                 UINT32_C(0x0)
19171         /* Enhanced Transmission Selection */
19172         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
19173                 UINT32_C(0x1)
19174         /* reserved. */
19175         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
19176                 UINT32_C(0x2)
19177         /* reserved. */
19178         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
19179                 UINT32_C(0xff)
19180         /*
19181          * Priority level for strict priority. Valid only when the
19182          * tsa_assign is 0 - Strict Priority (SP)
19183          * 0..7 - Valid values.
19184          * 8..255 - Reserved.
19185          */
19186         uint8_t queue_id1_pri_lvl;
19187         /*
19188          * Weight used to allocate remaining BW for this COS after
19189          * servicing guaranteed bandwidths for all COS.
19190          */
19191         uint8_t queue_id1_bw_weight;
19192         /* ID of CoS Queue 2. */
19193         uint8_t queue_id2;
19194         /*
19195          * Minimum BW allocated to CoS Queue.
19196          * The HWRM will translate this value into byte counter and
19197          * time interval used for this COS inside the device.
19198          */
19199         uint32_t        queue_id2_min_bw;
19200         /* The bandwidth value. */
19201         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
19202                 UINT32_C(0xfffffff)
19203         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
19204                 0
19205         /* The granularity of the value (bits or bytes). */
19206         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE \
19207                 UINT32_C(0x10000000)
19208         /* Value is in bits. */
19209         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
19210                 (UINT32_C(0x0) << 28)
19211         /* Value is in bytes. */
19212         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
19213                 (UINT32_C(0x1) << 28)
19214         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
19215                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
19216         /* bw_value_unit is 3 b */
19217         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
19218                 UINT32_C(0xe0000000)
19219         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
19220                 29
19221         /* Value is in Mb or MB (base 10). */
19222         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
19223                 (UINT32_C(0x0) << 29)
19224         /* Value is in Kb or KB (base 10). */
19225         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
19226                 (UINT32_C(0x2) << 29)
19227         /* Value is in bits or bytes. */
19228         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
19229                 (UINT32_C(0x4) << 29)
19230         /* Value is in Gb or GB (base 10). */
19231         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
19232                 (UINT32_C(0x6) << 29)
19233         /* Value is in 1/100th of a percentage of total bandwidth. */
19234         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19235                 (UINT32_C(0x1) << 29)
19236         /* Invalid unit */
19237         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
19238                 (UINT32_C(0x7) << 29)
19239         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
19240                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
19241         /*
19242          * Maximum BW allocated to CoS queue.
19243          * The HWRM will translate this value into byte counter and
19244          * time interval used for this COS inside the device.
19245          */
19246         uint32_t        queue_id2_max_bw;
19247         /* The bandwidth value. */
19248         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
19249                 UINT32_C(0xfffffff)
19250         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
19251                 0
19252         /* The granularity of the value (bits or bytes). */
19253         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE \
19254                 UINT32_C(0x10000000)
19255         /* Value is in bits. */
19256         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
19257                 (UINT32_C(0x0) << 28)
19258         /* Value is in bytes. */
19259         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
19260                 (UINT32_C(0x1) << 28)
19261         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
19262                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
19263         /* bw_value_unit is 3 b */
19264         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
19265                 UINT32_C(0xe0000000)
19266         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
19267                 29
19268         /* Value is in Mb or MB (base 10). */
19269         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
19270                 (UINT32_C(0x0) << 29)
19271         /* Value is in Kb or KB (base 10). */
19272         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
19273                 (UINT32_C(0x2) << 29)
19274         /* Value is in bits or bytes. */
19275         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
19276                 (UINT32_C(0x4) << 29)
19277         /* Value is in Gb or GB (base 10). */
19278         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
19279                 (UINT32_C(0x6) << 29)
19280         /* Value is in 1/100th of a percentage of total bandwidth. */
19281         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19282                 (UINT32_C(0x1) << 29)
19283         /* Invalid unit */
19284         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
19285                 (UINT32_C(0x7) << 29)
19286         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
19287                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
19288         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19289         uint8_t queue_id2_tsa_assign;
19290         /* Strict Priority */
19291         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_SP \
19292                 UINT32_C(0x0)
19293         /* Enhanced Transmission Selection */
19294         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
19295                 UINT32_C(0x1)
19296         /* reserved. */
19297         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
19298                 UINT32_C(0x2)
19299         /* reserved. */
19300         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
19301                 UINT32_C(0xff)
19302         /*
19303          * Priority level for strict priority. Valid only when the
19304          * tsa_assign is 0 - Strict Priority (SP)
19305          * 0..7 - Valid values.
19306          * 8..255 - Reserved.
19307          */
19308         uint8_t queue_id2_pri_lvl;
19309         /*
19310          * Weight used to allocate remaining BW for this COS after
19311          * servicing guaranteed bandwidths for all COS.
19312          */
19313         uint8_t queue_id2_bw_weight;
19314         /* ID of CoS Queue 3. */
19315         uint8_t queue_id3;
19316         /*
19317          * Minimum BW allocated to CoS Queue.
19318          * The HWRM will translate this value into byte counter and
19319          * time interval used for this COS inside the device.
19320          */
19321         uint32_t        queue_id3_min_bw;
19322         /* The bandwidth value. */
19323         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
19324                 UINT32_C(0xfffffff)
19325         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
19326                 0
19327         /* The granularity of the value (bits or bytes). */
19328         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE \
19329                 UINT32_C(0x10000000)
19330         /* Value is in bits. */
19331         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
19332                 (UINT32_C(0x0) << 28)
19333         /* Value is in bytes. */
19334         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
19335                 (UINT32_C(0x1) << 28)
19336         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
19337                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
19338         /* bw_value_unit is 3 b */
19339         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
19340                 UINT32_C(0xe0000000)
19341         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
19342                 29
19343         /* Value is in Mb or MB (base 10). */
19344         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
19345                 (UINT32_C(0x0) << 29)
19346         /* Value is in Kb or KB (base 10). */
19347         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
19348                 (UINT32_C(0x2) << 29)
19349         /* Value is in bits or bytes. */
19350         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
19351                 (UINT32_C(0x4) << 29)
19352         /* Value is in Gb or GB (base 10). */
19353         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
19354                 (UINT32_C(0x6) << 29)
19355         /* Value is in 1/100th of a percentage of total bandwidth. */
19356         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19357                 (UINT32_C(0x1) << 29)
19358         /* Invalid unit */
19359         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
19360                 (UINT32_C(0x7) << 29)
19361         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
19362                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
19363         /*
19364          * Maximum BW allocated to CoS queue.
19365          * The HWRM will translate this value into byte counter and
19366          * time interval used for this COS inside the device.
19367          */
19368         uint32_t        queue_id3_max_bw;
19369         /* The bandwidth value. */
19370         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
19371                 UINT32_C(0xfffffff)
19372         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
19373                 0
19374         /* The granularity of the value (bits or bytes). */
19375         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE \
19376                 UINT32_C(0x10000000)
19377         /* Value is in bits. */
19378         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
19379                 (UINT32_C(0x0) << 28)
19380         /* Value is in bytes. */
19381         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
19382                 (UINT32_C(0x1) << 28)
19383         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
19384                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
19385         /* bw_value_unit is 3 b */
19386         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
19387                 UINT32_C(0xe0000000)
19388         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
19389                 29
19390         /* Value is in Mb or MB (base 10). */
19391         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
19392                 (UINT32_C(0x0) << 29)
19393         /* Value is in Kb or KB (base 10). */
19394         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
19395                 (UINT32_C(0x2) << 29)
19396         /* Value is in bits or bytes. */
19397         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
19398                 (UINT32_C(0x4) << 29)
19399         /* Value is in Gb or GB (base 10). */
19400         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
19401                 (UINT32_C(0x6) << 29)
19402         /* Value is in 1/100th of a percentage of total bandwidth. */
19403         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19404                 (UINT32_C(0x1) << 29)
19405         /* Invalid unit */
19406         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
19407                 (UINT32_C(0x7) << 29)
19408         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
19409                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
19410         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19411         uint8_t queue_id3_tsa_assign;
19412         /* Strict Priority */
19413         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_SP \
19414                 UINT32_C(0x0)
19415         /* Enhanced Transmission Selection */
19416         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
19417                 UINT32_C(0x1)
19418         /* reserved. */
19419         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
19420                 UINT32_C(0x2)
19421         /* reserved. */
19422         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
19423                 UINT32_C(0xff)
19424         /*
19425          * Priority level for strict priority. Valid only when the
19426          * tsa_assign is 0 - Strict Priority (SP)
19427          * 0..7 - Valid values.
19428          * 8..255 - Reserved.
19429          */
19430         uint8_t queue_id3_pri_lvl;
19431         /*
19432          * Weight used to allocate remaining BW for this COS after
19433          * servicing guaranteed bandwidths for all COS.
19434          */
19435         uint8_t queue_id3_bw_weight;
19436         /* ID of CoS Queue 4. */
19437         uint8_t queue_id4;
19438         /*
19439          * Minimum BW allocated to CoS Queue.
19440          * The HWRM will translate this value into byte counter and
19441          * time interval used for this COS inside the device.
19442          */
19443         uint32_t        queue_id4_min_bw;
19444         /* The bandwidth value. */
19445         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
19446                 UINT32_C(0xfffffff)
19447         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
19448                 0
19449         /* The granularity of the value (bits or bytes). */
19450         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE \
19451                 UINT32_C(0x10000000)
19452         /* Value is in bits. */
19453         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
19454                 (UINT32_C(0x0) << 28)
19455         /* Value is in bytes. */
19456         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
19457                 (UINT32_C(0x1) << 28)
19458         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
19459                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
19460         /* bw_value_unit is 3 b */
19461         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
19462                 UINT32_C(0xe0000000)
19463         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
19464                 29
19465         /* Value is in Mb or MB (base 10). */
19466         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
19467                 (UINT32_C(0x0) << 29)
19468         /* Value is in Kb or KB (base 10). */
19469         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
19470                 (UINT32_C(0x2) << 29)
19471         /* Value is in bits or bytes. */
19472         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
19473                 (UINT32_C(0x4) << 29)
19474         /* Value is in Gb or GB (base 10). */
19475         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
19476                 (UINT32_C(0x6) << 29)
19477         /* Value is in 1/100th of a percentage of total bandwidth. */
19478         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19479                 (UINT32_C(0x1) << 29)
19480         /* Invalid unit */
19481         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
19482                 (UINT32_C(0x7) << 29)
19483         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
19484                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
19485         /*
19486          * Maximum BW allocated to CoS queue.
19487          * The HWRM will translate this value into byte counter and
19488          * time interval used for this COS inside the device.
19489          */
19490         uint32_t        queue_id4_max_bw;
19491         /* The bandwidth value. */
19492         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
19493                 UINT32_C(0xfffffff)
19494         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
19495                 0
19496         /* The granularity of the value (bits or bytes). */
19497         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE \
19498                 UINT32_C(0x10000000)
19499         /* Value is in bits. */
19500         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
19501                 (UINT32_C(0x0) << 28)
19502         /* Value is in bytes. */
19503         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
19504                 (UINT32_C(0x1) << 28)
19505         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
19506                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
19507         /* bw_value_unit is 3 b */
19508         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
19509                 UINT32_C(0xe0000000)
19510         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
19511                 29
19512         /* Value is in Mb or MB (base 10). */
19513         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
19514                 (UINT32_C(0x0) << 29)
19515         /* Value is in Kb or KB (base 10). */
19516         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
19517                 (UINT32_C(0x2) << 29)
19518         /* Value is in bits or bytes. */
19519         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
19520                 (UINT32_C(0x4) << 29)
19521         /* Value is in Gb or GB (base 10). */
19522         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
19523                 (UINT32_C(0x6) << 29)
19524         /* Value is in 1/100th of a percentage of total bandwidth. */
19525         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19526                 (UINT32_C(0x1) << 29)
19527         /* Invalid unit */
19528         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
19529                 (UINT32_C(0x7) << 29)
19530         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
19531                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
19532         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19533         uint8_t queue_id4_tsa_assign;
19534         /* Strict Priority */
19535         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_SP \
19536                 UINT32_C(0x0)
19537         /* Enhanced Transmission Selection */
19538         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
19539                 UINT32_C(0x1)
19540         /* reserved. */
19541         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
19542                 UINT32_C(0x2)
19543         /* reserved. */
19544         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
19545                 UINT32_C(0xff)
19546         /*
19547          * Priority level for strict priority. Valid only when the
19548          * tsa_assign is 0 - Strict Priority (SP)
19549          * 0..7 - Valid values.
19550          * 8..255 - Reserved.
19551          */
19552         uint8_t queue_id4_pri_lvl;
19553         /*
19554          * Weight used to allocate remaining BW for this COS after
19555          * servicing guaranteed bandwidths for all COS.
19556          */
19557         uint8_t queue_id4_bw_weight;
19558         /* ID of CoS Queue 5. */
19559         uint8_t queue_id5;
19560         /*
19561          * Minimum BW allocated to CoS Queue.
19562          * The HWRM will translate this value into byte counter and
19563          * time interval used for this COS inside the device.
19564          */
19565         uint32_t        queue_id5_min_bw;
19566         /* The bandwidth value. */
19567         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
19568                 UINT32_C(0xfffffff)
19569         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
19570                 0
19571         /* The granularity of the value (bits or bytes). */
19572         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE \
19573                 UINT32_C(0x10000000)
19574         /* Value is in bits. */
19575         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
19576                 (UINT32_C(0x0) << 28)
19577         /* Value is in bytes. */
19578         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
19579                 (UINT32_C(0x1) << 28)
19580         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
19581                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
19582         /* bw_value_unit is 3 b */
19583         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
19584                 UINT32_C(0xe0000000)
19585         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
19586                 29
19587         /* Value is in Mb or MB (base 10). */
19588         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
19589                 (UINT32_C(0x0) << 29)
19590         /* Value is in Kb or KB (base 10). */
19591         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
19592                 (UINT32_C(0x2) << 29)
19593         /* Value is in bits or bytes. */
19594         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
19595                 (UINT32_C(0x4) << 29)
19596         /* Value is in Gb or GB (base 10). */
19597         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
19598                 (UINT32_C(0x6) << 29)
19599         /* Value is in 1/100th of a percentage of total bandwidth. */
19600         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19601                 (UINT32_C(0x1) << 29)
19602         /* Invalid unit */
19603         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
19604                 (UINT32_C(0x7) << 29)
19605         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
19606                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
19607         /*
19608          * Maximum BW allocated to CoS queue.
19609          * The HWRM will translate this value into byte counter and
19610          * time interval used for this COS inside the device.
19611          */
19612         uint32_t        queue_id5_max_bw;
19613         /* The bandwidth value. */
19614         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
19615                 UINT32_C(0xfffffff)
19616         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
19617                 0
19618         /* The granularity of the value (bits or bytes). */
19619         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE \
19620                 UINT32_C(0x10000000)
19621         /* Value is in bits. */
19622         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
19623                 (UINT32_C(0x0) << 28)
19624         /* Value is in bytes. */
19625         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
19626                 (UINT32_C(0x1) << 28)
19627         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
19628                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
19629         /* bw_value_unit is 3 b */
19630         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
19631                 UINT32_C(0xe0000000)
19632         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
19633                 29
19634         /* Value is in Mb or MB (base 10). */
19635         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
19636                 (UINT32_C(0x0) << 29)
19637         /* Value is in Kb or KB (base 10). */
19638         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
19639                 (UINT32_C(0x2) << 29)
19640         /* Value is in bits or bytes. */
19641         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
19642                 (UINT32_C(0x4) << 29)
19643         /* Value is in Gb or GB (base 10). */
19644         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
19645                 (UINT32_C(0x6) << 29)
19646         /* Value is in 1/100th of a percentage of total bandwidth. */
19647         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19648                 (UINT32_C(0x1) << 29)
19649         /* Invalid unit */
19650         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
19651                 (UINT32_C(0x7) << 29)
19652         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
19653                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
19654         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19655         uint8_t queue_id5_tsa_assign;
19656         /* Strict Priority */
19657         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_SP \
19658                 UINT32_C(0x0)
19659         /* Enhanced Transmission Selection */
19660         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
19661                 UINT32_C(0x1)
19662         /* reserved. */
19663         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
19664                 UINT32_C(0x2)
19665         /* reserved. */
19666         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
19667                 UINT32_C(0xff)
19668         /*
19669          * Priority level for strict priority. Valid only when the
19670          * tsa_assign is 0 - Strict Priority (SP)
19671          * 0..7 - Valid values.
19672          * 8..255 - Reserved.
19673          */
19674         uint8_t queue_id5_pri_lvl;
19675         /*
19676          * Weight used to allocate remaining BW for this COS after
19677          * servicing guaranteed bandwidths for all COS.
19678          */
19679         uint8_t queue_id5_bw_weight;
19680         /* ID of CoS Queue 6. */
19681         uint8_t queue_id6;
19682         /*
19683          * Minimum BW allocated to CoS Queue.
19684          * The HWRM will translate this value into byte counter and
19685          * time interval used for this COS inside the device.
19686          */
19687         uint32_t        queue_id6_min_bw;
19688         /* The bandwidth value. */
19689         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
19690                 UINT32_C(0xfffffff)
19691         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
19692                 0
19693         /* The granularity of the value (bits or bytes). */
19694         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE \
19695                 UINT32_C(0x10000000)
19696         /* Value is in bits. */
19697         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
19698                 (UINT32_C(0x0) << 28)
19699         /* Value is in bytes. */
19700         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
19701                 (UINT32_C(0x1) << 28)
19702         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
19703                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
19704         /* bw_value_unit is 3 b */
19705         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
19706                 UINT32_C(0xe0000000)
19707         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
19708                 29
19709         /* Value is in Mb or MB (base 10). */
19710         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
19711                 (UINT32_C(0x0) << 29)
19712         /* Value is in Kb or KB (base 10). */
19713         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
19714                 (UINT32_C(0x2) << 29)
19715         /* Value is in bits or bytes. */
19716         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
19717                 (UINT32_C(0x4) << 29)
19718         /* Value is in Gb or GB (base 10). */
19719         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
19720                 (UINT32_C(0x6) << 29)
19721         /* Value is in 1/100th of a percentage of total bandwidth. */
19722         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19723                 (UINT32_C(0x1) << 29)
19724         /* Invalid unit */
19725         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
19726                 (UINT32_C(0x7) << 29)
19727         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
19728                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
19729         /*
19730          * Maximum BW allocated to CoS queue.
19731          * The HWRM will translate this value into byte counter and
19732          * time interval used for this COS inside the device.
19733          */
19734         uint32_t        queue_id6_max_bw;
19735         /* The bandwidth value. */
19736         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
19737                 UINT32_C(0xfffffff)
19738         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
19739                 0
19740         /* The granularity of the value (bits or bytes). */
19741         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE \
19742                 UINT32_C(0x10000000)
19743         /* Value is in bits. */
19744         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
19745                 (UINT32_C(0x0) << 28)
19746         /* Value is in bytes. */
19747         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
19748                 (UINT32_C(0x1) << 28)
19749         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
19750                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
19751         /* bw_value_unit is 3 b */
19752         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
19753                 UINT32_C(0xe0000000)
19754         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
19755                 29
19756         /* Value is in Mb or MB (base 10). */
19757         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
19758                 (UINT32_C(0x0) << 29)
19759         /* Value is in Kb or KB (base 10). */
19760         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
19761                 (UINT32_C(0x2) << 29)
19762         /* Value is in bits or bytes. */
19763         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
19764                 (UINT32_C(0x4) << 29)
19765         /* Value is in Gb or GB (base 10). */
19766         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
19767                 (UINT32_C(0x6) << 29)
19768         /* Value is in 1/100th of a percentage of total bandwidth. */
19769         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19770                 (UINT32_C(0x1) << 29)
19771         /* Invalid unit */
19772         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
19773                 (UINT32_C(0x7) << 29)
19774         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
19775                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
19776         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19777         uint8_t queue_id6_tsa_assign;
19778         /* Strict Priority */
19779         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_SP \
19780                 UINT32_C(0x0)
19781         /* Enhanced Transmission Selection */
19782         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
19783                 UINT32_C(0x1)
19784         /* reserved. */
19785         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
19786                 UINT32_C(0x2)
19787         /* reserved. */
19788         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
19789                 UINT32_C(0xff)
19790         /*
19791          * Priority level for strict priority. Valid only when the
19792          * tsa_assign is 0 - Strict Priority (SP)
19793          * 0..7 - Valid values.
19794          * 8..255 - Reserved.
19795          */
19796         uint8_t queue_id6_pri_lvl;
19797         /*
19798          * Weight used to allocate remaining BW for this COS after
19799          * servicing guaranteed bandwidths for all COS.
19800          */
19801         uint8_t queue_id6_bw_weight;
19802         /* ID of CoS Queue 7. */
19803         uint8_t queue_id7;
19804         /*
19805          * Minimum BW allocated to CoS Queue.
19806          * The HWRM will translate this value into byte counter and
19807          * time interval used for this COS inside the device.
19808          */
19809         uint32_t        queue_id7_min_bw;
19810         /* The bandwidth value. */
19811         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
19812                 UINT32_C(0xfffffff)
19813         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
19814                 0
19815         /* The granularity of the value (bits or bytes). */
19816         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE \
19817                 UINT32_C(0x10000000)
19818         /* Value is in bits. */
19819         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
19820                 (UINT32_C(0x0) << 28)
19821         /* Value is in bytes. */
19822         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
19823                 (UINT32_C(0x1) << 28)
19824         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
19825                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
19826         /* bw_value_unit is 3 b */
19827         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
19828                 UINT32_C(0xe0000000)
19829         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
19830                 29
19831         /* Value is in Mb or MB (base 10). */
19832         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
19833                 (UINT32_C(0x0) << 29)
19834         /* Value is in Kb or KB (base 10). */
19835         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
19836                 (UINT32_C(0x2) << 29)
19837         /* Value is in bits or bytes. */
19838         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
19839                 (UINT32_C(0x4) << 29)
19840         /* Value is in Gb or GB (base 10). */
19841         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
19842                 (UINT32_C(0x6) << 29)
19843         /* Value is in 1/100th of a percentage of total bandwidth. */
19844         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
19845                 (UINT32_C(0x1) << 29)
19846         /* Invalid unit */
19847         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
19848                 (UINT32_C(0x7) << 29)
19849         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
19850                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
19851         /*
19852          * Maximum BW allocated to CoS queue.
19853          * The HWRM will translate this value into byte counter and
19854          * time interval used for this COS inside the device.
19855          */
19856         uint32_t        queue_id7_max_bw;
19857         /* The bandwidth value. */
19858         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
19859                 UINT32_C(0xfffffff)
19860         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
19861                 0
19862         /* The granularity of the value (bits or bytes). */
19863         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE \
19864                 UINT32_C(0x10000000)
19865         /* Value is in bits. */
19866         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
19867                 (UINT32_C(0x0) << 28)
19868         /* Value is in bytes. */
19869         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
19870                 (UINT32_C(0x1) << 28)
19871         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
19872                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
19873         /* bw_value_unit is 3 b */
19874         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
19875                 UINT32_C(0xe0000000)
19876         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
19877                 29
19878         /* Value is in Mb or MB (base 10). */
19879         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
19880                 (UINT32_C(0x0) << 29)
19881         /* Value is in Kb or KB (base 10). */
19882         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
19883                 (UINT32_C(0x2) << 29)
19884         /* Value is in bits or bytes. */
19885         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
19886                 (UINT32_C(0x4) << 29)
19887         /* Value is in Gb or GB (base 10). */
19888         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
19889                 (UINT32_C(0x6) << 29)
19890         /* Value is in 1/100th of a percentage of total bandwidth. */
19891         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
19892                 (UINT32_C(0x1) << 29)
19893         /* Invalid unit */
19894         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
19895                 (UINT32_C(0x7) << 29)
19896         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
19897                 HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
19898         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
19899         uint8_t queue_id7_tsa_assign;
19900         /* Strict Priority */
19901         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_SP \
19902                 UINT32_C(0x0)
19903         /* Enhanced Transmission Selection */
19904         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
19905                 UINT32_C(0x1)
19906         /* reserved. */
19907         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
19908                 UINT32_C(0x2)
19909         /* reserved. */
19910         #define HWRM_QUEUE_COS2BW_QCFG_OUTPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
19911                 UINT32_C(0xff)
19912         /*
19913          * Priority level for strict priority. Valid only when the
19914          * tsa_assign is 0 - Strict Priority (SP)
19915          * 0..7 - Valid values.
19916          * 8..255 - Reserved.
19917          */
19918         uint8_t queue_id7_pri_lvl;
19919         /*
19920          * Weight used to allocate remaining BW for this COS after
19921          * servicing guaranteed bandwidths for all COS.
19922          */
19923         uint8_t queue_id7_bw_weight;
19924         uint8_t unused_2[4];
19925         /*
19926          * This field is used in Output records to indicate that the output
19927          * is completely written to RAM.  This field should be read as '1'
19928          * to indicate that the output has been completely written.
19929          * When writing a command completion or response to an internal processor,
19930          * the order of writes has to be such that this field is written last.
19931          */
19932         uint8_t valid;
19933 } __attribute__((packed));
19934
19935 /*************************
19936  * hwrm_queue_cos2bw_cfg *
19937  *************************/
19938
19939
19940 /* hwrm_queue_cos2bw_cfg_input (size:1024b/128B) */
19941 struct hwrm_queue_cos2bw_cfg_input {
19942         /* The HWRM command request type. */
19943         uint16_t        req_type;
19944         /*
19945          * The completion ring to send the completion event on. This should
19946          * be the NQ ID returned from the `nq_alloc` HWRM command.
19947          */
19948         uint16_t        cmpl_ring;
19949         /*
19950          * The sequence ID is used by the driver for tracking multiple
19951          * commands. This ID is treated as opaque data by the firmware and
19952          * the value is returned in the `hwrm_resp_hdr` upon completion.
19953          */
19954         uint16_t        seq_id;
19955         /*
19956          * The target ID of the command:
19957          * * 0x0-0xFFF8 - The function ID
19958          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
19959          * * 0xFFFD - Reserved for user-space HWRM interface
19960          * * 0xFFFF - HWRM
19961          */
19962         uint16_t        target_id;
19963         /*
19964          * A physical address pointer pointing to a host buffer that the
19965          * command's response data will be written. This can be either a host
19966          * physical address (HPA) or a guest physical address (GPA) and must
19967          * point to a physically contiguous block of memory.
19968          */
19969         uint64_t        resp_addr;
19970         uint32_t        flags;
19971         uint32_t        enables;
19972         /*
19973          * If this bit is set to 1, then all queue_id0 related
19974          * parameters in this command are valid.
19975          */
19976         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID0_VALID \
19977                 UINT32_C(0x1)
19978         /*
19979          * If this bit is set to 1, then all queue_id1 related
19980          * parameters in this command are valid.
19981          */
19982         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID1_VALID \
19983                 UINT32_C(0x2)
19984         /*
19985          * If this bit is set to 1, then all queue_id2 related
19986          * parameters in this command are valid.
19987          */
19988         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID2_VALID \
19989                 UINT32_C(0x4)
19990         /*
19991          * If this bit is set to 1, then all queue_id3 related
19992          * parameters in this command are valid.
19993          */
19994         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID3_VALID \
19995                 UINT32_C(0x8)
19996         /*
19997          * If this bit is set to 1, then all queue_id4 related
19998          * parameters in this command are valid.
19999          */
20000         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID4_VALID \
20001                 UINT32_C(0x10)
20002         /*
20003          * If this bit is set to 1, then all queue_id5 related
20004          * parameters in this command are valid.
20005          */
20006         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID5_VALID \
20007                 UINT32_C(0x20)
20008         /*
20009          * If this bit is set to 1, then all queue_id6 related
20010          * parameters in this command are valid.
20011          */
20012         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID6_VALID \
20013                 UINT32_C(0x40)
20014         /*
20015          * If this bit is set to 1, then all queue_id7 related
20016          * parameters in this command are valid.
20017          */
20018         #define HWRM_QUEUE_COS2BW_CFG_INPUT_ENABLES_COS_QUEUE_ID7_VALID \
20019                 UINT32_C(0x80)
20020         /*
20021          * Port ID of port for which the table is being configured.
20022          * The HWRM needs to check whether this function is allowed
20023          * to configure TC BW assignment on this port.
20024          */
20025         uint16_t        port_id;
20026         /* ID of CoS Queue 0. */
20027         uint8_t queue_id0;
20028         uint8_t unused_0;
20029         /*
20030          * Minimum BW allocated to CoS Queue.
20031          * The HWRM will translate this value into byte counter and
20032          * time interval used for this COS inside the device.
20033          */
20034         uint32_t        queue_id0_min_bw;
20035         /* The bandwidth value. */
20036         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_MASK \
20037                 UINT32_C(0xfffffff)
20038         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_SFT \
20039                 0
20040         /* The granularity of the value (bits or bytes). */
20041         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE \
20042                 UINT32_C(0x10000000)
20043         /* Value is in bits. */
20044         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BITS \
20045                 (UINT32_C(0x0) << 28)
20046         /* Value is in bytes. */
20047         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES \
20048                 (UINT32_C(0x1) << 28)
20049         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_LAST \
20050                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_SCALE_BYTES
20051         /* bw_value_unit is 3 b */
20052         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MASK \
20053                 UINT32_C(0xe0000000)
20054         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_SFT \
20055                 29
20056         /* Value is in Mb or MB (base 10). */
20057         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_MEGA \
20058                 (UINT32_C(0x0) << 29)
20059         /* Value is in Kb or KB (base 10). */
20060         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_KILO \
20061                 (UINT32_C(0x2) << 29)
20062         /* Value is in bits or bytes. */
20063         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_BASE \
20064                 (UINT32_C(0x4) << 29)
20065         /* Value is in Gb or GB (base 10). */
20066         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_GIGA \
20067                 (UINT32_C(0x6) << 29)
20068         /* Value is in 1/100th of a percentage of total bandwidth. */
20069         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20070                 (UINT32_C(0x1) << 29)
20071         /* Invalid unit */
20072         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID \
20073                 (UINT32_C(0x7) << 29)
20074         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_LAST \
20075                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MIN_BW_BW_VALUE_UNIT_INVALID
20076         /*
20077          * Maximum BW allocated to CoS Queue.
20078          * The HWRM will translate this value into byte counter and
20079          * time interval used for this COS inside the device.
20080          */
20081         uint32_t        queue_id0_max_bw;
20082         /* The bandwidth value. */
20083         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_MASK \
20084                 UINT32_C(0xfffffff)
20085         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_SFT \
20086                 0
20087         /* The granularity of the value (bits or bytes). */
20088         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE \
20089                 UINT32_C(0x10000000)
20090         /* Value is in bits. */
20091         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BITS \
20092                 (UINT32_C(0x0) << 28)
20093         /* Value is in bytes. */
20094         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES \
20095                 (UINT32_C(0x1) << 28)
20096         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_LAST \
20097                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_SCALE_BYTES
20098         /* bw_value_unit is 3 b */
20099         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MASK \
20100                 UINT32_C(0xe0000000)
20101         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_SFT \
20102                 29
20103         /* Value is in Mb or MB (base 10). */
20104         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_MEGA \
20105                 (UINT32_C(0x0) << 29)
20106         /* Value is in Kb or KB (base 10). */
20107         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_KILO \
20108                 (UINT32_C(0x2) << 29)
20109         /* Value is in bits or bytes. */
20110         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_BASE \
20111                 (UINT32_C(0x4) << 29)
20112         /* Value is in Gb or GB (base 10). */
20113         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_GIGA \
20114                 (UINT32_C(0x6) << 29)
20115         /* Value is in 1/100th of a percentage of total bandwidth. */
20116         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20117                 (UINT32_C(0x1) << 29)
20118         /* Invalid unit */
20119         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID \
20120                 (UINT32_C(0x7) << 29)
20121         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_LAST \
20122                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_MAX_BW_BW_VALUE_UNIT_INVALID
20123         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20124         uint8_t queue_id0_tsa_assign;
20125         /* Strict Priority */
20126         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_SP \
20127                 UINT32_C(0x0)
20128         /* Enhanced Transmission Selection */
20129         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_ETS \
20130                 UINT32_C(0x1)
20131         /* reserved. */
20132         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST \
20133                 UINT32_C(0x2)
20134         /* reserved. */
20135         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST \
20136                 UINT32_C(0xff)
20137         /*
20138          * Priority level for strict priority. Valid only when the
20139          * tsa_assign is 0 - Strict Priority (SP)
20140          * 0..7 - Valid values.
20141          * 8..255 - Reserved.
20142          */
20143         uint8_t queue_id0_pri_lvl;
20144         /*
20145          * Weight used to allocate remaining BW for this COS after
20146          * servicing guaranteed bandwidths for all COS.
20147          */
20148         uint8_t queue_id0_bw_weight;
20149         /* ID of CoS Queue 1. */
20150         uint8_t queue_id1;
20151         /*
20152          * Minimum BW allocated to CoS Queue.
20153          * The HWRM will translate this value into byte counter and
20154          * time interval used for this COS inside the device.
20155          */
20156         uint32_t        queue_id1_min_bw;
20157         /* The bandwidth value. */
20158         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_MASK \
20159                 UINT32_C(0xfffffff)
20160         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_SFT \
20161                 0
20162         /* The granularity of the value (bits or bytes). */
20163         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE \
20164                 UINT32_C(0x10000000)
20165         /* Value is in bits. */
20166         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BITS \
20167                 (UINT32_C(0x0) << 28)
20168         /* Value is in bytes. */
20169         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES \
20170                 (UINT32_C(0x1) << 28)
20171         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_LAST \
20172                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_SCALE_BYTES
20173         /* bw_value_unit is 3 b */
20174         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MASK \
20175                 UINT32_C(0xe0000000)
20176         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_SFT \
20177                 29
20178         /* Value is in Mb or MB (base 10). */
20179         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_MEGA \
20180                 (UINT32_C(0x0) << 29)
20181         /* Value is in Kb or KB (base 10). */
20182         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_KILO \
20183                 (UINT32_C(0x2) << 29)
20184         /* Value is in bits or bytes. */
20185         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_BASE \
20186                 (UINT32_C(0x4) << 29)
20187         /* Value is in Gb or GB (base 10). */
20188         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_GIGA \
20189                 (UINT32_C(0x6) << 29)
20190         /* Value is in 1/100th of a percentage of total bandwidth. */
20191         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20192                 (UINT32_C(0x1) << 29)
20193         /* Invalid unit */
20194         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID \
20195                 (UINT32_C(0x7) << 29)
20196         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_LAST \
20197                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MIN_BW_BW_VALUE_UNIT_INVALID
20198         /*
20199          * Maximum BW allocated to CoS queue.
20200          * The HWRM will translate this value into byte counter and
20201          * time interval used for this COS inside the device.
20202          */
20203         uint32_t        queue_id1_max_bw;
20204         /* The bandwidth value. */
20205         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_MASK \
20206                 UINT32_C(0xfffffff)
20207         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_SFT \
20208                 0
20209         /* The granularity of the value (bits or bytes). */
20210         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE \
20211                 UINT32_C(0x10000000)
20212         /* Value is in bits. */
20213         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BITS \
20214                 (UINT32_C(0x0) << 28)
20215         /* Value is in bytes. */
20216         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES \
20217                 (UINT32_C(0x1) << 28)
20218         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_LAST \
20219                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_SCALE_BYTES
20220         /* bw_value_unit is 3 b */
20221         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MASK \
20222                 UINT32_C(0xe0000000)
20223         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_SFT \
20224                 29
20225         /* Value is in Mb or MB (base 10). */
20226         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_MEGA \
20227                 (UINT32_C(0x0) << 29)
20228         /* Value is in Kb or KB (base 10). */
20229         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_KILO \
20230                 (UINT32_C(0x2) << 29)
20231         /* Value is in bits or bytes. */
20232         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_BASE \
20233                 (UINT32_C(0x4) << 29)
20234         /* Value is in Gb or GB (base 10). */
20235         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_GIGA \
20236                 (UINT32_C(0x6) << 29)
20237         /* Value is in 1/100th of a percentage of total bandwidth. */
20238         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20239                 (UINT32_C(0x1) << 29)
20240         /* Invalid unit */
20241         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID \
20242                 (UINT32_C(0x7) << 29)
20243         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_LAST \
20244                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_MAX_BW_BW_VALUE_UNIT_INVALID
20245         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20246         uint8_t queue_id1_tsa_assign;
20247         /* Strict Priority */
20248         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_SP \
20249                 UINT32_C(0x0)
20250         /* Enhanced Transmission Selection */
20251         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_ETS \
20252                 UINT32_C(0x1)
20253         /* reserved. */
20254         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST \
20255                 UINT32_C(0x2)
20256         /* reserved. */
20257         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST \
20258                 UINT32_C(0xff)
20259         /*
20260          * Priority level for strict priority. Valid only when the
20261          * tsa_assign is 0 - Strict Priority (SP)
20262          * 0..7 - Valid values.
20263          * 8..255 - Reserved.
20264          */
20265         uint8_t queue_id1_pri_lvl;
20266         /*
20267          * Weight used to allocate remaining BW for this COS after
20268          * servicing guaranteed bandwidths for all COS.
20269          */
20270         uint8_t queue_id1_bw_weight;
20271         /* ID of CoS Queue 2. */
20272         uint8_t queue_id2;
20273         /*
20274          * Minimum BW allocated to CoS Queue.
20275          * The HWRM will translate this value into byte counter and
20276          * time interval used for this COS inside the device.
20277          */
20278         uint32_t        queue_id2_min_bw;
20279         /* The bandwidth value. */
20280         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_MASK \
20281                 UINT32_C(0xfffffff)
20282         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_SFT \
20283                 0
20284         /* The granularity of the value (bits or bytes). */
20285         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE \
20286                 UINT32_C(0x10000000)
20287         /* Value is in bits. */
20288         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BITS \
20289                 (UINT32_C(0x0) << 28)
20290         /* Value is in bytes. */
20291         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES \
20292                 (UINT32_C(0x1) << 28)
20293         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_LAST \
20294                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_SCALE_BYTES
20295         /* bw_value_unit is 3 b */
20296         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MASK \
20297                 UINT32_C(0xe0000000)
20298         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_SFT \
20299                 29
20300         /* Value is in Mb or MB (base 10). */
20301         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_MEGA \
20302                 (UINT32_C(0x0) << 29)
20303         /* Value is in Kb or KB (base 10). */
20304         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_KILO \
20305                 (UINT32_C(0x2) << 29)
20306         /* Value is in bits or bytes. */
20307         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_BASE \
20308                 (UINT32_C(0x4) << 29)
20309         /* Value is in Gb or GB (base 10). */
20310         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_GIGA \
20311                 (UINT32_C(0x6) << 29)
20312         /* Value is in 1/100th of a percentage of total bandwidth. */
20313         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20314                 (UINT32_C(0x1) << 29)
20315         /* Invalid unit */
20316         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID \
20317                 (UINT32_C(0x7) << 29)
20318         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_LAST \
20319                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MIN_BW_BW_VALUE_UNIT_INVALID
20320         /*
20321          * Maximum BW allocated to CoS queue.
20322          * The HWRM will translate this value into byte counter and
20323          * time interval used for this COS inside the device.
20324          */
20325         uint32_t        queue_id2_max_bw;
20326         /* The bandwidth value. */
20327         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_MASK \
20328                 UINT32_C(0xfffffff)
20329         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_SFT \
20330                 0
20331         /* The granularity of the value (bits or bytes). */
20332         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE \
20333                 UINT32_C(0x10000000)
20334         /* Value is in bits. */
20335         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BITS \
20336                 (UINT32_C(0x0) << 28)
20337         /* Value is in bytes. */
20338         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES \
20339                 (UINT32_C(0x1) << 28)
20340         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_LAST \
20341                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_SCALE_BYTES
20342         /* bw_value_unit is 3 b */
20343         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MASK \
20344                 UINT32_C(0xe0000000)
20345         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_SFT \
20346                 29
20347         /* Value is in Mb or MB (base 10). */
20348         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_MEGA \
20349                 (UINT32_C(0x0) << 29)
20350         /* Value is in Kb or KB (base 10). */
20351         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_KILO \
20352                 (UINT32_C(0x2) << 29)
20353         /* Value is in bits or bytes. */
20354         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_BASE \
20355                 (UINT32_C(0x4) << 29)
20356         /* Value is in Gb or GB (base 10). */
20357         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_GIGA \
20358                 (UINT32_C(0x6) << 29)
20359         /* Value is in 1/100th of a percentage of total bandwidth. */
20360         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20361                 (UINT32_C(0x1) << 29)
20362         /* Invalid unit */
20363         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID \
20364                 (UINT32_C(0x7) << 29)
20365         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_LAST \
20366                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_MAX_BW_BW_VALUE_UNIT_INVALID
20367         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20368         uint8_t queue_id2_tsa_assign;
20369         /* Strict Priority */
20370         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_SP \
20371                 UINT32_C(0x0)
20372         /* Enhanced Transmission Selection */
20373         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_ETS \
20374                 UINT32_C(0x1)
20375         /* reserved. */
20376         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST \
20377                 UINT32_C(0x2)
20378         /* reserved. */
20379         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST \
20380                 UINT32_C(0xff)
20381         /*
20382          * Priority level for strict priority. Valid only when the
20383          * tsa_assign is 0 - Strict Priority (SP)
20384          * 0..7 - Valid values.
20385          * 8..255 - Reserved.
20386          */
20387         uint8_t queue_id2_pri_lvl;
20388         /*
20389          * Weight used to allocate remaining BW for this COS after
20390          * servicing guaranteed bandwidths for all COS.
20391          */
20392         uint8_t queue_id2_bw_weight;
20393         /* ID of CoS Queue 3. */
20394         uint8_t queue_id3;
20395         /*
20396          * Minimum BW allocated to CoS Queue.
20397          * The HWRM will translate this value into byte counter and
20398          * time interval used for this COS inside the device.
20399          */
20400         uint32_t        queue_id3_min_bw;
20401         /* The bandwidth value. */
20402         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_MASK \
20403                 UINT32_C(0xfffffff)
20404         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_SFT \
20405                 0
20406         /* The granularity of the value (bits or bytes). */
20407         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE \
20408                 UINT32_C(0x10000000)
20409         /* Value is in bits. */
20410         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BITS \
20411                 (UINT32_C(0x0) << 28)
20412         /* Value is in bytes. */
20413         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES \
20414                 (UINT32_C(0x1) << 28)
20415         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_LAST \
20416                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_SCALE_BYTES
20417         /* bw_value_unit is 3 b */
20418         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MASK \
20419                 UINT32_C(0xe0000000)
20420         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_SFT \
20421                 29
20422         /* Value is in Mb or MB (base 10). */
20423         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_MEGA \
20424                 (UINT32_C(0x0) << 29)
20425         /* Value is in Kb or KB (base 10). */
20426         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_KILO \
20427                 (UINT32_C(0x2) << 29)
20428         /* Value is in bits or bytes. */
20429         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_BASE \
20430                 (UINT32_C(0x4) << 29)
20431         /* Value is in Gb or GB (base 10). */
20432         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_GIGA \
20433                 (UINT32_C(0x6) << 29)
20434         /* Value is in 1/100th of a percentage of total bandwidth. */
20435         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20436                 (UINT32_C(0x1) << 29)
20437         /* Invalid unit */
20438         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID \
20439                 (UINT32_C(0x7) << 29)
20440         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_LAST \
20441                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MIN_BW_BW_VALUE_UNIT_INVALID
20442         /*
20443          * Maximum BW allocated to CoS queue.
20444          * The HWRM will translate this value into byte counter and
20445          * time interval used for this COS inside the device.
20446          */
20447         uint32_t        queue_id3_max_bw;
20448         /* The bandwidth value. */
20449         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_MASK \
20450                 UINT32_C(0xfffffff)
20451         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_SFT \
20452                 0
20453         /* The granularity of the value (bits or bytes). */
20454         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE \
20455                 UINT32_C(0x10000000)
20456         /* Value is in bits. */
20457         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BITS \
20458                 (UINT32_C(0x0) << 28)
20459         /* Value is in bytes. */
20460         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES \
20461                 (UINT32_C(0x1) << 28)
20462         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_LAST \
20463                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_SCALE_BYTES
20464         /* bw_value_unit is 3 b */
20465         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MASK \
20466                 UINT32_C(0xe0000000)
20467         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_SFT \
20468                 29
20469         /* Value is in Mb or MB (base 10). */
20470         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_MEGA \
20471                 (UINT32_C(0x0) << 29)
20472         /* Value is in Kb or KB (base 10). */
20473         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_KILO \
20474                 (UINT32_C(0x2) << 29)
20475         /* Value is in bits or bytes. */
20476         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_BASE \
20477                 (UINT32_C(0x4) << 29)
20478         /* Value is in Gb or GB (base 10). */
20479         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_GIGA \
20480                 (UINT32_C(0x6) << 29)
20481         /* Value is in 1/100th of a percentage of total bandwidth. */
20482         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20483                 (UINT32_C(0x1) << 29)
20484         /* Invalid unit */
20485         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID \
20486                 (UINT32_C(0x7) << 29)
20487         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_LAST \
20488                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_MAX_BW_BW_VALUE_UNIT_INVALID
20489         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20490         uint8_t queue_id3_tsa_assign;
20491         /* Strict Priority */
20492         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_SP \
20493                 UINT32_C(0x0)
20494         /* Enhanced Transmission Selection */
20495         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_ETS \
20496                 UINT32_C(0x1)
20497         /* reserved. */
20498         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST \
20499                 UINT32_C(0x2)
20500         /* reserved. */
20501         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST \
20502                 UINT32_C(0xff)
20503         /*
20504          * Priority level for strict priority. Valid only when the
20505          * tsa_assign is 0 - Strict Priority (SP)
20506          * 0..7 - Valid values.
20507          * 8..255 - Reserved.
20508          */
20509         uint8_t queue_id3_pri_lvl;
20510         /*
20511          * Weight used to allocate remaining BW for this COS after
20512          * servicing guaranteed bandwidths for all COS.
20513          */
20514         uint8_t queue_id3_bw_weight;
20515         /* ID of CoS Queue 4. */
20516         uint8_t queue_id4;
20517         /*
20518          * Minimum BW allocated to CoS Queue.
20519          * The HWRM will translate this value into byte counter and
20520          * time interval used for this COS inside the device.
20521          */
20522         uint32_t        queue_id4_min_bw;
20523         /* The bandwidth value. */
20524         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_MASK \
20525                 UINT32_C(0xfffffff)
20526         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_SFT \
20527                 0
20528         /* The granularity of the value (bits or bytes). */
20529         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE \
20530                 UINT32_C(0x10000000)
20531         /* Value is in bits. */
20532         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BITS \
20533                 (UINT32_C(0x0) << 28)
20534         /* Value is in bytes. */
20535         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES \
20536                 (UINT32_C(0x1) << 28)
20537         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_LAST \
20538                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_SCALE_BYTES
20539         /* bw_value_unit is 3 b */
20540         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MASK \
20541                 UINT32_C(0xe0000000)
20542         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_SFT \
20543                 29
20544         /* Value is in Mb or MB (base 10). */
20545         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_MEGA \
20546                 (UINT32_C(0x0) << 29)
20547         /* Value is in Kb or KB (base 10). */
20548         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_KILO \
20549                 (UINT32_C(0x2) << 29)
20550         /* Value is in bits or bytes. */
20551         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_BASE \
20552                 (UINT32_C(0x4) << 29)
20553         /* Value is in Gb or GB (base 10). */
20554         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_GIGA \
20555                 (UINT32_C(0x6) << 29)
20556         /* Value is in 1/100th of a percentage of total bandwidth. */
20557         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20558                 (UINT32_C(0x1) << 29)
20559         /* Invalid unit */
20560         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID \
20561                 (UINT32_C(0x7) << 29)
20562         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_LAST \
20563                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MIN_BW_BW_VALUE_UNIT_INVALID
20564         /*
20565          * Maximum BW allocated to CoS queue.
20566          * The HWRM will translate this value into byte counter and
20567          * time interval used for this COS inside the device.
20568          */
20569         uint32_t        queue_id4_max_bw;
20570         /* The bandwidth value. */
20571         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_MASK \
20572                 UINT32_C(0xfffffff)
20573         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_SFT \
20574                 0
20575         /* The granularity of the value (bits or bytes). */
20576         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE \
20577                 UINT32_C(0x10000000)
20578         /* Value is in bits. */
20579         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BITS \
20580                 (UINT32_C(0x0) << 28)
20581         /* Value is in bytes. */
20582         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES \
20583                 (UINT32_C(0x1) << 28)
20584         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_LAST \
20585                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_SCALE_BYTES
20586         /* bw_value_unit is 3 b */
20587         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MASK \
20588                 UINT32_C(0xe0000000)
20589         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_SFT \
20590                 29
20591         /* Value is in Mb or MB (base 10). */
20592         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_MEGA \
20593                 (UINT32_C(0x0) << 29)
20594         /* Value is in Kb or KB (base 10). */
20595         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_KILO \
20596                 (UINT32_C(0x2) << 29)
20597         /* Value is in bits or bytes. */
20598         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_BASE \
20599                 (UINT32_C(0x4) << 29)
20600         /* Value is in Gb or GB (base 10). */
20601         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_GIGA \
20602                 (UINT32_C(0x6) << 29)
20603         /* Value is in 1/100th of a percentage of total bandwidth. */
20604         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20605                 (UINT32_C(0x1) << 29)
20606         /* Invalid unit */
20607         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID \
20608                 (UINT32_C(0x7) << 29)
20609         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_LAST \
20610                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_MAX_BW_BW_VALUE_UNIT_INVALID
20611         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20612         uint8_t queue_id4_tsa_assign;
20613         /* Strict Priority */
20614         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_SP \
20615                 UINT32_C(0x0)
20616         /* Enhanced Transmission Selection */
20617         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_ETS \
20618                 UINT32_C(0x1)
20619         /* reserved. */
20620         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST \
20621                 UINT32_C(0x2)
20622         /* reserved. */
20623         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST \
20624                 UINT32_C(0xff)
20625         /*
20626          * Priority level for strict priority. Valid only when the
20627          * tsa_assign is 0 - Strict Priority (SP)
20628          * 0..7 - Valid values.
20629          * 8..255 - Reserved.
20630          */
20631         uint8_t queue_id4_pri_lvl;
20632         /*
20633          * Weight used to allocate remaining BW for this COS after
20634          * servicing guaranteed bandwidths for all COS.
20635          */
20636         uint8_t queue_id4_bw_weight;
20637         /* ID of CoS Queue 5. */
20638         uint8_t queue_id5;
20639         /*
20640          * Minimum BW allocated to CoS Queue.
20641          * The HWRM will translate this value into byte counter and
20642          * time interval used for this COS inside the device.
20643          */
20644         uint32_t        queue_id5_min_bw;
20645         /* The bandwidth value. */
20646         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_MASK \
20647                 UINT32_C(0xfffffff)
20648         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_SFT \
20649                 0
20650         /* The granularity of the value (bits or bytes). */
20651         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE \
20652                 UINT32_C(0x10000000)
20653         /* Value is in bits. */
20654         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BITS \
20655                 (UINT32_C(0x0) << 28)
20656         /* Value is in bytes. */
20657         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES \
20658                 (UINT32_C(0x1) << 28)
20659         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_LAST \
20660                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_SCALE_BYTES
20661         /* bw_value_unit is 3 b */
20662         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MASK \
20663                 UINT32_C(0xe0000000)
20664         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_SFT \
20665                 29
20666         /* Value is in Mb or MB (base 10). */
20667         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_MEGA \
20668                 (UINT32_C(0x0) << 29)
20669         /* Value is in Kb or KB (base 10). */
20670         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_KILO \
20671                 (UINT32_C(0x2) << 29)
20672         /* Value is in bits or bytes. */
20673         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_BASE \
20674                 (UINT32_C(0x4) << 29)
20675         /* Value is in Gb or GB (base 10). */
20676         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_GIGA \
20677                 (UINT32_C(0x6) << 29)
20678         /* Value is in 1/100th of a percentage of total bandwidth. */
20679         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20680                 (UINT32_C(0x1) << 29)
20681         /* Invalid unit */
20682         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID \
20683                 (UINT32_C(0x7) << 29)
20684         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_LAST \
20685                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MIN_BW_BW_VALUE_UNIT_INVALID
20686         /*
20687          * Maximum BW allocated to CoS queue.
20688          * The HWRM will translate this value into byte counter and
20689          * time interval used for this COS inside the device.
20690          */
20691         uint32_t        queue_id5_max_bw;
20692         /* The bandwidth value. */
20693         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_MASK \
20694                 UINT32_C(0xfffffff)
20695         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_SFT \
20696                 0
20697         /* The granularity of the value (bits or bytes). */
20698         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE \
20699                 UINT32_C(0x10000000)
20700         /* Value is in bits. */
20701         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BITS \
20702                 (UINT32_C(0x0) << 28)
20703         /* Value is in bytes. */
20704         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES \
20705                 (UINT32_C(0x1) << 28)
20706         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_LAST \
20707                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_SCALE_BYTES
20708         /* bw_value_unit is 3 b */
20709         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MASK \
20710                 UINT32_C(0xe0000000)
20711         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_SFT \
20712                 29
20713         /* Value is in Mb or MB (base 10). */
20714         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_MEGA \
20715                 (UINT32_C(0x0) << 29)
20716         /* Value is in Kb or KB (base 10). */
20717         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_KILO \
20718                 (UINT32_C(0x2) << 29)
20719         /* Value is in bits or bytes. */
20720         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_BASE \
20721                 (UINT32_C(0x4) << 29)
20722         /* Value is in Gb or GB (base 10). */
20723         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_GIGA \
20724                 (UINT32_C(0x6) << 29)
20725         /* Value is in 1/100th of a percentage of total bandwidth. */
20726         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20727                 (UINT32_C(0x1) << 29)
20728         /* Invalid unit */
20729         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID \
20730                 (UINT32_C(0x7) << 29)
20731         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_LAST \
20732                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_MAX_BW_BW_VALUE_UNIT_INVALID
20733         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20734         uint8_t queue_id5_tsa_assign;
20735         /* Strict Priority */
20736         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_SP \
20737                 UINT32_C(0x0)
20738         /* Enhanced Transmission Selection */
20739         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_ETS \
20740                 UINT32_C(0x1)
20741         /* reserved. */
20742         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST \
20743                 UINT32_C(0x2)
20744         /* reserved. */
20745         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST \
20746                 UINT32_C(0xff)
20747         /*
20748          * Priority level for strict priority. Valid only when the
20749          * tsa_assign is 0 - Strict Priority (SP)
20750          * 0..7 - Valid values.
20751          * 8..255 - Reserved.
20752          */
20753         uint8_t queue_id5_pri_lvl;
20754         /*
20755          * Weight used to allocate remaining BW for this COS after
20756          * servicing guaranteed bandwidths for all COS.
20757          */
20758         uint8_t queue_id5_bw_weight;
20759         /* ID of CoS Queue 6. */
20760         uint8_t queue_id6;
20761         /*
20762          * Minimum BW allocated to CoS Queue.
20763          * The HWRM will translate this value into byte counter and
20764          * time interval used for this COS inside the device.
20765          */
20766         uint32_t        queue_id6_min_bw;
20767         /* The bandwidth value. */
20768         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_MASK \
20769                 UINT32_C(0xfffffff)
20770         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_SFT \
20771                 0
20772         /* The granularity of the value (bits or bytes). */
20773         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE \
20774                 UINT32_C(0x10000000)
20775         /* Value is in bits. */
20776         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BITS \
20777                 (UINT32_C(0x0) << 28)
20778         /* Value is in bytes. */
20779         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES \
20780                 (UINT32_C(0x1) << 28)
20781         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_LAST \
20782                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_SCALE_BYTES
20783         /* bw_value_unit is 3 b */
20784         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MASK \
20785                 UINT32_C(0xe0000000)
20786         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_SFT \
20787                 29
20788         /* Value is in Mb or MB (base 10). */
20789         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_MEGA \
20790                 (UINT32_C(0x0) << 29)
20791         /* Value is in Kb or KB (base 10). */
20792         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_KILO \
20793                 (UINT32_C(0x2) << 29)
20794         /* Value is in bits or bytes. */
20795         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_BASE \
20796                 (UINT32_C(0x4) << 29)
20797         /* Value is in Gb or GB (base 10). */
20798         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_GIGA \
20799                 (UINT32_C(0x6) << 29)
20800         /* Value is in 1/100th of a percentage of total bandwidth. */
20801         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20802                 (UINT32_C(0x1) << 29)
20803         /* Invalid unit */
20804         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID \
20805                 (UINT32_C(0x7) << 29)
20806         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_LAST \
20807                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MIN_BW_BW_VALUE_UNIT_INVALID
20808         /*
20809          * Maximum BW allocated to CoS queue.
20810          * The HWRM will translate this value into byte counter and
20811          * time interval used for this COS inside the device.
20812          */
20813         uint32_t        queue_id6_max_bw;
20814         /* The bandwidth value. */
20815         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_MASK \
20816                 UINT32_C(0xfffffff)
20817         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_SFT \
20818                 0
20819         /* The granularity of the value (bits or bytes). */
20820         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE \
20821                 UINT32_C(0x10000000)
20822         /* Value is in bits. */
20823         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BITS \
20824                 (UINT32_C(0x0) << 28)
20825         /* Value is in bytes. */
20826         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES \
20827                 (UINT32_C(0x1) << 28)
20828         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_LAST \
20829                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_SCALE_BYTES
20830         /* bw_value_unit is 3 b */
20831         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MASK \
20832                 UINT32_C(0xe0000000)
20833         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_SFT \
20834                 29
20835         /* Value is in Mb or MB (base 10). */
20836         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_MEGA \
20837                 (UINT32_C(0x0) << 29)
20838         /* Value is in Kb or KB (base 10). */
20839         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_KILO \
20840                 (UINT32_C(0x2) << 29)
20841         /* Value is in bits or bytes. */
20842         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_BASE \
20843                 (UINT32_C(0x4) << 29)
20844         /* Value is in Gb or GB (base 10). */
20845         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_GIGA \
20846                 (UINT32_C(0x6) << 29)
20847         /* Value is in 1/100th of a percentage of total bandwidth. */
20848         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20849                 (UINT32_C(0x1) << 29)
20850         /* Invalid unit */
20851         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID \
20852                 (UINT32_C(0x7) << 29)
20853         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_LAST \
20854                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_MAX_BW_BW_VALUE_UNIT_INVALID
20855         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20856         uint8_t queue_id6_tsa_assign;
20857         /* Strict Priority */
20858         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_SP \
20859                 UINT32_C(0x0)
20860         /* Enhanced Transmission Selection */
20861         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_ETS \
20862                 UINT32_C(0x1)
20863         /* reserved. */
20864         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST \
20865                 UINT32_C(0x2)
20866         /* reserved. */
20867         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST \
20868                 UINT32_C(0xff)
20869         /*
20870          * Priority level for strict priority. Valid only when the
20871          * tsa_assign is 0 - Strict Priority (SP)
20872          * 0..7 - Valid values.
20873          * 8..255 - Reserved.
20874          */
20875         uint8_t queue_id6_pri_lvl;
20876         /*
20877          * Weight used to allocate remaining BW for this COS after
20878          * servicing guaranteed bandwidths for all COS.
20879          */
20880         uint8_t queue_id6_bw_weight;
20881         /* ID of CoS Queue 7. */
20882         uint8_t queue_id7;
20883         /*
20884          * Minimum BW allocated to CoS Queue.
20885          * The HWRM will translate this value into byte counter and
20886          * time interval used for this COS inside the device.
20887          */
20888         uint32_t        queue_id7_min_bw;
20889         /* The bandwidth value. */
20890         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_MASK \
20891                 UINT32_C(0xfffffff)
20892         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_SFT \
20893                 0
20894         /* The granularity of the value (bits or bytes). */
20895         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE \
20896                 UINT32_C(0x10000000)
20897         /* Value is in bits. */
20898         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BITS \
20899                 (UINT32_C(0x0) << 28)
20900         /* Value is in bytes. */
20901         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES \
20902                 (UINT32_C(0x1) << 28)
20903         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_LAST \
20904                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_SCALE_BYTES
20905         /* bw_value_unit is 3 b */
20906         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MASK \
20907                 UINT32_C(0xe0000000)
20908         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_SFT \
20909                 29
20910         /* Value is in Mb or MB (base 10). */
20911         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_MEGA \
20912                 (UINT32_C(0x0) << 29)
20913         /* Value is in Kb or KB (base 10). */
20914         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_KILO \
20915                 (UINT32_C(0x2) << 29)
20916         /* Value is in bits or bytes. */
20917         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_BASE \
20918                 (UINT32_C(0x4) << 29)
20919         /* Value is in Gb or GB (base 10). */
20920         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_GIGA \
20921                 (UINT32_C(0x6) << 29)
20922         /* Value is in 1/100th of a percentage of total bandwidth. */
20923         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
20924                 (UINT32_C(0x1) << 29)
20925         /* Invalid unit */
20926         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID \
20927                 (UINT32_C(0x7) << 29)
20928         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_LAST \
20929                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MIN_BW_BW_VALUE_UNIT_INVALID
20930         /*
20931          * Maximum BW allocated to CoS queue.
20932          * The HWRM will translate this value into byte counter and
20933          * time interval used for this COS inside the device.
20934          */
20935         uint32_t        queue_id7_max_bw;
20936         /* The bandwidth value. */
20937         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_MASK \
20938                 UINT32_C(0xfffffff)
20939         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_SFT \
20940                 0
20941         /* The granularity of the value (bits or bytes). */
20942         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE \
20943                 UINT32_C(0x10000000)
20944         /* Value is in bits. */
20945         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BITS \
20946                 (UINT32_C(0x0) << 28)
20947         /* Value is in bytes. */
20948         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES \
20949                 (UINT32_C(0x1) << 28)
20950         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_LAST \
20951                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_SCALE_BYTES
20952         /* bw_value_unit is 3 b */
20953         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MASK \
20954                 UINT32_C(0xe0000000)
20955         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_SFT \
20956                 29
20957         /* Value is in Mb or MB (base 10). */
20958         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_MEGA \
20959                 (UINT32_C(0x0) << 29)
20960         /* Value is in Kb or KB (base 10). */
20961         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_KILO \
20962                 (UINT32_C(0x2) << 29)
20963         /* Value is in bits or bytes. */
20964         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_BASE \
20965                 (UINT32_C(0x4) << 29)
20966         /* Value is in Gb or GB (base 10). */
20967         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_GIGA \
20968                 (UINT32_C(0x6) << 29)
20969         /* Value is in 1/100th of a percentage of total bandwidth. */
20970         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
20971                 (UINT32_C(0x1) << 29)
20972         /* Invalid unit */
20973         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID \
20974                 (UINT32_C(0x7) << 29)
20975         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_LAST \
20976                 HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_MAX_BW_BW_VALUE_UNIT_INVALID
20977         /* Transmission Selection Algorithm (TSA) for CoS Queue. */
20978         uint8_t queue_id7_tsa_assign;
20979         /* Strict Priority */
20980         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_SP \
20981                 UINT32_C(0x0)
20982         /* Enhanced Transmission Selection */
20983         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_ETS \
20984                 UINT32_C(0x1)
20985         /* reserved. */
20986         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST \
20987                 UINT32_C(0x2)
20988         /* reserved. */
20989         #define HWRM_QUEUE_COS2BW_CFG_INPUT_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST \
20990                 UINT32_C(0xff)
20991         /*
20992          * Priority level for strict priority. Valid only when the
20993          * tsa_assign is 0 - Strict Priority (SP)
20994          * 0..7 - Valid values.
20995          * 8..255 - Reserved.
20996          */
20997         uint8_t queue_id7_pri_lvl;
20998         /*
20999          * Weight used to allocate remaining BW for this COS after
21000          * servicing guaranteed bandwidths for all COS.
21001          */
21002         uint8_t queue_id7_bw_weight;
21003         uint8_t unused_1[5];
21004 } __attribute__((packed));
21005
21006 /* hwrm_queue_cos2bw_cfg_output (size:128b/16B) */
21007 struct hwrm_queue_cos2bw_cfg_output {
21008         /* The specific error status for the command. */
21009         uint16_t        error_code;
21010         /* The HWRM command request type. */
21011         uint16_t        req_type;
21012         /* The sequence ID from the original command. */
21013         uint16_t        seq_id;
21014         /* The length of the response data in number of bytes. */
21015         uint16_t        resp_len;
21016         uint8_t unused_0[7];
21017         /*
21018          * This field is used in Output records to indicate that the output
21019          * is completely written to RAM.  This field should be read as '1'
21020          * to indicate that the output has been completely written.
21021          * When writing a command completion or response to an internal processor,
21022          * the order of writes has to be such that this field is written last.
21023          */
21024         uint8_t valid;
21025 } __attribute__((packed));
21026
21027 /*******************
21028  * hwrm_vnic_alloc *
21029  *******************/
21030
21031
21032 /* hwrm_vnic_alloc_input (size:192b/24B) */
21033 struct hwrm_vnic_alloc_input {
21034         /* The HWRM command request type. */
21035         uint16_t        req_type;
21036         /*
21037          * The completion ring to send the completion event on. This should
21038          * be the NQ ID returned from the `nq_alloc` HWRM command.
21039          */
21040         uint16_t        cmpl_ring;
21041         /*
21042          * The sequence ID is used by the driver for tracking multiple
21043          * commands. This ID is treated as opaque data by the firmware and
21044          * the value is returned in the `hwrm_resp_hdr` upon completion.
21045          */
21046         uint16_t        seq_id;
21047         /*
21048          * The target ID of the command:
21049          * * 0x0-0xFFF8 - The function ID
21050          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21051          * * 0xFFFD - Reserved for user-space HWRM interface
21052          * * 0xFFFF - HWRM
21053          */
21054         uint16_t        target_id;
21055         /*
21056          * A physical address pointer pointing to a host buffer that the
21057          * command's response data will be written. This can be either a host
21058          * physical address (HPA) or a guest physical address (GPA) and must
21059          * point to a physically contiguous block of memory.
21060          */
21061         uint64_t        resp_addr;
21062         uint32_t        flags;
21063         /*
21064          * When this bit is '1', this VNIC is requested to
21065          * be the default VNIC for this function.
21066          */
21067         #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT     UINT32_C(0x1)
21068         uint8_t unused_0[4];
21069 } __attribute__((packed));
21070
21071 /* hwrm_vnic_alloc_output (size:128b/16B) */
21072 struct hwrm_vnic_alloc_output {
21073         /* The specific error status for the command. */
21074         uint16_t        error_code;
21075         /* The HWRM command request type. */
21076         uint16_t        req_type;
21077         /* The sequence ID from the original command. */
21078         uint16_t        seq_id;
21079         /* The length of the response data in number of bytes. */
21080         uint16_t        resp_len;
21081         /* Logical vnic ID */
21082         uint32_t        vnic_id;
21083         uint8_t unused_0[3];
21084         /*
21085          * This field is used in Output records to indicate that the output
21086          * is completely written to RAM.  This field should be read as '1'
21087          * to indicate that the output has been completely written.
21088          * When writing a command completion or response to an internal processor,
21089          * the order of writes has to be such that this field is written last.
21090          */
21091         uint8_t valid;
21092 } __attribute__((packed));
21093
21094 /******************
21095  * hwrm_vnic_free *
21096  ******************/
21097
21098
21099 /* hwrm_vnic_free_input (size:192b/24B) */
21100 struct hwrm_vnic_free_input {
21101         /* The HWRM command request type. */
21102         uint16_t        req_type;
21103         /*
21104          * The completion ring to send the completion event on. This should
21105          * be the NQ ID returned from the `nq_alloc` HWRM command.
21106          */
21107         uint16_t        cmpl_ring;
21108         /*
21109          * The sequence ID is used by the driver for tracking multiple
21110          * commands. This ID is treated as opaque data by the firmware and
21111          * the value is returned in the `hwrm_resp_hdr` upon completion.
21112          */
21113         uint16_t        seq_id;
21114         /*
21115          * The target ID of the command:
21116          * * 0x0-0xFFF8 - The function ID
21117          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21118          * * 0xFFFD - Reserved for user-space HWRM interface
21119          * * 0xFFFF - HWRM
21120          */
21121         uint16_t        target_id;
21122         /*
21123          * A physical address pointer pointing to a host buffer that the
21124          * command's response data will be written. This can be either a host
21125          * physical address (HPA) or a guest physical address (GPA) and must
21126          * point to a physically contiguous block of memory.
21127          */
21128         uint64_t        resp_addr;
21129         /* Logical vnic ID */
21130         uint32_t        vnic_id;
21131         uint8_t unused_0[4];
21132 } __attribute__((packed));
21133
21134 /* hwrm_vnic_free_output (size:128b/16B) */
21135 struct hwrm_vnic_free_output {
21136         /* The specific error status for the command. */
21137         uint16_t        error_code;
21138         /* The HWRM command request type. */
21139         uint16_t        req_type;
21140         /* The sequence ID from the original command. */
21141         uint16_t        seq_id;
21142         /* The length of the response data in number of bytes. */
21143         uint16_t        resp_len;
21144         uint8_t unused_0[7];
21145         /*
21146          * This field is used in Output records to indicate that the output
21147          * is completely written to RAM.  This field should be read as '1'
21148          * to indicate that the output has been completely written.
21149          * When writing a command completion or response to an internal processor,
21150          * the order of writes has to be such that this field is written last.
21151          */
21152         uint8_t valid;
21153 } __attribute__((packed));
21154
21155 /*****************
21156  * hwrm_vnic_cfg *
21157  *****************/
21158
21159
21160 /* hwrm_vnic_cfg_input (size:384b/48B) */
21161 struct hwrm_vnic_cfg_input {
21162         /* The HWRM command request type. */
21163         uint16_t        req_type;
21164         /*
21165          * The completion ring to send the completion event on. This should
21166          * be the NQ ID returned from the `nq_alloc` HWRM command.
21167          */
21168         uint16_t        cmpl_ring;
21169         /*
21170          * The sequence ID is used by the driver for tracking multiple
21171          * commands. This ID is treated as opaque data by the firmware and
21172          * the value is returned in the `hwrm_resp_hdr` upon completion.
21173          */
21174         uint16_t        seq_id;
21175         /*
21176          * The target ID of the command:
21177          * * 0x0-0xFFF8 - The function ID
21178          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21179          * * 0xFFFD - Reserved for user-space HWRM interface
21180          * * 0xFFFF - HWRM
21181          */
21182         uint16_t        target_id;
21183         /*
21184          * A physical address pointer pointing to a host buffer that the
21185          * command's response data will be written. This can be either a host
21186          * physical address (HPA) or a guest physical address (GPA) and must
21187          * point to a physically contiguous block of memory.
21188          */
21189         uint64_t        resp_addr;
21190         uint32_t        flags;
21191         /*
21192          * When this bit is '1', the VNIC is requested to
21193          * be the default VNIC for the function.
21194          */
21195         #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT \
21196                 UINT32_C(0x1)
21197         /*
21198          * When this bit is '1', the VNIC is being configured to
21199          * strip VLAN in the RX path.
21200          * If set to '0', then VLAN stripping is disabled on
21201          * this VNIC.
21202          */
21203         #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE \
21204                 UINT32_C(0x2)
21205         /*
21206          * When this bit is '1', the VNIC is being configured to
21207          * buffer receive packets in the hardware until the host
21208          * posts new receive buffers.
21209          * If set to '0', then bd_stall is being configured to be
21210          * disabled on this VNIC.
21211          */
21212         #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE \
21213                 UINT32_C(0x4)
21214         /*
21215          * When this bit is '1', the VNIC is being configured to
21216          * receive both RoCE and non-RoCE traffic.
21217          * If set to '0', then this VNIC is not configured to be
21218          * operating in dual VNIC mode.
21219          */
21220         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
21221                 UINT32_C(0x8)
21222         /*
21223          * When this flag is set to '1', the VNIC is requested to
21224          * be configured to receive only RoCE traffic.
21225          * If this flag is set to '0', then this flag shall be
21226          * ignored by the HWRM.
21227          * If roce_dual_vnic_mode flag is set to '1'
21228          * or roce_mirroring_capable_vnic_mode flag to 1,
21229          * then the HWRM client shall not set this flag to '1'.
21230          */
21231         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
21232                 UINT32_C(0x10)
21233         /*
21234          * When a VNIC uses one destination ring group for certain
21235          * application (e.g. Receive Flow Steering) where
21236          * exact match is used to direct packets to a VNIC with one
21237          * destination ring group only, there is no need to configure
21238          * RSS indirection table for that VNIC as only one destination
21239          * ring group is used.
21240          *
21241          * This flag is used to enable a mode where
21242          * RSS is enabled in the VNIC using a RSS context
21243          * for computing RSS hash but the RSS indirection table is
21244          * not configured using hwrm_vnic_rss_cfg.
21245          *
21246          * If this mode is enabled, then the driver should not program
21247          * RSS indirection table for the RSS context that is used for
21248          * computing RSS hash only.
21249          */
21250         #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE \
21251                 UINT32_C(0x20)
21252         /*
21253          * When this bit is '1', the VNIC is being configured to
21254          * receive both RoCE and non-RoCE traffic, but forward only the
21255          * RoCE traffic further. Also, RoCE traffic can be mirrored to
21256          * L2 driver.
21257          */
21258         #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
21259                 UINT32_C(0x40)
21260         uint32_t        enables;
21261         /*
21262          * This bit must be '1' for the dflt_ring_grp field to be
21263          * configured.
21264          */
21265         #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP \
21266                 UINT32_C(0x1)
21267         /*
21268          * This bit must be '1' for the rss_rule field to be
21269          * configured.
21270          */
21271         #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE \
21272                 UINT32_C(0x2)
21273         /*
21274          * This bit must be '1' for the cos_rule field to be
21275          * configured.
21276          */
21277         #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE \
21278                 UINT32_C(0x4)
21279         /*
21280          * This bit must be '1' for the lb_rule field to be
21281          * configured.
21282          */
21283         #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE \
21284                 UINT32_C(0x8)
21285         /*
21286          * This bit must be '1' for the mru field to be
21287          * configured.
21288          */
21289         #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU \
21290                 UINT32_C(0x10)
21291         /*
21292          * This bit must be '1' for the default_rx_ring_id field to be
21293          * configured.
21294          */
21295         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_RX_RING_ID \
21296                 UINT32_C(0x20)
21297         /*
21298          * This bit must be '1' for the default_cmpl_ring_id field to be
21299          * configured.
21300          */
21301         #define HWRM_VNIC_CFG_INPUT_ENABLES_DEFAULT_CMPL_RING_ID \
21302                 UINT32_C(0x40)
21303         /* This bit must be '1' for the queue_id field to be configured. */
21304         #define HWRM_VNIC_CFG_INPUT_ENABLES_QUEUE_ID \
21305                 UINT32_C(0x80)
21306         /* Logical vnic ID */
21307         uint16_t        vnic_id;
21308         /*
21309          * Default Completion ring for the VNIC.  This ring will
21310          * be chosen if packet does not match any RSS rules and if
21311          * there is no COS rule.
21312          */
21313         uint16_t        dflt_ring_grp;
21314         /*
21315          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
21316          * there is no RSS rule.
21317          */
21318         uint16_t        rss_rule;
21319         /*
21320          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
21321          * there is no COS rule.
21322          */
21323         uint16_t        cos_rule;
21324         /*
21325          * RSS ID for load balancing rule/table structure.
21326          * 0xFF... (All Fs) if there is no LB rule.
21327          */
21328         uint16_t        lb_rule;
21329         /*
21330          * The maximum receive unit of the vnic.
21331          * Each vnic is associated with a function.
21332          * The vnic mru value overwrites the mru setting of the
21333          * associated function.
21334          * The HWRM shall make sure that vnic mru does not exceed
21335          * the mru of the port the function is associated with.
21336          */
21337         uint16_t        mru;
21338         /*
21339          * Default Rx ring for the VNIC.  This ring will
21340          * be chosen if packet does not match any RSS rules.
21341          * The aggregation ring associated with the Rx ring is
21342          * implied based on the Rx ring specified when the
21343          * aggregation ring was allocated.
21344          */
21345         uint16_t        default_rx_ring_id;
21346         /*
21347          * Default completion ring for the VNIC.  This ring will
21348          * be chosen if packet does not match any RSS rules.
21349          */
21350         uint16_t        default_cmpl_ring_id;
21351         /*
21352          * When specified, only incoming packets classified to the specified CoS
21353          * queue ID will be arriving on this VNIC.  Packet priority to CoS mapping
21354          * rules can be specified using HWRM_QUEUE_PRI2COS_CFG.  In this mode,
21355          * ntuple filters with VNIC destination specified are invalid since they
21356          * conflict with the the CoS to VNIC steering rules in this mode.
21357          *
21358          * If this field is not specified, packet to VNIC steering will be
21359          * subject to the standard L2 filter rules and any additional ntuple
21360          * filter rules with destination VNIC specified.
21361          */
21362         uint16_t        queue_id;
21363         uint8_t unused0[6];
21364 } __attribute__((packed));
21365
21366 /* hwrm_vnic_cfg_output (size:128b/16B) */
21367 struct hwrm_vnic_cfg_output {
21368         /* The specific error status for the command. */
21369         uint16_t        error_code;
21370         /* The HWRM command request type. */
21371         uint16_t        req_type;
21372         /* The sequence ID from the original command. */
21373         uint16_t        seq_id;
21374         /* The length of the response data in number of bytes. */
21375         uint16_t        resp_len;
21376         uint8_t unused_0[7];
21377         /*
21378          * This field is used in Output records to indicate that the output
21379          * is completely written to RAM.  This field should be read as '1'
21380          * to indicate that the output has been completely written.
21381          * When writing a command completion or response to an internal processor,
21382          * the order of writes has to be such that this field is written last.
21383          */
21384         uint8_t valid;
21385 } __attribute__((packed));
21386
21387 /******************
21388  * hwrm_vnic_qcfg *
21389  ******************/
21390
21391
21392 /* hwrm_vnic_qcfg_input (size:256b/32B) */
21393 struct hwrm_vnic_qcfg_input {
21394         /* The HWRM command request type. */
21395         uint16_t        req_type;
21396         /*
21397          * The completion ring to send the completion event on. This should
21398          * be the NQ ID returned from the `nq_alloc` HWRM command.
21399          */
21400         uint16_t        cmpl_ring;
21401         /*
21402          * The sequence ID is used by the driver for tracking multiple
21403          * commands. This ID is treated as opaque data by the firmware and
21404          * the value is returned in the `hwrm_resp_hdr` upon completion.
21405          */
21406         uint16_t        seq_id;
21407         /*
21408          * The target ID of the command:
21409          * * 0x0-0xFFF8 - The function ID
21410          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21411          * * 0xFFFD - Reserved for user-space HWRM interface
21412          * * 0xFFFF - HWRM
21413          */
21414         uint16_t        target_id;
21415         /*
21416          * A physical address pointer pointing to a host buffer that the
21417          * command's response data will be written. This can be either a host
21418          * physical address (HPA) or a guest physical address (GPA) and must
21419          * point to a physically contiguous block of memory.
21420          */
21421         uint64_t        resp_addr;
21422         uint32_t        enables;
21423         /*
21424          * This bit must be '1' for the vf_id_valid field to be
21425          * configured.
21426          */
21427         #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID     UINT32_C(0x1)
21428         /* Logical vnic ID */
21429         uint32_t        vnic_id;
21430         /* ID of Virtual Function whose VNIC resource is being queried. */
21431         uint16_t        vf_id;
21432         uint8_t unused_0[6];
21433 } __attribute__((packed));
21434
21435 /* hwrm_vnic_qcfg_output (size:256b/32B) */
21436 struct hwrm_vnic_qcfg_output {
21437         /* The specific error status for the command. */
21438         uint16_t        error_code;
21439         /* The HWRM command request type. */
21440         uint16_t        req_type;
21441         /* The sequence ID from the original command. */
21442         uint16_t        seq_id;
21443         /* The length of the response data in number of bytes. */
21444         uint16_t        resp_len;
21445         /* Default Completion ring for the VNIC. */
21446         uint16_t        dflt_ring_grp;
21447         /*
21448          * RSS ID for RSS rule/table structure.  0xFF... (All Fs) if
21449          * there is no RSS rule.
21450          */
21451         uint16_t        rss_rule;
21452         /*
21453          * RSS ID for COS rule/table structure.  0xFF... (All Fs) if
21454          * there is no COS rule.
21455          */
21456         uint16_t        cos_rule;
21457         /*
21458          * RSS ID for load balancing rule/table structure.
21459          * 0xFF... (All Fs) if there is no LB rule.
21460          */
21461         uint16_t        lb_rule;
21462         /* The maximum receive unit of the vnic. */
21463         uint16_t        mru;
21464         uint8_t unused_0[2];
21465         uint32_t        flags;
21466         /*
21467          * When this bit is '1', the VNIC is the default VNIC for
21468          * the function.
21469          */
21470         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT \
21471                 UINT32_C(0x1)
21472         /*
21473          * When this bit is '1', the VNIC is configured to
21474          * strip VLAN in the RX path.
21475          * If set to '0', then VLAN stripping is disabled on
21476          * this VNIC.
21477          */
21478         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE \
21479                 UINT32_C(0x2)
21480         /*
21481          * When this bit is '1', the VNIC is configured to
21482          * buffer receive packets in the hardware until the host
21483          * posts new receive buffers.
21484          * If set to '0', then bd_stall is disabled on
21485          * this VNIC.
21486          */
21487         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE \
21488                 UINT32_C(0x4)
21489         /*
21490          * When this bit is '1', the VNIC is configured to
21491          * receive both RoCE and non-RoCE traffic.
21492          * If set to '0', then this VNIC is not configured to
21493          * operate in dual VNIC mode.
21494          */
21495         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE \
21496                 UINT32_C(0x8)
21497         /*
21498          * When this flag is set to '1', the VNIC is configured to
21499          * receive only RoCE traffic.
21500          * When this flag is set to '0', the VNIC is not configured
21501          * to receive only RoCE traffic.
21502          * If roce_dual_vnic_mode flag and this flag both are set
21503          * to '1', then it is an invalid configuration of the
21504          * VNIC. The HWRM should not allow that type of
21505          * mis-configuration by HWRM clients.
21506          */
21507         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE \
21508                 UINT32_C(0x10)
21509         /*
21510          * When a VNIC uses one destination ring group for certain
21511          * application (e.g. Receive Flow Steering) where
21512          * exact match is used to direct packets to a VNIC with one
21513          * destination ring group only, there is no need to configure
21514          * RSS indirection table for that VNIC as only one destination
21515          * ring group is used.
21516          *
21517          * When this bit is set to '1', then the VNIC is enabled in a
21518          * mode where RSS is enabled in the VNIC using a RSS context
21519          * for computing RSS hash but the RSS indirection table is
21520          * not configured.
21521          */
21522         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE \
21523                 UINT32_C(0x20)
21524         /*
21525          * When this bit is '1', the VNIC is configured to
21526          * receive both RoCE and non-RoCE traffic, but forward only
21527          * RoCE traffic further. Also RoCE traffic can be mirrored to
21528          * L2 driver.
21529          */
21530         #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE \
21531                 UINT32_C(0x40)
21532         uint8_t unused_1[7];
21533         /*
21534          * This field is used in Output records to indicate that the output
21535          * is completely written to RAM.  This field should be read as '1'
21536          * to indicate that the output has been completely written.
21537          * When writing a command completion or response to an internal processor,
21538          * the order of writes has to be such that this field is written last.
21539          */
21540         uint8_t valid;
21541 } __attribute__((packed));
21542
21543 /*******************
21544  * hwrm_vnic_qcaps *
21545  *******************/
21546
21547
21548 /* hwrm_vnic_qcaps_input (size:192b/24B) */
21549 struct hwrm_vnic_qcaps_input {
21550         /* The HWRM command request type. */
21551         uint16_t        req_type;
21552         /*
21553          * The completion ring to send the completion event on. This should
21554          * be the NQ ID returned from the `nq_alloc` HWRM command.
21555          */
21556         uint16_t        cmpl_ring;
21557         /*
21558          * The sequence ID is used by the driver for tracking multiple
21559          * commands. This ID is treated as opaque data by the firmware and
21560          * the value is returned in the `hwrm_resp_hdr` upon completion.
21561          */
21562         uint16_t        seq_id;
21563         /*
21564          * The target ID of the command:
21565          * * 0x0-0xFFF8 - The function ID
21566          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21567          * * 0xFFFD - Reserved for user-space HWRM interface
21568          * * 0xFFFF - HWRM
21569          */
21570         uint16_t        target_id;
21571         /*
21572          * A physical address pointer pointing to a host buffer that the
21573          * command's response data will be written. This can be either a host
21574          * physical address (HPA) or a guest physical address (GPA) and must
21575          * point to a physically contiguous block of memory.
21576          */
21577         uint64_t        resp_addr;
21578         uint32_t        enables;
21579         uint8_t unused_0[4];
21580 } __attribute__((packed));
21581
21582 /* hwrm_vnic_qcaps_output (size:192b/24B) */
21583 struct hwrm_vnic_qcaps_output {
21584         /* The specific error status for the command. */
21585         uint16_t        error_code;
21586         /* The HWRM command request type. */
21587         uint16_t        req_type;
21588         /* The sequence ID from the original command. */
21589         uint16_t        seq_id;
21590         /* The length of the response data in number of bytes. */
21591         uint16_t        resp_len;
21592         /* The maximum receive unit that is settable on a vnic. */
21593         uint16_t        mru;
21594         uint8_t unused_0[2];
21595         uint32_t        flags;
21596         /* Unused. */
21597         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_UNUSED \
21598                 UINT32_C(0x1)
21599         /*
21600          * When this bit is '1', the capability of stripping VLAN in
21601          * the RX path is supported on VNIC(s).
21602          * If set to '0', then VLAN stripping capability is
21603          * not supported on VNIC(s).
21604          */
21605         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP \
21606                 UINT32_C(0x2)
21607         /*
21608          * When this bit is '1', the capability to buffer receive
21609          * packets in the hardware until the host posts new receive buffers
21610          * is supported on VNIC(s).
21611          * If set to '0', then bd_stall capability is not supported
21612          * on VNIC(s).
21613          */
21614         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_BD_STALL_CAP \
21615                 UINT32_C(0x4)
21616         /*
21617          * When this bit is '1', the capability to
21618          * receive both RoCE and non-RoCE traffic on VNIC(s) is
21619          * supported.
21620          * If set to '0', then the capability to receive
21621          * both RoCE and non-RoCE traffic on VNIC(s) is
21622          * not supported.
21623          */
21624         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_DUAL_VNIC_CAP \
21625                 UINT32_C(0x8)
21626         /*
21627          * When this bit is set to '1', the capability to configure
21628          * a VNIC to receive only RoCE traffic is supported.
21629          * When this flag is set to '0', the VNIC capability to
21630          * configure to receive only RoCE traffic is not supported.
21631          */
21632         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_ONLY_VNIC_CAP \
21633                 UINT32_C(0x10)
21634         /*
21635          * When this bit is set to '1', then the capability to enable
21636          * a VNIC in a mode where RSS context without configuring
21637          * RSS indirection table is supported (for RSS hash computation).
21638          * When this bit is set to '0', then a VNIC can not be configured
21639          * with a mode to enable RSS context without configuring RSS
21640          * indirection table.
21641          */
21642         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_DFLT_CR_CAP \
21643                 UINT32_C(0x20)
21644         /*
21645          * When this bit is '1', the capability to
21646          * mirror the the RoCE traffic is supported.
21647          * If set to '0', then the capability to mirror the
21648          * RoCE traffic is not supported.
21649          */
21650         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_CAP \
21651                 UINT32_C(0x40)
21652         /*
21653          * When this bit is '1', the outermost RSS hashing capability
21654          * is supported. If set to '0', then the outermost RSS hashing
21655          * capability is not supported.
21656          */
21657         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_OUTERMOST_RSS_CAP \
21658                 UINT32_C(0x80)
21659         /*
21660          * When this bit is '1', it indicates that firmware supports the
21661          * ability to steer incoming packets from one CoS queue to one
21662          * VNIC.  This optional feature can then be enabled
21663          * using HWRM_VNIC_CFG on any VNIC.  This feature is only
21664          * available when NVM option “enable_cos_classfication” is set
21665          * to 1.  If set to '0', firmware does not support this feature.
21666          */
21667         #define HWRM_VNIC_QCAPS_OUTPUT_FLAGS_COS_ASSIGNMENT_CAP \
21668                 UINT32_C(0x100)
21669         /*
21670          * This field advertises the maximum concurrent TPA aggregations
21671          * supported by the VNIC on new devices that support TPA v2.
21672          * '0' means that TPA v2 is not supported.
21673          */
21674         uint16_t        max_aggs_supported;
21675         uint8_t unused_1[5];
21676         /*
21677          * This field is used in Output records to indicate that the output
21678          * is completely written to RAM.  This field should be read as '1'
21679          * to indicate that the output has been completely written.
21680          * When writing a command completion or response to an internal processor,
21681          * the order of writes has to be such that this field is written last.
21682          */
21683         uint8_t valid;
21684 } __attribute__((packed));
21685
21686 /*********************
21687  * hwrm_vnic_tpa_cfg *
21688  *********************/
21689
21690
21691 /* hwrm_vnic_tpa_cfg_input (size:320b/40B) */
21692 struct hwrm_vnic_tpa_cfg_input {
21693         /* The HWRM command request type. */
21694         uint16_t        req_type;
21695         /*
21696          * The completion ring to send the completion event on. This should
21697          * be the NQ ID returned from the `nq_alloc` HWRM command.
21698          */
21699         uint16_t        cmpl_ring;
21700         /*
21701          * The sequence ID is used by the driver for tracking multiple
21702          * commands. This ID is treated as opaque data by the firmware and
21703          * the value is returned in the `hwrm_resp_hdr` upon completion.
21704          */
21705         uint16_t        seq_id;
21706         /*
21707          * The target ID of the command:
21708          * * 0x0-0xFFF8 - The function ID
21709          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21710          * * 0xFFFD - Reserved for user-space HWRM interface
21711          * * 0xFFFF - HWRM
21712          */
21713         uint16_t        target_id;
21714         /*
21715          * A physical address pointer pointing to a host buffer that the
21716          * command's response data will be written. This can be either a host
21717          * physical address (HPA) or a guest physical address (GPA) and must
21718          * point to a physically contiguous block of memory.
21719          */
21720         uint64_t        resp_addr;
21721         uint32_t        flags;
21722         /*
21723          * When this bit is '1', the VNIC shall be configured to
21724          * perform transparent packet aggregation (TPA) of
21725          * non-tunneled TCP packets.
21726          */
21727         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA \
21728                 UINT32_C(0x1)
21729         /*
21730          * When this bit is '1', the VNIC shall be configured to
21731          * perform transparent packet aggregation (TPA) of
21732          * tunneled TCP packets.
21733          */
21734         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA \
21735                 UINT32_C(0x2)
21736         /*
21737          * When this bit is '1', the VNIC shall be configured to
21738          * perform transparent packet aggregation (TPA) according
21739          * to Windows Receive Segment Coalescing (RSC) rules.
21740          */
21741         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE \
21742                 UINT32_C(0x4)
21743         /*
21744          * When this bit is '1', the VNIC shall be configured to
21745          * perform transparent packet aggregation (TPA) according
21746          * to Linux Generic Receive Offload (GRO) rules.
21747          */
21748         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO \
21749                 UINT32_C(0x8)
21750         /*
21751          * When this bit is '1', the VNIC shall be configured to
21752          * perform transparent packet aggregation (TPA) for TCP
21753          * packets with IP ECN set to non-zero.
21754          */
21755         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN \
21756                 UINT32_C(0x10)
21757         /*
21758          * When this bit is '1', the VNIC shall be configured to
21759          * perform transparent packet aggregation (TPA) for
21760          * GRE tunneled TCP packets only if all packets have the
21761          * same GRE sequence.
21762          */
21763         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
21764                 UINT32_C(0x20)
21765         /*
21766          * When this bit is '1' and the GRO mode is enabled,
21767          * the VNIC shall be configured to
21768          * perform transparent packet aggregation (TPA) for
21769          * TCP/IPv4 packets with consecutively increasing IPIDs.
21770          * In other words, the last packet that is being
21771          * aggregated to an already existing aggregation context
21772          * shall have IPID 1 more than the IPID of the last packet
21773          * that was aggregated in that aggregation context.
21774          */
21775         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK \
21776                 UINT32_C(0x40)
21777         /*
21778          * When this bit is '1' and the GRO mode is enabled,
21779          * the VNIC shall be configured to
21780          * perform transparent packet aggregation (TPA) for
21781          * TCP packets with the same TTL (IPv4) or Hop limit (IPv6)
21782          * value.
21783          */
21784         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK \
21785                 UINT32_C(0x80)
21786         /*
21787          * When this bit is '1' and the GRO mode is enabled,
21788          * the VNIC shall DMA payload data using GRO rules.
21789          * When this bit is '0', the VNIC shall DMA payload data
21790          * using the more efficient LRO rules of filling all
21791          * aggregation buffers.
21792          */
21793         #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_PACK_AS_GRO \
21794                 UINT32_C(0x100)
21795         uint32_t        enables;
21796         /*
21797          * This bit must be '1' for the max_agg_segs field to be
21798          * configured.
21799          */
21800         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS      UINT32_C(0x1)
21801         /*
21802          * This bit must be '1' for the max_aggs field to be
21803          * configured.
21804          */
21805         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS          UINT32_C(0x2)
21806         /*
21807          * This bit must be '1' for the max_agg_timer field to be
21808          * configured.
21809          */
21810         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER     UINT32_C(0x4)
21811         /* deprecated bit.  Do not use!!! */
21812         #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN       UINT32_C(0x8)
21813         /* Logical vnic ID */
21814         uint16_t        vnic_id;
21815         /*
21816          * This is the maximum number of TCP segments that can
21817          * be aggregated (unit is Log2). Max value is 31. On new
21818          * devices supporting TPA v2, the unit is multiples of 4 and
21819          * valid values are > 0 and <= 63.
21820          */
21821         uint16_t        max_agg_segs;
21822         /* 1 segment */
21823         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1   UINT32_C(0x0)
21824         /* 2 segments */
21825         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2   UINT32_C(0x1)
21826         /* 4 segments */
21827         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4   UINT32_C(0x2)
21828         /* 8 segments */
21829         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8   UINT32_C(0x3)
21830         /* Any segment size larger than this is not valid */
21831         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
21832         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_LAST \
21833                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX
21834         /*
21835          * This is the maximum number of aggregations this VNIC is
21836          * allowed (unit is Log2). Max value is 7. On new devices
21837          * supporting TPA v2, this is in unit of 1 and must be > 0
21838          * and <= max_aggs_supported in the hwrm_vnic_qcaps response
21839          * to enable TPA v2.
21840          */
21841         uint16_t        max_aggs;
21842         /* 1 aggregation */
21843         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1   UINT32_C(0x0)
21844         /* 2 aggregations */
21845         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2   UINT32_C(0x1)
21846         /* 4 aggregations */
21847         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4   UINT32_C(0x2)
21848         /* 8 aggregations */
21849         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8   UINT32_C(0x3)
21850         /* 16 aggregations */
21851         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16  UINT32_C(0x4)
21852         /* Any aggregation size larger than this is not valid */
21853         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
21854         #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_LAST \
21855                 HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX
21856         uint8_t unused_0[2];
21857         /*
21858          * This is the maximum amount of time allowed for
21859          * an aggregation context to complete after it was initiated.
21860          */
21861         uint32_t        max_agg_timer;
21862         /*
21863          * This is the minimum amount of payload length required to
21864          * start an aggregation context. This field is deprecated and
21865          * should be set to 0.  The minimum length is set by firmware
21866          * and can be queried using hwrm_vnic_tpa_qcfg.
21867          */
21868         uint32_t        min_agg_len;
21869 } __attribute__((packed));
21870
21871 /* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
21872 struct hwrm_vnic_tpa_cfg_output {
21873         /* The specific error status for the command. */
21874         uint16_t        error_code;
21875         /* The HWRM command request type. */
21876         uint16_t        req_type;
21877         /* The sequence ID from the original command. */
21878         uint16_t        seq_id;
21879         /* The length of the response data in number of bytes. */
21880         uint16_t        resp_len;
21881         uint8_t unused_0[7];
21882         /*
21883          * This field is used in Output records to indicate that the output
21884          * is completely written to RAM.  This field should be read as '1'
21885          * to indicate that the output has been completely written.
21886          * When writing a command completion or response to an internal processor,
21887          * the order of writes has to be such that this field is written last.
21888          */
21889         uint8_t valid;
21890 } __attribute__((packed));
21891
21892 /*********************
21893  * hwrm_vnic_rss_cfg *
21894  *********************/
21895
21896
21897 /* hwrm_vnic_rss_cfg_input (size:384b/48B) */
21898 struct hwrm_vnic_rss_cfg_input {
21899         /* The HWRM command request type. */
21900         uint16_t        req_type;
21901         /*
21902          * The completion ring to send the completion event on. This should
21903          * be the NQ ID returned from the `nq_alloc` HWRM command.
21904          */
21905         uint16_t        cmpl_ring;
21906         /*
21907          * The sequence ID is used by the driver for tracking multiple
21908          * commands. This ID is treated as opaque data by the firmware and
21909          * the value is returned in the `hwrm_resp_hdr` upon completion.
21910          */
21911         uint16_t        seq_id;
21912         /*
21913          * The target ID of the command:
21914          * * 0x0-0xFFF8 - The function ID
21915          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
21916          * * 0xFFFD - Reserved for user-space HWRM interface
21917          * * 0xFFFF - HWRM
21918          */
21919         uint16_t        target_id;
21920         /*
21921          * A physical address pointer pointing to a host buffer that the
21922          * command's response data will be written. This can be either a host
21923          * physical address (HPA) or a guest physical address (GPA) and must
21924          * point to a physically contiguous block of memory.
21925          */
21926         uint64_t        resp_addr;
21927         uint32_t        hash_type;
21928         /*
21929          * When this bit is '1', the RSS hash shall be computed
21930          * over source and destination IPv4 addresses of IPv4
21931          * packets.
21932          */
21933         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
21934         /*
21935          * When this bit is '1', the RSS hash shall be computed
21936          * over source/destination IPv4 addresses and
21937          * source/destination ports of TCP/IPv4 packets.
21938          */
21939         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
21940         /*
21941          * When this bit is '1', the RSS hash shall be computed
21942          * over source/destination IPv4 addresses and
21943          * source/destination ports of UDP/IPv4 packets.
21944          */
21945         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
21946         /*
21947          * When this bit is '1', the RSS hash shall be computed
21948          * over source and destination IPv4 addresses of IPv6
21949          * packets.
21950          */
21951         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
21952         /*
21953          * When this bit is '1', the RSS hash shall be computed
21954          * over source/destination IPv6 addresses and
21955          * source/destination ports of TCP/IPv6 packets.
21956          */
21957         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
21958         /*
21959          * When this bit is '1', the RSS hash shall be computed
21960          * over source/destination IPv6 addresses and
21961          * source/destination ports of UDP/IPv6 packets.
21962          */
21963         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
21964         /* VNIC ID of VNIC associated with RSS table being configured. */
21965         uint16_t        vnic_id;
21966         /*
21967          * Specifies which VNIC ring table pair to configure.
21968          * Valid values range from 0 to 7.
21969          */
21970         uint8_t ring_table_pair_index;
21971         /* Flags to specify different RSS hash modes. */
21972         uint8_t hash_mode_flags;
21973         /*
21974          * When this bit is '1', it indicates using current RSS
21975          * hash mode setting configured in the device.
21976          */
21977         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT \
21978                 UINT32_C(0x1)
21979         /*
21980          * When this bit is '1', it indicates requesting support of
21981          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
21982          * l4.src, l4.dest} for tunnel packets. For none-tunnel
21983          * packets, the RSS hash is computed over the normal
21984          * src/dest l3 and src/dest l4 headers.
21985          */
21986         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_4 \
21987                 UINT32_C(0x2)
21988         /*
21989          * When this bit is '1', it indicates requesting support of
21990          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
21991          * tunnel packets. For none-tunnel packets, the RSS hash is
21992          * computed over the normal src/dest l3 headers.
21993          */
21994         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_INNERMOST_2 \
21995                 UINT32_C(0x4)
21996         /*
21997          * When this bit is '1', it indicates requesting support of
21998          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
21999          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
22000          * packets, the RSS hash is computed over the normal
22001          * src/dest l3 and src/dest l4 headers.
22002          */
22003         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
22004                 UINT32_C(0x8)
22005         /*
22006          * When this bit is '1', it indicates requesting support of
22007          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
22008          * tunnel packets. For none-tunnel packets, the RSS hash is
22009          * computed over the normal src/dest l3 headers.
22010          */
22011         #define HWRM_VNIC_RSS_CFG_INPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
22012                 UINT32_C(0x10)
22013         /* This is the address for rss ring group table */
22014         uint64_t        ring_grp_tbl_addr;
22015         /* This is the address for rss hash key table */
22016         uint64_t        hash_key_tbl_addr;
22017         /* Index to the rss indirection table. */
22018         uint16_t        rss_ctx_idx;
22019         uint8_t unused_1[6];
22020 } __attribute__((packed));
22021
22022 /* hwrm_vnic_rss_cfg_output (size:128b/16B) */
22023 struct hwrm_vnic_rss_cfg_output {
22024         /* The specific error status for the command. */
22025         uint16_t        error_code;
22026         /* The HWRM command request type. */
22027         uint16_t        req_type;
22028         /* The sequence ID from the original command. */
22029         uint16_t        seq_id;
22030         /* The length of the response data in number of bytes. */
22031         uint16_t        resp_len;
22032         uint8_t unused_0[7];
22033         /*
22034          * This field is used in Output records to indicate that the output
22035          * is completely written to RAM.  This field should be read as '1'
22036          * to indicate that the output has been completely written.
22037          * When writing a command completion or response to an internal processor,
22038          * the order of writes has to be such that this field is written last.
22039          */
22040         uint8_t valid;
22041 } __attribute__((packed));
22042
22043 /**********************
22044  * hwrm_vnic_rss_qcfg *
22045  **********************/
22046
22047
22048 /* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
22049 struct hwrm_vnic_rss_qcfg_input {
22050         /* The HWRM command request type. */
22051         uint16_t        req_type;
22052         /*
22053          * The completion ring to send the completion event on. This should
22054          * be the NQ ID returned from the `nq_alloc` HWRM command.
22055          */
22056         uint16_t        cmpl_ring;
22057         /*
22058          * The sequence ID is used by the driver for tracking multiple
22059          * commands. This ID is treated as opaque data by the firmware and
22060          * the value is returned in the `hwrm_resp_hdr` upon completion.
22061          */
22062         uint16_t        seq_id;
22063         /*
22064          * The target ID of the command:
22065          * * 0x0-0xFFF8 - The function ID
22066          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22067          * * 0xFFFD - Reserved for user-space HWRM interface
22068          * * 0xFFFF - HWRM
22069          */
22070         uint16_t        target_id;
22071         /*
22072          * A physical address pointer pointing to a host buffer that the
22073          * command's response data will be written. This can be either a host
22074          * physical address (HPA) or a guest physical address (GPA) and must
22075          * point to a physically contiguous block of memory.
22076          */
22077         uint64_t        resp_addr;
22078         /* Index to the rss indirection table. */
22079         uint16_t        rss_ctx_idx;
22080         uint8_t unused_0[6];
22081 } __attribute__((packed));
22082
22083 /* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
22084 struct hwrm_vnic_rss_qcfg_output {
22085         /* The specific error status for the command. */
22086         uint16_t        error_code;
22087         /* The HWRM command request type. */
22088         uint16_t        req_type;
22089         /* The sequence ID from the original command. */
22090         uint16_t        seq_id;
22091         /* The length of the response data in number of bytes. */
22092         uint16_t        resp_len;
22093         uint32_t        hash_type;
22094         /*
22095          * When this bit is '1', the RSS hash shall be computed
22096          * over source and destination IPv4 addresses of IPv4
22097          * packets.
22098          */
22099         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV4         UINT32_C(0x1)
22100         /*
22101          * When this bit is '1', the RSS hash shall be computed
22102          * over source/destination IPv4 addresses and
22103          * source/destination ports of TCP/IPv4 packets.
22104          */
22105         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV4     UINT32_C(0x2)
22106         /*
22107          * When this bit is '1', the RSS hash shall be computed
22108          * over source/destination IPv4 addresses and
22109          * source/destination ports of UDP/IPv4 packets.
22110          */
22111         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV4     UINT32_C(0x4)
22112         /*
22113          * When this bit is '1', the RSS hash shall be computed
22114          * over source and destination IPv4 addresses of IPv6
22115          * packets.
22116          */
22117         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_IPV6         UINT32_C(0x8)
22118         /*
22119          * When this bit is '1', the RSS hash shall be computed
22120          * over source/destination IPv6 addresses and
22121          * source/destination ports of TCP/IPv6 packets.
22122          */
22123         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_TCP_IPV6     UINT32_C(0x10)
22124         /*
22125          * When this bit is '1', the RSS hash shall be computed
22126          * over source/destination IPv6 addresses and
22127          * source/destination ports of UDP/IPv6 packets.
22128          */
22129         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_TYPE_UDP_IPV6     UINT32_C(0x20)
22130         uint8_t unused_0[4];
22131         /* This is the value of rss hash key */
22132         uint32_t        hash_key[10];
22133         /* Flags to specify different RSS hash modes. */
22134         uint8_t hash_mode_flags;
22135         /*
22136          * When this bit is '1', it indicates using current RSS
22137          * hash mode setting configured in the device.
22138          */
22139         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_DEFAULT \
22140                 UINT32_C(0x1)
22141         /*
22142          * When this bit is '1', it indicates requesting support of
22143          * RSS hashing over innermost 4 tuples {l3.src, l3.dest,
22144          * l4.src, l4.dest} for tunnel packets. For none-tunnel
22145          * packets, the RSS hash is computed over the normal
22146          * src/dest l3 and src/dest l4 headers.
22147          */
22148         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_4 \
22149                 UINT32_C(0x2)
22150         /*
22151          * When this bit is '1', it indicates requesting support of
22152          * RSS hashing over innermost 2 tuples {l3.src, l3.dest} for
22153          * tunnel packets. For none-tunnel packets, the RSS hash is
22154          * computed over the normal src/dest l3 headers.
22155          */
22156         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_INNERMOST_2 \
22157                 UINT32_C(0x4)
22158         /*
22159          * When this bit is '1', it indicates requesting support of
22160          * RSS hashing over outermost 4 tuples {t_l3.src, t_l3.dest,
22161          * t_l4.src, t_l4.dest} for tunnel packets. For none-tunnel
22162          * packets, the RSS hash is computed over the normal
22163          * src/dest l3 and src/dest l4 headers.
22164          */
22165         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_4 \
22166                 UINT32_C(0x8)
22167         /*
22168          * When this bit is '1', it indicates requesting support of
22169          * RSS hashing over outermost 2 tuples {t_l3.src, t_l3.dest} for
22170          * tunnel packets. For none-tunnel packets, the RSS hash is
22171          * computed over the normal src/dest l3 headers.
22172          */
22173         #define HWRM_VNIC_RSS_QCFG_OUTPUT_HASH_MODE_FLAGS_OUTERMOST_2 \
22174                 UINT32_C(0x10)
22175         uint8_t unused_1[6];
22176         /*
22177          * This field is used in Output records to indicate that the output
22178          * is completely written to RAM.  This field should be read as '1'
22179          * to indicate that the output has been completely written.
22180          * When writing a command completion or response to an internal processor,
22181          * the order of writes has to be such that this field is written last.
22182          */
22183         uint8_t valid;
22184 } __attribute__((packed));
22185
22186 /**************************
22187  * hwrm_vnic_plcmodes_cfg *
22188  **************************/
22189
22190
22191 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
22192 struct hwrm_vnic_plcmodes_cfg_input {
22193         /* The HWRM command request type. */
22194         uint16_t        req_type;
22195         /*
22196          * The completion ring to send the completion event on. This should
22197          * be the NQ ID returned from the `nq_alloc` HWRM command.
22198          */
22199         uint16_t        cmpl_ring;
22200         /*
22201          * The sequence ID is used by the driver for tracking multiple
22202          * commands. This ID is treated as opaque data by the firmware and
22203          * the value is returned in the `hwrm_resp_hdr` upon completion.
22204          */
22205         uint16_t        seq_id;
22206         /*
22207          * The target ID of the command:
22208          * * 0x0-0xFFF8 - The function ID
22209          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22210          * * 0xFFFD - Reserved for user-space HWRM interface
22211          * * 0xFFFF - HWRM
22212          */
22213         uint16_t        target_id;
22214         /*
22215          * A physical address pointer pointing to a host buffer that the
22216          * command's response data will be written. This can be either a host
22217          * physical address (HPA) or a guest physical address (GPA) and must
22218          * point to a physically contiguous block of memory.
22219          */
22220         uint64_t        resp_addr;
22221         uint32_t        flags;
22222         /*
22223          * When this bit is '1', the VNIC shall be configured to
22224          * use regular placement algorithm.
22225          * By default, the regular placement algorithm shall be
22226          * enabled on the VNIC.
22227          */
22228         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
22229                 UINT32_C(0x1)
22230         /*
22231          * When this bit is '1', the VNIC shall be configured
22232          * use the jumbo placement algorithm.
22233          */
22234         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
22235                 UINT32_C(0x2)
22236         /*
22237          * When this bit is '1', the VNIC shall be configured
22238          * to enable Header-Data split for IPv4 packets according
22239          * to the following rules:
22240          * # If the packet is identified as TCP/IPv4, then the
22241          * packet is split at the beginning of the TCP payload.
22242          * # If the packet is identified as UDP/IPv4, then the
22243          * packet is split at the beginning of UDP payload.
22244          * # If the packet is identified as non-TCP and non-UDP
22245          * IPv4 packet, then the packet is split at the beginning
22246          * of the upper layer protocol header carried in the IPv4
22247          * packet.
22248          */
22249         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 \
22250                 UINT32_C(0x4)
22251         /*
22252          * When this bit is '1', the VNIC shall be configured
22253          * to enable Header-Data split for IPv6 packets according
22254          * to the following rules:
22255          * # If the packet is identified as TCP/IPv6, then the
22256          * packet is split at the beginning of the TCP payload.
22257          * # If the packet is identified as UDP/IPv6, then the
22258          * packet is split at the beginning of UDP payload.
22259          * # If the packet is identified as non-TCP and non-UDP
22260          * IPv6 packet, then the packet is split at the beginning
22261          * of the upper layer protocol header carried in the IPv6
22262          * packet.
22263          */
22264         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 \
22265                 UINT32_C(0x8)
22266         /*
22267          * When this bit is '1', the VNIC shall be configured
22268          * to enable Header-Data split for FCoE packets at the
22269          * beginning of FC payload.
22270          */
22271         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE \
22272                 UINT32_C(0x10)
22273         /*
22274          * When this bit is '1', the VNIC shall be configured
22275          * to enable Header-Data split for RoCE packets at the
22276          * beginning of RoCE payload (after BTH/GRH headers).
22277          */
22278         #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE \
22279                 UINT32_C(0x20)
22280         uint32_t        enables;
22281         /*
22282          * This bit must be '1' for the jumbo_thresh_valid field to be
22283          * configured.
22284          */
22285         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
22286                 UINT32_C(0x1)
22287         /*
22288          * This bit must be '1' for the hds_offset_valid field to be
22289          * configured.
22290          */
22291         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
22292                 UINT32_C(0x2)
22293         /*
22294          * This bit must be '1' for the hds_threshold_valid field to be
22295          * configured.
22296          */
22297         #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
22298                 UINT32_C(0x4)
22299         /* Logical vnic ID */
22300         uint32_t        vnic_id;
22301         /*
22302          * When jumbo placement algorithm is enabled, this value
22303          * is used to determine the threshold for jumbo placement.
22304          * Packets with length larger than this value will be
22305          * placed according to the jumbo placement algorithm.
22306          */
22307         uint16_t        jumbo_thresh;
22308         /*
22309          * This value is used to determine the offset into
22310          * packet buffer where the split data (payload) will be
22311          * placed according to one of of HDS placement algorithm.
22312          *
22313          * The lengths of packet buffers provided for split data
22314          * shall be larger than this value.
22315          */
22316         uint16_t        hds_offset;
22317         /*
22318          * When one of the HDS placement algorithm is enabled, this
22319          * value is used to determine the threshold for HDS
22320          * placement.
22321          * Packets with length larger than this value will be
22322          * placed according to the HDS placement algorithm.
22323          * This value shall be in multiple of 4 bytes.
22324          */
22325         uint16_t        hds_threshold;
22326         uint8_t unused_0[6];
22327 } __attribute__((packed));
22328
22329 /* hwrm_vnic_plcmodes_cfg_output (size:128b/16B) */
22330 struct hwrm_vnic_plcmodes_cfg_output {
22331         /* The specific error status for the command. */
22332         uint16_t        error_code;
22333         /* The HWRM command request type. */
22334         uint16_t        req_type;
22335         /* The sequence ID from the original command. */
22336         uint16_t        seq_id;
22337         /* The length of the response data in number of bytes. */
22338         uint16_t        resp_len;
22339         uint8_t unused_0[7];
22340         /*
22341          * This field is used in Output records to indicate that the output
22342          * is completely written to RAM.  This field should be read as '1'
22343          * to indicate that the output has been completely written.
22344          * When writing a command completion or response to an internal processor,
22345          * the order of writes has to be such that this field is written last.
22346          */
22347         uint8_t valid;
22348 } __attribute__((packed));
22349
22350 /***************************
22351  * hwrm_vnic_plcmodes_qcfg *
22352  ***************************/
22353
22354
22355 /* hwrm_vnic_plcmodes_qcfg_input (size:192b/24B) */
22356 struct hwrm_vnic_plcmodes_qcfg_input {
22357         /* The HWRM command request type. */
22358         uint16_t        req_type;
22359         /*
22360          * The completion ring to send the completion event on. This should
22361          * be the NQ ID returned from the `nq_alloc` HWRM command.
22362          */
22363         uint16_t        cmpl_ring;
22364         /*
22365          * The sequence ID is used by the driver for tracking multiple
22366          * commands. This ID is treated as opaque data by the firmware and
22367          * the value is returned in the `hwrm_resp_hdr` upon completion.
22368          */
22369         uint16_t        seq_id;
22370         /*
22371          * The target ID of the command:
22372          * * 0x0-0xFFF8 - The function ID
22373          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22374          * * 0xFFFD - Reserved for user-space HWRM interface
22375          * * 0xFFFF - HWRM
22376          */
22377         uint16_t        target_id;
22378         /*
22379          * A physical address pointer pointing to a host buffer that the
22380          * command's response data will be written. This can be either a host
22381          * physical address (HPA) or a guest physical address (GPA) and must
22382          * point to a physically contiguous block of memory.
22383          */
22384         uint64_t        resp_addr;
22385         /* Logical vnic ID */
22386         uint32_t        vnic_id;
22387         uint8_t unused_0[4];
22388 } __attribute__((packed));
22389
22390 /* hwrm_vnic_plcmodes_qcfg_output (size:192b/24B) */
22391 struct hwrm_vnic_plcmodes_qcfg_output {
22392         /* The specific error status for the command. */
22393         uint16_t        error_code;
22394         /* The HWRM command request type. */
22395         uint16_t        req_type;
22396         /* The sequence ID from the original command. */
22397         uint16_t        seq_id;
22398         /* The length of the response data in number of bytes. */
22399         uint16_t        resp_len;
22400         uint32_t        flags;
22401         /*
22402          * When this bit is '1', the VNIC is configured to
22403          * use regular placement algorithm.
22404          */
22405         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
22406                 UINT32_C(0x1)
22407         /*
22408          * When this bit is '1', the VNIC is configured to
22409          * use the jumbo placement algorithm.
22410          */
22411         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
22412                 UINT32_C(0x2)
22413         /*
22414          * When this bit is '1', the VNIC is configured
22415          * to enable Header-Data split for IPv4 packets.
22416          */
22417         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 \
22418                 UINT32_C(0x4)
22419         /*
22420          * When this bit is '1', the VNIC is configured
22421          * to enable Header-Data split for IPv6 packets.
22422          */
22423         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 \
22424                 UINT32_C(0x8)
22425         /*
22426          * When this bit is '1', the VNIC is configured
22427          * to enable Header-Data split for FCoE packets.
22428          */
22429         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE \
22430                 UINT32_C(0x10)
22431         /*
22432          * When this bit is '1', the VNIC is configured
22433          * to enable Header-Data split for RoCE packets.
22434          */
22435         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE \
22436                 UINT32_C(0x20)
22437         /*
22438          * When this bit is '1', the VNIC is configured
22439          * to be the default VNIC of the requesting function.
22440          */
22441         #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC \
22442                 UINT32_C(0x40)
22443         /*
22444          * When jumbo placement algorithm is enabled, this value
22445          * is used to determine the threshold for jumbo placement.
22446          * Packets with length larger than this value will be
22447          * placed according to the jumbo placement algorithm.
22448          */
22449         uint16_t        jumbo_thresh;
22450         /*
22451          * This value is used to determine the offset into
22452          * packet buffer where the split data (payload) will be
22453          * placed according to one of of HDS placement algorithm.
22454          *
22455          * The lengths of packet buffers provided for split data
22456          * shall be larger than this value.
22457          */
22458         uint16_t        hds_offset;
22459         /*
22460          * When one of the HDS placement algorithm is enabled, this
22461          * value is used to determine the threshold for HDS
22462          * placement.
22463          * Packets with length larger than this value will be
22464          * placed according to the HDS placement algorithm.
22465          * This value shall be in multiple of 4 bytes.
22466          */
22467         uint16_t        hds_threshold;
22468         uint8_t unused_0[5];
22469         /*
22470          * This field is used in Output records to indicate that the output
22471          * is completely written to RAM.  This field should be read as '1'
22472          * to indicate that the output has been completely written.
22473          * When writing a command completion or response to an internal processor,
22474          * the order of writes has to be such that this field is written last.
22475          */
22476         uint8_t valid;
22477 } __attribute__((packed));
22478
22479 /**********************************
22480  * hwrm_vnic_rss_cos_lb_ctx_alloc *
22481  **********************************/
22482
22483
22484 /* hwrm_vnic_rss_cos_lb_ctx_alloc_input (size:128b/16B) */
22485 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
22486         /* The HWRM command request type. */
22487         uint16_t        req_type;
22488         /*
22489          * The completion ring to send the completion event on. This should
22490          * be the NQ ID returned from the `nq_alloc` HWRM command.
22491          */
22492         uint16_t        cmpl_ring;
22493         /*
22494          * The sequence ID is used by the driver for tracking multiple
22495          * commands. This ID is treated as opaque data by the firmware and
22496          * the value is returned in the `hwrm_resp_hdr` upon completion.
22497          */
22498         uint16_t        seq_id;
22499         /*
22500          * The target ID of the command:
22501          * * 0x0-0xFFF8 - The function ID
22502          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22503          * * 0xFFFD - Reserved for user-space HWRM interface
22504          * * 0xFFFF - HWRM
22505          */
22506         uint16_t        target_id;
22507         /*
22508          * A physical address pointer pointing to a host buffer that the
22509          * command's response data will be written. This can be either a host
22510          * physical address (HPA) or a guest physical address (GPA) and must
22511          * point to a physically contiguous block of memory.
22512          */
22513         uint64_t        resp_addr;
22514 } __attribute__((packed));
22515
22516 /* hwrm_vnic_rss_cos_lb_ctx_alloc_output (size:128b/16B) */
22517 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
22518         /* The specific error status for the command. */
22519         uint16_t        error_code;
22520         /* The HWRM command request type. */
22521         uint16_t        req_type;
22522         /* The sequence ID from the original command. */
22523         uint16_t        seq_id;
22524         /* The length of the response data in number of bytes. */
22525         uint16_t        resp_len;
22526         /* rss_cos_lb_ctx_id is 16 b */
22527         uint16_t        rss_cos_lb_ctx_id;
22528         uint8_t unused_0[5];
22529         /*
22530          * This field is used in Output records to indicate that the output
22531          * is completely written to RAM.  This field should be read as '1'
22532          * to indicate that the output has been completely written.
22533          * When writing a command completion or response to an internal processor,
22534          * the order of writes has to be such that this field is written last.
22535          */
22536         uint8_t valid;
22537 } __attribute__((packed));
22538
22539 /*********************************
22540  * hwrm_vnic_rss_cos_lb_ctx_free *
22541  *********************************/
22542
22543
22544 /* hwrm_vnic_rss_cos_lb_ctx_free_input (size:192b/24B) */
22545 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
22546         /* The HWRM command request type. */
22547         uint16_t        req_type;
22548         /*
22549          * The completion ring to send the completion event on. This should
22550          * be the NQ ID returned from the `nq_alloc` HWRM command.
22551          */
22552         uint16_t        cmpl_ring;
22553         /*
22554          * The sequence ID is used by the driver for tracking multiple
22555          * commands. This ID is treated as opaque data by the firmware and
22556          * the value is returned in the `hwrm_resp_hdr` upon completion.
22557          */
22558         uint16_t        seq_id;
22559         /*
22560          * The target ID of the command:
22561          * * 0x0-0xFFF8 - The function ID
22562          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22563          * * 0xFFFD - Reserved for user-space HWRM interface
22564          * * 0xFFFF - HWRM
22565          */
22566         uint16_t        target_id;
22567         /*
22568          * A physical address pointer pointing to a host buffer that the
22569          * command's response data will be written. This can be either a host
22570          * physical address (HPA) or a guest physical address (GPA) and must
22571          * point to a physically contiguous block of memory.
22572          */
22573         uint64_t        resp_addr;
22574         /* rss_cos_lb_ctx_id is 16 b */
22575         uint16_t        rss_cos_lb_ctx_id;
22576         uint8_t unused_0[6];
22577 } __attribute__((packed));
22578
22579 /* hwrm_vnic_rss_cos_lb_ctx_free_output (size:128b/16B) */
22580 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
22581         /* The specific error status for the command. */
22582         uint16_t        error_code;
22583         /* The HWRM command request type. */
22584         uint16_t        req_type;
22585         /* The sequence ID from the original command. */
22586         uint16_t        seq_id;
22587         /* The length of the response data in number of bytes. */
22588         uint16_t        resp_len;
22589         uint8_t unused_0[7];
22590         /*
22591          * This field is used in Output records to indicate that the output
22592          * is completely written to RAM.  This field should be read as '1'
22593          * to indicate that the output has been completely written.
22594          * When writing a command completion or response to an internal processor,
22595          * the order of writes has to be such that this field is written last.
22596          */
22597         uint8_t valid;
22598 } __attribute__((packed));
22599
22600 /*******************
22601  * hwrm_ring_alloc *
22602  *******************/
22603
22604
22605 /* hwrm_ring_alloc_input (size:704b/88B) */
22606 struct hwrm_ring_alloc_input {
22607         /* The HWRM command request type. */
22608         uint16_t        req_type;
22609         /*
22610          * The completion ring to send the completion event on. This should
22611          * be the NQ ID returned from the `nq_alloc` HWRM command.
22612          */
22613         uint16_t        cmpl_ring;
22614         /*
22615          * The sequence ID is used by the driver for tracking multiple
22616          * commands. This ID is treated as opaque data by the firmware and
22617          * the value is returned in the `hwrm_resp_hdr` upon completion.
22618          */
22619         uint16_t        seq_id;
22620         /*
22621          * The target ID of the command:
22622          * * 0x0-0xFFF8 - The function ID
22623          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22624          * * 0xFFFD - Reserved for user-space HWRM interface
22625          * * 0xFFFF - HWRM
22626          */
22627         uint16_t        target_id;
22628         /*
22629          * A physical address pointer pointing to a host buffer that the
22630          * command's response data will be written. This can be either a host
22631          * physical address (HPA) or a guest physical address (GPA) and must
22632          * point to a physically contiguous block of memory.
22633          */
22634         uint64_t        resp_addr;
22635         uint32_t        enables;
22636         /*
22637          * This bit must be '1' for the ring_arb_cfg field to be
22638          * configured.
22639          */
22640         #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG \
22641                 UINT32_C(0x2)
22642         /*
22643          * This bit must be '1' for the stat_ctx_id_valid field to be
22644          * configured.
22645          */
22646         #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID \
22647                 UINT32_C(0x8)
22648         /*
22649          * This bit must be '1' for the max_bw_valid field to be
22650          * configured.
22651          */
22652         #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID \
22653                 UINT32_C(0x20)
22654         /*
22655          * This bit must be '1' for the rx_ring_id field to be
22656          * configured.
22657          */
22658         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_RING_ID_VALID \
22659                 UINT32_C(0x40)
22660         /*
22661          * This bit must be '1' for the nq_ring_id field to be
22662          * configured.
22663          */
22664         #define HWRM_RING_ALLOC_INPUT_ENABLES_NQ_RING_ID_VALID \
22665                 UINT32_C(0x80)
22666         /*
22667          * This bit must be '1' for the rx_buf_size field to be
22668          * configured.
22669          */
22670         #define HWRM_RING_ALLOC_INPUT_ENABLES_RX_BUF_SIZE_VALID \
22671                 UINT32_C(0x100)
22672         /* Ring Type. */
22673         uint8_t ring_type;
22674         /* L2 Completion Ring (CR) */
22675         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
22676         /* TX Ring (TR) */
22677         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX        UINT32_C(0x1)
22678         /* RX Ring (RR) */
22679         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX        UINT32_C(0x2)
22680         /* RoCE Notification Completion Ring (ROCE_CR) */
22681         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
22682         /* RX Aggregation Ring */
22683         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
22684         /* Notification Queue */
22685         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
22686         #define HWRM_RING_ALLOC_INPUT_RING_TYPE_LAST \
22687                 HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ
22688         uint8_t unused_0;
22689         /* Ring allocation flags. */
22690         uint16_t        flags;
22691         /*
22692          * For Rx rings, the incoming packet data can be placed at either
22693          * a 0B or 2B offset from the start of the Rx packet buffer. When
22694          * '1', the received packet will be padded with 2B of zeros at the
22695          * front of the packet. Note that this flag is only used for
22696          * Rx rings and is ignored for all other rings included Rx
22697          * Aggregation rings.
22698          */
22699         #define HWRM_RING_ALLOC_INPUT_FLAGS_RX_SOP_PAD     UINT32_C(0x1)
22700         /*
22701          * This value is a pointer to the page table for the
22702          * Ring.
22703          */
22704         uint64_t        page_tbl_addr;
22705         /* First Byte Offset of the first entry in the first page. */
22706         uint32_t        fbo;
22707         /*
22708          * Actual page size in 2^page_size. The supported range is increments
22709          * in powers of 2 from 16 bytes to 1GB.
22710          * - 4 = 16 B
22711          *     Page size is 16 B.
22712          * - 12 = 4 KB
22713          *     Page size is 4 KB.
22714          * - 13 = 8 KB
22715          *     Page size is 8 KB.
22716          * - 16 = 64 KB
22717          *     Page size is 64 KB.
22718          * - 21 = 2 MB
22719          *     Page size is 2 MB.
22720          * - 22 = 4 MB
22721          *     Page size is 4 MB.
22722          * - 30 = 1 GB
22723          *     Page size is 1 GB.
22724          */
22725         uint8_t page_size;
22726         /*
22727          * This value indicates the depth of page table.
22728          * For this version of the specification, value other than 0 or
22729          * 1 shall be considered as an invalid value.
22730          * When the page_tbl_depth = 0, then it is treated as a
22731          * special case with the following.
22732          * 1. FBO and page size fields are not valid.
22733          * 2. page_tbl_addr is the physical address of the first
22734          *    element of the ring.
22735          */
22736         uint8_t page_tbl_depth;
22737         uint8_t unused_1[2];
22738         /*
22739          * Number of 16B units in the ring.  Minimum size for
22740          * a ring is 16 16B entries.
22741          */
22742         uint32_t        length;
22743         /*
22744          * Logical ring number for the ring to be allocated.
22745          * This value determines the position in the doorbell
22746          * area where the update to the ring will be made.
22747          *
22748          * For completion rings, this value is also the MSI-X
22749          * vector number for the function the completion ring is
22750          * associated with.
22751          */
22752         uint16_t        logical_id;
22753         /*
22754          * This field is used only when ring_type is a TX ring.
22755          * This value indicates what completion ring the TX ring
22756          * is associated with.
22757          */
22758         uint16_t        cmpl_ring_id;
22759         /*
22760          * This field is used only when ring_type is a TX ring.
22761          * This value indicates what CoS queue the TX ring
22762          * is associated with.
22763          */
22764         uint16_t        queue_id;
22765         /*
22766          * When allocating a Rx ring or Rx aggregation ring, this field
22767          * specifies the size of the buffer descriptors posted to the ring.
22768          */
22769         uint16_t        rx_buf_size;
22770         /*
22771          * When allocating an Rx aggregation ring, this field
22772          * specifies the associated Rx ring ID.
22773          */
22774         uint16_t        rx_ring_id;
22775         /*
22776          * When allocating a completion ring, this field
22777          * specifies the associated NQ ring ID.
22778          */
22779         uint16_t        nq_ring_id;
22780         /*
22781          * This field is used only when ring_type is a TX ring.
22782          * This field is used to configure arbitration related
22783          * parameters for a TX ring.
22784          */
22785         uint16_t        ring_arb_cfg;
22786         /* Arbitration policy used for the ring. */
22787         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK \
22788                 UINT32_C(0xf)
22789         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT       0
22790         /*
22791          * Use strict priority for the TX ring.
22792          * Priority value is specified in arb_policy_param
22793          */
22794         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
22795                 UINT32_C(0x1)
22796         /*
22797          * Use weighted fair queue arbitration for the TX ring.
22798          * Weight is specified in arb_policy_param
22799          */
22800         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
22801                 UINT32_C(0x2)
22802         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
22803                 HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
22804         /* Reserved field. */
22805         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK \
22806                 UINT32_C(0xf0)
22807         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT             4
22808         /*
22809          * Arbitration policy specific parameter.
22810          * # For strict priority arbitration policy, this field
22811          * represents a priority value. If set to 0, then the priority
22812          * is not specified and the HWRM is allowed to select
22813          * any priority for this TX ring.
22814          * # For weighted fair queue arbitration policy, this field
22815          * represents a weight value. If set to 0, then the weight
22816          * is not specified and the HWRM is allowed to select
22817          * any weight for this TX ring.
22818          */
22819         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
22820                 UINT32_C(0xff00)
22821         #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
22822         uint16_t        unused_3;
22823         /*
22824          * This field is reserved for the future use.
22825          * It shall be set to 0.
22826          */
22827         uint32_t        reserved3;
22828         /*
22829          * This field is used only when ring_type is a TX ring.
22830          * This input indicates what statistics context this ring
22831          * should be associated with.
22832          */
22833         uint32_t        stat_ctx_id;
22834         /*
22835          * This field is reserved for the future use.
22836          * It shall be set to 0.
22837          */
22838         uint32_t        reserved4;
22839         /*
22840          * This field is used only when ring_type is a TX ring
22841          * to specify maximum BW allocated to the TX ring.
22842          * The HWRM will translate this value into byte counter and
22843          * time interval used for this ring inside the device.
22844          */
22845         uint32_t        max_bw;
22846         /* The bandwidth value. */
22847         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK \
22848                 UINT32_C(0xfffffff)
22849         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT              0
22850         /* The granularity of the value (bits or bytes). */
22851         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE \
22852                 UINT32_C(0x10000000)
22853         /* Value is in bits. */
22854         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS \
22855                 (UINT32_C(0x0) << 28)
22856         /* Value is in bytes. */
22857         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES \
22858                 (UINT32_C(0x1) << 28)
22859         #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
22860                 HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
22861         /* bw_value_unit is 3 b */
22862         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
22863                 UINT32_C(0xe0000000)
22864         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT         29
22865         /* Value is in Mb or MB (base 10). */
22866         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
22867                 (UINT32_C(0x0) << 29)
22868         /* Value is in Kb or KB (base 10). */
22869         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
22870                 (UINT32_C(0x2) << 29)
22871         /* Value is in bits or bytes. */
22872         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
22873                 (UINT32_C(0x4) << 29)
22874         /* Value is in Gb or GB (base 10). */
22875         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
22876                 (UINT32_C(0x6) << 29)
22877         /* Value is in 1/100th of a percentage of total bandwidth. */
22878         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
22879                 (UINT32_C(0x1) << 29)
22880         /* Invalid unit */
22881         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
22882                 (UINT32_C(0x7) << 29)
22883         #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
22884                 HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
22885         /*
22886          * This field is used only when ring_type is a Completion ring.
22887          * This value indicates what interrupt mode should be used
22888          * on this completion ring.
22889          * Note: In the legacy interrupt mode, no more than 16
22890          * completion rings are allowed.
22891          */
22892         uint8_t int_mode;
22893         /* Legacy INTA */
22894         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
22895         /* Reserved */
22896         #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD   UINT32_C(0x1)
22897         /* MSI-X */
22898         #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX   UINT32_C(0x2)
22899         /* No Interrupt - Polled mode */
22900         #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL   UINT32_C(0x3)
22901         #define HWRM_RING_ALLOC_INPUT_INT_MODE_LAST \
22902                 HWRM_RING_ALLOC_INPUT_INT_MODE_POLL
22903         uint8_t unused_4[3];
22904         /*
22905          * The cq_handle is specified when allocating a completion ring. For
22906          * devices that support NQs, this cq_handle will be included in the
22907          * NQE to specify which CQ should be read to retrieve the completion
22908          * record.
22909          */
22910         uint64_t        cq_handle;
22911 } __attribute__((packed));
22912
22913 /* hwrm_ring_alloc_output (size:128b/16B) */
22914 struct hwrm_ring_alloc_output {
22915         /* The specific error status for the command. */
22916         uint16_t        error_code;
22917         /* The HWRM command request type. */
22918         uint16_t        req_type;
22919         /* The sequence ID from the original command. */
22920         uint16_t        seq_id;
22921         /* The length of the response data in number of bytes. */
22922         uint16_t        resp_len;
22923         /*
22924          * Physical number of ring allocated.
22925          * This value shall be unique for a ring type.
22926          */
22927         uint16_t        ring_id;
22928         /* Logical number of ring allocated. */
22929         uint16_t        logical_ring_id;
22930         uint8_t unused_0[3];
22931         /*
22932          * This field is used in Output records to indicate that the output
22933          * is completely written to RAM.  This field should be read as '1'
22934          * to indicate that the output has been completely written.
22935          * When writing a command completion or response to an internal processor,
22936          * the order of writes has to be such that this field is written last.
22937          */
22938         uint8_t valid;
22939 } __attribute__((packed));
22940
22941 /******************
22942  * hwrm_ring_free *
22943  ******************/
22944
22945
22946 /* hwrm_ring_free_input (size:192b/24B) */
22947 struct hwrm_ring_free_input {
22948         /* The HWRM command request type. */
22949         uint16_t        req_type;
22950         /*
22951          * The completion ring to send the completion event on. This should
22952          * be the NQ ID returned from the `nq_alloc` HWRM command.
22953          */
22954         uint16_t        cmpl_ring;
22955         /*
22956          * The sequence ID is used by the driver for tracking multiple
22957          * commands. This ID is treated as opaque data by the firmware and
22958          * the value is returned in the `hwrm_resp_hdr` upon completion.
22959          */
22960         uint16_t        seq_id;
22961         /*
22962          * The target ID of the command:
22963          * * 0x0-0xFFF8 - The function ID
22964          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
22965          * * 0xFFFD - Reserved for user-space HWRM interface
22966          * * 0xFFFF - HWRM
22967          */
22968         uint16_t        target_id;
22969         /*
22970          * A physical address pointer pointing to a host buffer that the
22971          * command's response data will be written. This can be either a host
22972          * physical address (HPA) or a guest physical address (GPA) and must
22973          * point to a physically contiguous block of memory.
22974          */
22975         uint64_t        resp_addr;
22976         /* Ring Type. */
22977         uint8_t ring_type;
22978         /* L2 Completion Ring (CR) */
22979         #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
22980         /* TX Ring (TR) */
22981         #define HWRM_RING_FREE_INPUT_RING_TYPE_TX        UINT32_C(0x1)
22982         /* RX Ring (RR) */
22983         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX        UINT32_C(0x2)
22984         /* RoCE Notification Completion Ring (ROCE_CR) */
22985         #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
22986         /* RX Aggregation Ring */
22987         #define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG    UINT32_C(0x4)
22988         /* Notification Queue */
22989         #define HWRM_RING_FREE_INPUT_RING_TYPE_NQ        UINT32_C(0x5)
22990         #define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \
22991                 HWRM_RING_FREE_INPUT_RING_TYPE_NQ
22992         uint8_t unused_0;
22993         /* Physical number of ring allocated. */
22994         uint16_t        ring_id;
22995         uint8_t unused_1[4];
22996 } __attribute__((packed));
22997
22998 /* hwrm_ring_free_output (size:128b/16B) */
22999 struct hwrm_ring_free_output {
23000         /* The specific error status for the command. */
23001         uint16_t        error_code;
23002         /* The HWRM command request type. */
23003         uint16_t        req_type;
23004         /* The sequence ID from the original command. */
23005         uint16_t        seq_id;
23006         /* The length of the response data in number of bytes. */
23007         uint16_t        resp_len;
23008         uint8_t unused_0[7];
23009         /*
23010          * This field is used in Output records to indicate that the output
23011          * is completely written to RAM.  This field should be read as '1'
23012          * to indicate that the output has been completely written.
23013          * When writing a command completion or response to an internal processor,
23014          * the order of writes has to be such that this field is written last.
23015          */
23016         uint8_t valid;
23017 } __attribute__((packed));
23018
23019 /*******************
23020  * hwrm_ring_reset *
23021  *******************/
23022
23023
23024 /* hwrm_ring_reset_input (size:192b/24B) */
23025 struct hwrm_ring_reset_input {
23026         /* The HWRM command request type. */
23027         uint16_t        req_type;
23028         /*
23029          * The completion ring to send the completion event on. This should
23030          * be the NQ ID returned from the `nq_alloc` HWRM command.
23031          */
23032         uint16_t        cmpl_ring;
23033         /*
23034          * The sequence ID is used by the driver for tracking multiple
23035          * commands. This ID is treated as opaque data by the firmware and
23036          * the value is returned in the `hwrm_resp_hdr` upon completion.
23037          */
23038         uint16_t        seq_id;
23039         /*
23040          * The target ID of the command:
23041          * * 0x0-0xFFF8 - The function ID
23042          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23043          * * 0xFFFD - Reserved for user-space HWRM interface
23044          * * 0xFFFF - HWRM
23045          */
23046         uint16_t        target_id;
23047         /*
23048          * A physical address pointer pointing to a host buffer that the
23049          * command's response data will be written. This can be either a host
23050          * physical address (HPA) or a guest physical address (GPA) and must
23051          * point to a physically contiguous block of memory.
23052          */
23053         uint64_t        resp_addr;
23054         /* Ring Type. */
23055         uint8_t ring_type;
23056         /* L2 Completion Ring (CR) */
23057         #define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL   UINT32_C(0x0)
23058         /* TX Ring (TR) */
23059         #define HWRM_RING_RESET_INPUT_RING_TYPE_TX        UINT32_C(0x1)
23060         /* RX Ring (RR) */
23061         #define HWRM_RING_RESET_INPUT_RING_TYPE_RX        UINT32_C(0x2)
23062         /* RoCE Notification Completion Ring (ROCE_CR) */
23063         #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
23064         #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \
23065                 HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL
23066         uint8_t unused_0;
23067         /* Physical number of the ring. */
23068         uint16_t        ring_id;
23069         uint8_t unused_1[4];
23070 } __attribute__((packed));
23071
23072 /* hwrm_ring_reset_output (size:128b/16B) */
23073 struct hwrm_ring_reset_output {
23074         /* The specific error status for the command. */
23075         uint16_t        error_code;
23076         /* The HWRM command request type. */
23077         uint16_t        req_type;
23078         /* The sequence ID from the original command. */
23079         uint16_t        seq_id;
23080         /* The length of the response data in number of bytes. */
23081         uint16_t        resp_len;
23082         uint8_t unused_0[4];
23083         /* Position of consumer index after ring reset completes. */
23084         uint8_t consumer_idx[3];
23085         /*
23086          * This field is used in Output records to indicate that the output
23087          * is completely written to RAM.  This field should be read as '1'
23088          * to indicate that the output has been completely written.
23089          * When writing a command completion or response to an internal processor,
23090          * the order of writes has to be such that this field is written last.
23091          */
23092         uint8_t valid;
23093 } __attribute__((packed));
23094
23095 /**************************
23096  * hwrm_ring_aggint_qcaps *
23097  **************************/
23098
23099
23100 /* hwrm_ring_aggint_qcaps_input (size:128b/16B) */
23101 struct hwrm_ring_aggint_qcaps_input {
23102         /* The HWRM command request type. */
23103         uint16_t        req_type;
23104         /*
23105          * The completion ring to send the completion event on. This should
23106          * be the NQ ID returned from the `nq_alloc` HWRM command.
23107          */
23108         uint16_t        cmpl_ring;
23109         /*
23110          * The sequence ID is used by the driver for tracking multiple
23111          * commands. This ID is treated as opaque data by the firmware and
23112          * the value is returned in the `hwrm_resp_hdr` upon completion.
23113          */
23114         uint16_t        seq_id;
23115         /*
23116          * The target ID of the command:
23117          * * 0x0-0xFFF8 - The function ID
23118          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23119          * * 0xFFFD - Reserved for user-space HWRM interface
23120          * * 0xFFFF - HWRM
23121          */
23122         uint16_t        target_id;
23123         /*
23124          * A physical address pointer pointing to a host buffer that the
23125          * command's response data will be written. This can be either a host
23126          * physical address (HPA) or a guest physical address (GPA) and must
23127          * point to a physically contiguous block of memory.
23128          */
23129         uint64_t        resp_addr;
23130 } __attribute__((packed));
23131
23132 /* hwrm_ring_aggint_qcaps_output (size:384b/48B) */
23133 struct hwrm_ring_aggint_qcaps_output {
23134         /* The specific error status for the command. */
23135         uint16_t        error_code;
23136         /* The HWRM command request type. */
23137         uint16_t        req_type;
23138         /* The sequence ID from the original command. */
23139         uint16_t        seq_id;
23140         /* The length of the response data in number of bytes. */
23141         uint16_t        resp_len;
23142         uint32_t        cmpl_params;
23143         /*
23144          * When this bit is set to '1', int_lat_tmr_min can be configured
23145          * on completion rings.
23146          */
23147         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MIN \
23148                 UINT32_C(0x1)
23149         /*
23150          * When this bit is set to '1', int_lat_tmr_max can be configured
23151          * on completion rings.
23152          */
23153         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_INT_LAT_TMR_MAX \
23154                 UINT32_C(0x2)
23155         /*
23156          * When this bit is set to '1', timer_reset can be enabled
23157          * on completion rings.
23158          */
23159         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_TIMER_RESET \
23160                 UINT32_C(0x4)
23161         /*
23162          * When this bit is set to '1', ring_idle can be enabled
23163          * on completion rings.
23164          */
23165         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_RING_IDLE \
23166                 UINT32_C(0x8)
23167         /*
23168          * When this bit is set to '1', num_cmpl_dma_aggr can be configured
23169          * on completion rings.
23170          */
23171         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR \
23172                 UINT32_C(0x10)
23173         /*
23174          * When this bit is set to '1', num_cmpl_dma_aggr_during_int can be configured
23175          * on completion rings.
23176          */
23177         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_DMA_AGGR_DURING_INT \
23178                 UINT32_C(0x20)
23179         /*
23180          * When this bit is set to '1', cmpl_aggr_dma_tmr can be configured
23181          * on completion rings.
23182          */
23183         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR \
23184                 UINT32_C(0x40)
23185         /*
23186          * When this bit is set to '1', cmpl_aggr_dma_tmr_during_int can be configured
23187          * on completion rings.
23188          */
23189         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_CMPL_AGGR_DMA_TMR_DURING_INT \
23190                 UINT32_C(0x80)
23191         /*
23192          * When this bit is set to '1', num_cmpl_aggr_int can be configured
23193          * on completion rings.
23194          */
23195         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_CMPL_PARAMS_NUM_CMPL_AGGR_INT \
23196                 UINT32_C(0x100)
23197         uint32_t        nq_params;
23198         /*
23199          * When this bit is set to '1', int_lat_tmr_min can be configured
23200          * on notification queues.
23201          */
23202         #define HWRM_RING_AGGINT_QCAPS_OUTPUT_NQ_PARAMS_INT_LAT_TMR_MIN \
23203                 UINT32_C(0x1)
23204         /* Minimum value for num_cmpl_dma_aggr */
23205         uint16_t        num_cmpl_dma_aggr_min;
23206         /* Maximum value for num_cmpl_dma_aggr */
23207         uint16_t        num_cmpl_dma_aggr_max;
23208         /* Minimum value for num_cmpl_dma_aggr_during_int */
23209         uint16_t        num_cmpl_dma_aggr_during_int_min;
23210         /* Maximum value for num_cmpl_dma_aggr_during_int */
23211         uint16_t        num_cmpl_dma_aggr_during_int_max;
23212         /* Minimum value for cmpl_aggr_dma_tmr */
23213         uint16_t        cmpl_aggr_dma_tmr_min;
23214         /* Maximum value for cmpl_aggr_dma_tmr */
23215         uint16_t        cmpl_aggr_dma_tmr_max;
23216         /* Minimum value for cmpl_aggr_dma_tmr_during_int */
23217         uint16_t        cmpl_aggr_dma_tmr_during_int_min;
23218         /* Maximum value for cmpl_aggr_dma_tmr_during_int */
23219         uint16_t        cmpl_aggr_dma_tmr_during_int_max;
23220         /* Minimum value for int_lat_tmr_min */
23221         uint16_t        int_lat_tmr_min_min;
23222         /* Maximum value for int_lat_tmr_min */
23223         uint16_t        int_lat_tmr_min_max;
23224         /* Minimum value for int_lat_tmr_max */
23225         uint16_t        int_lat_tmr_max_min;
23226         /* Maximum value for int_lat_tmr_max */
23227         uint16_t        int_lat_tmr_max_max;
23228         /* Minimum value for num_cmpl_aggr_int */
23229         uint16_t        num_cmpl_aggr_int_min;
23230         /* Maximum value for num_cmpl_aggr_int */
23231         uint16_t        num_cmpl_aggr_int_max;
23232         /* The units for timer parameters, in nanoseconds. */
23233         uint16_t        timer_units;
23234         uint8_t unused_0[1];
23235         /*
23236          * This field is used in Output records to indicate that the output
23237          * is completely written to RAM.  This field should be read as '1'
23238          * to indicate that the output has been completely written.
23239          * When writing a command completion or response to an internal processor,
23240          * the order of writes has to be such that this field is written last.
23241          */
23242         uint8_t valid;
23243 } __attribute__((packed));
23244
23245 /**************************************
23246  * hwrm_ring_cmpl_ring_qaggint_params *
23247  **************************************/
23248
23249
23250 /* hwrm_ring_cmpl_ring_qaggint_params_input (size:192b/24B) */
23251 struct hwrm_ring_cmpl_ring_qaggint_params_input {
23252         /* The HWRM command request type. */
23253         uint16_t        req_type;
23254         /*
23255          * The completion ring to send the completion event on. This should
23256          * be the NQ ID returned from the `nq_alloc` HWRM command.
23257          */
23258         uint16_t        cmpl_ring;
23259         /*
23260          * The sequence ID is used by the driver for tracking multiple
23261          * commands. This ID is treated as opaque data by the firmware and
23262          * the value is returned in the `hwrm_resp_hdr` upon completion.
23263          */
23264         uint16_t        seq_id;
23265         /*
23266          * The target ID of the command:
23267          * * 0x0-0xFFF8 - The function ID
23268          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23269          * * 0xFFFD - Reserved for user-space HWRM interface
23270          * * 0xFFFF - HWRM
23271          */
23272         uint16_t        target_id;
23273         /*
23274          * A physical address pointer pointing to a host buffer that the
23275          * command's response data will be written. This can be either a host
23276          * physical address (HPA) or a guest physical address (GPA) and must
23277          * point to a physically contiguous block of memory.
23278          */
23279         uint64_t        resp_addr;
23280         /* Physical number of completion ring. */
23281         uint16_t        ring_id;
23282         uint8_t unused_0[6];
23283 } __attribute__((packed));
23284
23285 /* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
23286 struct hwrm_ring_cmpl_ring_qaggint_params_output {
23287         /* The specific error status for the command. */
23288         uint16_t        error_code;
23289         /* The HWRM command request type. */
23290         uint16_t        req_type;
23291         /* The sequence ID from the original command. */
23292         uint16_t        seq_id;
23293         /* The length of the response data in number of bytes. */
23294         uint16_t        resp_len;
23295         uint16_t        flags;
23296         /*
23297          * When this bit is set to '1', interrupt max
23298          * timer is reset whenever a completion is received.
23299          */
23300         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_TIMER_RESET \
23301                 UINT32_C(0x1)
23302         /*
23303          * When this bit is set to '1', ring idle mode
23304          * aggregation will be enabled.
23305          */
23306         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_OUTPUT_FLAGS_RING_IDLE \
23307                 UINT32_C(0x2)
23308         /*
23309          * Number of completions to aggregate before DMA
23310          * during the normal mode.
23311          */
23312         uint16_t        num_cmpl_dma_aggr;
23313         /*
23314          * Number of completions to aggregate before DMA
23315          * during the interrupt mode.
23316          */
23317         uint16_t        num_cmpl_dma_aggr_during_int;
23318         /*
23319          * Timer in unit of 80-nsec used to aggregate completions before
23320          * DMA during the normal mode (not in interrupt mode).
23321          */
23322         uint16_t        cmpl_aggr_dma_tmr;
23323         /*
23324          * Timer in unit of 80-nsec used to aggregate completions before
23325          * DMA during the interrupt mode.
23326          */
23327         uint16_t        cmpl_aggr_dma_tmr_during_int;
23328         /* Minimum time (in unit of 80-nsec) between two interrupts. */
23329         uint16_t        int_lat_tmr_min;
23330         /*
23331          * Maximum wait time (in unit of 80-nsec) spent aggregating
23332          * completions before signaling the interrupt after the
23333          * interrupt is enabled.
23334          */
23335         uint16_t        int_lat_tmr_max;
23336         /*
23337          * Minimum number of completions aggregated before signaling
23338          * an interrupt.
23339          */
23340         uint16_t        num_cmpl_aggr_int;
23341         uint8_t unused_0[7];
23342         /*
23343          * This field is used in Output records to indicate that the output
23344          * is completely written to RAM.  This field should be read as '1'
23345          * to indicate that the output has been completely written.
23346          * When writing a command completion or response to an internal processor,
23347          * the order of writes has to be such that this field is written last.
23348          */
23349         uint8_t valid;
23350 } __attribute__((packed));
23351
23352 /*****************************************
23353  * hwrm_ring_cmpl_ring_cfg_aggint_params *
23354  *****************************************/
23355
23356
23357 /* hwrm_ring_cmpl_ring_cfg_aggint_params_input (size:320b/40B) */
23358 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
23359         /* The HWRM command request type. */
23360         uint16_t        req_type;
23361         /*
23362          * The completion ring to send the completion event on. This should
23363          * be the NQ ID returned from the `nq_alloc` HWRM command.
23364          */
23365         uint16_t        cmpl_ring;
23366         /*
23367          * The sequence ID is used by the driver for tracking multiple
23368          * commands. This ID is treated as opaque data by the firmware and
23369          * the value is returned in the `hwrm_resp_hdr` upon completion.
23370          */
23371         uint16_t        seq_id;
23372         /*
23373          * The target ID of the command:
23374          * * 0x0-0xFFF8 - The function ID
23375          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23376          * * 0xFFFD - Reserved for user-space HWRM interface
23377          * * 0xFFFF - HWRM
23378          */
23379         uint16_t        target_id;
23380         /*
23381          * A physical address pointer pointing to a host buffer that the
23382          * command's response data will be written. This can be either a host
23383          * physical address (HPA) or a guest physical address (GPA) and must
23384          * point to a physically contiguous block of memory.
23385          */
23386         uint64_t        resp_addr;
23387         /* Physical number of completion ring. */
23388         uint16_t        ring_id;
23389         uint16_t        flags;
23390         /*
23391          * When this bit is set to '1', interrupt latency max
23392          * timer is reset whenever a completion is received.
23393          */
23394         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET \
23395                 UINT32_C(0x1)
23396         /*
23397          * When this bit is set to '1', ring idle mode
23398          * aggregation will be enabled.
23399          */
23400         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE \
23401                 UINT32_C(0x2)
23402         /*
23403          * Set this flag to 1 when configuring parameters on a
23404          * notification queue. Set this flag to 0 when configuring
23405          * parameters on a completion queue.
23406          */
23407         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ \
23408                 UINT32_C(0x4)
23409         /*
23410          * Number of completions to aggregate before DMA
23411          * during the normal mode.
23412          */
23413         uint16_t        num_cmpl_dma_aggr;
23414         /*
23415          * Number of completions to aggregate before DMA
23416          * during the interrupt mode.
23417          */
23418         uint16_t        num_cmpl_dma_aggr_during_int;
23419         /*
23420          * Timer in unit of 80-nsec used to aggregate completions before
23421          * DMA during the normal mode (not in interrupt mode).
23422          */
23423         uint16_t        cmpl_aggr_dma_tmr;
23424         /*
23425          * Timer in unit of 80-nsec used to aggregate completions before
23426          * DMA during the interrupt mode.
23427          */
23428         uint16_t        cmpl_aggr_dma_tmr_during_int;
23429         /* Minimum time (in unit of 80-nsec) between two interrupts. */
23430         uint16_t        int_lat_tmr_min;
23431         /*
23432          * Maximum wait time (in unit of 80-nsec) spent aggregating
23433          * cmpls before signaling the interrupt after the
23434          * interrupt is enabled.
23435          */
23436         uint16_t        int_lat_tmr_max;
23437         /*
23438          * Minimum number of completions aggregated before signaling
23439          * an interrupt.
23440          */
23441         uint16_t        num_cmpl_aggr_int;
23442         /*
23443          * Bitfield that indicates which parameters are to be applied. Only
23444          * required when configuring devices with notification queues, and
23445          * used in that case to set certain parameters on completion queues
23446          * and others on notification queues.
23447          */
23448         uint16_t        enables;
23449         /*
23450          * This bit must be '1' for the num_cmpl_dma_aggr field to be
23451          * configured.
23452          */
23453         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR \
23454                 UINT32_C(0x1)
23455         /*
23456          * This bit must be '1' for the num_cmpl_dma_aggr_during_int field to be
23457          * configured.
23458          */
23459         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR_DURING_INT \
23460                 UINT32_C(0x2)
23461         /*
23462          * This bit must be '1' for the cmpl_aggr_dma_tmr field to be
23463          * configured.
23464          */
23465         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_CMPL_AGGR_DMA_TMR \
23466                 UINT32_C(0x4)
23467         /*
23468          * This bit must be '1' for the int_lat_tmr_min field to be
23469          * configured.
23470          */
23471         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MIN \
23472                 UINT32_C(0x8)
23473         /*
23474          * This bit must be '1' for the int_lat_tmr_max field to be
23475          * configured.
23476          */
23477         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_INT_LAT_TMR_MAX \
23478                 UINT32_C(0x10)
23479         /*
23480          * This bit must be '1' for the num_cmpl_aggr_int field to be
23481          * configured.
23482          */
23483         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_AGGR_INT \
23484                 UINT32_C(0x20)
23485         uint8_t unused_0[4];
23486 } __attribute__((packed));
23487
23488 /* hwrm_ring_cmpl_ring_cfg_aggint_params_output (size:128b/16B) */
23489 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
23490         /* The specific error status for the command. */
23491         uint16_t        error_code;
23492         /* The HWRM command request type. */
23493         uint16_t        req_type;
23494         /* The sequence ID from the original command. */
23495         uint16_t        seq_id;
23496         /* The length of the response data in number of bytes. */
23497         uint16_t        resp_len;
23498         uint8_t unused_0[7];
23499         /*
23500          * This field is used in Output records to indicate that the output
23501          * is completely written to RAM.  This field should be read as '1'
23502          * to indicate that the output has been completely written.
23503          * When writing a command completion or response to an internal processor,
23504          * the order of writes has to be such that this field is written last.
23505          */
23506         uint8_t valid;
23507 } __attribute__((packed));
23508
23509 /***********************
23510  * hwrm_ring_grp_alloc *
23511  ***********************/
23512
23513
23514 /* hwrm_ring_grp_alloc_input (size:192b/24B) */
23515 struct hwrm_ring_grp_alloc_input {
23516         /* The HWRM command request type. */
23517         uint16_t        req_type;
23518         /*
23519          * The completion ring to send the completion event on. This should
23520          * be the NQ ID returned from the `nq_alloc` HWRM command.
23521          */
23522         uint16_t        cmpl_ring;
23523         /*
23524          * The sequence ID is used by the driver for tracking multiple
23525          * commands. This ID is treated as opaque data by the firmware and
23526          * the value is returned in the `hwrm_resp_hdr` upon completion.
23527          */
23528         uint16_t        seq_id;
23529         /*
23530          * The target ID of the command:
23531          * * 0x0-0xFFF8 - The function ID
23532          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23533          * * 0xFFFD - Reserved for user-space HWRM interface
23534          * * 0xFFFF - HWRM
23535          */
23536         uint16_t        target_id;
23537         /*
23538          * A physical address pointer pointing to a host buffer that the
23539          * command's response data will be written. This can be either a host
23540          * physical address (HPA) or a guest physical address (GPA) and must
23541          * point to a physically contiguous block of memory.
23542          */
23543         uint64_t        resp_addr;
23544         /*
23545          * This value identifies the CR associated with the ring
23546          * group.
23547          */
23548         uint16_t        cr;
23549         /*
23550          * This value identifies the main RR associated with the ring
23551          * group.
23552          */
23553         uint16_t        rr;
23554         /*
23555          * This value identifies the aggregation RR associated with
23556          * the ring group.  If this value is 0xFF... (All Fs), then no
23557          * Aggregation ring will be set.
23558          */
23559         uint16_t        ar;
23560         /*
23561          * This value identifies the statistics context associated
23562          * with the ring group.
23563          */
23564         uint16_t        sc;
23565 } __attribute__((packed));
23566
23567 /* hwrm_ring_grp_alloc_output (size:128b/16B) */
23568 struct hwrm_ring_grp_alloc_output {
23569         /* The specific error status for the command. */
23570         uint16_t        error_code;
23571         /* The HWRM command request type. */
23572         uint16_t        req_type;
23573         /* The sequence ID from the original command. */
23574         uint16_t        seq_id;
23575         /* The length of the response data in number of bytes. */
23576         uint16_t        resp_len;
23577         /*
23578          * This is the ring group ID value.  Use this value to program
23579          * the default ring group for the VNIC or as table entries
23580          * in an RSS/COS context.
23581          */
23582         uint32_t        ring_group_id;
23583         uint8_t unused_0[3];
23584         /*
23585          * This field is used in Output records to indicate that the output
23586          * is completely written to RAM.  This field should be read as '1'
23587          * to indicate that the output has been completely written.
23588          * When writing a command completion or response to an internal processor,
23589          * the order of writes has to be such that this field is written last.
23590          */
23591         uint8_t valid;
23592 } __attribute__((packed));
23593
23594 /**********************
23595  * hwrm_ring_grp_free *
23596  **********************/
23597
23598
23599 /* hwrm_ring_grp_free_input (size:192b/24B) */
23600 struct hwrm_ring_grp_free_input {
23601         /* The HWRM command request type. */
23602         uint16_t        req_type;
23603         /*
23604          * The completion ring to send the completion event on. This should
23605          * be the NQ ID returned from the `nq_alloc` HWRM command.
23606          */
23607         uint16_t        cmpl_ring;
23608         /*
23609          * The sequence ID is used by the driver for tracking multiple
23610          * commands. This ID is treated as opaque data by the firmware and
23611          * the value is returned in the `hwrm_resp_hdr` upon completion.
23612          */
23613         uint16_t        seq_id;
23614         /*
23615          * The target ID of the command:
23616          * * 0x0-0xFFF8 - The function ID
23617          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23618          * * 0xFFFD - Reserved for user-space HWRM interface
23619          * * 0xFFFF - HWRM
23620          */
23621         uint16_t        target_id;
23622         /*
23623          * A physical address pointer pointing to a host buffer that the
23624          * command's response data will be written. This can be either a host
23625          * physical address (HPA) or a guest physical address (GPA) and must
23626          * point to a physically contiguous block of memory.
23627          */
23628         uint64_t        resp_addr;
23629         /* This is the ring group ID value. */
23630         uint32_t        ring_group_id;
23631         uint8_t unused_0[4];
23632 } __attribute__((packed));
23633
23634 /* hwrm_ring_grp_free_output (size:128b/16B) */
23635 struct hwrm_ring_grp_free_output {
23636         /* The specific error status for the command. */
23637         uint16_t        error_code;
23638         /* The HWRM command request type. */
23639         uint16_t        req_type;
23640         /* The sequence ID from the original command. */
23641         uint16_t        seq_id;
23642         /* The length of the response data in number of bytes. */
23643         uint16_t        resp_len;
23644         uint8_t unused_0[7];
23645         /*
23646          * This field is used in Output records to indicate that the output
23647          * is completely written to RAM.  This field should be read as '1'
23648          * to indicate that the output has been completely written.
23649          * When writing a command completion or response to an internal processor,
23650          * the order of writes has to be such that this field is written last.
23651          */
23652         uint8_t valid;
23653 } __attribute__((packed));
23654 /*
23655  * special reserved flow ID to identify per function default
23656  * flows for vSwitch offload
23657  */
23658 #define DEFAULT_FLOW_ID 0xFFFFFFFFUL
23659 /*
23660  * special reserved flow ID to identify per function RoCEv1
23661  * flows
23662  */
23663 #define ROCEV1_FLOW_ID 0xFFFFFFFEUL
23664 /*
23665  * special reserved flow ID to identify per function RoCEv2
23666  * flows
23667  */
23668 #define ROCEV2_FLOW_ID 0xFFFFFFFDUL
23669 /*
23670  * special reserved flow ID to identify per function RoCEv2
23671  * CNP flows
23672  */
23673 #define ROCEV2_CNP_FLOW_ID 0xFFFFFFFCUL
23674
23675 /****************************
23676  * hwrm_cfa_l2_filter_alloc *
23677  ****************************/
23678
23679
23680 /* hwrm_cfa_l2_filter_alloc_input (size:768b/96B) */
23681 struct hwrm_cfa_l2_filter_alloc_input {
23682         /* The HWRM command request type. */
23683         uint16_t        req_type;
23684         /*
23685          * The completion ring to send the completion event on. This should
23686          * be the NQ ID returned from the `nq_alloc` HWRM command.
23687          */
23688         uint16_t        cmpl_ring;
23689         /*
23690          * The sequence ID is used by the driver for tracking multiple
23691          * commands. This ID is treated as opaque data by the firmware and
23692          * the value is returned in the `hwrm_resp_hdr` upon completion.
23693          */
23694         uint16_t        seq_id;
23695         /*
23696          * The target ID of the command:
23697          * * 0x0-0xFFF8 - The function ID
23698          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
23699          * * 0xFFFD - Reserved for user-space HWRM interface
23700          * * 0xFFFF - HWRM
23701          */
23702         uint16_t        target_id;
23703         /*
23704          * A physical address pointer pointing to a host buffer that the
23705          * command's response data will be written. This can be either a host
23706          * physical address (HPA) or a guest physical address (GPA) and must
23707          * point to a physically contiguous block of memory.
23708          */
23709         uint64_t        resp_addr;
23710         uint32_t        flags;
23711         /*
23712          * Enumeration denoting the RX, TX type of the resource.
23713          * This enumeration is used for resources that are similar for both
23714          * TX and RX paths of the chip.
23715          */
23716         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
23717                 UINT32_C(0x1)
23718         /* tx path */
23719         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
23720                 UINT32_C(0x0)
23721         /* rx path */
23722         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
23723                 UINT32_C(0x1)
23724         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
23725                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
23726         /* Setting of this flag indicates the applicability to the loopback path. */
23727         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
23728                 UINT32_C(0x2)
23729         /*
23730          * Setting of this flag indicates drop action. If this flag is not set,
23731          * then it should be considered accept action.
23732          */
23733         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
23734                 UINT32_C(0x4)
23735         /*
23736          * If this flag is set, all t_l2_* fields are invalid
23737          * and they should not be specified.
23738          * If this flag is set, then l2_* fields refer to
23739          * fields of outermost L2 header.
23740          */
23741         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
23742                 UINT32_C(0x8)
23743         /*
23744          * Enumeration denoting NO_ROCE_L2 to support old drivers.
23745          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
23746          */
23747         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_MASK \
23748                 UINT32_C(0x30)
23749         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_SFT       4
23750         /* To support old drivers */
23751         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
23752                 (UINT32_C(0x0) << 4)
23753         /* Only L2 traffic */
23754         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2 \
23755                 (UINT32_C(0x1) << 4)
23756         /* Roce & L2 traffic */
23757         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE \
23758                 (UINT32_C(0x2) << 4)
23759         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_LAST \
23760                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_ROCE
23761         /*
23762          * Setting of this flag indicates that no XDP filter is created with
23763          * L2 filter.
23764          * 0 - legacy behavior, XDP filter is created with L2 filter
23765          * 1 - XDP filter won't be created with L2 filter
23766          */
23767         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_XDP_DISABLE \
23768                 UINT32_C(0x40)
23769         /*
23770          * Setting this flag to 1 indicate the L2 fields in this command
23771          * pertain to source fields.  Setting this flag to 0 indicate the
23772          * L2 fields in this command pertain to the destination fields
23773          * and this is the default/legacy behavior.
23774          */
23775         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_SOURCE_VALID \
23776                 UINT32_C(0x80)
23777         uint32_t        enables;
23778         /*
23779          * This bit must be '1' for the l2_addr field to be
23780          * configured.
23781          */
23782         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
23783                 UINT32_C(0x1)
23784         /*
23785          * This bit must be '1' for the l2_addr_mask field to be
23786          * configured.
23787          */
23788         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
23789                 UINT32_C(0x2)
23790         /*
23791          * This bit must be '1' for the l2_ovlan field to be
23792          * configured.
23793          */
23794         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
23795                 UINT32_C(0x4)
23796         /*
23797          * This bit must be '1' for the l2_ovlan_mask field to be
23798          * configured.
23799          */
23800         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
23801                 UINT32_C(0x8)
23802         /*
23803          * This bit must be '1' for the l2_ivlan field to be
23804          * configured.
23805          */
23806         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
23807                 UINT32_C(0x10)
23808         /*
23809          * This bit must be '1' for the l2_ivlan_mask field to be
23810          * configured.
23811          */
23812         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
23813                 UINT32_C(0x20)
23814         /*
23815          * This bit must be '1' for the t_l2_addr field to be
23816          * configured.
23817          */
23818         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
23819                 UINT32_C(0x40)
23820         /*
23821          * This bit must be '1' for the t_l2_addr_mask field to be
23822          * configured.
23823          */
23824         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
23825                 UINT32_C(0x80)
23826         /*
23827          * This bit must be '1' for the t_l2_ovlan field to be
23828          * configured.
23829          */
23830         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
23831                 UINT32_C(0x100)
23832         /*
23833          * This bit must be '1' for the t_l2_ovlan_mask field to be
23834          * configured.
23835          */
23836         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
23837                 UINT32_C(0x200)
23838         /*
23839          * This bit must be '1' for the t_l2_ivlan field to be
23840          * configured.
23841          */
23842         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
23843                 UINT32_C(0x400)
23844         /*
23845          * This bit must be '1' for the t_l2_ivlan_mask field to be
23846          * configured.
23847          */
23848         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
23849                 UINT32_C(0x800)
23850         /*
23851          * This bit must be '1' for the src_type field to be
23852          * configured.
23853          */
23854         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
23855                 UINT32_C(0x1000)
23856         /*
23857          * This bit must be '1' for the src_id field to be
23858          * configured.
23859          */
23860         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
23861                 UINT32_C(0x2000)
23862         /*
23863          * This bit must be '1' for the tunnel_type field to be
23864          * configured.
23865          */
23866         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
23867                 UINT32_C(0x4000)
23868         /*
23869          * This bit must be '1' for the dst_id field to be
23870          * configured.
23871          */
23872         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
23873                 UINT32_C(0x8000)
23874         /*
23875          * This bit must be '1' for the mirror_vnic_id field to be
23876          * configured.
23877          */
23878         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
23879                 UINT32_C(0x10000)
23880         /*
23881          * This bit must be '1' for the num_vlans field to be
23882          * configured.
23883          */
23884         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_NUM_VLANS \
23885                 UINT32_C(0x20000)
23886         /*
23887          * This bit must be '1' for the t_num_vlans field to be
23888          * configured.
23889          */
23890         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_NUM_VLANS \
23891                 UINT32_C(0x40000)
23892         /*
23893          * This value sets the match value for the L2 MAC address.
23894          * Destination MAC address for RX path.
23895          * Source MAC address for TX path.
23896          */
23897         uint8_t l2_addr[6];
23898         /* This value sets the match value for the number of VLANs. */
23899         uint8_t num_vlans;
23900         /*
23901          * This value sets the match value for the number of VLANs
23902          * in the tunnel headers.
23903          */
23904         uint8_t t_num_vlans;
23905         /*
23906          * This value sets the mask value for the L2 address.
23907          * A value of 0 will mask the corresponding bit from
23908          * compare.
23909          */
23910         uint8_t l2_addr_mask[6];
23911         /* This value sets VLAN ID value for outer VLAN. */
23912         uint16_t        l2_ovlan;
23913         /*
23914          * This value sets the mask value for the ovlan id.
23915          * A value of 0 will mask the corresponding bit from
23916          * compare.
23917          */
23918         uint16_t        l2_ovlan_mask;
23919         /* This value sets VLAN ID value for inner VLAN. */
23920         uint16_t        l2_ivlan;
23921         /*
23922          * This value sets the mask value for the ivlan id.
23923          * A value of 0 will mask the corresponding bit from
23924          * compare.
23925          */
23926         uint16_t        l2_ivlan_mask;
23927         uint8_t unused_1[2];
23928         /*
23929          * This value sets the match value for the tunnel
23930          * L2 MAC address.
23931          * Destination MAC address for RX path.
23932          * Source MAC address for TX path.
23933          */
23934         uint8_t t_l2_addr[6];
23935         uint8_t unused_2[2];
23936         /*
23937          * This value sets the mask value for the tunnel L2
23938          * address.
23939          * A value of 0 will mask the corresponding bit from
23940          * compare.
23941          */
23942         uint8_t t_l2_addr_mask[6];
23943         /* This value sets VLAN ID value for tunnel outer VLAN. */
23944         uint16_t        t_l2_ovlan;
23945         /*
23946          * This value sets the mask value for the tunnel ovlan id.
23947          * A value of 0 will mask the corresponding bit from
23948          * compare.
23949          */
23950         uint16_t        t_l2_ovlan_mask;
23951         /* This value sets VLAN ID value for tunnel inner VLAN. */
23952         uint16_t        t_l2_ivlan;
23953         /*
23954          * This value sets the mask value for the tunnel ivlan id.
23955          * A value of 0 will mask the corresponding bit from
23956          * compare.
23957          */
23958         uint16_t        t_l2_ivlan_mask;
23959         /* This value identifies the type of source of the packet. */
23960         uint8_t src_type;
23961         /* Network port */
23962         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
23963         /* Physical function */
23964         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF    UINT32_C(0x1)
23965         /* Virtual function */
23966         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF    UINT32_C(0x2)
23967         /* Virtual NIC of a function */
23968         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC  UINT32_C(0x3)
23969         /* Embedded processor for CFA management */
23970         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG  UINT32_C(0x4)
23971         /* Embedded processor for OOB management */
23972         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE   UINT32_C(0x5)
23973         /* Embedded processor for RoCE */
23974         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO  UINT32_C(0x6)
23975         /* Embedded processor for network proxy functions */
23976         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG  UINT32_C(0x7)
23977         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_LAST \
23978                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG
23979         uint8_t unused_3;
23980         /*
23981          * This value is the id of the source.
23982          * For a network port, it represents port_id.
23983          * For a physical function, it represents fid.
23984          * For a virtual function, it represents vf_id.
23985          * For a vnic, it represents vnic_id.
23986          * For embedded processors, this id is not valid.
23987          *
23988          * Notes:
23989          * 1. The function ID is implied if it src_id is
23990          *    not provided for a src_type that is either
23991          */
23992         uint32_t        src_id;
23993         /* Tunnel Type. */
23994         uint8_t tunnel_type;
23995         /* Non-tunnel */
23996         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
23997                 UINT32_C(0x0)
23998         /* Virtual eXtensible Local Area Network (VXLAN) */
23999         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
24000                 UINT32_C(0x1)
24001         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
24002         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
24003                 UINT32_C(0x2)
24004         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
24005         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
24006                 UINT32_C(0x3)
24007         /* IP in IP */
24008         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
24009                 UINT32_C(0x4)
24010         /* Generic Network Virtualization Encapsulation (Geneve) */
24011         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
24012                 UINT32_C(0x5)
24013         /* Multi-Protocol Lable Switching (MPLS) */
24014         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
24015                 UINT32_C(0x6)
24016         /* Stateless Transport Tunnel (STT) */
24017         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
24018                 UINT32_C(0x7)
24019         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
24020         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
24021                 UINT32_C(0x8)
24022         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
24023         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
24024                 UINT32_C(0x9)
24025         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
24026         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
24027                 UINT32_C(0xa)
24028         /* Use fixed layer 2 ether type of 0xFFFF */
24029         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
24030                 UINT32_C(0xb)
24031         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
24032         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
24033                 UINT32_C(0xc)
24034         /* Any tunneled traffic */
24035         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
24036                 UINT32_C(0xff)
24037         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
24038                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
24039         uint8_t unused_4;
24040         /*
24041          * If set, this value shall represent the
24042          * Logical VNIC ID of the destination VNIC for the RX
24043          * path and network port id of the destination port for
24044          * the TX path.
24045          */
24046         uint16_t        dst_id;
24047         /*
24048          * Logical VNIC ID of the VNIC where traffic is
24049          * mirrored.
24050          */
24051         uint16_t        mirror_vnic_id;
24052         /*
24053          * This hint is provided to help in placing
24054          * the filter in the filter table.
24055          */
24056         uint8_t pri_hint;
24057         /* No preference */
24058         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
24059                 UINT32_C(0x0)
24060         /* Above the given filter */
24061         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
24062                 UINT32_C(0x1)
24063         /* Below the given filter */
24064         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
24065                 UINT32_C(0x2)
24066         /* As high as possible */
24067         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
24068                 UINT32_C(0x3)
24069         /* As low as possible */
24070         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
24071                 UINT32_C(0x4)
24072         #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
24073                 HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN
24074         uint8_t unused_5;
24075         uint32_t        unused_6;
24076         /*
24077          * This is the ID of the filter that goes along with
24078          * the pri_hint.
24079          *
24080          * This field is valid only for the following values.
24081          * 1 - Above the given filter
24082          * 2 - Below the given filter
24083          */
24084         uint64_t        l2_filter_id_hint;
24085 } __attribute__((packed));
24086
24087 /* hwrm_cfa_l2_filter_alloc_output (size:192b/24B) */
24088 struct hwrm_cfa_l2_filter_alloc_output {
24089         /* The specific error status for the command. */
24090         uint16_t        error_code;
24091         /* The HWRM command request type. */
24092         uint16_t        req_type;
24093         /* The sequence ID from the original command. */
24094         uint16_t        seq_id;
24095         /* The length of the response data in number of bytes. */
24096         uint16_t        resp_len;
24097         /*
24098          * This value identifies a set of CFA data structures used for an L2
24099          * context.
24100          */
24101         uint64_t        l2_filter_id;
24102         /*
24103          * The flow id value in bit 0-29 is the actual ID of the flow
24104          * associated with this filter and it shall be used to match
24105          * and associate the flow identifier returned in completion
24106          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
24107          * shall indicate no valid flow id.
24108          */
24109         uint32_t        flow_id;
24110         /* Indicate the flow id value. */
24111         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
24112                 UINT32_C(0x3fffffff)
24113         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
24114         /* Indicate type of the flow. */
24115         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
24116                 UINT32_C(0x40000000)
24117         /*
24118          * If this bit set to 0, then it indicates that the flow is
24119          * internal flow.
24120          */
24121         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
24122                 (UINT32_C(0x0) << 30)
24123         /*
24124          * If this bit is set to 1, then it indicates that the flow is
24125          * external flow.
24126          */
24127         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
24128                 (UINT32_C(0x1) << 30)
24129         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
24130                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
24131         /* Indicate the flow direction. */
24132         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
24133                 UINT32_C(0x80000000)
24134         /* If this bit set to 0, then it indicates rx flow. */
24135         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
24136                 (UINT32_C(0x0) << 31)
24137         /* If this bit is set to 1, then it indicates that tx flow. */
24138         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
24139                 (UINT32_C(0x1) << 31)
24140         #define HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
24141                 HWRM_CFA_L2_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
24142         uint8_t unused_0[3];
24143         /*
24144          * This field is used in Output records to indicate that the output
24145          * is completely written to RAM.  This field should be read as '1'
24146          * to indicate that the output has been completely written.
24147          * When writing a command completion or response to an internal processor,
24148          * the order of writes has to be such that this field is written last.
24149          */
24150         uint8_t valid;
24151 } __attribute__((packed));
24152
24153 /***************************
24154  * hwrm_cfa_l2_filter_free *
24155  ***************************/
24156
24157
24158 /* hwrm_cfa_l2_filter_free_input (size:192b/24B) */
24159 struct hwrm_cfa_l2_filter_free_input {
24160         /* The HWRM command request type. */
24161         uint16_t        req_type;
24162         /*
24163          * The completion ring to send the completion event on. This should
24164          * be the NQ ID returned from the `nq_alloc` HWRM command.
24165          */
24166         uint16_t        cmpl_ring;
24167         /*
24168          * The sequence ID is used by the driver for tracking multiple
24169          * commands. This ID is treated as opaque data by the firmware and
24170          * the value is returned in the `hwrm_resp_hdr` upon completion.
24171          */
24172         uint16_t        seq_id;
24173         /*
24174          * The target ID of the command:
24175          * * 0x0-0xFFF8 - The function ID
24176          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24177          * * 0xFFFD - Reserved for user-space HWRM interface
24178          * * 0xFFFF - HWRM
24179          */
24180         uint16_t        target_id;
24181         /*
24182          * A physical address pointer pointing to a host buffer that the
24183          * command's response data will be written. This can be either a host
24184          * physical address (HPA) or a guest physical address (GPA) and must
24185          * point to a physically contiguous block of memory.
24186          */
24187         uint64_t        resp_addr;
24188         /*
24189          * This value identifies a set of CFA data structures used for an L2
24190          * context.
24191          */
24192         uint64_t        l2_filter_id;
24193 } __attribute__((packed));
24194
24195 /* hwrm_cfa_l2_filter_free_output (size:128b/16B) */
24196 struct hwrm_cfa_l2_filter_free_output {
24197         /* The specific error status for the command. */
24198         uint16_t        error_code;
24199         /* The HWRM command request type. */
24200         uint16_t        req_type;
24201         /* The sequence ID from the original command. */
24202         uint16_t        seq_id;
24203         /* The length of the response data in number of bytes. */
24204         uint16_t        resp_len;
24205         uint8_t unused_0[7];
24206         /*
24207          * This field is used in Output records to indicate that the output
24208          * is completely written to RAM.  This field should be read as '1'
24209          * to indicate that the output has been completely written.
24210          * When writing a command completion or response to an internal processor,
24211          * the order of writes has to be such that this field is written last.
24212          */
24213         uint8_t valid;
24214 } __attribute__((packed));
24215
24216 /**************************
24217  * hwrm_cfa_l2_filter_cfg *
24218  **************************/
24219
24220
24221 /* hwrm_cfa_l2_filter_cfg_input (size:320b/40B) */
24222 struct hwrm_cfa_l2_filter_cfg_input {
24223         /* The HWRM command request type. */
24224         uint16_t        req_type;
24225         /*
24226          * The completion ring to send the completion event on. This should
24227          * be the NQ ID returned from the `nq_alloc` HWRM command.
24228          */
24229         uint16_t        cmpl_ring;
24230         /*
24231          * The sequence ID is used by the driver for tracking multiple
24232          * commands. This ID is treated as opaque data by the firmware and
24233          * the value is returned in the `hwrm_resp_hdr` upon completion.
24234          */
24235         uint16_t        seq_id;
24236         /*
24237          * The target ID of the command:
24238          * * 0x0-0xFFF8 - The function ID
24239          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24240          * * 0xFFFD - Reserved for user-space HWRM interface
24241          * * 0xFFFF - HWRM
24242          */
24243         uint16_t        target_id;
24244         /*
24245          * A physical address pointer pointing to a host buffer that the
24246          * command's response data will be written. This can be either a host
24247          * physical address (HPA) or a guest physical address (GPA) and must
24248          * point to a physically contiguous block of memory.
24249          */
24250         uint64_t        resp_addr;
24251         uint32_t        flags;
24252         /*
24253          * Enumeration denoting the RX, TX type of the resource.
24254          * This enumeration is used for resources that are similar for both
24255          * TX and RX paths of the chip.
24256          */
24257         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH \
24258                 UINT32_C(0x1)
24259         /* tx path */
24260         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \
24261                 UINT32_C(0x0)
24262         /* rx path */
24263         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \
24264                 UINT32_C(0x1)
24265         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
24266                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
24267         /*
24268          * Setting of this flag indicates drop action. If this flag is not set,
24269          * then it should be considered accept action.
24270          */
24271         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP \
24272                 UINT32_C(0x2)
24273         /*
24274          * Enumeration denoting NO_ROCE_L2 to support old drivers.
24275          * New driver L2 for only L2 traffic, ROCE for roce and l2 traffic
24276          */
24277         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_MASK \
24278                 UINT32_C(0xc)
24279         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_SFT       2
24280         /* To support old drivers */
24281         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_NO_ROCE_L2 \
24282                 (UINT32_C(0x0) << 2)
24283         /* Only L2 traffic */
24284         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_L2 \
24285                 (UINT32_C(0x1) << 2)
24286         /* Roce & L2 traffic */
24287         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE \
24288                 (UINT32_C(0x2) << 2)
24289         #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_LAST \
24290                 HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_TRAFFIC_ROCE
24291         uint32_t        enables;
24292         /*
24293          * This bit must be '1' for the dst_id field to be
24294          * configured.
24295          */
24296         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID \
24297                 UINT32_C(0x1)
24298         /*
24299          * This bit must be '1' for the new_mirror_vnic_id field to be
24300          * configured.
24301          */
24302         #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
24303                 UINT32_C(0x2)
24304         /*
24305          * This value identifies a set of CFA data structures used for an L2
24306          * context.
24307          */
24308         uint64_t        l2_filter_id;
24309         /*
24310          * If set, this value shall represent the
24311          * Logical VNIC ID of the destination VNIC for the RX
24312          * path and network port id of the destination port for
24313          * the TX path.
24314          */
24315         uint32_t        dst_id;
24316         /*
24317          * New Logical VNIC ID of the VNIC where traffic is
24318          * mirrored.
24319          */
24320         uint32_t        new_mirror_vnic_id;
24321 } __attribute__((packed));
24322
24323 /* hwrm_cfa_l2_filter_cfg_output (size:128b/16B) */
24324 struct hwrm_cfa_l2_filter_cfg_output {
24325         /* The specific error status for the command. */
24326         uint16_t        error_code;
24327         /* The HWRM command request type. */
24328         uint16_t        req_type;
24329         /* The sequence ID from the original command. */
24330         uint16_t        seq_id;
24331         /* The length of the response data in number of bytes. */
24332         uint16_t        resp_len;
24333         uint8_t unused_0[7];
24334         /*
24335          * This field is used in Output records to indicate that the output
24336          * is completely written to RAM.  This field should be read as '1'
24337          * to indicate that the output has been completely written.
24338          * When writing a command completion or response to an internal processor,
24339          * the order of writes has to be such that this field is written last.
24340          */
24341         uint8_t valid;
24342 } __attribute__((packed));
24343
24344 /***************************
24345  * hwrm_cfa_l2_set_rx_mask *
24346  ***************************/
24347
24348
24349 /* hwrm_cfa_l2_set_rx_mask_input (size:448b/56B) */
24350 struct hwrm_cfa_l2_set_rx_mask_input {
24351         /* The HWRM command request type. */
24352         uint16_t        req_type;
24353         /*
24354          * The completion ring to send the completion event on. This should
24355          * be the NQ ID returned from the `nq_alloc` HWRM command.
24356          */
24357         uint16_t        cmpl_ring;
24358         /*
24359          * The sequence ID is used by the driver for tracking multiple
24360          * commands. This ID is treated as opaque data by the firmware and
24361          * the value is returned in the `hwrm_resp_hdr` upon completion.
24362          */
24363         uint16_t        seq_id;
24364         /*
24365          * The target ID of the command:
24366          * * 0x0-0xFFF8 - The function ID
24367          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24368          * * 0xFFFD - Reserved for user-space HWRM interface
24369          * * 0xFFFF - HWRM
24370          */
24371         uint16_t        target_id;
24372         /*
24373          * A physical address pointer pointing to a host buffer that the
24374          * command's response data will be written. This can be either a host
24375          * physical address (HPA) or a guest physical address (GPA) and must
24376          * point to a physically contiguous block of memory.
24377          */
24378         uint64_t        resp_addr;
24379         /* VNIC ID */
24380         uint32_t        vnic_id;
24381         uint32_t        mask;
24382         /*
24383          * When this bit is '1', the function is requested to accept
24384          * multi-cast packets specified by the multicast addr table.
24385          */
24386         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST \
24387                 UINT32_C(0x2)
24388         /*
24389          * When this bit is '1', the function is requested to accept
24390          * all multi-cast packets.
24391          */
24392         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST \
24393                 UINT32_C(0x4)
24394         /*
24395          * When this bit is '1', the function is requested to accept
24396          * broadcast packets.
24397          */
24398         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST \
24399                 UINT32_C(0x8)
24400         /*
24401          * When this bit is '1', the function is requested to be
24402          * put in the promiscuous mode.
24403          *
24404          * The HWRM should accept any function to set up
24405          * promiscuous mode.
24406          *
24407          * The HWRM shall follow the semantics below for the
24408          * promiscuous mode support.
24409          * # When partitioning is not enabled on a port
24410          * (i.e. single PF on the port), then the PF shall
24411          * be allowed to be in the promiscuous mode. When the
24412          * PF is in the promiscuous mode, then it shall
24413          * receive all host bound traffic on that port.
24414          * # When partitioning is enabled on a port
24415          * (i.e. multiple PFs per port) and a PF on that
24416          * port is in the promiscuous mode, then the PF
24417          * receives all traffic within that partition as
24418          * identified by a unique identifier for the
24419          * PF (e.g. S-Tag). If a unique outer VLAN
24420          * for the PF is specified, then the setting of
24421          * promiscuous mode on that PF shall result in the
24422          * PF receiving all host bound traffic with matching
24423          * outer VLAN.
24424          * # A VF shall can be set in the promiscuous mode.
24425          * In the promiscuous mode, the VF does not receive any
24426          * traffic unless a unique outer VLAN for the
24427          * VF is specified. If a unique outer VLAN
24428          * for the VF is specified, then the setting of
24429          * promiscuous mode on that VF shall result in the
24430          * VF receiving all host bound traffic with the
24431          * matching outer VLAN.
24432          * # The HWRM shall allow the setting of promiscuous
24433          * mode on a function independently from the
24434          * promiscuous mode settings on other functions.
24435          */
24436         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS \
24437                 UINT32_C(0x10)
24438         /*
24439          * If this flag is set, the corresponding RX
24440          * filters shall be set up to cover multicast/broadcast
24441          * filters for the outermost Layer 2 destination MAC
24442          * address field.
24443          */
24444         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST \
24445                 UINT32_C(0x20)
24446         /*
24447          * If this flag is set, the corresponding RX
24448          * filters shall be set up to cover multicast/broadcast
24449          * filters for the VLAN-tagged packets that match the
24450          * TPID and VID fields of VLAN tags in the VLAN tag
24451          * table specified in this command.
24452          */
24453         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY \
24454                 UINT32_C(0x40)
24455         /*
24456          * If this flag is set, the corresponding RX
24457          * filters shall be set up to cover multicast/broadcast
24458          * filters for non-VLAN tagged packets and VLAN-tagged
24459          * packets that match the TPID and VID fields of VLAN
24460          * tags in the VLAN tag table specified in this command.
24461          */
24462         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN \
24463                 UINT32_C(0x80)
24464         /*
24465          * If this flag is set, the corresponding RX
24466          * filters shall be set up to cover multicast/broadcast
24467          * filters for non-VLAN tagged packets and VLAN-tagged
24468          * packets matching any VLAN tag.
24469          *
24470          * If this flag is set, then the HWRM shall ignore
24471          * VLAN tags specified in vlan_tag_tbl.
24472          *
24473          * If none of vlanonly, vlan_nonvlan, and anyvlan_nonvlan
24474          * flags is set, then the HWRM shall ignore
24475          * VLAN tags specified in vlan_tag_tbl.
24476          *
24477          * The HWRM client shall set at most one flag out of
24478          * vlanonly, vlan_nonvlan, and anyvlan_nonvlan.
24479          */
24480         #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
24481                 UINT32_C(0x100)
24482         /* This is the address for mcast address tbl. */
24483         uint64_t        mc_tbl_addr;
24484         /*
24485          * This value indicates how many entries in mc_tbl are valid.
24486          * Each entry is 6 bytes.
24487          */
24488         uint32_t        num_mc_entries;
24489         uint8_t unused_0[4];
24490         /*
24491          * This is the address for VLAN tag table.
24492          * Each VLAN entry in the table is 4 bytes of a VLAN tag
24493          * including TPID, PCP, DEI, and VID fields in network byte
24494          * order.
24495          */
24496         uint64_t        vlan_tag_tbl_addr;
24497         /*
24498          * This value indicates how many entries in vlan_tag_tbl are
24499          * valid. Each entry is 4 bytes.
24500          */
24501         uint32_t        num_vlan_tags;
24502         uint8_t unused_1[4];
24503 } __attribute__((packed));
24504
24505 /* hwrm_cfa_l2_set_rx_mask_output (size:128b/16B) */
24506 struct hwrm_cfa_l2_set_rx_mask_output {
24507         /* The specific error status for the command. */
24508         uint16_t        error_code;
24509         /* The HWRM command request type. */
24510         uint16_t        req_type;
24511         /* The sequence ID from the original command. */
24512         uint16_t        seq_id;
24513         /* The length of the response data in number of bytes. */
24514         uint16_t        resp_len;
24515         uint8_t unused_0[7];
24516         /*
24517          * This field is used in Output records to indicate that the output
24518          * is completely written to RAM.  This field should be read as '1'
24519          * to indicate that the output has been completely written.
24520          * When writing a command completion or response to an internal processor,
24521          * the order of writes has to be such that this field is written last.
24522          */
24523         uint8_t valid;
24524 } __attribute__((packed));
24525
24526 /* hwrm_cfa_l2_set_rx_mask_cmd_err (size:64b/8B) */
24527 struct hwrm_cfa_l2_set_rx_mask_cmd_err {
24528         /*
24529          * command specific error codes that goes to
24530          * the cmd_err field in Common HWRM Error Response.
24531          */
24532         uint8_t code;
24533         /* Unknown error */
24534         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_UNKNOWN \
24535                 UINT32_C(0x0)
24536         /* Unable to complete operation due to conflict with Ntuple Filter */
24537         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR \
24538                 UINT32_C(0x1)
24539         #define HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_LAST \
24540                 HWRM_CFA_L2_SET_RX_MASK_CMD_ERR_CODE_NTUPLE_FILTER_CONFLICT_ERR
24541         uint8_t unused_0[7];
24542 } __attribute__((packed));
24543
24544 /*******************************
24545  * hwrm_cfa_vlan_antispoof_cfg *
24546  *******************************/
24547
24548
24549 /* hwrm_cfa_vlan_antispoof_cfg_input (size:256b/32B) */
24550 struct hwrm_cfa_vlan_antispoof_cfg_input {
24551         /* The HWRM command request type. */
24552         uint16_t        req_type;
24553         /*
24554          * The completion ring to send the completion event on. This should
24555          * be the NQ ID returned from the `nq_alloc` HWRM command.
24556          */
24557         uint16_t        cmpl_ring;
24558         /*
24559          * The sequence ID is used by the driver for tracking multiple
24560          * commands. This ID is treated as opaque data by the firmware and
24561          * the value is returned in the `hwrm_resp_hdr` upon completion.
24562          */
24563         uint16_t        seq_id;
24564         /*
24565          * The target ID of the command:
24566          * * 0x0-0xFFF8 - The function ID
24567          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24568          * * 0xFFFD - Reserved for user-space HWRM interface
24569          * * 0xFFFF - HWRM
24570          */
24571         uint16_t        target_id;
24572         /*
24573          * A physical address pointer pointing to a host buffer that the
24574          * command's response data will be written. This can be either a host
24575          * physical address (HPA) or a guest physical address (GPA) and must
24576          * point to a physically contiguous block of memory.
24577          */
24578         uint64_t        resp_addr;
24579         /*
24580          * Function ID of the function that is being configured.
24581          * Only valid for a VF FID configured by the PF.
24582          */
24583         uint16_t        fid;
24584         uint8_t unused_0[2];
24585         /* Number of VLAN entries in the vlan_tag_mask_tbl. */
24586         uint32_t        num_vlan_entries;
24587         /*
24588          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
24589          * antispoof table. Each table entry contains the 16-bit TPID
24590          * (0x8100 or 0x88a8 only), 16-bit VLAN ID, and a 16-bit mask,
24591          * all in network order to match hwrm_cfa_l2_set_rx_mask.
24592          * For an individual VLAN entry, the mask value should be 0xfff
24593          * for the 12-bit VLAN ID.
24594          */
24595         uint64_t        vlan_tag_mask_tbl_addr;
24596 } __attribute__((packed));
24597
24598 /* hwrm_cfa_vlan_antispoof_cfg_output (size:128b/16B) */
24599 struct hwrm_cfa_vlan_antispoof_cfg_output {
24600         /* The specific error status for the command. */
24601         uint16_t        error_code;
24602         /* The HWRM command request type. */
24603         uint16_t        req_type;
24604         /* The sequence ID from the original command. */
24605         uint16_t        seq_id;
24606         /* The length of the response data in number of bytes. */
24607         uint16_t        resp_len;
24608         uint8_t unused_0[7];
24609         /*
24610          * This field is used in Output records to indicate that the output
24611          * is completely written to RAM.  This field should be read as '1'
24612          * to indicate that the output has been completely written.
24613          * When writing a command completion or response to an internal processor,
24614          * the order of writes has to be such that this field is written last.
24615          */
24616         uint8_t valid;
24617 } __attribute__((packed));
24618
24619 /********************************
24620  * hwrm_cfa_vlan_antispoof_qcfg *
24621  ********************************/
24622
24623
24624 /* hwrm_cfa_vlan_antispoof_qcfg_input (size:256b/32B) */
24625 struct hwrm_cfa_vlan_antispoof_qcfg_input {
24626         /* The HWRM command request type. */
24627         uint16_t        req_type;
24628         /*
24629          * The completion ring to send the completion event on. This should
24630          * be the NQ ID returned from the `nq_alloc` HWRM command.
24631          */
24632         uint16_t        cmpl_ring;
24633         /*
24634          * The sequence ID is used by the driver for tracking multiple
24635          * commands. This ID is treated as opaque data by the firmware and
24636          * the value is returned in the `hwrm_resp_hdr` upon completion.
24637          */
24638         uint16_t        seq_id;
24639         /*
24640          * The target ID of the command:
24641          * * 0x0-0xFFF8 - The function ID
24642          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24643          * * 0xFFFD - Reserved for user-space HWRM interface
24644          * * 0xFFFF - HWRM
24645          */
24646         uint16_t        target_id;
24647         /*
24648          * A physical address pointer pointing to a host buffer that the
24649          * command's response data will be written. This can be either a host
24650          * physical address (HPA) or a guest physical address (GPA) and must
24651          * point to a physically contiguous block of memory.
24652          */
24653         uint64_t        resp_addr;
24654         /*
24655          * Function ID of the function that is being queried.
24656          * Only valid for a VF FID queried by the PF.
24657          */
24658         uint16_t        fid;
24659         uint8_t unused_0[2];
24660         /*
24661          * Maximum number of VLAN entries the firmware is allowed to DMA
24662          * to vlan_tag_mask_tbl.
24663          */
24664         uint32_t        max_vlan_entries;
24665         /*
24666          * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN
24667          * antispoof table to which firmware will DMA to. Each table
24668          * entry will contain the 16-bit TPID (0x8100 or 0x88a8 only),
24669          * 16-bit VLAN ID, and a 16-bit mask, all in network order to
24670          * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry,
24671          * the mask value should be 0xfff for the 12-bit VLAN ID.
24672          */
24673         uint64_t        vlan_tag_mask_tbl_addr;
24674 } __attribute__((packed));
24675
24676 /* hwrm_cfa_vlan_antispoof_qcfg_output (size:128b/16B) */
24677 struct hwrm_cfa_vlan_antispoof_qcfg_output {
24678         /* The specific error status for the command. */
24679         uint16_t        error_code;
24680         /* The HWRM command request type. */
24681         uint16_t        req_type;
24682         /* The sequence ID from the original command. */
24683         uint16_t        seq_id;
24684         /* The length of the response data in number of bytes. */
24685         uint16_t        resp_len;
24686         /* Number of valid entries DMAd by firmware to vlan_tag_mask_tbl. */
24687         uint32_t        num_vlan_entries;
24688         uint8_t unused_0[3];
24689         /*
24690          * This field is used in Output records to indicate that the output
24691          * is completely written to RAM.  This field should be read as '1'
24692          * to indicate that the output has been completely written.
24693          * When writing a command completion or response to an internal processor,
24694          * the order of writes has to be such that this field is written last.
24695          */
24696         uint8_t valid;
24697 } __attribute__((packed));
24698
24699 /********************************
24700  * hwrm_cfa_tunnel_filter_alloc *
24701  ********************************/
24702
24703
24704 /* hwrm_cfa_tunnel_filter_alloc_input (size:704b/88B) */
24705 struct hwrm_cfa_tunnel_filter_alloc_input {
24706         /* The HWRM command request type. */
24707         uint16_t        req_type;
24708         /*
24709          * The completion ring to send the completion event on. This should
24710          * be the NQ ID returned from the `nq_alloc` HWRM command.
24711          */
24712         uint16_t        cmpl_ring;
24713         /*
24714          * The sequence ID is used by the driver for tracking multiple
24715          * commands. This ID is treated as opaque data by the firmware and
24716          * the value is returned in the `hwrm_resp_hdr` upon completion.
24717          */
24718         uint16_t        seq_id;
24719         /*
24720          * The target ID of the command:
24721          * * 0x0-0xFFF8 - The function ID
24722          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
24723          * * 0xFFFD - Reserved for user-space HWRM interface
24724          * * 0xFFFF - HWRM
24725          */
24726         uint16_t        target_id;
24727         /*
24728          * A physical address pointer pointing to a host buffer that the
24729          * command's response data will be written. This can be either a host
24730          * physical address (HPA) or a guest physical address (GPA) and must
24731          * point to a physically contiguous block of memory.
24732          */
24733         uint64_t        resp_addr;
24734         uint32_t        flags;
24735         /* Setting of this flag indicates the applicability to the loopback path. */
24736         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
24737                 UINT32_C(0x1)
24738         uint32_t        enables;
24739         /*
24740          * This bit must be '1' for the l2_filter_id field to be
24741          * configured.
24742          */
24743         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
24744                 UINT32_C(0x1)
24745         /*
24746          * This bit must be '1' for the l2_addr field to be
24747          * configured.
24748          */
24749         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
24750                 UINT32_C(0x2)
24751         /*
24752          * This bit must be '1' for the l2_ivlan field to be
24753          * configured.
24754          */
24755         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
24756                 UINT32_C(0x4)
24757         /*
24758          * This bit must be '1' for the l3_addr field to be
24759          * configured.
24760          */
24761         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR \
24762                 UINT32_C(0x8)
24763         /*
24764          * This bit must be '1' for the l3_addr_type field to be
24765          * configured.
24766          */
24767         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_L3_ADDR_TYPE \
24768                 UINT32_C(0x10)
24769         /*
24770          * This bit must be '1' for the t_l3_addr_type field to be
24771          * configured.
24772          */
24773         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR_TYPE \
24774                 UINT32_C(0x20)
24775         /*
24776          * This bit must be '1' for the t_l3_addr field to be
24777          * configured.
24778          */
24779         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_T_L3_ADDR \
24780                 UINT32_C(0x40)
24781         /*
24782          * This bit must be '1' for the tunnel_type field to be
24783          * configured.
24784          */
24785         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
24786                 UINT32_C(0x80)
24787         /*
24788          * This bit must be '1' for the vni field to be
24789          * configured.
24790          */
24791         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_VNI \
24792                 UINT32_C(0x100)
24793         /*
24794          * This bit must be '1' for the dst_vnic_id field to be
24795          * configured.
24796          */
24797         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_DST_VNIC_ID \
24798                 UINT32_C(0x200)
24799         /*
24800          * This bit must be '1' for the mirror_vnic_id field to be
24801          * configured.
24802          */
24803         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
24804                 UINT32_C(0x400)
24805         /*
24806          * This value identifies a set of CFA data structures used for an L2
24807          * context.
24808          */
24809         uint64_t        l2_filter_id;
24810         /*
24811          * This value sets the match value for the inner L2
24812          * MAC address.
24813          * Destination MAC address for RX path.
24814          * Source MAC address for TX path.
24815          */
24816         uint8_t l2_addr[6];
24817         /*
24818          * This value sets VLAN ID value for inner VLAN.
24819          * Only 12-bits of VLAN ID are used in setting the filter.
24820          */
24821         uint16_t        l2_ivlan;
24822         /*
24823          * The value of inner destination IP address to be used in filtering.
24824          * For IPv4, first four bytes represent the IP address.
24825          */
24826         uint32_t        l3_addr[4];
24827         /*
24828          * The value of tunnel destination IP address to be used in filtering.
24829          * For IPv4, first four bytes represent the IP address.
24830          */
24831         uint32_t        t_l3_addr[4];
24832         /*
24833          * This value indicates the type of inner IP address.
24834          * 4 - IPv4
24835          * 6 - IPv6
24836          * All others are invalid.
24837          */
24838         uint8_t l3_addr_type;
24839         /*
24840          * This value indicates the type of tunnel IP address.
24841          * 4 - IPv4
24842          * 6 - IPv6
24843          * All others are invalid.
24844          */
24845         uint8_t t_l3_addr_type;
24846         /* Tunnel Type. */
24847         uint8_t tunnel_type;
24848         /* Non-tunnel */
24849         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
24850                 UINT32_C(0x0)
24851         /* Virtual eXtensible Local Area Network (VXLAN) */
24852         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
24853                 UINT32_C(0x1)
24854         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
24855         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
24856                 UINT32_C(0x2)
24857         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
24858         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
24859                 UINT32_C(0x3)
24860         /* IP in IP */
24861         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
24862                 UINT32_C(0x4)
24863         /* Generic Network Virtualization Encapsulation (Geneve) */
24864         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
24865                 UINT32_C(0x5)
24866         /* Multi-Protocol Lable Switching (MPLS) */
24867         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
24868                 UINT32_C(0x6)
24869         /* Stateless Transport Tunnel (STT) */
24870         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
24871                 UINT32_C(0x7)
24872         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
24873         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
24874                 UINT32_C(0x8)
24875         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
24876         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
24877                 UINT32_C(0x9)
24878         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
24879         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
24880                 UINT32_C(0xa)
24881         /* Use fixed layer 2 ether type of 0xFFFF */
24882         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
24883                 UINT32_C(0xb)
24884         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
24885         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
24886                 UINT32_C(0xc)
24887         /* Any tunneled traffic */
24888         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
24889                 UINT32_C(0xff)
24890         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
24891                 HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
24892         /*
24893          * tunnel_flags allows the user to indicate the tunnel tag detection
24894          * for the tunnel type specified in tunnel_type.
24895          */
24896         uint8_t tunnel_flags;
24897         /*
24898          * If the tunnel_type is geneve, then this bit indicates if we
24899          * need to match the geneve OAM packet.
24900          * If the tunnel_type is nvgre or gre, then this bit indicates if
24901          * we need to detect checksum present bit in geneve header.
24902          * If the tunnel_type is mpls, then this bit indicates if we need
24903          * to match mpls packet with explicit IPV4/IPV6 null header.
24904          */
24905         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_OAM_CHECKSUM_EXPLHDR \
24906                 UINT32_C(0x1)
24907         /*
24908          * If the tunnel_type is geneve, then this bit indicates if we
24909          * need to detect the critical option bit set in the oam packet.
24910          * If the tunnel_type is nvgre or gre, then this bit indicates
24911          * if we need to match nvgre packets with key present bit set in
24912          * gre header.
24913          * If the tunnel_type is mpls, then this bit indicates if we
24914          * need to match mpls packet with S bit from inner/second label.
24915          */
24916         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_CRITICAL_OPT_S1 \
24917                 UINT32_C(0x2)
24918         /*
24919          * If the tunnel_type is geneve, then this bit indicates if we
24920          * need to match geneve packet with extended header bit set in
24921          * geneve header.
24922          * If the tunnel_type is nvgre or gre, then this bit indicates
24923          * if we need to match nvgre packets with sequence number
24924          * present bit set in gre header.
24925          * If the tunnel_type is mpls, then this bit indicates if we
24926          * need to match mpls packet with S bit from out/first label.
24927          */
24928         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_INPUT_TUNNEL_FLAGS_TUN_FLAGS_EXTHDR_SEQNUM_S0 \
24929                 UINT32_C(0x4)
24930         /*
24931          * Virtual Network Identifier (VNI). Only valid with
24932          * tunnel_types VXLAN, NVGRE, and Geneve.
24933          * Only lower 24-bits of VNI field are used
24934          * in setting up the filter.
24935          */
24936         uint32_t        vni;
24937         /* Logical VNIC ID of the destination VNIC. */
24938         uint32_t        dst_vnic_id;
24939         /*
24940          * Logical VNIC ID of the VNIC where traffic is
24941          * mirrored.
24942          */
24943         uint32_t        mirror_vnic_id;
24944 } __attribute__((packed));
24945
24946 /* hwrm_cfa_tunnel_filter_alloc_output (size:192b/24B) */
24947 struct hwrm_cfa_tunnel_filter_alloc_output {
24948         /* The specific error status for the command. */
24949         uint16_t        error_code;
24950         /* The HWRM command request type. */
24951         uint16_t        req_type;
24952         /* The sequence ID from the original command. */
24953         uint16_t        seq_id;
24954         /* The length of the response data in number of bytes. */
24955         uint16_t        resp_len;
24956         /* This value is an opaque id into CFA data structures. */
24957         uint64_t        tunnel_filter_id;
24958         /*
24959          * The flow id value in bit 0-29 is the actual ID of the flow
24960          * associated with this filter and it shall be used to match
24961          * and associate the flow identifier returned in completion
24962          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
24963          * shall indicate no valid flow id.
24964          */
24965         uint32_t        flow_id;
24966         /* Indicate the flow id value. */
24967         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
24968                 UINT32_C(0x3fffffff)
24969         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
24970         /* Indicate type of the flow. */
24971         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
24972                 UINT32_C(0x40000000)
24973         /*
24974          * If this bit set to 0, then it indicates that the flow is
24975          * internal flow.
24976          */
24977         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
24978                 (UINT32_C(0x0) << 30)
24979         /*
24980          * If this bit is set to 1, then it indicates that the flow is
24981          * external flow.
24982          */
24983         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
24984                 (UINT32_C(0x1) << 30)
24985         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
24986                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
24987         /* Indicate the flow direction. */
24988         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
24989                 UINT32_C(0x80000000)
24990         /* If this bit set to 0, then it indicates rx flow. */
24991         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
24992                 (UINT32_C(0x0) << 31)
24993         /* If this bit is set to 1, then it indicates that tx flow. */
24994         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
24995                 (UINT32_C(0x1) << 31)
24996         #define HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
24997                 HWRM_CFA_TUNNEL_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
24998         uint8_t unused_0[3];
24999         /*
25000          * This field is used in Output records to indicate that the output
25001          * is completely written to RAM.  This field should be read as '1'
25002          * to indicate that the output has been completely written.
25003          * When writing a command completion or response to an internal processor,
25004          * the order of writes has to be such that this field is written last.
25005          */
25006         uint8_t valid;
25007 } __attribute__((packed));
25008
25009 /*******************************
25010  * hwrm_cfa_tunnel_filter_free *
25011  *******************************/
25012
25013
25014 /* hwrm_cfa_tunnel_filter_free_input (size:192b/24B) */
25015 struct hwrm_cfa_tunnel_filter_free_input {
25016         /* The HWRM command request type. */
25017         uint16_t        req_type;
25018         /*
25019          * The completion ring to send the completion event on. This should
25020          * be the NQ ID returned from the `nq_alloc` HWRM command.
25021          */
25022         uint16_t        cmpl_ring;
25023         /*
25024          * The sequence ID is used by the driver for tracking multiple
25025          * commands. This ID is treated as opaque data by the firmware and
25026          * the value is returned in the `hwrm_resp_hdr` upon completion.
25027          */
25028         uint16_t        seq_id;
25029         /*
25030          * The target ID of the command:
25031          * * 0x0-0xFFF8 - The function ID
25032          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25033          * * 0xFFFD - Reserved for user-space HWRM interface
25034          * * 0xFFFF - HWRM
25035          */
25036         uint16_t        target_id;
25037         /*
25038          * A physical address pointer pointing to a host buffer that the
25039          * command's response data will be written. This can be either a host
25040          * physical address (HPA) or a guest physical address (GPA) and must
25041          * point to a physically contiguous block of memory.
25042          */
25043         uint64_t        resp_addr;
25044         /* This value is an opaque id into CFA data structures. */
25045         uint64_t        tunnel_filter_id;
25046 } __attribute__((packed));
25047
25048 /* hwrm_cfa_tunnel_filter_free_output (size:128b/16B) */
25049 struct hwrm_cfa_tunnel_filter_free_output {
25050         /* The specific error status for the command. */
25051         uint16_t        error_code;
25052         /* The HWRM command request type. */
25053         uint16_t        req_type;
25054         /* The sequence ID from the original command. */
25055         uint16_t        seq_id;
25056         /* The length of the response data in number of bytes. */
25057         uint16_t        resp_len;
25058         uint8_t unused_0[7];
25059         /*
25060          * This field is used in Output records to indicate that the output
25061          * is completely written to RAM.  This field should be read as '1'
25062          * to indicate that the output has been completely written.
25063          * When writing a command completion or response to an internal processor,
25064          * the order of writes has to be such that this field is written last.
25065          */
25066         uint8_t valid;
25067 } __attribute__((packed));
25068
25069 /***************************************
25070  * hwrm_cfa_redirect_tunnel_type_alloc *
25071  ***************************************/
25072
25073
25074 /* hwrm_cfa_redirect_tunnel_type_alloc_input (size:192b/24B) */
25075 struct hwrm_cfa_redirect_tunnel_type_alloc_input {
25076         /* The HWRM command request type. */
25077         uint16_t        req_type;
25078         /*
25079          * The completion ring to send the completion event on. This should
25080          * be the NQ ID returned from the `nq_alloc` HWRM command.
25081          */
25082         uint16_t        cmpl_ring;
25083         /*
25084          * The sequence ID is used by the driver for tracking multiple
25085          * commands. This ID is treated as opaque data by the firmware and
25086          * the value is returned in the `hwrm_resp_hdr` upon completion.
25087          */
25088         uint16_t        seq_id;
25089         /*
25090          * The target ID of the command:
25091          * * 0x0-0xFFF8 - The function ID
25092          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25093          * * 0xFFFD - Reserved for user-space HWRM interface
25094          * * 0xFFFF - HWRM
25095          */
25096         uint16_t        target_id;
25097         /*
25098          * A physical address pointer pointing to a host buffer that the
25099          * command's response data will be written. This can be either a host
25100          * physical address (HPA) or a guest physical address (GPA) and must
25101          * point to a physically contiguous block of memory.
25102          */
25103         uint64_t        resp_addr;
25104         /* The destination function id, to whom the traffic is redirected. */
25105         uint16_t        dest_fid;
25106         /* Tunnel Type. */
25107         uint8_t tunnel_type;
25108         /* Non-tunnel */
25109         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
25110                 UINT32_C(0x0)
25111         /* Virtual eXtensible Local Area Network (VXLAN) */
25112         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
25113                 UINT32_C(0x1)
25114         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25115         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
25116                 UINT32_C(0x2)
25117         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25118         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
25119                 UINT32_C(0x3)
25120         /* IP in IP */
25121         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
25122                 UINT32_C(0x4)
25123         /* Generic Network Virtualization Encapsulation (Geneve) */
25124         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
25125                 UINT32_C(0x5)
25126         /* Multi-Protocol Lable Switching (MPLS) */
25127         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
25128                 UINT32_C(0x6)
25129         /* Stateless Transport Tunnel (STT) */
25130         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_STT \
25131                 UINT32_C(0x7)
25132         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25133         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
25134                 UINT32_C(0x8)
25135         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25136         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25137                 UINT32_C(0x9)
25138         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25139         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25140                 UINT32_C(0xa)
25141         /* Use fixed layer 2 ether type of 0xFFFF */
25142         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
25143                 UINT32_C(0xb)
25144         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25145         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25146                 UINT32_C(0xc)
25147         /* Any tunneled traffic */
25148         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25149                 UINT32_C(0xff)
25150         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_LAST \
25151                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
25152         /* Tunnel alloc flags. */
25153         uint8_t flags;
25154         /* Setting of this flag indicates modify existing redirect tunnel to new destination function ID. */
25155         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_ALLOC_INPUT_FLAGS_MODIFY_DST \
25156                 UINT32_C(0x1)
25157         uint8_t unused_0[4];
25158 } __attribute__((packed));
25159
25160 /* hwrm_cfa_redirect_tunnel_type_alloc_output (size:128b/16B) */
25161 struct hwrm_cfa_redirect_tunnel_type_alloc_output {
25162         /* The specific error status for the command. */
25163         uint16_t        error_code;
25164         /* The HWRM command request type. */
25165         uint16_t        req_type;
25166         /* The sequence ID from the original command. */
25167         uint16_t        seq_id;
25168         /* The length of the response data in number of bytes. */
25169         uint16_t        resp_len;
25170         uint8_t unused_0[7];
25171         /*
25172          * This field is used in Output records to indicate that the output
25173          * is completely written to RAM.  This field should be read as '1'
25174          * to indicate that the output has been completely written.
25175          * When writing a command completion or response to an internal processor,
25176          * the order of writes has to be such that this field is written last.
25177          */
25178         uint8_t valid;
25179 } __attribute__((packed));
25180
25181 /**************************************
25182  * hwrm_cfa_redirect_tunnel_type_free *
25183  **************************************/
25184
25185
25186 /* hwrm_cfa_redirect_tunnel_type_free_input (size:192b/24B) */
25187 struct hwrm_cfa_redirect_tunnel_type_free_input {
25188         /* The HWRM command request type. */
25189         uint16_t        req_type;
25190         /*
25191          * The completion ring to send the completion event on. This should
25192          * be the NQ ID returned from the `nq_alloc` HWRM command.
25193          */
25194         uint16_t        cmpl_ring;
25195         /*
25196          * The sequence ID is used by the driver for tracking multiple
25197          * commands. This ID is treated as opaque data by the firmware and
25198          * the value is returned in the `hwrm_resp_hdr` upon completion.
25199          */
25200         uint16_t        seq_id;
25201         /*
25202          * The target ID of the command:
25203          * * 0x0-0xFFF8 - The function ID
25204          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25205          * * 0xFFFD - Reserved for user-space HWRM interface
25206          * * 0xFFFF - HWRM
25207          */
25208         uint16_t        target_id;
25209         /*
25210          * A physical address pointer pointing to a host buffer that the
25211          * command's response data will be written. This can be either a host
25212          * physical address (HPA) or a guest physical address (GPA) and must
25213          * point to a physically contiguous block of memory.
25214          */
25215         uint64_t        resp_addr;
25216         /* The destination function id, to whom the traffic is redirected. */
25217         uint16_t        dest_fid;
25218         /* Tunnel Type. */
25219         uint8_t tunnel_type;
25220         /* Non-tunnel */
25221         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NONTUNNEL \
25222                 UINT32_C(0x0)
25223         /* Virtual eXtensible Local Area Network (VXLAN) */
25224         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN \
25225                 UINT32_C(0x1)
25226         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25227         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_NVGRE \
25228                 UINT32_C(0x2)
25229         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25230         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2GRE \
25231                 UINT32_C(0x3)
25232         /* IP in IP */
25233         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPIP \
25234                 UINT32_C(0x4)
25235         /* Generic Network Virtualization Encapsulation (Geneve) */
25236         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_GENEVE \
25237                 UINT32_C(0x5)
25238         /* Multi-Protocol Lable Switching (MPLS) */
25239         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_MPLS \
25240                 UINT32_C(0x6)
25241         /* Stateless Transport Tunnel (STT) */
25242         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_STT \
25243                 UINT32_C(0x7)
25244         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25245         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE \
25246                 UINT32_C(0x8)
25247         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25248         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25249                 UINT32_C(0x9)
25250         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25251         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25252                 UINT32_C(0xa)
25253         /* Use fixed layer 2 ether type of 0xFFFF */
25254         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
25255                 UINT32_C(0xb)
25256         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25257         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25258                 UINT32_C(0xc)
25259         /* Any tunneled traffic */
25260         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25261                 UINT32_C(0xff)
25262         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_LAST \
25263                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_FREE_INPUT_TUNNEL_TYPE_ANYTUNNEL
25264         uint8_t unused_0[5];
25265 } __attribute__((packed));
25266
25267 /* hwrm_cfa_redirect_tunnel_type_free_output (size:128b/16B) */
25268 struct hwrm_cfa_redirect_tunnel_type_free_output {
25269         /* The specific error status for the command. */
25270         uint16_t        error_code;
25271         /* The HWRM command request type. */
25272         uint16_t        req_type;
25273         /* The sequence ID from the original command. */
25274         uint16_t        seq_id;
25275         /* The length of the response data in number of bytes. */
25276         uint16_t        resp_len;
25277         uint8_t unused_0[7];
25278         /*
25279          * This field is used in Output records to indicate that the output
25280          * is completely written to RAM.  This field should be read as '1'
25281          * to indicate that the output has been completely written.
25282          * When writing a command completion or response to an internal processor,
25283          * the order of writes has to be such that this field is written last.
25284          */
25285         uint8_t valid;
25286 } __attribute__((packed));
25287
25288 /**************************************
25289  * hwrm_cfa_redirect_tunnel_type_info *
25290  **************************************/
25291
25292
25293 /* hwrm_cfa_redirect_tunnel_type_info_input (size:192b/24B) */
25294 struct hwrm_cfa_redirect_tunnel_type_info_input {
25295         /* The HWRM command request type. */
25296         uint16_t        req_type;
25297         /*
25298          * The completion ring to send the completion event on. This should
25299          * be the NQ ID returned from the `nq_alloc` HWRM command.
25300          */
25301         uint16_t        cmpl_ring;
25302         /*
25303          * The sequence ID is used by the driver for tracking multiple
25304          * commands. This ID is treated as opaque data by the firmware and
25305          * the value is returned in the `hwrm_resp_hdr` upon completion.
25306          */
25307         uint16_t        seq_id;
25308         /*
25309          * The target ID of the command:
25310          * * 0x0-0xFFF8 - The function ID
25311          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25312          * * 0xFFFD - Reserved for user-space HWRM interface
25313          * * 0xFFFF - HWRM
25314          */
25315         uint16_t        target_id;
25316         /*
25317          * A physical address pointer pointing to a host buffer that the
25318          * command's response data will be written. This can be either a host
25319          * physical address (HPA) or a guest physical address (GPA) and must
25320          * point to a physically contiguous block of memory.
25321          */
25322         uint64_t        resp_addr;
25323         /* The source function id. */
25324         uint16_t        src_fid;
25325         /* Tunnel Type. */
25326         uint8_t tunnel_type;
25327         /* Non-tunnel */
25328         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NONTUNNEL \
25329                 UINT32_C(0x0)
25330         /* Virtual eXtensible Local Area Network (VXLAN) */
25331         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN \
25332                 UINT32_C(0x1)
25333         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25334         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_NVGRE \
25335                 UINT32_C(0x2)
25336         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25337         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2GRE \
25338                 UINT32_C(0x3)
25339         /* IP in IP */
25340         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPIP \
25341                 UINT32_C(0x4)
25342         /* Generic Network Virtualization Encapsulation (Geneve) */
25343         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_GENEVE \
25344                 UINT32_C(0x5)
25345         /* Multi-Protocol Lable Switching (MPLS) */
25346         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_MPLS \
25347                 UINT32_C(0x6)
25348         /* Stateless Transport Tunnel (STT) */
25349         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_STT \
25350                 UINT32_C(0x7)
25351         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25352         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE \
25353                 UINT32_C(0x8)
25354         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25355         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25356                 UINT32_C(0x9)
25357         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25358         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25359                 UINT32_C(0xa)
25360         /* Use fixed layer 2 ether type of 0xFFFF */
25361         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_L2_ETYPE \
25362                 UINT32_C(0xb)
25363         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25364         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25365                 UINT32_C(0xc)
25366         /* Any tunneled traffic */
25367         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25368                 UINT32_C(0xff)
25369         #define HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_LAST \
25370                 HWRM_CFA_REDIRECT_TUNNEL_TYPE_INFO_INPUT_TUNNEL_TYPE_ANYTUNNEL
25371         uint8_t unused_0[5];
25372 } __attribute__((packed));
25373
25374 /* hwrm_cfa_redirect_tunnel_type_info_output (size:128b/16B) */
25375 struct hwrm_cfa_redirect_tunnel_type_info_output {
25376         /* The specific error status for the command. */
25377         uint16_t        error_code;
25378         /* The HWRM command request type. */
25379         uint16_t        req_type;
25380         /* The sequence ID from the original command. */
25381         uint16_t        seq_id;
25382         /* The length of the response data in number of bytes. */
25383         uint16_t        resp_len;
25384         /* The destination function id, to whom the traffic is redirected. */
25385         uint16_t        dest_fid;
25386         uint8_t unused_0[5];
25387         /*
25388          * This field is used in Output records to indicate that the output
25389          * is completely written to RAM.  This field should be read as '1'
25390          * to indicate that the output has been completely written.
25391          * When writing a command completion or response to an internal processor,
25392          * the order of writes has to be such that this field is written last.
25393          */
25394         uint8_t valid;
25395 } __attribute__((packed));
25396
25397 /* hwrm_vxlan_ipv4_hdr (size:128b/16B) */
25398 struct hwrm_vxlan_ipv4_hdr {
25399         /* IPv4 version and header length. */
25400         uint8_t ver_hlen;
25401         /* IPv4 header length */
25402         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_MASK UINT32_C(0xf)
25403         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_HEADER_LENGTH_SFT 0
25404         /* Version */
25405         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_MASK      UINT32_C(0xf0)
25406         #define HWRM_VXLAN_IPV4_HDR_VER_HLEN_VERSION_SFT       4
25407         /* IPv4 type of service. */
25408         uint8_t tos;
25409         /* IPv4 identification. */
25410         uint16_t        ip_id;
25411         /* IPv4 flags and offset. */
25412         uint16_t        flags_frag_offset;
25413         /* IPv4 TTL. */
25414         uint8_t ttl;
25415         /* IPv4 protocol. */
25416         uint8_t protocol;
25417         /* IPv4 source address. */
25418         uint32_t        src_ip_addr;
25419         /* IPv4 destination address. */
25420         uint32_t        dest_ip_addr;
25421 } __attribute__((packed));
25422
25423 /* hwrm_vxlan_ipv6_hdr (size:320b/40B) */
25424 struct hwrm_vxlan_ipv6_hdr {
25425         /* IPv6 version, traffic class and flow label. */
25426         uint32_t        ver_tc_flow_label;
25427         /* IPv6 version shift */
25428         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_SFT \
25429                 UINT32_C(0x1c)
25430         /* IPv6 version mask */
25431         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_VER_MASK \
25432                 UINT32_C(0xf0000000)
25433         /* IPv6 TC shift */
25434         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_SFT \
25435                 UINT32_C(0x14)
25436         /* IPv6 TC mask */
25437         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_TC_MASK \
25438                 UINT32_C(0xff00000)
25439         /* IPv6 flow label shift */
25440         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_SFT \
25441                 UINT32_C(0x0)
25442         /* IPv6 flow label mask */
25443         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK \
25444                 UINT32_C(0xfffff)
25445         #define HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_LAST \
25446                 HWRM_VXLAN_IPV6_HDR_VER_TC_FLOW_LABEL_FLOW_LABEL_MASK
25447         /* IPv6 payload length. */
25448         uint16_t        payload_len;
25449         /* IPv6 next header. */
25450         uint8_t next_hdr;
25451         /* IPv6 TTL. */
25452         uint8_t ttl;
25453         /* IPv6 source address. */
25454         uint32_t        src_ip_addr[4];
25455         /* IPv6 destination address. */
25456         uint32_t        dest_ip_addr[4];
25457 } __attribute__((packed));
25458
25459 /* hwrm_cfa_encap_data_vxlan (size:640b/80B) */
25460 struct hwrm_cfa_encap_data_vxlan {
25461         /* Source MAC address. */
25462         uint8_t src_mac_addr[6];
25463         /* reserved. */
25464         uint16_t        unused_0;
25465         /* Destination MAC address. */
25466         uint8_t dst_mac_addr[6];
25467         /* Number of VLAN tags. */
25468         uint8_t num_vlan_tags;
25469         /* reserved. */
25470         uint8_t unused_1;
25471         /* Outer VLAN TPID. */
25472         uint16_t        ovlan_tpid;
25473         /* Outer VLAN TCI. */
25474         uint16_t        ovlan_tci;
25475         /* Inner VLAN TPID. */
25476         uint16_t        ivlan_tpid;
25477         /* Inner VLAN TCI. */
25478         uint16_t        ivlan_tci;
25479         /* L3 header fields. */
25480         uint32_t        l3[10];
25481         /* IP version mask. */
25482         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_MASK UINT32_C(0xf)
25483         /* IP version 4. */
25484         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV4 UINT32_C(0x4)
25485         /* IP version 6. */
25486         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6 UINT32_C(0x6)
25487         #define HWRM_CFA_ENCAP_DATA_VXLAN_L3_LAST \
25488                 HWRM_CFA_ENCAP_DATA_VXLAN_L3_VER_IPV6
25489         /* UDP source port. */
25490         uint16_t        src_port;
25491         /* UDP destination port. */
25492         uint16_t        dst_port;
25493         /* VXLAN Network Identifier. */
25494         uint32_t        vni;
25495         /* 3 bytes VXLAN header reserve fields from 1st dword of the VXLAN header. */
25496         uint8_t hdr_rsvd0[3];
25497         /* 1 byte VXLAN header reserve field from 2nd dword of the VXLAN header. */
25498         uint8_t hdr_rsvd1;
25499         /* VXLAN header flags field. */
25500         uint8_t hdr_flags;
25501         uint8_t unused[3];
25502 } __attribute__((packed));
25503
25504 /*******************************
25505  * hwrm_cfa_encap_record_alloc *
25506  *******************************/
25507
25508
25509 /* hwrm_cfa_encap_record_alloc_input (size:832b/104B) */
25510 struct hwrm_cfa_encap_record_alloc_input {
25511         /* The HWRM command request type. */
25512         uint16_t        req_type;
25513         /*
25514          * The completion ring to send the completion event on. This should
25515          * be the NQ ID returned from the `nq_alloc` HWRM command.
25516          */
25517         uint16_t        cmpl_ring;
25518         /*
25519          * The sequence ID is used by the driver for tracking multiple
25520          * commands. This ID is treated as opaque data by the firmware and
25521          * the value is returned in the `hwrm_resp_hdr` upon completion.
25522          */
25523         uint16_t        seq_id;
25524         /*
25525          * The target ID of the command:
25526          * * 0x0-0xFFF8 - The function ID
25527          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25528          * * 0xFFFD - Reserved for user-space HWRM interface
25529          * * 0xFFFF - HWRM
25530          */
25531         uint16_t        target_id;
25532         /*
25533          * A physical address pointer pointing to a host buffer that the
25534          * command's response data will be written. This can be either a host
25535          * physical address (HPA) or a guest physical address (GPA) and must
25536          * point to a physically contiguous block of memory.
25537          */
25538         uint64_t        resp_addr;
25539         uint32_t        flags;
25540         /* Setting of this flag indicates the applicability to the loopback path. */
25541         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_LOOPBACK \
25542                 UINT32_C(0x1)
25543         /*
25544          * Setting of this flag indicates this encap record is external encap record.
25545          * Resetting of this flag indicates this flag is internal encap record and
25546          * this is the default setting.
25547          */
25548         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_FLAGS_EXTERNAL \
25549                 UINT32_C(0x2)
25550         /* Encapsulation Type. */
25551         uint8_t encap_type;
25552         /* Virtual eXtensible Local Area Network (VXLAN) */
25553         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN \
25554                 UINT32_C(0x1)
25555         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25556         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_NVGRE \
25557                 UINT32_C(0x2)
25558         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
25559         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2GRE \
25560                 UINT32_C(0x3)
25561         /* IP in IP */
25562         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPIP \
25563                 UINT32_C(0x4)
25564         /* Generic Network Virtualization Encapsulation (Geneve) */
25565         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_GENEVE \
25566                 UINT32_C(0x5)
25567         /* Multi-Protocol Lable Switching (MPLS) */
25568         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_MPLS \
25569                 UINT32_C(0x6)
25570         /* VLAN */
25571         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VLAN \
25572                 UINT32_C(0x7)
25573         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25574         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE \
25575                 UINT32_C(0x8)
25576         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25577         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_V4 \
25578                 UINT32_C(0x9)
25579         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25580         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_IPGRE_V1 \
25581                 UINT32_C(0xa)
25582         /* Use fixed layer 2 ether type of 0xFFFF */
25583         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_L2_ETYPE \
25584                 UINT32_C(0xb)
25585         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25586         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6 \
25587                 UINT32_C(0xc)
25588         #define HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_LAST \
25589                 HWRM_CFA_ENCAP_RECORD_ALLOC_INPUT_ENCAP_TYPE_VXLAN_GPE_V6
25590         uint8_t unused_0[3];
25591         /* This value is encap data used for the given encap type. */
25592         uint32_t        encap_data[20];
25593 } __attribute__((packed));
25594
25595 /* hwrm_cfa_encap_record_alloc_output (size:128b/16B) */
25596 struct hwrm_cfa_encap_record_alloc_output {
25597         /* The specific error status for the command. */
25598         uint16_t        error_code;
25599         /* The HWRM command request type. */
25600         uint16_t        req_type;
25601         /* The sequence ID from the original command. */
25602         uint16_t        seq_id;
25603         /* The length of the response data in number of bytes. */
25604         uint16_t        resp_len;
25605         /* This value is an opaque id into CFA data structures. */
25606         uint32_t        encap_record_id;
25607         uint8_t unused_0[3];
25608         /*
25609          * This field is used in Output records to indicate that the output
25610          * is completely written to RAM.  This field should be read as '1'
25611          * to indicate that the output has been completely written.
25612          * When writing a command completion or response to an internal processor,
25613          * the order of writes has to be such that this field is written last.
25614          */
25615         uint8_t valid;
25616 } __attribute__((packed));
25617
25618 /******************************
25619  * hwrm_cfa_encap_record_free *
25620  ******************************/
25621
25622
25623 /* hwrm_cfa_encap_record_free_input (size:192b/24B) */
25624 struct hwrm_cfa_encap_record_free_input {
25625         /* The HWRM command request type. */
25626         uint16_t        req_type;
25627         /*
25628          * The completion ring to send the completion event on. This should
25629          * be the NQ ID returned from the `nq_alloc` HWRM command.
25630          */
25631         uint16_t        cmpl_ring;
25632         /*
25633          * The sequence ID is used by the driver for tracking multiple
25634          * commands. This ID is treated as opaque data by the firmware and
25635          * the value is returned in the `hwrm_resp_hdr` upon completion.
25636          */
25637         uint16_t        seq_id;
25638         /*
25639          * The target ID of the command:
25640          * * 0x0-0xFFF8 - The function ID
25641          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25642          * * 0xFFFD - Reserved for user-space HWRM interface
25643          * * 0xFFFF - HWRM
25644          */
25645         uint16_t        target_id;
25646         /*
25647          * A physical address pointer pointing to a host buffer that the
25648          * command's response data will be written. This can be either a host
25649          * physical address (HPA) or a guest physical address (GPA) and must
25650          * point to a physically contiguous block of memory.
25651          */
25652         uint64_t        resp_addr;
25653         /* This value is an opaque id into CFA data structures. */
25654         uint32_t        encap_record_id;
25655         uint8_t unused_0[4];
25656 } __attribute__((packed));
25657
25658 /* hwrm_cfa_encap_record_free_output (size:128b/16B) */
25659 struct hwrm_cfa_encap_record_free_output {
25660         /* The specific error status for the command. */
25661         uint16_t        error_code;
25662         /* The HWRM command request type. */
25663         uint16_t        req_type;
25664         /* The sequence ID from the original command. */
25665         uint16_t        seq_id;
25666         /* The length of the response data in number of bytes. */
25667         uint16_t        resp_len;
25668         uint8_t unused_0[7];
25669         /*
25670          * This field is used in Output records to indicate that the output
25671          * is completely written to RAM.  This field should be read as '1'
25672          * to indicate that the output has been completely written.
25673          * When writing a command completion or response to an internal processor,
25674          * the order of writes has to be such that this field is written last.
25675          */
25676         uint8_t valid;
25677 } __attribute__((packed));
25678
25679 /********************************
25680  * hwrm_cfa_ntuple_filter_alloc *
25681  ********************************/
25682
25683
25684 /* hwrm_cfa_ntuple_filter_alloc_input (size:1088b/136B) */
25685 struct hwrm_cfa_ntuple_filter_alloc_input {
25686         /* The HWRM command request type. */
25687         uint16_t        req_type;
25688         /*
25689          * The completion ring to send the completion event on. This should
25690          * be the NQ ID returned from the `nq_alloc` HWRM command.
25691          */
25692         uint16_t        cmpl_ring;
25693         /*
25694          * The sequence ID is used by the driver for tracking multiple
25695          * commands. This ID is treated as opaque data by the firmware and
25696          * the value is returned in the `hwrm_resp_hdr` upon completion.
25697          */
25698         uint16_t        seq_id;
25699         /*
25700          * The target ID of the command:
25701          * * 0x0-0xFFF8 - The function ID
25702          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
25703          * * 0xFFFD - Reserved for user-space HWRM interface
25704          * * 0xFFFF - HWRM
25705          */
25706         uint16_t        target_id;
25707         /*
25708          * A physical address pointer pointing to a host buffer that the
25709          * command's response data will be written. This can be either a host
25710          * physical address (HPA) or a guest physical address (GPA) and must
25711          * point to a physically contiguous block of memory.
25712          */
25713         uint64_t        resp_addr;
25714         uint32_t        flags;
25715         /* Setting of this flag indicates the applicability to the loopback path. */
25716         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
25717                 UINT32_C(0x1)
25718         /*
25719          * Setting of this flag indicates drop action. If this flag is not set,
25720          * then it should be considered accept action.
25721          */
25722         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP \
25723                 UINT32_C(0x2)
25724         /*
25725          * Setting of this flag indicates that a meter is expected to be attached
25726          * to this flow. This hint can be used when choosing the action record
25727          * format required for the flow.
25728          */
25729         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_METER \
25730                 UINT32_C(0x4)
25731         /*
25732          * Setting of this flag indicates that the dest_id field contains function ID.
25733          * If this is not set it indicates dest_id is VNIC or VPORT.
25734          */
25735         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DEST_FID \
25736                 UINT32_C(0x8)
25737         uint32_t        enables;
25738         /*
25739          * This bit must be '1' for the l2_filter_id field to be
25740          * configured.
25741          */
25742         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
25743                 UINT32_C(0x1)
25744         /*
25745          * This bit must be '1' for the ethertype field to be
25746          * configured.
25747          */
25748         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
25749                 UINT32_C(0x2)
25750         /*
25751          * This bit must be '1' for the tunnel_type field to be
25752          * configured.
25753          */
25754         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
25755                 UINT32_C(0x4)
25756         /*
25757          * This bit must be '1' for the src_macaddr field to be
25758          * configured.
25759          */
25760         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
25761                 UINT32_C(0x8)
25762         /*
25763          * This bit must be '1' for the ipaddr_type field to be
25764          * configured.
25765          */
25766         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
25767                 UINT32_C(0x10)
25768         /*
25769          * This bit must be '1' for the src_ipaddr field to be
25770          * configured.
25771          */
25772         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
25773                 UINT32_C(0x20)
25774         /*
25775          * This bit must be '1' for the src_ipaddr_mask field to be
25776          * configured.
25777          */
25778         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR_MASK \
25779                 UINT32_C(0x40)
25780         /*
25781          * This bit must be '1' for the dst_ipaddr field to be
25782          * configured.
25783          */
25784         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
25785                 UINT32_C(0x80)
25786         /*
25787          * This bit must be '1' for the dst_ipaddr_mask field to be
25788          * configured.
25789          */
25790         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR_MASK \
25791                 UINT32_C(0x100)
25792         /*
25793          * This bit must be '1' for the ip_protocol field to be
25794          * configured.
25795          */
25796         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
25797                 UINT32_C(0x200)
25798         /*
25799          * This bit must be '1' for the src_port field to be
25800          * configured.
25801          */
25802         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
25803                 UINT32_C(0x400)
25804         /*
25805          * This bit must be '1' for the src_port_mask field to be
25806          * configured.
25807          */
25808         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT_MASK \
25809                 UINT32_C(0x800)
25810         /*
25811          * This bit must be '1' for the dst_port field to be
25812          * configured.
25813          */
25814         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
25815                 UINT32_C(0x1000)
25816         /*
25817          * This bit must be '1' for the dst_port_mask field to be
25818          * configured.
25819          */
25820         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_PORT_MASK \
25821                 UINT32_C(0x2000)
25822         /*
25823          * This bit must be '1' for the pri_hint field to be
25824          * configured.
25825          */
25826         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_PRI_HINT \
25827                 UINT32_C(0x4000)
25828         /*
25829          * This bit must be '1' for the ntuple_filter_id field to be
25830          * configured.
25831          */
25832         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_NTUPLE_FILTER_ID \
25833                 UINT32_C(0x8000)
25834         /*
25835          * This bit must be '1' for the dst_id field to be
25836          * configured.
25837          */
25838         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
25839                 UINT32_C(0x10000)
25840         /*
25841          * This bit must be '1' for the mirror_vnic_id field to be
25842          * configured.
25843          */
25844         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
25845                 UINT32_C(0x20000)
25846         /*
25847          * This bit must be '1' for the dst_macaddr field to be
25848          * configured.
25849          */
25850         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
25851                 UINT32_C(0x40000)
25852         /*
25853          * This bit must be '1' for the rfs_ring_tbl_idx field to be
25854          * configured.
25855          */
25856         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_RFS_RING_TBL_IDX \
25857                 UINT32_C(0x80000)
25858         /*
25859          * This value identifies a set of CFA data structures used for an L2
25860          * context.
25861          */
25862         uint64_t        l2_filter_id;
25863         /*
25864          * This value indicates the source MAC address in
25865          * the Ethernet header.
25866          */
25867         uint8_t src_macaddr[6];
25868         /* This value indicates the ethertype in the Ethernet header. */
25869         uint16_t        ethertype;
25870         /*
25871          * This value indicates the type of IP address.
25872          * 4 - IPv4
25873          * 6 - IPv6
25874          * All others are invalid.
25875          */
25876         uint8_t ip_addr_type;
25877         /* invalid */
25878         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
25879                 UINT32_C(0x0)
25880         /* IPv4 */
25881         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
25882                 UINT32_C(0x4)
25883         /* IPv6 */
25884         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
25885                 UINT32_C(0x6)
25886         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
25887                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
25888         /*
25889          * The value of protocol filed in IP header.
25890          * Applies to UDP and TCP traffic.
25891          * 6 - TCP
25892          * 17 - UDP
25893          */
25894         uint8_t ip_protocol;
25895         /* invalid */
25896         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
25897                 UINT32_C(0x0)
25898         /* TCP */
25899         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
25900                 UINT32_C(0x6)
25901         /* UDP */
25902         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
25903                 UINT32_C(0x11)
25904         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
25905                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
25906         /*
25907          * If set, this value shall represent the
25908          * Logical VNIC ID of the destination VNIC for the RX
25909          * path and network port id of the destination port for
25910          * the TX path.
25911          */
25912         uint16_t        dst_id;
25913         /*
25914          * Logical VNIC ID of the VNIC where traffic is
25915          * mirrored.
25916          */
25917         uint16_t        mirror_vnic_id;
25918         /*
25919          * This value indicates the tunnel type for this filter.
25920          * If this field is not specified, then the filter shall
25921          * apply to both non-tunneled and tunneled packets.
25922          * If this field conflicts with the tunnel_type specified
25923          * in the l2_filter_id, then the HWRM shall return an
25924          * error for this command.
25925          */
25926         uint8_t tunnel_type;
25927         /* Non-tunnel */
25928         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
25929                 UINT32_C(0x0)
25930         /* Virtual eXtensible Local Area Network (VXLAN) */
25931         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
25932                 UINT32_C(0x1)
25933         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
25934         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
25935                 UINT32_C(0x2)
25936         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
25937         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
25938                 UINT32_C(0x3)
25939         /* IP in IP */
25940         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
25941                 UINT32_C(0x4)
25942         /* Generic Network Virtualization Encapsulation (Geneve) */
25943         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
25944                 UINT32_C(0x5)
25945         /* Multi-Protocol Lable Switching (MPLS) */
25946         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
25947                 UINT32_C(0x6)
25948         /* Stateless Transport Tunnel (STT) */
25949         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
25950                 UINT32_C(0x7)
25951         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
25952         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
25953                 UINT32_C(0x8)
25954         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
25955         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
25956                 UINT32_C(0x9)
25957         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
25958         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
25959                 UINT32_C(0xa)
25960         /* Use fixed layer 2 ether type of 0xFFFF */
25961         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
25962                 UINT32_C(0xb)
25963         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
25964         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
25965                 UINT32_C(0xc)
25966         /* Any tunneled traffic */
25967         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
25968                 UINT32_C(0xff)
25969         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
25970                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
25971         /*
25972          * This hint is provided to help in placing
25973          * the filter in the filter table.
25974          */
25975         uint8_t pri_hint;
25976         /* No preference */
25977         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
25978                 UINT32_C(0x0)
25979         /* Above the given filter */
25980         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE \
25981                 UINT32_C(0x1)
25982         /* Below the given filter */
25983         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_BELOW \
25984                 UINT32_C(0x2)
25985         /* As high as possible */
25986         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_HIGHEST \
25987                 UINT32_C(0x3)
25988         /* As low as possible */
25989         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST \
25990                 UINT32_C(0x4)
25991         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LAST \
25992                 HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_PRI_HINT_LOWEST
25993         /*
25994          * The value of source IP address to be used in filtering.
25995          * For IPv4, first four bytes represent the IP address.
25996          */
25997         uint32_t        src_ipaddr[4];
25998         /*
25999          * The value of source IP address mask to be used in
26000          * filtering.
26001          * For IPv4, first four bytes represent the IP address mask.
26002          */
26003         uint32_t        src_ipaddr_mask[4];
26004         /*
26005          * The value of destination IP address to be used in filtering.
26006          * For IPv4, first four bytes represent the IP address.
26007          */
26008         uint32_t        dst_ipaddr[4];
26009         /*
26010          * The value of destination IP address mask to be used in
26011          * filtering.
26012          * For IPv4, first four bytes represent the IP address mask.
26013          */
26014         uint32_t        dst_ipaddr_mask[4];
26015         /*
26016          * The value of source port to be used in filtering.
26017          * Applies to UDP and TCP traffic.
26018          */
26019         uint16_t        src_port;
26020         /*
26021          * The value of source port mask to be used in filtering.
26022          * Applies to UDP and TCP traffic.
26023          */
26024         uint16_t        src_port_mask;
26025         /*
26026          * The value of destination port to be used in filtering.
26027          * Applies to UDP and TCP traffic.
26028          */
26029         uint16_t        dst_port;
26030         /*
26031          * The value of destination port mask to be used in
26032          * filtering.
26033          * Applies to UDP and TCP traffic.
26034          */
26035         uint16_t        dst_port_mask;
26036         /*
26037          * This is the ID of the filter that goes along with
26038          * the pri_hint.
26039          */
26040         uint64_t        ntuple_filter_id_hint;
26041         /*
26042          * The value of rfs_ring_tbl_idx to be used for RFS for this filter.
26043          * This index is used in lieu of the RSS hash when selecting the
26044          * index into the RSS table to determine the rx ring.
26045          */
26046         uint16_t        rfs_ring_tbl_idx;
26047         uint8_t unused_0[6];
26048 } __attribute__((packed));
26049
26050 /* hwrm_cfa_ntuple_filter_alloc_output (size:192b/24B) */
26051 struct hwrm_cfa_ntuple_filter_alloc_output {
26052         /* The specific error status for the command. */
26053         uint16_t        error_code;
26054         /* The HWRM command request type. */
26055         uint16_t        req_type;
26056         /* The sequence ID from the original command. */
26057         uint16_t        seq_id;
26058         /* The length of the response data in number of bytes. */
26059         uint16_t        resp_len;
26060         /* This value is an opaque id into CFA data structures. */
26061         uint64_t        ntuple_filter_id;
26062         /*
26063          * The flow id value in bit 0-29 is the actual ID of the flow
26064          * associated with this filter and it shall be used to match
26065          * and associate the flow identifier returned in completion
26066          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
26067          * shall indicate no valid flow id.
26068          */
26069         uint32_t        flow_id;
26070         /* Indicate the flow id value. */
26071         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
26072                 UINT32_C(0x3fffffff)
26073         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
26074         /* Indicate type of the flow. */
26075         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE \
26076                 UINT32_C(0x40000000)
26077         /*
26078          * If this bit set to 0, then it indicates that the flow is
26079          * internal flow.
26080          */
26081         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
26082                 (UINT32_C(0x0) << 30)
26083         /*
26084          * If this bit is set to 1, then it indicates that the flow is
26085          * external flow.
26086          */
26087         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
26088                 (UINT32_C(0x1) << 30)
26089         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
26090                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
26091         /* Indicate the flow direction. */
26092         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR \
26093                 UINT32_C(0x80000000)
26094         /* If this bit set to 0, then it indicates rx flow. */
26095         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
26096                 (UINT32_C(0x0) << 31)
26097         /* If this bit is set to 1, then it indicates that tx flow. */
26098         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
26099                 (UINT32_C(0x1) << 31)
26100         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
26101                 HWRM_CFA_NTUPLE_FILTER_ALLOC_OUTPUT_FLOW_ID_DIR_TX
26102         uint8_t unused_0[3];
26103         /*
26104          * This field is used in Output records to indicate that the output
26105          * is completely written to RAM.  This field should be read as '1'
26106          * to indicate that the output has been completely written.
26107          * When writing a command completion or response to an internal processor,
26108          * the order of writes has to be such that this field is written last.
26109          */
26110         uint8_t valid;
26111 } __attribute__((packed));
26112
26113 /* hwrm_cfa_ntuple_filter_alloc_cmd_err (size:64b/8B) */
26114 struct hwrm_cfa_ntuple_filter_alloc_cmd_err {
26115         /*
26116          * command specific error codes that goes to
26117          * the cmd_err field in Common HWRM Error Response.
26118          */
26119         uint8_t code;
26120         /* Unknown error */
26121         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_UNKNOWN \
26122                 UINT32_C(0x0)
26123         /* Unable to complete operation due to conflict with Rx Mask VLAN */
26124         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR \
26125                 UINT32_C(0x1)
26126         #define HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_LAST \
26127                 HWRM_CFA_NTUPLE_FILTER_ALLOC_CMD_ERR_CODE_RX_MASK_VLAN_CONFLICT_ERR
26128         uint8_t unused_0[7];
26129 } __attribute__((packed));
26130
26131 /*******************************
26132  * hwrm_cfa_ntuple_filter_free *
26133  *******************************/
26134
26135
26136 /* hwrm_cfa_ntuple_filter_free_input (size:192b/24B) */
26137 struct hwrm_cfa_ntuple_filter_free_input {
26138         /* The HWRM command request type. */
26139         uint16_t        req_type;
26140         /*
26141          * The completion ring to send the completion event on. This should
26142          * be the NQ ID returned from the `nq_alloc` HWRM command.
26143          */
26144         uint16_t        cmpl_ring;
26145         /*
26146          * The sequence ID is used by the driver for tracking multiple
26147          * commands. This ID is treated as opaque data by the firmware and
26148          * the value is returned in the `hwrm_resp_hdr` upon completion.
26149          */
26150         uint16_t        seq_id;
26151         /*
26152          * The target ID of the command:
26153          * * 0x0-0xFFF8 - The function ID
26154          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26155          * * 0xFFFD - Reserved for user-space HWRM interface
26156          * * 0xFFFF - HWRM
26157          */
26158         uint16_t        target_id;
26159         /*
26160          * A physical address pointer pointing to a host buffer that the
26161          * command's response data will be written. This can be either a host
26162          * physical address (HPA) or a guest physical address (GPA) and must
26163          * point to a physically contiguous block of memory.
26164          */
26165         uint64_t        resp_addr;
26166         /* This value is an opaque id into CFA data structures. */
26167         uint64_t        ntuple_filter_id;
26168 } __attribute__((packed));
26169
26170 /* hwrm_cfa_ntuple_filter_free_output (size:128b/16B) */
26171 struct hwrm_cfa_ntuple_filter_free_output {
26172         /* The specific error status for the command. */
26173         uint16_t        error_code;
26174         /* The HWRM command request type. */
26175         uint16_t        req_type;
26176         /* The sequence ID from the original command. */
26177         uint16_t        seq_id;
26178         /* The length of the response data in number of bytes. */
26179         uint16_t        resp_len;
26180         uint8_t unused_0[7];
26181         /*
26182          * This field is used in Output records to indicate that the output
26183          * is completely written to RAM.  This field should be read as '1'
26184          * to indicate that the output has been completely written.
26185          * When writing a command completion or response to an internal processor,
26186          * the order of writes has to be such that this field is written last.
26187          */
26188         uint8_t valid;
26189 } __attribute__((packed));
26190
26191 /******************************
26192  * hwrm_cfa_ntuple_filter_cfg *
26193  ******************************/
26194
26195
26196 /* hwrm_cfa_ntuple_filter_cfg_input (size:384b/48B) */
26197 struct hwrm_cfa_ntuple_filter_cfg_input {
26198         /* The HWRM command request type. */
26199         uint16_t        req_type;
26200         /*
26201          * The completion ring to send the completion event on. This should
26202          * be the NQ ID returned from the `nq_alloc` HWRM command.
26203          */
26204         uint16_t        cmpl_ring;
26205         /*
26206          * The sequence ID is used by the driver for tracking multiple
26207          * commands. This ID is treated as opaque data by the firmware and
26208          * the value is returned in the `hwrm_resp_hdr` upon completion.
26209          */
26210         uint16_t        seq_id;
26211         /*
26212          * The target ID of the command:
26213          * * 0x0-0xFFF8 - The function ID
26214          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26215          * * 0xFFFD - Reserved for user-space HWRM interface
26216          * * 0xFFFF - HWRM
26217          */
26218         uint16_t        target_id;
26219         /*
26220          * A physical address pointer pointing to a host buffer that the
26221          * command's response data will be written. This can be either a host
26222          * physical address (HPA) or a guest physical address (GPA) and must
26223          * point to a physically contiguous block of memory.
26224          */
26225         uint64_t        resp_addr;
26226         uint32_t        enables;
26227         /*
26228          * This bit must be '1' for the new_dst_id field to be
26229          * configured.
26230          */
26231         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_DST_ID \
26232                 UINT32_C(0x1)
26233         /*
26234          * This bit must be '1' for the new_mirror_vnic_id field to be
26235          * configured.
26236          */
26237         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
26238                 UINT32_C(0x2)
26239         /*
26240          * This bit must be '1' for the new_meter_instance_id field to be
26241          * configured.
26242          */
26243         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_ENABLES_NEW_METER_INSTANCE_ID \
26244                 UINT32_C(0x4)
26245         uint32_t        flags;
26246         /*
26247          * Setting this bit to 1 indicates that dest_id field contains FID.
26248          * Setting this to 0 indicates that dest_id field contains VNIC or VPORT.
26249          */
26250         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_FLAGS_DEST_FID \
26251                 UINT32_C(0x1)
26252         /* This value is an opaque id into CFA data structures. */
26253         uint64_t        ntuple_filter_id;
26254         /*
26255          * If set, this value shall represent the new
26256          * Logical VNIC ID of the destination VNIC for the RX
26257          * path and new network port id of the destination port for
26258          * the TX path.
26259          */
26260         uint32_t        new_dst_id;
26261         /*
26262          * New Logical VNIC ID of the VNIC where traffic is
26263          * mirrored.
26264          */
26265         uint32_t        new_mirror_vnic_id;
26266         /*
26267          * New meter to attach to the flow. Specifying the
26268          * invalid instance ID is used to remove any existing
26269          * meter from the flow.
26270          */
26271         uint16_t        new_meter_instance_id;
26272         /*
26273          * A value of 0xfff is considered invalid and implies the
26274          * instance is not configured.
26275          */
26276         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID \
26277                 UINT32_C(0xffff)
26278         #define HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_LAST \
26279                 HWRM_CFA_NTUPLE_FILTER_CFG_INPUT_NEW_METER_INSTANCE_ID_INVALID
26280         uint8_t unused_1[6];
26281 } __attribute__((packed));
26282
26283 /* hwrm_cfa_ntuple_filter_cfg_output (size:128b/16B) */
26284 struct hwrm_cfa_ntuple_filter_cfg_output {
26285         /* The specific error status for the command. */
26286         uint16_t        error_code;
26287         /* The HWRM command request type. */
26288         uint16_t        req_type;
26289         /* The sequence ID from the original command. */
26290         uint16_t        seq_id;
26291         /* The length of the response data in number of bytes. */
26292         uint16_t        resp_len;
26293         uint8_t unused_0[7];
26294         /*
26295          * This field is used in Output records to indicate that the output
26296          * is completely written to RAM.  This field should be read as '1'
26297          * to indicate that the output has been completely written.
26298          * When writing a command completion or response to an internal processor,
26299          * the order of writes has to be such that this field is written last.
26300          */
26301         uint8_t valid;
26302 } __attribute__((packed));
26303
26304 /**************************
26305  * hwrm_cfa_em_flow_alloc *
26306  **************************/
26307
26308
26309 /* hwrm_cfa_em_flow_alloc_input (size:896b/112B) */
26310 struct hwrm_cfa_em_flow_alloc_input {
26311         /* The HWRM command request type. */
26312         uint16_t        req_type;
26313         /*
26314          * The completion ring to send the completion event on. This should
26315          * be the NQ ID returned from the `nq_alloc` HWRM command.
26316          */
26317         uint16_t        cmpl_ring;
26318         /*
26319          * The sequence ID is used by the driver for tracking multiple
26320          * commands. This ID is treated as opaque data by the firmware and
26321          * the value is returned in the `hwrm_resp_hdr` upon completion.
26322          */
26323         uint16_t        seq_id;
26324         /*
26325          * The target ID of the command:
26326          * * 0x0-0xFFF8 - The function ID
26327          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26328          * * 0xFFFD - Reserved for user-space HWRM interface
26329          * * 0xFFFF - HWRM
26330          */
26331         uint16_t        target_id;
26332         /*
26333          * A physical address pointer pointing to a host buffer that the
26334          * command's response data will be written. This can be either a host
26335          * physical address (HPA) or a guest physical address (GPA) and must
26336          * point to a physically contiguous block of memory.
26337          */
26338         uint64_t        resp_addr;
26339         uint32_t        flags;
26340         /*
26341          * Enumeration denoting the RX, TX type of the resource.
26342          * This enumeration is used for resources that are similar for both
26343          * TX and RX paths of the chip.
26344          */
26345         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH         UINT32_C(0x1)
26346         /* tx path */
26347         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_TX        UINT32_C(0x0)
26348         /* rx path */
26349         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX        UINT32_C(0x1)
26350         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_LAST \
26351                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX
26352         /*
26353          * Setting of this flag indicates enabling of a byte counter for a given
26354          * flow.
26355          */
26356         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_BYTE_CTR     UINT32_C(0x2)
26357         /*
26358          * Setting of this flag indicates enabling of a packet counter for a given
26359          * flow.
26360          */
26361         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PKT_CTR      UINT32_C(0x4)
26362         /* Setting of this flag indicates de-capsulation action for the given flow. */
26363         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DECAP        UINT32_C(0x8)
26364         /* Setting of this flag indicates encapsulation action for the given flow. */
26365         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_ENCAP        UINT32_C(0x10)
26366         /*
26367          * Setting of this flag indicates drop action. If this flag is not set,
26368          * then it should be considered accept action.
26369          */
26370         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_DROP         UINT32_C(0x20)
26371         /*
26372          * Setting of this flag indicates that a meter is expected to be attached
26373          * to this flow. This hint can be used when choosing the action record
26374          * format required for the flow.
26375          */
26376         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_METER        UINT32_C(0x40)
26377         uint32_t        enables;
26378         /*
26379          * This bit must be '1' for the l2_filter_id field to be
26380          * configured.
26381          */
26382         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_L2_FILTER_ID \
26383                 UINT32_C(0x1)
26384         /*
26385          * This bit must be '1' for the tunnel_type field to be
26386          * configured.
26387          */
26388         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
26389                 UINT32_C(0x2)
26390         /*
26391          * This bit must be '1' for the tunnel_id field to be
26392          * configured.
26393          */
26394         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_TUNNEL_ID \
26395                 UINT32_C(0x4)
26396         /*
26397          * This bit must be '1' for the src_macaddr field to be
26398          * configured.
26399          */
26400         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR \
26401                 UINT32_C(0x8)
26402         /*
26403          * This bit must be '1' for the dst_macaddr field to be
26404          * configured.
26405          */
26406         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR \
26407                 UINT32_C(0x10)
26408         /*
26409          * This bit must be '1' for the ovlan_vid field to be
26410          * configured.
26411          */
26412         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID \
26413                 UINT32_C(0x20)
26414         /*
26415          * This bit must be '1' for the ivlan_vid field to be
26416          * configured.
26417          */
26418         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IVLAN_VID \
26419                 UINT32_C(0x40)
26420         /*
26421          * This bit must be '1' for the ethertype field to be
26422          * configured.
26423          */
26424         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ETHERTYPE \
26425                 UINT32_C(0x80)
26426         /*
26427          * This bit must be '1' for the src_ipaddr field to be
26428          * configured.
26429          */
26430         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_IPADDR \
26431                 UINT32_C(0x100)
26432         /*
26433          * This bit must be '1' for the dst_ipaddr field to be
26434          * configured.
26435          */
26436         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_IPADDR \
26437                 UINT32_C(0x200)
26438         /*
26439          * This bit must be '1' for the ipaddr_type field to be
26440          * configured.
26441          */
26442         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
26443                 UINT32_C(0x400)
26444         /*
26445          * This bit must be '1' for the ip_protocol field to be
26446          * configured.
26447          */
26448         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
26449                 UINT32_C(0x800)
26450         /*
26451          * This bit must be '1' for the src_port field to be
26452          * configured.
26453          */
26454         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_PORT \
26455                 UINT32_C(0x1000)
26456         /*
26457          * This bit must be '1' for the dst_port field to be
26458          * configured.
26459          */
26460         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_PORT \
26461                 UINT32_C(0x2000)
26462         /*
26463          * This bit must be '1' for the dst_id field to be
26464          * configured.
26465          */
26466         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_ID \
26467                 UINT32_C(0x4000)
26468         /*
26469          * This bit must be '1' for the mirror_vnic_id field to be
26470          * configured.
26471          */
26472         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
26473                 UINT32_C(0x8000)
26474         /*
26475          * This bit must be '1' for the encap_record_id field to be
26476          * configured.
26477          */
26478         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_ENCAP_RECORD_ID \
26479                 UINT32_C(0x10000)
26480         /*
26481          * This bit must be '1' for the meter_instance_id field to be
26482          * configured.
26483          */
26484         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_METER_INSTANCE_ID \
26485                 UINT32_C(0x20000)
26486         /*
26487          * This value identifies a set of CFA data structures used for an L2
26488          * context.
26489          */
26490         uint64_t        l2_filter_id;
26491         /* Tunnel Type. */
26492         uint8_t tunnel_type;
26493         /* Non-tunnel */
26494         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
26495                 UINT32_C(0x0)
26496         /* Virtual eXtensible Local Area Network (VXLAN) */
26497         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
26498                 UINT32_C(0x1)
26499         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
26500         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
26501                 UINT32_C(0x2)
26502         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
26503         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
26504                 UINT32_C(0x3)
26505         /* IP in IP */
26506         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
26507                 UINT32_C(0x4)
26508         /* Generic Network Virtualization Encapsulation (Geneve) */
26509         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
26510                 UINT32_C(0x5)
26511         /* Multi-Protocol Lable Switching (MPLS) */
26512         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
26513                 UINT32_C(0x6)
26514         /* Stateless Transport Tunnel (STT) */
26515         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
26516                 UINT32_C(0x7)
26517         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
26518         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
26519                 UINT32_C(0x8)
26520         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
26521         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
26522                 UINT32_C(0x9)
26523         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
26524         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
26525                 UINT32_C(0xa)
26526         /* Use fixed layer 2 ether type of 0xFFFF */
26527         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
26528                 UINT32_C(0xb)
26529         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
26530         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
26531                 UINT32_C(0xc)
26532         /* Any tunneled traffic */
26533         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
26534                 UINT32_C(0xff)
26535         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
26536                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
26537         uint8_t unused_0[3];
26538         /*
26539          * Tunnel identifier.
26540          * Virtual Network Identifier (VNI). Only valid with
26541          * tunnel_types VXLAN, NVGRE, and Geneve.
26542          * Only lower 24-bits of VNI field are used
26543          * in setting up the filter.
26544          */
26545         uint32_t        tunnel_id;
26546         /*
26547          * This value indicates the source MAC address in
26548          * the Ethernet header.
26549          */
26550         uint8_t src_macaddr[6];
26551         /* The meter instance to attach to the flow. */
26552         uint16_t        meter_instance_id;
26553         /*
26554          * A value of 0xfff is considered invalid and implies the
26555          * instance is not configured.
26556          */
26557         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID \
26558                 UINT32_C(0xffff)
26559         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_LAST \
26560                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_METER_INSTANCE_ID_INVALID
26561         /*
26562          * This value indicates the destination MAC address in
26563          * the Ethernet header.
26564          */
26565         uint8_t dst_macaddr[6];
26566         /*
26567          * This value indicates the VLAN ID of the outer VLAN tag
26568          * in the Ethernet header.
26569          */
26570         uint16_t        ovlan_vid;
26571         /*
26572          * This value indicates the VLAN ID of the inner VLAN tag
26573          * in the Ethernet header.
26574          */
26575         uint16_t        ivlan_vid;
26576         /* This value indicates the ethertype in the Ethernet header. */
26577         uint16_t        ethertype;
26578         /*
26579          * This value indicates the type of IP address.
26580          * 4 - IPv4
26581          * 6 - IPv6
26582          * All others are invalid.
26583          */
26584         uint8_t ip_addr_type;
26585         /* invalid */
26586         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN UINT32_C(0x0)
26587         /* IPv4 */
26588         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV4    UINT32_C(0x4)
26589         /* IPv6 */
26590         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6    UINT32_C(0x6)
26591         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
26592                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
26593         /*
26594          * The value of protocol filed in IP header.
26595          * Applies to UDP and TCP traffic.
26596          * 6 - TCP
26597          * 17 - UDP
26598          */
26599         uint8_t ip_protocol;
26600         /* invalid */
26601         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN UINT32_C(0x0)
26602         /* TCP */
26603         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_TCP     UINT32_C(0x6)
26604         /* UDP */
26605         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP     UINT32_C(0x11)
26606         #define HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_LAST \
26607                 HWRM_CFA_EM_FLOW_ALLOC_INPUT_IP_PROTOCOL_UDP
26608         uint8_t unused_1[2];
26609         /*
26610          * The value of source IP address to be used in filtering.
26611          * For IPv4, first four bytes represent the IP address.
26612          */
26613         uint32_t        src_ipaddr[4];
26614         /*
26615          * big_endian = True
26616          *     The value of destination IP address to be used in filtering.
26617          *     For IPv4, first four bytes represent the IP address.
26618          */
26619         uint32_t        dst_ipaddr[4];
26620         /*
26621          * The value of source port to be used in filtering.
26622          * Applies to UDP and TCP traffic.
26623          */
26624         uint16_t        src_port;
26625         /*
26626          * The value of destination port to be used in filtering.
26627          * Applies to UDP and TCP traffic.
26628          */
26629         uint16_t        dst_port;
26630         /*
26631          * If set, this value shall represent the
26632          * Logical VNIC ID of the destination VNIC for the RX
26633          * path and network port id of the destination port for
26634          * the TX path.
26635          */
26636         uint16_t        dst_id;
26637         /*
26638          * Logical VNIC ID of the VNIC where traffic is
26639          * mirrored.
26640          */
26641         uint16_t        mirror_vnic_id;
26642         /* Logical ID of the encapsulation record. */
26643         uint32_t        encap_record_id;
26644         uint8_t unused_2[4];
26645 } __attribute__((packed));
26646
26647 /* hwrm_cfa_em_flow_alloc_output (size:192b/24B) */
26648 struct hwrm_cfa_em_flow_alloc_output {
26649         /* The specific error status for the command. */
26650         uint16_t        error_code;
26651         /* The HWRM command request type. */
26652         uint16_t        req_type;
26653         /* The sequence ID from the original command. */
26654         uint16_t        seq_id;
26655         /* The length of the response data in number of bytes. */
26656         uint16_t        resp_len;
26657         /* This value is an opaque id into CFA data structures. */
26658         uint64_t        em_filter_id;
26659         /*
26660          * The flow id value in bit 0-29 is the actual ID of the flow
26661          * associated with this filter and it shall be used to match
26662          * and associate the flow identifier returned in completion
26663          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
26664          * shall indicate no valid flow id.
26665          */
26666         uint32_t        flow_id;
26667         /* Indicate the flow id value. */
26668         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
26669                 UINT32_C(0x3fffffff)
26670         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
26671         /* Indicate type of the flow. */
26672         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
26673                 UINT32_C(0x40000000)
26674         /*
26675          * If this bit set to 0, then it indicates that the flow is
26676          * internal flow.
26677          */
26678         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
26679                 (UINT32_C(0x0) << 30)
26680         /*
26681          * If this bit is set to 1, then it indicates that the flow is
26682          * external flow.
26683          */
26684         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
26685                 (UINT32_C(0x1) << 30)
26686         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
26687                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
26688         /* Indicate the flow direction. */
26689         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
26690                 UINT32_C(0x80000000)
26691         /* If this bit set to 0, then it indicates rx flow. */
26692         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
26693                 (UINT32_C(0x0) << 31)
26694         /* If this bit is set to 1, then it indicates that tx flow. */
26695         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
26696                 (UINT32_C(0x1) << 31)
26697         #define HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
26698                 HWRM_CFA_EM_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
26699         uint8_t unused_0[3];
26700         /*
26701          * This field is used in Output records to indicate that the output
26702          * is completely written to RAM.  This field should be read as '1'
26703          * to indicate that the output has been completely written.
26704          * When writing a command completion or response to an internal processor,
26705          * the order of writes has to be such that this field is written last.
26706          */
26707         uint8_t valid;
26708 } __attribute__((packed));
26709
26710 /*************************
26711  * hwrm_cfa_em_flow_free *
26712  *************************/
26713
26714
26715 /* hwrm_cfa_em_flow_free_input (size:192b/24B) */
26716 struct hwrm_cfa_em_flow_free_input {
26717         /* The HWRM command request type. */
26718         uint16_t        req_type;
26719         /*
26720          * The completion ring to send the completion event on. This should
26721          * be the NQ ID returned from the `nq_alloc` HWRM command.
26722          */
26723         uint16_t        cmpl_ring;
26724         /*
26725          * The sequence ID is used by the driver for tracking multiple
26726          * commands. This ID is treated as opaque data by the firmware and
26727          * the value is returned in the `hwrm_resp_hdr` upon completion.
26728          */
26729         uint16_t        seq_id;
26730         /*
26731          * The target ID of the command:
26732          * * 0x0-0xFFF8 - The function ID
26733          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26734          * * 0xFFFD - Reserved for user-space HWRM interface
26735          * * 0xFFFF - HWRM
26736          */
26737         uint16_t        target_id;
26738         /*
26739          * A physical address pointer pointing to a host buffer that the
26740          * command's response data will be written. This can be either a host
26741          * physical address (HPA) or a guest physical address (GPA) and must
26742          * point to a physically contiguous block of memory.
26743          */
26744         uint64_t        resp_addr;
26745         /* This value is an opaque id into CFA data structures. */
26746         uint64_t        em_filter_id;
26747 } __attribute__((packed));
26748
26749 /* hwrm_cfa_em_flow_free_output (size:128b/16B) */
26750 struct hwrm_cfa_em_flow_free_output {
26751         /* The specific error status for the command. */
26752         uint16_t        error_code;
26753         /* The HWRM command request type. */
26754         uint16_t        req_type;
26755         /* The sequence ID from the original command. */
26756         uint16_t        seq_id;
26757         /* The length of the response data in number of bytes. */
26758         uint16_t        resp_len;
26759         uint8_t unused_0[7];
26760         /*
26761          * This field is used in Output records to indicate that the output
26762          * is completely written to RAM.  This field should be read as '1'
26763          * to indicate that the output has been completely written.
26764          * When writing a command completion or response to an internal processor,
26765          * the order of writes has to be such that this field is written last.
26766          */
26767         uint8_t valid;
26768 } __attribute__((packed));
26769
26770 /************************
26771  * hwrm_cfa_meter_qcaps *
26772  ************************/
26773
26774
26775 /* hwrm_cfa_meter_qcaps_input (size:128b/16B) */
26776 struct hwrm_cfa_meter_qcaps_input {
26777         /* The HWRM command request type. */
26778         uint16_t        req_type;
26779         /*
26780          * The completion ring to send the completion event on. This should
26781          * be the NQ ID returned from the `nq_alloc` HWRM command.
26782          */
26783         uint16_t        cmpl_ring;
26784         /*
26785          * The sequence ID is used by the driver for tracking multiple
26786          * commands. This ID is treated as opaque data by the firmware and
26787          * the value is returned in the `hwrm_resp_hdr` upon completion.
26788          */
26789         uint16_t        seq_id;
26790         /*
26791          * The target ID of the command:
26792          * * 0x0-0xFFF8 - The function ID
26793          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26794          * * 0xFFFD - Reserved for user-space HWRM interface
26795          * * 0xFFFF - HWRM
26796          */
26797         uint16_t        target_id;
26798         /*
26799          * A physical address pointer pointing to a host buffer that the
26800          * command's response data will be written. This can be either a host
26801          * physical address (HPA) or a guest physical address (GPA) and must
26802          * point to a physically contiguous block of memory.
26803          */
26804         uint64_t        resp_addr;
26805 } __attribute__((packed));
26806
26807 /* hwrm_cfa_meter_qcaps_output (size:320b/40B) */
26808 struct hwrm_cfa_meter_qcaps_output {
26809         /* The specific error status for the command. */
26810         uint16_t        error_code;
26811         /* The HWRM command request type. */
26812         uint16_t        req_type;
26813         /* The sequence ID from the original command. */
26814         uint16_t        seq_id;
26815         /* The length of the response data in number of bytes. */
26816         uint16_t        resp_len;
26817         uint32_t        flags;
26818         /*
26819          * Enumeration denoting the clock at which the Meter is running with.
26820          * This enumeration is used for resources that are similar for both
26821          * TX and RX paths of the chip.
26822          */
26823         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_MASK  UINT32_C(0xf)
26824         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_SFT   0
26825         /* 375 MHz */
26826         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_375MHZ  UINT32_C(0x0)
26827         /* 625 MHz */
26828         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ  UINT32_C(0x1)
26829         #define HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_LAST \
26830                 HWRM_CFA_METER_QCAPS_OUTPUT_FLAGS_CLOCK_625MHZ
26831         uint8_t unused_0[4];
26832         /*
26833          * The minimum guaranteed number of tx meter profiles supported
26834          * for this function.
26835          */
26836         uint16_t        min_tx_profile;
26837         /*
26838          * The maximum non-guaranteed number of tx meter profiles supported
26839          * for this function.
26840          */
26841         uint16_t        max_tx_profile;
26842         /*
26843          * The minimum guaranteed number of rx meter profiles supported
26844          * for this function.
26845          */
26846         uint16_t        min_rx_profile;
26847         /*
26848          * The maximum non-guaranteed number of rx meter profiles supported
26849          * for this function.
26850          */
26851         uint16_t        max_rx_profile;
26852         /*
26853          * The minimum guaranteed number of tx meter instances supported
26854          * for this function.
26855          */
26856         uint16_t        min_tx_instance;
26857         /*
26858          * The maximum non-guaranteed number of tx meter instances supported
26859          * for this function.
26860          */
26861         uint16_t        max_tx_instance;
26862         /*
26863          * The minimum guaranteed number of rx meter instances supported
26864          * for this function.
26865          */
26866         uint16_t        min_rx_instance;
26867         /*
26868          * The maximum non-guaranteed number of rx meter instances supported
26869          * for this function.
26870          */
26871         uint16_t        max_rx_instance;
26872         uint8_t unused_1[7];
26873         /*
26874          * This field is used in Output records to indicate that the output
26875          * is completely written to RAM.  This field should be read as '1'
26876          * to indicate that the output has been completely written.
26877          * When writing a command completion or response to an internal processor,
26878          * the order of writes has to be such that this field is written last.
26879          */
26880         uint8_t valid;
26881 } __attribute__((packed));
26882
26883 /********************************
26884  * hwrm_cfa_meter_profile_alloc *
26885  ********************************/
26886
26887
26888 /* hwrm_cfa_meter_profile_alloc_input (size:320b/40B) */
26889 struct hwrm_cfa_meter_profile_alloc_input {
26890         /* The HWRM command request type. */
26891         uint16_t        req_type;
26892         /*
26893          * The completion ring to send the completion event on. This should
26894          * be the NQ ID returned from the `nq_alloc` HWRM command.
26895          */
26896         uint16_t        cmpl_ring;
26897         /*
26898          * The sequence ID is used by the driver for tracking multiple
26899          * commands. This ID is treated as opaque data by the firmware and
26900          * the value is returned in the `hwrm_resp_hdr` upon completion.
26901          */
26902         uint16_t        seq_id;
26903         /*
26904          * The target ID of the command:
26905          * * 0x0-0xFFF8 - The function ID
26906          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
26907          * * 0xFFFD - Reserved for user-space HWRM interface
26908          * * 0xFFFF - HWRM
26909          */
26910         uint16_t        target_id;
26911         /*
26912          * A physical address pointer pointing to a host buffer that the
26913          * command's response data will be written. This can be either a host
26914          * physical address (HPA) or a guest physical address (GPA) and must
26915          * point to a physically contiguous block of memory.
26916          */
26917         uint64_t        resp_addr;
26918         uint8_t flags;
26919         /*
26920          * Enumeration denoting the RX, TX type of the resource.
26921          * This enumeration is used for resources that are similar for both
26922          * TX and RX paths of the chip.
26923          */
26924         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH     UINT32_C(0x1)
26925         /* tx path */
26926         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_TX \
26927                 UINT32_C(0x0)
26928         /* rx path */
26929         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX \
26930                 UINT32_C(0x1)
26931         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_LAST \
26932                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_FLAGS_PATH_RX
26933         /* The meter algorithm type. */
26934         uint8_t meter_type;
26935         /* RFC 2697 (srTCM) */
26936         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2697 \
26937                 UINT32_C(0x0)
26938         /* RFC 2698 (trTCM) */
26939         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC2698 \
26940                 UINT32_C(0x1)
26941         /* RFC 4115 (trTCM) */
26942         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115 \
26943                 UINT32_C(0x2)
26944         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_LAST \
26945                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_METER_TYPE_RFC4115
26946         /*
26947          * This field is reserved for the future use.
26948          * It shall be set to 0.
26949          */
26950         uint16_t        reserved1;
26951         /*
26952          * This field is reserved for the future use.
26953          * It shall be set to 0.
26954          */
26955         uint32_t        reserved2;
26956         /* A meter rate specified in bytes-per-second. */
26957         uint32_t        commit_rate;
26958         /* The bandwidth value. */
26959         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_MASK \
26960                 UINT32_C(0xfffffff)
26961         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_SFT \
26962                 0
26963         /* The granularity of the value (bits or bytes). */
26964         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE \
26965                 UINT32_C(0x10000000)
26966         /* Value is in bits. */
26967         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BITS \
26968                 (UINT32_C(0x0) << 28)
26969         /* Value is in bytes. */
26970         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES \
26971                 (UINT32_C(0x1) << 28)
26972         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_LAST \
26973                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_SCALE_BYTES
26974         /* bw_value_unit is 3 b */
26975         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
26976                 UINT32_C(0xe0000000)
26977         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
26978                 29
26979         /* Value is in Mb or MB (base 10). */
26980         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
26981                 (UINT32_C(0x0) << 29)
26982         /* Value is in Kb or KB (base 10). */
26983         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
26984                 (UINT32_C(0x2) << 29)
26985         /* Value is in bits or bytes. */
26986         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
26987                 (UINT32_C(0x4) << 29)
26988         /* Value is in Gb or GB (base 10). */
26989         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
26990                 (UINT32_C(0x6) << 29)
26991         /* Value is in 1/100th of a percentage of total bandwidth. */
26992         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
26993                 (UINT32_C(0x1) << 29)
26994         /* Raw value */
26995         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
26996                 (UINT32_C(0x7) << 29)
26997         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
26998                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
26999         /* A meter burst size specified in bytes. */
27000         uint32_t        commit_burst;
27001         /* The bandwidth value. */
27002         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_MASK \
27003                 UINT32_C(0xfffffff)
27004         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_SFT \
27005                 0
27006         /* The granularity of the value (bits or bytes). */
27007         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE \
27008                 UINT32_C(0x10000000)
27009         /* Value is in bits. */
27010         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BITS \
27011                 (UINT32_C(0x0) << 28)
27012         /* Value is in bytes. */
27013         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES \
27014                 (UINT32_C(0x1) << 28)
27015         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_LAST \
27016                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_SCALE_BYTES
27017         /* bw_value_unit is 3 b */
27018         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
27019                 UINT32_C(0xe0000000)
27020         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
27021                 29
27022         /* Value is in Mb or MB (base 10). */
27023         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
27024                 (UINT32_C(0x0) << 29)
27025         /* Value is in Kb or KB (base 10). */
27026         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
27027                 (UINT32_C(0x2) << 29)
27028         /* Value is in bits or bytes. */
27029         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
27030                 (UINT32_C(0x4) << 29)
27031         /* Value is in Gb or GB (base 10). */
27032         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
27033                 (UINT32_C(0x6) << 29)
27034         /* Value is in 1/100th of a percentage of total bandwidth. */
27035         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27036                 (UINT32_C(0x1) << 29)
27037         /* Invalid value */
27038         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
27039                 (UINT32_C(0x7) << 29)
27040         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
27041                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
27042         /* A meter rate specified in bytes-per-second. */
27043         uint32_t        excess_peak_rate;
27044         /* The bandwidth value. */
27045         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
27046                 UINT32_C(0xfffffff)
27047         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
27048                 0
27049         /* The granularity of the value (bits or bytes). */
27050         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE \
27051                 UINT32_C(0x10000000)
27052         /* Value is in bits. */
27053         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
27054                 (UINT32_C(0x0) << 28)
27055         /* Value is in bytes. */
27056         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
27057                 (UINT32_C(0x1) << 28)
27058         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
27059                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
27060         /* bw_value_unit is 3 b */
27061         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
27062                 UINT32_C(0xe0000000)
27063         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
27064                 29
27065         /* Value is in Mb or MB (base 10). */
27066         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
27067                 (UINT32_C(0x0) << 29)
27068         /* Value is in Kb or KB (base 10). */
27069         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
27070                 (UINT32_C(0x2) << 29)
27071         /* Value is in bits or bytes. */
27072         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
27073                 (UINT32_C(0x4) << 29)
27074         /* Value is in Gb or GB (base 10). */
27075         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
27076                 (UINT32_C(0x6) << 29)
27077         /* Value is in 1/100th of a percentage of total bandwidth. */
27078         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
27079                 (UINT32_C(0x1) << 29)
27080         /* Raw unit */
27081         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
27082                 (UINT32_C(0x7) << 29)
27083         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
27084                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
27085         /* A meter burst size specified in bytes. */
27086         uint32_t        excess_peak_burst;
27087         /* The bandwidth value. */
27088         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
27089                 UINT32_C(0xfffffff)
27090         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
27091                 0
27092         /* The granularity of the value (bits or bytes). */
27093         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE \
27094                 UINT32_C(0x10000000)
27095         /* Value is in bits. */
27096         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
27097                 (UINT32_C(0x0) << 28)
27098         /* Value is in bytes. */
27099         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
27100                 (UINT32_C(0x1) << 28)
27101         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
27102                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
27103         /* bw_value_unit is 3 b */
27104         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
27105                 UINT32_C(0xe0000000)
27106         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
27107                 29
27108         /* Value is in Mb or MB (base 10). */
27109         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
27110                 (UINT32_C(0x0) << 29)
27111         /* Value is in Kb or KB (base 10). */
27112         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
27113                 (UINT32_C(0x2) << 29)
27114         /* Value is in bits or bytes. */
27115         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
27116                 (UINT32_C(0x4) << 29)
27117         /* Value is in Gb or GB (base 10). */
27118         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
27119                 (UINT32_C(0x6) << 29)
27120         /* Value is in 1/100th of a percentage of total bandwidth. */
27121         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27122                 (UINT32_C(0x1) << 29)
27123         /* Invalid unit */
27124         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
27125                 (UINT32_C(0x7) << 29)
27126         #define HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
27127                 HWRM_CFA_METER_PROFILE_ALLOC_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
27128 } __attribute__((packed));
27129
27130 /* hwrm_cfa_meter_profile_alloc_output (size:128b/16B) */
27131 struct hwrm_cfa_meter_profile_alloc_output {
27132         /* The specific error status for the command. */
27133         uint16_t        error_code;
27134         /* The HWRM command request type. */
27135         uint16_t        req_type;
27136         /* The sequence ID from the original command. */
27137         uint16_t        seq_id;
27138         /* The length of the response data in number of bytes. */
27139         uint16_t        resp_len;
27140         /* This value identifies a meter profile in CFA. */
27141         uint16_t        meter_profile_id;
27142         /*
27143          * A value of 0xfff is considered invalid and implies the
27144          * profile is not configured.
27145          */
27146         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID \
27147                 UINT32_C(0xffff)
27148         #define HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_LAST \
27149                 HWRM_CFA_METER_PROFILE_ALLOC_OUTPUT_METER_PROFILE_ID_INVALID
27150         uint8_t unused_0[5];
27151         /*
27152          * This field is used in Output records to indicate that the output
27153          * is completely written to RAM.  This field should be read as '1'
27154          * to indicate that the output has been completely written.
27155          * When writing a command completion or response to an internal processor,
27156          * the order of writes has to be such that this field is written last.
27157          */
27158         uint8_t valid;
27159 } __attribute__((packed));
27160
27161 /*******************************
27162  * hwrm_cfa_meter_profile_free *
27163  *******************************/
27164
27165
27166 /* hwrm_cfa_meter_profile_free_input (size:192b/24B) */
27167 struct hwrm_cfa_meter_profile_free_input {
27168         /* The HWRM command request type. */
27169         uint16_t        req_type;
27170         /*
27171          * The completion ring to send the completion event on. This should
27172          * be the NQ ID returned from the `nq_alloc` HWRM command.
27173          */
27174         uint16_t        cmpl_ring;
27175         /*
27176          * The sequence ID is used by the driver for tracking multiple
27177          * commands. This ID is treated as opaque data by the firmware and
27178          * the value is returned in the `hwrm_resp_hdr` upon completion.
27179          */
27180         uint16_t        seq_id;
27181         /*
27182          * The target ID of the command:
27183          * * 0x0-0xFFF8 - The function ID
27184          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27185          * * 0xFFFD - Reserved for user-space HWRM interface
27186          * * 0xFFFF - HWRM
27187          */
27188         uint16_t        target_id;
27189         /*
27190          * A physical address pointer pointing to a host buffer that the
27191          * command's response data will be written. This can be either a host
27192          * physical address (HPA) or a guest physical address (GPA) and must
27193          * point to a physically contiguous block of memory.
27194          */
27195         uint64_t        resp_addr;
27196         uint8_t flags;
27197         /*
27198          * Enumeration denoting the RX, TX type of the resource.
27199          * This enumeration is used for resources that are similar for both
27200          * TX and RX paths of the chip.
27201          */
27202         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
27203         /* tx path */
27204         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_TX \
27205                 UINT32_C(0x0)
27206         /* rx path */
27207         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX \
27208                 UINT32_C(0x1)
27209         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_LAST \
27210                 HWRM_CFA_METER_PROFILE_FREE_INPUT_FLAGS_PATH_RX
27211         uint8_t unused_0;
27212         /* This value identifies a meter profile in CFA. */
27213         uint16_t        meter_profile_id;
27214         /*
27215          * A value of 0xfff is considered invalid and implies the
27216          * profile is not configured.
27217          */
27218         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID \
27219                 UINT32_C(0xffff)
27220         #define HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_LAST \
27221                 HWRM_CFA_METER_PROFILE_FREE_INPUT_METER_PROFILE_ID_INVALID
27222         uint8_t unused_1[4];
27223 } __attribute__((packed));
27224
27225 /* hwrm_cfa_meter_profile_free_output (size:128b/16B) */
27226 struct hwrm_cfa_meter_profile_free_output {
27227         /* The specific error status for the command. */
27228         uint16_t        error_code;
27229         /* The HWRM command request type. */
27230         uint16_t        req_type;
27231         /* The sequence ID from the original command. */
27232         uint16_t        seq_id;
27233         /* The length of the response data in number of bytes. */
27234         uint16_t        resp_len;
27235         uint8_t unused_0[7];
27236         /*
27237          * This field is used in Output records to indicate that the output
27238          * is completely written to RAM.  This field should be read as '1'
27239          * to indicate that the output has been completely written.
27240          * When writing a command completion or response to an internal processor,
27241          * the order of writes has to be such that this field is written last.
27242          */
27243         uint8_t valid;
27244 } __attribute__((packed));
27245
27246 /******************************
27247  * hwrm_cfa_meter_profile_cfg *
27248  ******************************/
27249
27250
27251 /* hwrm_cfa_meter_profile_cfg_input (size:320b/40B) */
27252 struct hwrm_cfa_meter_profile_cfg_input {
27253         /* The HWRM command request type. */
27254         uint16_t        req_type;
27255         /*
27256          * The completion ring to send the completion event on. This should
27257          * be the NQ ID returned from the `nq_alloc` HWRM command.
27258          */
27259         uint16_t        cmpl_ring;
27260         /*
27261          * The sequence ID is used by the driver for tracking multiple
27262          * commands. This ID is treated as opaque data by the firmware and
27263          * the value is returned in the `hwrm_resp_hdr` upon completion.
27264          */
27265         uint16_t        seq_id;
27266         /*
27267          * The target ID of the command:
27268          * * 0x0-0xFFF8 - The function ID
27269          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27270          * * 0xFFFD - Reserved for user-space HWRM interface
27271          * * 0xFFFF - HWRM
27272          */
27273         uint16_t        target_id;
27274         /*
27275          * A physical address pointer pointing to a host buffer that the
27276          * command's response data will be written. This can be either a host
27277          * physical address (HPA) or a guest physical address (GPA) and must
27278          * point to a physically contiguous block of memory.
27279          */
27280         uint64_t        resp_addr;
27281         uint8_t flags;
27282         /*
27283          * Enumeration denoting the RX, TX type of the resource.
27284          * This enumeration is used for resources that are similar for both
27285          * TX and RX paths of the chip.
27286          */
27287         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
27288         /* tx path */
27289         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
27290         /* rx path */
27291         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
27292         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_LAST \
27293                 HWRM_CFA_METER_PROFILE_CFG_INPUT_FLAGS_PATH_RX
27294         /* The meter algorithm type. */
27295         uint8_t meter_type;
27296         /* RFC 2697 (srTCM) */
27297         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2697 \
27298                 UINT32_C(0x0)
27299         /* RFC 2698 (trTCM) */
27300         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC2698 \
27301                 UINT32_C(0x1)
27302         /* RFC 4115 (trTCM) */
27303         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115 \
27304                 UINT32_C(0x2)
27305         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_LAST \
27306                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_TYPE_RFC4115
27307         /* This value identifies a meter profile in CFA. */
27308         uint16_t        meter_profile_id;
27309         /*
27310          * A value of 0xfff is considered invalid and implies the
27311          * profile is not configured.
27312          */
27313         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID \
27314                 UINT32_C(0xffff)
27315         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_LAST \
27316                 HWRM_CFA_METER_PROFILE_CFG_INPUT_METER_PROFILE_ID_INVALID
27317         /*
27318          * This field is reserved for the future use.
27319          * It shall be set to 0.
27320          */
27321         uint32_t        reserved;
27322         /* A meter rate specified in bytes-per-second. */
27323         uint32_t        commit_rate;
27324         /* The bandwidth value. */
27325         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_MASK \
27326                 UINT32_C(0xfffffff)
27327         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_SFT \
27328                 0
27329         /* The granularity of the value (bits or bytes). */
27330         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE \
27331                 UINT32_C(0x10000000)
27332         /* Value is in bits. */
27333         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BITS \
27334                 (UINT32_C(0x0) << 28)
27335         /* Value is in bytes. */
27336         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES \
27337                 (UINT32_C(0x1) << 28)
27338         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_LAST \
27339                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_SCALE_BYTES
27340         /* bw_value_unit is 3 b */
27341         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MASK \
27342                 UINT32_C(0xe0000000)
27343         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_SFT \
27344                 29
27345         /* Value is in Mb or MB (base 10). */
27346         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_MEGA \
27347                 (UINT32_C(0x0) << 29)
27348         /* Value is in Kb or KB (base 10). */
27349         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_KILO \
27350                 (UINT32_C(0x2) << 29)
27351         /* Value is in bits or bytes. */
27352         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_BASE \
27353                 (UINT32_C(0x4) << 29)
27354         /* Value is in Gb or GB (base 10). */
27355         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_GIGA \
27356                 (UINT32_C(0x6) << 29)
27357         /* Value is in 1/100th of a percentage of total bandwidth. */
27358         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_PERCENT1_100 \
27359                 (UINT32_C(0x1) << 29)
27360         /* Raw value */
27361         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW \
27362                 (UINT32_C(0x7) << 29)
27363         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_LAST \
27364                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_RATE_BW_VALUE_UNIT_RAW
27365         /* A meter burst size specified in bytes. */
27366         uint32_t        commit_burst;
27367         /* The bandwidth value. */
27368         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_MASK \
27369                 UINT32_C(0xfffffff)
27370         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_SFT \
27371                 0
27372         /* The granularity of the value (bits or bytes). */
27373         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE \
27374                 UINT32_C(0x10000000)
27375         /* Value is in bits. */
27376         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BITS \
27377                 (UINT32_C(0x0) << 28)
27378         /* Value is in bytes. */
27379         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES \
27380                 (UINT32_C(0x1) << 28)
27381         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_LAST \
27382                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_SCALE_BYTES
27383         /* bw_value_unit is 3 b */
27384         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MASK \
27385                 UINT32_C(0xe0000000)
27386         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_SFT \
27387                 29
27388         /* Value is in Mb or MB (base 10). */
27389         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_MEGA \
27390                 (UINT32_C(0x0) << 29)
27391         /* Value is in Kb or KB (base 10). */
27392         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_KILO \
27393                 (UINT32_C(0x2) << 29)
27394         /* Value is in bits or bytes. */
27395         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_BASE \
27396                 (UINT32_C(0x4) << 29)
27397         /* Value is in Gb or GB (base 10). */
27398         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_GIGA \
27399                 (UINT32_C(0x6) << 29)
27400         /* Value is in 1/100th of a percentage of total bandwidth. */
27401         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27402                 (UINT32_C(0x1) << 29)
27403         /* Invalid value */
27404         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID \
27405                 (UINT32_C(0x7) << 29)
27406         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_LAST \
27407                 HWRM_CFA_METER_PROFILE_CFG_INPUT_COMMIT_BURST_BW_VALUE_UNIT_INVALID
27408         /* A meter rate specified in bytes-per-second. */
27409         uint32_t        excess_peak_rate;
27410         /* The bandwidth value. */
27411         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_MASK \
27412                 UINT32_C(0xfffffff)
27413         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_SFT \
27414                 0
27415         /* The granularity of the value (bits or bytes). */
27416         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE \
27417                 UINT32_C(0x10000000)
27418         /* Value is in bits. */
27419         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BITS \
27420                 (UINT32_C(0x0) << 28)
27421         /* Value is in bytes. */
27422         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES \
27423                 (UINT32_C(0x1) << 28)
27424         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_LAST \
27425                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_SCALE_BYTES
27426         /* bw_value_unit is 3 b */
27427         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MASK \
27428                 UINT32_C(0xe0000000)
27429         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_SFT \
27430                 29
27431         /* Value is in Mb or MB (base 10). */
27432         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_MEGA \
27433                 (UINT32_C(0x0) << 29)
27434         /* Value is in Kb or KB (base 10). */
27435         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_KILO \
27436                 (UINT32_C(0x2) << 29)
27437         /* Value is in bits or bytes. */
27438         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_BASE \
27439                 (UINT32_C(0x4) << 29)
27440         /* Value is in Gb or GB (base 10). */
27441         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_GIGA \
27442                 (UINT32_C(0x6) << 29)
27443         /* Value is in 1/100th of a percentage of total bandwidth. */
27444         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_PERCENT1_100 \
27445                 (UINT32_C(0x1) << 29)
27446         /* Raw unit */
27447         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW \
27448                 (UINT32_C(0x7) << 29)
27449         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_LAST \
27450                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_RATE_BW_VALUE_UNIT_RAW
27451         /* A meter burst size specified in bytes. */
27452         uint32_t        excess_peak_burst;
27453         /* The bandwidth value. */
27454         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_MASK \
27455                 UINT32_C(0xfffffff)
27456         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_SFT \
27457                 0
27458         /* The granularity of the value (bits or bytes). */
27459         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE \
27460                 UINT32_C(0x10000000)
27461         /* Value is in bits. */
27462         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BITS \
27463                 (UINT32_C(0x0) << 28)
27464         /* Value is in bytes. */
27465         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES \
27466                 (UINT32_C(0x1) << 28)
27467         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_LAST \
27468                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_SCALE_BYTES
27469         /* bw_value_unit is 3 b */
27470         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MASK \
27471                 UINT32_C(0xe0000000)
27472         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_SFT \
27473                 29
27474         /* Value is in Mb or MB (base 10). */
27475         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_MEGA \
27476                 (UINT32_C(0x0) << 29)
27477         /* Value is in Kb or KB (base 10). */
27478         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_KILO \
27479                 (UINT32_C(0x2) << 29)
27480         /* Value is in bits or bytes. */
27481         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_BASE \
27482                 (UINT32_C(0x4) << 29)
27483         /* Value is in Gb or GB (base 10). */
27484         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_GIGA \
27485                 (UINT32_C(0x6) << 29)
27486         /* Value is in 1/100th of a percentage of total bandwidth. */
27487         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_PERCENT1_100 \
27488                 (UINT32_C(0x1) << 29)
27489         /* Invalid unit */
27490         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID \
27491                 (UINT32_C(0x7) << 29)
27492         #define HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_LAST \
27493                 HWRM_CFA_METER_PROFILE_CFG_INPUT_EXCESS_PEAK_BURST_BW_VALUE_UNIT_INVALID
27494 } __attribute__((packed));
27495
27496 /* hwrm_cfa_meter_profile_cfg_output (size:128b/16B) */
27497 struct hwrm_cfa_meter_profile_cfg_output {
27498         /* The specific error status for the command. */
27499         uint16_t        error_code;
27500         /* The HWRM command request type. */
27501         uint16_t        req_type;
27502         /* The sequence ID from the original command. */
27503         uint16_t        seq_id;
27504         /* The length of the response data in number of bytes. */
27505         uint16_t        resp_len;
27506         uint8_t unused_0[7];
27507         /*
27508          * This field is used in Output records to indicate that the output
27509          * is completely written to RAM.  This field should be read as '1'
27510          * to indicate that the output has been completely written.
27511          * When writing a command completion or response to an internal processor,
27512          * the order of writes has to be such that this field is written last.
27513          */
27514         uint8_t valid;
27515 } __attribute__((packed));
27516
27517 /*********************************
27518  * hwrm_cfa_meter_instance_alloc *
27519  *********************************/
27520
27521
27522 /* hwrm_cfa_meter_instance_alloc_input (size:192b/24B) */
27523 struct hwrm_cfa_meter_instance_alloc_input {
27524         /* The HWRM command request type. */
27525         uint16_t        req_type;
27526         /*
27527          * The completion ring to send the completion event on. This should
27528          * be the NQ ID returned from the `nq_alloc` HWRM command.
27529          */
27530         uint16_t        cmpl_ring;
27531         /*
27532          * The sequence ID is used by the driver for tracking multiple
27533          * commands. This ID is treated as opaque data by the firmware and
27534          * the value is returned in the `hwrm_resp_hdr` upon completion.
27535          */
27536         uint16_t        seq_id;
27537         /*
27538          * The target ID of the command:
27539          * * 0x0-0xFFF8 - The function ID
27540          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27541          * * 0xFFFD - Reserved for user-space HWRM interface
27542          * * 0xFFFF - HWRM
27543          */
27544         uint16_t        target_id;
27545         /*
27546          * A physical address pointer pointing to a host buffer that the
27547          * command's response data will be written. This can be either a host
27548          * physical address (HPA) or a guest physical address (GPA) and must
27549          * point to a physically contiguous block of memory.
27550          */
27551         uint64_t        resp_addr;
27552         uint8_t flags;
27553         /*
27554          * Enumeration denoting the RX, TX type of the resource.
27555          * This enumeration is used for resources that are similar for both
27556          * TX and RX paths of the chip.
27557          */
27558         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH \
27559                 UINT32_C(0x1)
27560         /* tx path */
27561         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_TX \
27562                 UINT32_C(0x0)
27563         /* rx path */
27564         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX \
27565                 UINT32_C(0x1)
27566         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_LAST \
27567                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_FLAGS_PATH_RX
27568         uint8_t unused_0;
27569         /* This value identifies a meter profile in CFA. */
27570         uint16_t        meter_profile_id;
27571         /*
27572          * A value of 0xffff is considered invalid and implies the
27573          * profile is not configured.
27574          */
27575         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID \
27576                 UINT32_C(0xffff)
27577         #define HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_LAST \
27578                 HWRM_CFA_METER_INSTANCE_ALLOC_INPUT_METER_PROFILE_ID_INVALID
27579         uint8_t unused_1[4];
27580 } __attribute__((packed));
27581
27582 /* hwrm_cfa_meter_instance_alloc_output (size:128b/16B) */
27583 struct hwrm_cfa_meter_instance_alloc_output {
27584         /* The specific error status for the command. */
27585         uint16_t        error_code;
27586         /* The HWRM command request type. */
27587         uint16_t        req_type;
27588         /* The sequence ID from the original command. */
27589         uint16_t        seq_id;
27590         /* The length of the response data in number of bytes. */
27591         uint16_t        resp_len;
27592         /* This value identifies a meter instance in CFA. */
27593         uint16_t        meter_instance_id;
27594         /*
27595          * A value of 0xffff is considered invalid and implies the
27596          * instance is not configured.
27597          */
27598         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID \
27599                 UINT32_C(0xffff)
27600         #define HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_LAST \
27601                 HWRM_CFA_METER_INSTANCE_ALLOC_OUTPUT_METER_INSTANCE_ID_INVALID
27602         uint8_t unused_0[5];
27603         /*
27604          * This field is used in Output records to indicate that the output
27605          * is completely written to RAM.  This field should be read as '1'
27606          * to indicate that the output has been completely written.
27607          * When writing a command completion or response to an internal processor,
27608          * the order of writes has to be such that this field is written last.
27609          */
27610         uint8_t valid;
27611 } __attribute__((packed));
27612
27613 /*******************************
27614  * hwrm_cfa_meter_instance_cfg *
27615  *******************************/
27616
27617
27618 /* hwrm_cfa_meter_instance_cfg_input (size:192b/24B) */
27619 struct hwrm_cfa_meter_instance_cfg_input {
27620         /* The HWRM command request type. */
27621         uint16_t        req_type;
27622         /*
27623          * The completion ring to send the completion event on. This should
27624          * be the NQ ID returned from the `nq_alloc` HWRM command.
27625          */
27626         uint16_t        cmpl_ring;
27627         /*
27628          * The sequence ID is used by the driver for tracking multiple
27629          * commands. This ID is treated as opaque data by the firmware and
27630          * the value is returned in the `hwrm_resp_hdr` upon completion.
27631          */
27632         uint16_t        seq_id;
27633         /*
27634          * The target ID of the command:
27635          * * 0x0-0xFFF8 - The function ID
27636          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27637          * * 0xFFFD - Reserved for user-space HWRM interface
27638          * * 0xFFFF - HWRM
27639          */
27640         uint16_t        target_id;
27641         /*
27642          * A physical address pointer pointing to a host buffer that the
27643          * command's response data will be written. This can be either a host
27644          * physical address (HPA) or a guest physical address (GPA) and must
27645          * point to a physically contiguous block of memory.
27646          */
27647         uint64_t        resp_addr;
27648         uint8_t flags;
27649         /*
27650          * Enumeration denoting the RX, TX type of the resource.
27651          * This enumeration is used for resources that are similar for both
27652          * TX and RX paths of the chip.
27653          */
27654         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
27655         /* tx path */
27656         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_TX \
27657                 UINT32_C(0x0)
27658         /* rx path */
27659         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX \
27660                 UINT32_C(0x1)
27661         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_LAST \
27662                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_FLAGS_PATH_RX
27663         uint8_t unused_0;
27664         /*
27665          * This value identifies a new meter profile to be associated with
27666          * the meter instance specified in this command.
27667          */
27668         uint16_t        meter_profile_id;
27669         /*
27670          * A value of 0xffff is considered invalid and implies the
27671          * profile is not configured.
27672          */
27673         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID \
27674                 UINT32_C(0xffff)
27675         #define HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_LAST \
27676                 HWRM_CFA_METER_INSTANCE_CFG_INPUT_METER_PROFILE_ID_INVALID
27677         /*
27678          * This value identifies the ID of a meter instance that needs to be updated with
27679          * a new meter profile specified in this command.
27680          */
27681         uint16_t        meter_instance_id;
27682         uint8_t unused_1[2];
27683 } __attribute__((packed));
27684
27685 /* hwrm_cfa_meter_instance_cfg_output (size:128b/16B) */
27686 struct hwrm_cfa_meter_instance_cfg_output {
27687         /* The specific error status for the command. */
27688         uint16_t        error_code;
27689         /* The HWRM command request type. */
27690         uint16_t        req_type;
27691         /* The sequence ID from the original command. */
27692         uint16_t        seq_id;
27693         /* The length of the response data in number of bytes. */
27694         uint16_t        resp_len;
27695         uint8_t unused_0[7];
27696         /*
27697          * This field is used in Output records to indicate that the output
27698          * is completely written to RAM.  This field should be read as '1'
27699          * to indicate that the output has been completely written.
27700          * When writing a command completion or response to an internal processor,
27701          * the order of writes has to be such that this field is written last.
27702          */
27703         uint8_t valid;
27704 } __attribute__((packed));
27705
27706 /********************************
27707  * hwrm_cfa_meter_instance_free *
27708  ********************************/
27709
27710
27711 /* hwrm_cfa_meter_instance_free_input (size:192b/24B) */
27712 struct hwrm_cfa_meter_instance_free_input {
27713         /* The HWRM command request type. */
27714         uint16_t        req_type;
27715         /*
27716          * The completion ring to send the completion event on. This should
27717          * be the NQ ID returned from the `nq_alloc` HWRM command.
27718          */
27719         uint16_t        cmpl_ring;
27720         /*
27721          * The sequence ID is used by the driver for tracking multiple
27722          * commands. This ID is treated as opaque data by the firmware and
27723          * the value is returned in the `hwrm_resp_hdr` upon completion.
27724          */
27725         uint16_t        seq_id;
27726         /*
27727          * The target ID of the command:
27728          * * 0x0-0xFFF8 - The function ID
27729          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27730          * * 0xFFFD - Reserved for user-space HWRM interface
27731          * * 0xFFFF - HWRM
27732          */
27733         uint16_t        target_id;
27734         /*
27735          * A physical address pointer pointing to a host buffer that the
27736          * command's response data will be written. This can be either a host
27737          * physical address (HPA) or a guest physical address (GPA) and must
27738          * point to a physically contiguous block of memory.
27739          */
27740         uint64_t        resp_addr;
27741         uint8_t flags;
27742         /*
27743          * Enumeration denoting the RX, TX type of the resource.
27744          * This enumeration is used for resources that are similar for both
27745          * TX and RX paths of the chip.
27746          */
27747         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH     UINT32_C(0x1)
27748         /* tx path */
27749         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_TX \
27750                 UINT32_C(0x0)
27751         /* rx path */
27752         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX \
27753                 UINT32_C(0x1)
27754         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_LAST \
27755                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_FLAGS_PATH_RX
27756         uint8_t unused_0;
27757         /* This value identifies a meter instance in CFA. */
27758         uint16_t        meter_instance_id;
27759         /*
27760          * A value of 0xfff is considered invalid and implies the
27761          * instance is not configured.
27762          */
27763         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID \
27764                 UINT32_C(0xffff)
27765         #define HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_LAST \
27766                 HWRM_CFA_METER_INSTANCE_FREE_INPUT_METER_INSTANCE_ID_INVALID
27767         uint8_t unused_1[4];
27768 } __attribute__((packed));
27769
27770 /* hwrm_cfa_meter_instance_free_output (size:128b/16B) */
27771 struct hwrm_cfa_meter_instance_free_output {
27772         /* The specific error status for the command. */
27773         uint16_t        error_code;
27774         /* The HWRM command request type. */
27775         uint16_t        req_type;
27776         /* The sequence ID from the original command. */
27777         uint16_t        seq_id;
27778         /* The length of the response data in number of bytes. */
27779         uint16_t        resp_len;
27780         uint8_t unused_0[7];
27781         /*
27782          * This field is used in Output records to indicate that the output
27783          * is completely written to RAM.  This field should be read as '1'
27784          * to indicate that the output has been completely written.
27785          * When writing a command completion or response to an internal processor,
27786          * the order of writes has to be such that this field is written last.
27787          */
27788         uint8_t valid;
27789 } __attribute__((packed));
27790
27791 /*******************************
27792  * hwrm_cfa_decap_filter_alloc *
27793  *******************************/
27794
27795
27796 /* hwrm_cfa_decap_filter_alloc_input (size:832b/104B) */
27797 struct hwrm_cfa_decap_filter_alloc_input {
27798         /* The HWRM command request type. */
27799         uint16_t        req_type;
27800         /*
27801          * The completion ring to send the completion event on. This should
27802          * be the NQ ID returned from the `nq_alloc` HWRM command.
27803          */
27804         uint16_t        cmpl_ring;
27805         /*
27806          * The sequence ID is used by the driver for tracking multiple
27807          * commands. This ID is treated as opaque data by the firmware and
27808          * the value is returned in the `hwrm_resp_hdr` upon completion.
27809          */
27810         uint16_t        seq_id;
27811         /*
27812          * The target ID of the command:
27813          * * 0x0-0xFFF8 - The function ID
27814          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
27815          * * 0xFFFD - Reserved for user-space HWRM interface
27816          * * 0xFFFF - HWRM
27817          */
27818         uint16_t        target_id;
27819         /*
27820          * A physical address pointer pointing to a host buffer that the
27821          * command's response data will be written. This can be either a host
27822          * physical address (HPA) or a guest physical address (GPA) and must
27823          * point to a physically contiguous block of memory.
27824          */
27825         uint64_t        resp_addr;
27826         uint32_t        flags;
27827         /* ovs_tunnel is 1 b */
27828         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_FLAGS_OVS_TUNNEL \
27829                 UINT32_C(0x1)
27830         uint32_t        enables;
27831         /*
27832          * This bit must be '1' for the tunnel_type field to be
27833          * configured.
27834          */
27835         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
27836                 UINT32_C(0x1)
27837         /*
27838          * This bit must be '1' for the tunnel_id field to be
27839          * configured.
27840          */
27841         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_ID \
27842                 UINT32_C(0x2)
27843         /*
27844          * This bit must be '1' for the src_macaddr field to be
27845          * configured.
27846          */
27847         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR \
27848                 UINT32_C(0x4)
27849         /*
27850          * This bit must be '1' for the dst_macaddr field to be
27851          * configured.
27852          */
27853         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR \
27854                 UINT32_C(0x8)
27855         /*
27856          * This bit must be '1' for the ovlan_vid field to be
27857          * configured.
27858          */
27859         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_OVLAN_VID \
27860                 UINT32_C(0x10)
27861         /*
27862          * This bit must be '1' for the ivlan_vid field to be
27863          * configured.
27864          */
27865         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IVLAN_VID \
27866                 UINT32_C(0x20)
27867         /*
27868          * This bit must be '1' for the t_ovlan_vid field to be
27869          * configured.
27870          */
27871         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_OVLAN_VID \
27872                 UINT32_C(0x40)
27873         /*
27874          * This bit must be '1' for the t_ivlan_vid field to be
27875          * configured.
27876          */
27877         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_T_IVLAN_VID \
27878                 UINT32_C(0x80)
27879         /*
27880          * This bit must be '1' for the ethertype field to be
27881          * configured.
27882          */
27883         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE \
27884                 UINT32_C(0x100)
27885         /*
27886          * This bit must be '1' for the src_ipaddr field to be
27887          * configured.
27888          */
27889         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_IPADDR \
27890                 UINT32_C(0x200)
27891         /*
27892          * This bit must be '1' for the dst_ipaddr field to be
27893          * configured.
27894          */
27895         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_IPADDR \
27896                 UINT32_C(0x400)
27897         /*
27898          * This bit must be '1' for the ipaddr_type field to be
27899          * configured.
27900          */
27901         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IPADDR_TYPE \
27902                 UINT32_C(0x800)
27903         /*
27904          * This bit must be '1' for the ip_protocol field to be
27905          * configured.
27906          */
27907         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_IP_PROTOCOL \
27908                 UINT32_C(0x1000)
27909         /*
27910          * This bit must be '1' for the src_port field to be
27911          * configured.
27912          */
27913         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_SRC_PORT \
27914                 UINT32_C(0x2000)
27915         /*
27916          * This bit must be '1' for the dst_port field to be
27917          * configured.
27918          */
27919         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_PORT \
27920                 UINT32_C(0x4000)
27921         /*
27922          * This bit must be '1' for the dst_id field to be
27923          * configured.
27924          */
27925         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
27926                 UINT32_C(0x8000)
27927         /*
27928          * This bit must be '1' for the mirror_vnic_id field to be
27929          * configured.
27930          */
27931         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
27932                 UINT32_C(0x10000)
27933         /*
27934          * Tunnel identifier.
27935          * Virtual Network Identifier (VNI). Only valid with
27936          * tunnel_types VXLAN, NVGRE, and Geneve.
27937          * Only lower 24-bits of VNI field are used
27938          * in setting up the filter.
27939          */
27940         uint32_t        tunnel_id;
27941         /* Tunnel Type. */
27942         uint8_t tunnel_type;
27943         /* Non-tunnel */
27944         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
27945                 UINT32_C(0x0)
27946         /* Virtual eXtensible Local Area Network (VXLAN) */
27947         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
27948                 UINT32_C(0x1)
27949         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
27950         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
27951                 UINT32_C(0x2)
27952         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
27953         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
27954                 UINT32_C(0x3)
27955         /* IP in IP */
27956         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
27957                 UINT32_C(0x4)
27958         /* Generic Network Virtualization Encapsulation (Geneve) */
27959         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
27960                 UINT32_C(0x5)
27961         /* Multi-Protocol Lable Switching (MPLS) */
27962         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
27963                 UINT32_C(0x6)
27964         /* Stateless Transport Tunnel (STT) */
27965         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
27966                 UINT32_C(0x7)
27967         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
27968         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
27969                 UINT32_C(0x8)
27970         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
27971         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
27972                 UINT32_C(0x9)
27973         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
27974         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
27975                 UINT32_C(0xa)
27976         /* Use fixed layer 2 ether type of 0xFFFF */
27977         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
27978                 UINT32_C(0xb)
27979         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
27980         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
27981                 UINT32_C(0xc)
27982         /* Any tunneled traffic */
27983         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
27984                 UINT32_C(0xff)
27985         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_LAST \
27986                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
27987         uint8_t unused_0;
27988         uint16_t        unused_1;
27989         /*
27990          * This value indicates the source MAC address in
27991          * the Ethernet header.
27992          */
27993         uint8_t src_macaddr[6];
27994         uint8_t unused_2[2];
27995         /*
27996          * This value indicates the destination MAC address in
27997          * the Ethernet header.
27998          */
27999         uint8_t dst_macaddr[6];
28000         /*
28001          * This value indicates the VLAN ID of the outer VLAN tag
28002          * in the Ethernet header.
28003          */
28004         uint16_t        ovlan_vid;
28005         /*
28006          * This value indicates the VLAN ID of the inner VLAN tag
28007          * in the Ethernet header.
28008          */
28009         uint16_t        ivlan_vid;
28010         /*
28011          * This value indicates the VLAN ID of the outer VLAN tag
28012          * in the tunnel Ethernet header.
28013          */
28014         uint16_t        t_ovlan_vid;
28015         /*
28016          * This value indicates the VLAN ID of the inner VLAN tag
28017          * in the tunnel Ethernet header.
28018          */
28019         uint16_t        t_ivlan_vid;
28020         /* This value indicates the ethertype in the Ethernet header. */
28021         uint16_t        ethertype;
28022         /*
28023          * This value indicates the type of IP address.
28024          * 4 - IPv4
28025          * 6 - IPv6
28026          * All others are invalid.
28027          */
28028         uint8_t ip_addr_type;
28029         /* invalid */
28030         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_UNKNOWN \
28031                 UINT32_C(0x0)
28032         /* IPv4 */
28033         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 \
28034                 UINT32_C(0x4)
28035         /* IPv6 */
28036         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 \
28037                 UINT32_C(0x6)
28038         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_LAST \
28039                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_ADDR_TYPE_IPV6
28040         /*
28041          * The value of protocol filed in IP header.
28042          * Applies to UDP and TCP traffic.
28043          * 6 - TCP
28044          * 17 - UDP
28045          */
28046         uint8_t ip_protocol;
28047         /* invalid */
28048         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UNKNOWN \
28049                 UINT32_C(0x0)
28050         /* TCP */
28051         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_TCP \
28052                 UINT32_C(0x6)
28053         /* UDP */
28054         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP \
28055                 UINT32_C(0x11)
28056         #define HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_LAST \
28057                 HWRM_CFA_DECAP_FILTER_ALLOC_INPUT_IP_PROTOCOL_UDP
28058         uint16_t        unused_3;
28059         uint32_t        unused_4;
28060         /*
28061          * The value of source IP address to be used in filtering.
28062          * For IPv4, first four bytes represent the IP address.
28063          */
28064         uint32_t        src_ipaddr[4];
28065         /*
28066          * The value of destination IP address to be used in filtering.
28067          * For IPv4, first four bytes represent the IP address.
28068          */
28069         uint32_t        dst_ipaddr[4];
28070         /*
28071          * The value of source port to be used in filtering.
28072          * Applies to UDP and TCP traffic.
28073          */
28074         uint16_t        src_port;
28075         /*
28076          * The value of destination port to be used in filtering.
28077          * Applies to UDP and TCP traffic.
28078          */
28079         uint16_t        dst_port;
28080         /*
28081          * If set, this value shall represent the
28082          * Logical VNIC ID of the destination VNIC for the RX
28083          * path.
28084          */
28085         uint16_t        dst_id;
28086         /*
28087          * If set, this value shall represent the L2 context that matches the L2
28088          * information of the decap filter.
28089          */
28090         uint16_t        l2_ctxt_ref_id;
28091 } __attribute__((packed));
28092
28093 /* hwrm_cfa_decap_filter_alloc_output (size:128b/16B) */
28094 struct hwrm_cfa_decap_filter_alloc_output {
28095         /* The specific error status for the command. */
28096         uint16_t        error_code;
28097         /* The HWRM command request type. */
28098         uint16_t        req_type;
28099         /* The sequence ID from the original command. */
28100         uint16_t        seq_id;
28101         /* The length of the response data in number of bytes. */
28102         uint16_t        resp_len;
28103         /* This value is an opaque id into CFA data structures. */
28104         uint32_t        decap_filter_id;
28105         uint8_t unused_0[3];
28106         /*
28107          * This field is used in Output records to indicate that the output
28108          * is completely written to RAM.  This field should be read as '1'
28109          * to indicate that the output has been completely written.
28110          * When writing a command completion or response to an internal processor,
28111          * the order of writes has to be such that this field is written last.
28112          */
28113         uint8_t valid;
28114 } __attribute__((packed));
28115
28116 /******************************
28117  * hwrm_cfa_decap_filter_free *
28118  ******************************/
28119
28120
28121 /* hwrm_cfa_decap_filter_free_input (size:192b/24B) */
28122 struct hwrm_cfa_decap_filter_free_input {
28123         /* The HWRM command request type. */
28124         uint16_t        req_type;
28125         /*
28126          * The completion ring to send the completion event on. This should
28127          * be the NQ ID returned from the `nq_alloc` HWRM command.
28128          */
28129         uint16_t        cmpl_ring;
28130         /*
28131          * The sequence ID is used by the driver for tracking multiple
28132          * commands. This ID is treated as opaque data by the firmware and
28133          * the value is returned in the `hwrm_resp_hdr` upon completion.
28134          */
28135         uint16_t        seq_id;
28136         /*
28137          * The target ID of the command:
28138          * * 0x0-0xFFF8 - The function ID
28139          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28140          * * 0xFFFD - Reserved for user-space HWRM interface
28141          * * 0xFFFF - HWRM
28142          */
28143         uint16_t        target_id;
28144         /*
28145          * A physical address pointer pointing to a host buffer that the
28146          * command's response data will be written. This can be either a host
28147          * physical address (HPA) or a guest physical address (GPA) and must
28148          * point to a physically contiguous block of memory.
28149          */
28150         uint64_t        resp_addr;
28151         /* This value is an opaque id into CFA data structures. */
28152         uint32_t        decap_filter_id;
28153         uint8_t unused_0[4];
28154 } __attribute__((packed));
28155
28156 /* hwrm_cfa_decap_filter_free_output (size:128b/16B) */
28157 struct hwrm_cfa_decap_filter_free_output {
28158         /* The specific error status for the command. */
28159         uint16_t        error_code;
28160         /* The HWRM command request type. */
28161         uint16_t        req_type;
28162         /* The sequence ID from the original command. */
28163         uint16_t        seq_id;
28164         /* The length of the response data in number of bytes. */
28165         uint16_t        resp_len;
28166         uint8_t unused_0[7];
28167         /*
28168          * This field is used in Output records to indicate that the output
28169          * is completely written to RAM.  This field should be read as '1'
28170          * to indicate that the output has been completely written.
28171          * When writing a command completion or response to an internal processor,
28172          * the order of writes has to be such that this field is written last.
28173          */
28174         uint8_t valid;
28175 } __attribute__((packed));
28176
28177 /***********************
28178  * hwrm_cfa_flow_alloc *
28179  ***********************/
28180
28181
28182 /* hwrm_cfa_flow_alloc_input (size:1024b/128B) */
28183 struct hwrm_cfa_flow_alloc_input {
28184         /* The HWRM command request type. */
28185         uint16_t        req_type;
28186         /*
28187          * The completion ring to send the completion event on. This should
28188          * be the NQ ID returned from the `nq_alloc` HWRM command.
28189          */
28190         uint16_t        cmpl_ring;
28191         /*
28192          * The sequence ID is used by the driver for tracking multiple
28193          * commands. This ID is treated as opaque data by the firmware and
28194          * the value is returned in the `hwrm_resp_hdr` upon completion.
28195          */
28196         uint16_t        seq_id;
28197         /*
28198          * The target ID of the command:
28199          * * 0x0-0xFFF8 - The function ID
28200          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28201          * * 0xFFFD - Reserved for user-space HWRM interface
28202          * * 0xFFFF - HWRM
28203          */
28204         uint16_t        target_id;
28205         /*
28206          * A physical address pointer pointing to a host buffer that the
28207          * command's response data will be written. This can be either a host
28208          * physical address (HPA) or a guest physical address (GPA) and must
28209          * point to a physically contiguous block of memory.
28210          */
28211         uint64_t        resp_addr;
28212         uint16_t        flags;
28213         /* tunnel is 1 b */
28214         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_TUNNEL \
28215                 UINT32_C(0x1)
28216         /* num_vlan is 2 b */
28217         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_MASK \
28218                 UINT32_C(0x6)
28219         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_SFT           1
28220         /* no tags */
28221         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_NONE \
28222                 (UINT32_C(0x0) << 1)
28223         /* 1 tag */
28224         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_ONE \
28225                 (UINT32_C(0x1) << 1)
28226         /* 2 tags */
28227         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO \
28228                 (UINT32_C(0x2) << 1)
28229         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_LAST \
28230                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_NUM_VLAN_TWO
28231         /* Enumeration denoting the Flow Type. */
28232         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_MASK \
28233                 UINT32_C(0x38)
28234         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_SFT           3
28235         /* L2 flow */
28236         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_L2 \
28237                 (UINT32_C(0x0) << 3)
28238         /* IPV4 flow */
28239         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV4 \
28240                 (UINT32_C(0x1) << 3)
28241         /* IPV6 flow */
28242         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6 \
28243                 (UINT32_C(0x2) << 3)
28244         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_LAST \
28245                 HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_FLOWTYPE_IPV6
28246         /*
28247          * when set to 1, indicates TX flow offload for function specified in src_fid and
28248          * the dst_fid should be set to invalid value. To indicate a VM to VM flow, both
28249          * of the path_tx and path_rx flags need to be set. For virtio vSwitch offload
28250          * case, the src_fid and dst_fid is set to the same fid value. For the SRIOV
28251          * vSwitch offload case, the src_fid and dst_fid must be set to the same VF FID
28252          * belong to the children VFs of the same PF to indicate VM to VM flow.
28253          */
28254         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_TX \
28255                 UINT32_C(0x40)
28256         /*
28257          * when set to 1, indicates RX flow offload for function specified in dst_fid and
28258          * the src_fid should be set to invalid value.
28259          */
28260         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_PATH_RX \
28261                 UINT32_C(0x80)
28262         /*
28263          * Set to 1 to indicate matching of VXLAN VNI from the custom vxlan header is
28264          * required and the VXLAN VNI value is stored in the first 24 bits of the dmac field.
28265          * This flag is only valid when the flow direction is RX.
28266          */
28267         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_MATCH_VXLAN_IP_VNI \
28268                 UINT32_C(0x100)
28269         /* Set to 1 to indicate vhost_id is specified in the outer_vlan_tci field. */
28270         #define HWRM_CFA_FLOW_ALLOC_INPUT_FLAGS_VHOST_ID_USE_VLAN \
28271                 UINT32_C(0x200)
28272         /*
28273          * Tx Flow: vf fid.
28274          * Rx Flow: pf fid.
28275          */
28276         uint16_t        src_fid;
28277         /* Tunnel handle valid when tunnel flag is set. */
28278         uint32_t        tunnel_handle;
28279         uint16_t        action_flags;
28280         /*
28281          * Setting of this flag indicates drop action. If this flag is not set,
28282          * then it should be considered accept action.
28283          */
28284         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FWD \
28285                 UINT32_C(0x1)
28286         /* recycle is 1 b */
28287         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_RECYCLE \
28288                 UINT32_C(0x2)
28289         /*
28290          * Setting of this flag indicates drop action. If this flag is not set,
28291          * then it should be considered accept action.
28292          */
28293         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_DROP \
28294                 UINT32_C(0x4)
28295         /* meter is 1 b */
28296         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_METER \
28297                 UINT32_C(0x8)
28298         /* tunnel is 1 b */
28299         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL \
28300                 UINT32_C(0x10)
28301         /* nat_src is 1 b */
28302         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_SRC \
28303                 UINT32_C(0x20)
28304         /* nat_dest is 1 b */
28305         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_DEST \
28306                 UINT32_C(0x40)
28307         /* nat_ipv4_address is 1 b */
28308         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NAT_IPV4_ADDRESS \
28309                 UINT32_C(0x80)
28310         /* l2_header_rewrite is 1 b */
28311         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_L2_HEADER_REWRITE \
28312                 UINT32_C(0x100)
28313         /* ttl_decrement is 1 b */
28314         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TTL_DECREMENT \
28315                 UINT32_C(0x200)
28316         /*
28317          * If set to 1 and flow direction is TX, it indicates decap of L2 header
28318          * and encap of tunnel header. If set to 1 and flow direction is RX, it
28319          * indicates decap of tunnel header and encap L2 header. The type of tunnel
28320          * is specified in the tunnel_type field.
28321          */
28322         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_TUNNEL_IP \
28323                 UINT32_C(0x400)
28324         /* If set to 1, flow aging is enabled for this flow. */
28325         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_FLOW_AGING_ENABLED \
28326                 UINT32_C(0x800)
28327         /*
28328          * If set to 1 an attempt will be made to try to offload this flow to the
28329          * most optimal flow table resource.  If set to 0, the flow will be
28330          * placed to the default flow table resource.
28331          */
28332         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_PRI_HINT \
28333                 UINT32_C(0x1000)
28334         /*
28335          * If set to 1 there will be no attempt to allocate an on-chip try to
28336          * offload this flow. If set to 0, which will keep compatibility with the
28337          * older drivers, will cause the FW to attempt to allocate an on-chip flow
28338          * counter for the newly created flow.  This will keep the existing behavior
28339          * with EM flows which always had an associated flow counter.
28340          */
28341         #define HWRM_CFA_FLOW_ALLOC_INPUT_ACTION_FLAGS_NO_FLOW_COUNTER_ALLOC \
28342                 UINT32_C(0x2000)
28343         /*
28344          * Tx Flow: pf or vf fid.
28345          * Rx Flow: vf fid.
28346          */
28347         uint16_t        dst_fid;
28348         /* VLAN tpid, valid when push_vlan flag is set. */
28349         uint16_t        l2_rewrite_vlan_tpid;
28350         /* VLAN tci, valid when push_vlan flag is set. */
28351         uint16_t        l2_rewrite_vlan_tci;
28352         /* Meter id, valid when meter flag is set. */
28353         uint16_t        act_meter_id;
28354         /* Flow with the same l2 context tcam key. */
28355         uint16_t        ref_flow_handle;
28356         /* This value sets the match value for the ethertype. */
28357         uint16_t        ethertype;
28358         /* valid when num tags is 1 or 2. */
28359         uint16_t        outer_vlan_tci;
28360         /* This value sets the match value for the Destination MAC address. */
28361         uint16_t        dmac[3];
28362         /* valid when num tags is 2. */
28363         uint16_t        inner_vlan_tci;
28364         /* This value sets the match value for the Source MAC address. */
28365         uint16_t        smac[3];
28366         /* The bit length of destination IP address mask. */
28367         uint8_t ip_dst_mask_len;
28368         /* The bit length of source IP address mask. */
28369         uint8_t ip_src_mask_len;
28370         /* The value of destination IPv4/IPv6 address. */
28371         uint32_t        ip_dst[4];
28372         /* The source IPv4/IPv6 address. */
28373         uint32_t        ip_src[4];
28374         /*
28375          * The value of source port.
28376          * Applies to UDP and TCP traffic.
28377          */
28378         uint16_t        l4_src_port;
28379         /*
28380          * The value of source port mask.
28381          * Applies to UDP and TCP traffic.
28382          */
28383         uint16_t        l4_src_port_mask;
28384         /*
28385          * The value of destination port.
28386          * Applies to UDP and TCP traffic.
28387          */
28388         uint16_t        l4_dst_port;
28389         /*
28390          * The value of destination port mask.
28391          * Applies to UDP and TCP traffic.
28392          */
28393         uint16_t        l4_dst_port_mask;
28394         /*
28395          * NAT IPv4/6 address based on address type flag.
28396          * 0 values are ignored.
28397          */
28398         uint32_t        nat_ip_address[4];
28399         /* L2 header re-write Destination MAC address. */
28400         uint16_t        l2_rewrite_dmac[3];
28401         /*
28402          * The NAT source/destination port based on direction flag.
28403          * Applies to UDP and TCP traffic.
28404          * 0 values are ignored.
28405          */
28406         uint16_t        nat_port;
28407         /* L2 header re-write Source MAC address. */
28408         uint16_t        l2_rewrite_smac[3];
28409         /* The value of ip protocol. */
28410         uint8_t ip_proto;
28411         /* Tunnel Type. */
28412         uint8_t tunnel_type;
28413         /* Non-tunnel */
28414         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
28415                 UINT32_C(0x0)
28416         /* Virtual eXtensible Local Area Network (VXLAN) */
28417         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
28418                 UINT32_C(0x1)
28419         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
28420         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
28421                 UINT32_C(0x2)
28422         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
28423         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
28424                 UINT32_C(0x3)
28425         /* IP in IP */
28426         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
28427                 UINT32_C(0x4)
28428         /* Generic Network Virtualization Encapsulation (Geneve) */
28429         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
28430                 UINT32_C(0x5)
28431         /* Multi-Protocol Lable Switching (MPLS) */
28432         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
28433                 UINT32_C(0x6)
28434         /* Stateless Transport Tunnel (STT) */
28435         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_STT \
28436                 UINT32_C(0x7)
28437         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
28438         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
28439                 UINT32_C(0x8)
28440         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
28441         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
28442                 UINT32_C(0x9)
28443         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
28444         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
28445                 UINT32_C(0xa)
28446         /* Use fixed layer 2 ether type of 0xFFFF */
28447         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
28448                 UINT32_C(0xb)
28449         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
28450         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
28451                 UINT32_C(0xc)
28452         /* Any tunneled traffic */
28453         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
28454                 UINT32_C(0xff)
28455         #define HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_LAST \
28456                 HWRM_CFA_FLOW_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL
28457 } __attribute__((packed));
28458
28459 /* hwrm_cfa_flow_alloc_output (size:256b/32B) */
28460 struct hwrm_cfa_flow_alloc_output {
28461         /* The specific error status for the command. */
28462         uint16_t        error_code;
28463         /* The HWRM command request type. */
28464         uint16_t        req_type;
28465         /* The sequence ID from the original command. */
28466         uint16_t        seq_id;
28467         /* The length of the response data in number of bytes. */
28468         uint16_t        resp_len;
28469         /* Flow record index. */
28470         uint16_t        flow_handle;
28471         uint8_t unused_0[2];
28472         /*
28473          * The flow id value in bit 0-29 is the actual ID of the flow
28474          * associated with this filter and it shall be used to match
28475          * and associate the flow identifier returned in completion
28476          * records. A value of 0xFFFFFFFF in the 32-bit flow_id field
28477          * shall indicate no valid flow id.
28478          */
28479         uint32_t        flow_id;
28480         /* Indicate the flow id value. */
28481         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_MASK \
28482                 UINT32_C(0x3fffffff)
28483         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_VALUE_SFT 0
28484         /* Indicate type of the flow. */
28485         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE \
28486                 UINT32_C(0x40000000)
28487         /*
28488          * If this bit set to 0, then it indicates that the flow is
28489          * internal flow.
28490          */
28491         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_INT \
28492                 (UINT32_C(0x0) << 30)
28493         /*
28494          * If this bit is set to 1, then it indicates that the flow is
28495          * external flow.
28496          */
28497         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT \
28498                 (UINT32_C(0x1) << 30)
28499         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_LAST \
28500                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_TYPE_EXT
28501         /* Indicate the flow direction. */
28502         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR \
28503                 UINT32_C(0x80000000)
28504         /* If this bit set to 0, then it indicates rx flow. */
28505         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_RX \
28506                 (UINT32_C(0x0) << 31)
28507         /* If this bit is set to 1, then it indicates that tx flow. */
28508         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX \
28509                 (UINT32_C(0x1) << 31)
28510         #define HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_LAST \
28511                 HWRM_CFA_FLOW_ALLOC_OUTPUT_FLOW_ID_DIR_TX
28512         /* This value identifies a set of CFA data structures used for a flow. */
28513         uint64_t        ext_flow_handle;
28514         uint32_t        flow_counter_id;
28515         uint8_t unused_1[3];
28516         /*
28517          * This field is used in Output records to indicate that the output
28518          * is completely written to RAM.  This field should be read as '1'
28519          * to indicate that the output has been completely written.
28520          * When writing a command completion or response to an internal processor,
28521          * the order of writes has to be such that this field is written last.
28522          */
28523         uint8_t valid;
28524 } __attribute__((packed));
28525
28526 /* hwrm_cfa_flow_alloc_cmd_err (size:64b/8B) */
28527 struct hwrm_cfa_flow_alloc_cmd_err {
28528         /*
28529          * command specific error codes that goes to
28530          * the cmd_err field in Common HWRM Error Response.
28531          */
28532         uint8_t code;
28533         /* Unknown error */
28534         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_UNKNOWN         UINT32_C(0x0)
28535         /* No more L2 Context TCAM */
28536         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_L2_CONTEXT_TCAM UINT32_C(0x1)
28537         /* No more action records */
28538         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_ACTION_RECORD   UINT32_C(0x2)
28539         /* No more flow counters */
28540         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_COUNTER    UINT32_C(0x3)
28541         /* No more wild-card TCAM */
28542         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_WILD_CARD_TCAM  UINT32_C(0x4)
28543         /* Hash collsion in exact match tables */
28544         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_HASH_COLLISION  UINT32_C(0x5)
28545         /* Key is already installed */
28546         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_KEY_EXISTS      UINT32_C(0x6)
28547         /* Flow Context DB is out of resource */
28548         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB    UINT32_C(0x7)
28549         #define HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_LAST \
28550                 HWRM_CFA_FLOW_ALLOC_CMD_ERR_CODE_FLOW_CTXT_DB
28551         uint8_t unused_0[7];
28552 } __attribute__((packed));
28553
28554 /**********************
28555  * hwrm_cfa_flow_free *
28556  **********************/
28557
28558
28559 /* hwrm_cfa_flow_free_input (size:256b/32B) */
28560 struct hwrm_cfa_flow_free_input {
28561         /* The HWRM command request type. */
28562         uint16_t        req_type;
28563         /*
28564          * The completion ring to send the completion event on. This should
28565          * be the NQ ID returned from the `nq_alloc` HWRM command.
28566          */
28567         uint16_t        cmpl_ring;
28568         /*
28569          * The sequence ID is used by the driver for tracking multiple
28570          * commands. This ID is treated as opaque data by the firmware and
28571          * the value is returned in the `hwrm_resp_hdr` upon completion.
28572          */
28573         uint16_t        seq_id;
28574         /*
28575          * The target ID of the command:
28576          * * 0x0-0xFFF8 - The function ID
28577          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28578          * * 0xFFFD - Reserved for user-space HWRM interface
28579          * * 0xFFFF - HWRM
28580          */
28581         uint16_t        target_id;
28582         /*
28583          * A physical address pointer pointing to a host buffer that the
28584          * command's response data will be written. This can be either a host
28585          * physical address (HPA) or a guest physical address (GPA) and must
28586          * point to a physically contiguous block of memory.
28587          */
28588         uint64_t        resp_addr;
28589         /* Flow record index. */
28590         uint16_t        flow_handle;
28591         uint16_t        unused_0;
28592         /* Flow counter id to be freed. */
28593         uint32_t        flow_counter_id;
28594         /* This value identifies a set of CFA data structures used for a flow. */
28595         uint64_t        ext_flow_handle;
28596 } __attribute__((packed));
28597
28598 /* hwrm_cfa_flow_free_output (size:256b/32B) */
28599 struct hwrm_cfa_flow_free_output {
28600         /* The specific error status for the command. */
28601         uint16_t        error_code;
28602         /* The HWRM command request type. */
28603         uint16_t        req_type;
28604         /* The sequence ID from the original command. */
28605         uint16_t        seq_id;
28606         /* The length of the response data in number of bytes. */
28607         uint16_t        resp_len;
28608         /* packet is 64 b */
28609         uint64_t        packet;
28610         /* byte is 64 b */
28611         uint64_t        byte;
28612         uint8_t unused_0[7];
28613         /*
28614          * This field is used in Output records to indicate that the output
28615          * is completely written to RAM.  This field should be read as '1'
28616          * to indicate that the output has been completely written.
28617          * When writing a command completion or response to an internal processor,
28618          * the order of writes has to be such that this field is written last.
28619          */
28620         uint8_t valid;
28621 } __attribute__((packed));
28622
28623 /* hwrm_cfa_flow_action_data (size:960b/120B) */
28624 struct hwrm_cfa_flow_action_data {
28625         uint16_t        action_flags;
28626         /* Setting of this flag indicates accept action. */
28627         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FWD \
28628                 UINT32_C(0x1)
28629         /* Setting of this flag indicates recycle action. */
28630         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_RECYCLE \
28631                 UINT32_C(0x2)
28632         /* Setting of this flag indicates drop action. */
28633         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DROP \
28634                 UINT32_C(0x4)
28635         /* Setting of this flag indicates meter action. */
28636         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_METER \
28637                 UINT32_C(0x8)
28638         /* Setting of this flag indicates tunnel action. */
28639         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL \
28640                 UINT32_C(0x10)
28641         /*
28642          * If set to 1 and flow direction is TX, it indicates decap of L2 header
28643          * and encap of tunnel header. If set to 1 and flow direction is RX, it
28644          * indicates decap of tunnel header and encap L2 header.
28645          */
28646         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TUNNEL_IP \
28647                 UINT32_C(0x20)
28648         /* Setting of this flag indicates ttl decrement action. */
28649         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_TTL_DECREMENT \
28650                 UINT32_C(0x40)
28651         /* If set to 1, flow aging is enabled for this flow. */
28652         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_FLOW_AGING_ENABLED \
28653                 UINT32_C(0x80)
28654         /* Setting of this flag indicates encap action.. */
28655         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_ENCAP \
28656                 UINT32_C(0x100)
28657         /* Setting of this flag indicates decap action.. */
28658         #define HWRM_CFA_FLOW_ACTION_DATA_ACTION_FLAGS_DECAP \
28659                 UINT32_C(0x200)
28660         /* Meter id. */
28661         uint16_t        act_meter_id;
28662         /* VNIC id. */
28663         uint16_t        vnic_id;
28664         /* vport number. */
28665         uint16_t        vport_id;
28666         /* The NAT source/destination. */
28667         uint16_t        nat_port;
28668         uint16_t        unused_0[3];
28669         /* NAT IPv4/IPv6 address. */
28670         uint32_t        nat_ip_address[4];
28671         /* Encapsulation Type. */
28672         uint8_t encap_type;
28673         /* Virtual eXtensible Local Area Network (VXLAN) */
28674         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN        UINT32_C(0x1)
28675         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
28676         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_NVGRE        UINT32_C(0x2)
28677         /* Generic Routing Encapsulation (GRE) after inside Ethernet payload */
28678         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2GRE        UINT32_C(0x3)
28679         /* IP in IP */
28680         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPIP         UINT32_C(0x4)
28681         /* Generic Network Virtualization Encapsulation (Geneve) */
28682         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_GENEVE       UINT32_C(0x5)
28683         /* Multi-Protocol Lable Switching (MPLS) */
28684         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_MPLS         UINT32_C(0x6)
28685         /* VLAN */
28686         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VLAN         UINT32_C(0x7)
28687         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
28688         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE        UINT32_C(0x8)
28689         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
28690         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_V4     UINT32_C(0x9)
28691         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
28692         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_IPGRE_V1     UINT32_C(0xa)
28693         /* Use fixed layer 2 ether type of 0xFFFF */
28694         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_L2_ETYPE     UINT32_C(0xb)
28695         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
28696         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6 UINT32_C(0xc)
28697         #define HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_LAST \
28698                 HWRM_CFA_FLOW_ACTION_DATA_ENCAP_TYPE_VXLAN_GPE_V6
28699         uint8_t unused[7];
28700         /* This value is encap data for the associated encap type. */
28701         uint32_t        encap_data[20];
28702 } __attribute__((packed));
28703
28704 /* hwrm_cfa_flow_tunnel_hdr_data (size:64b/8B) */
28705 struct hwrm_cfa_flow_tunnel_hdr_data {
28706         /* Tunnel Type. */
28707         uint8_t tunnel_type;
28708         /* Non-tunnel */
28709         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NONTUNNEL \
28710                 UINT32_C(0x0)
28711         /* Virtual eXtensible Local Area Network (VXLAN) */
28712         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN \
28713                 UINT32_C(0x1)
28714         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
28715         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_NVGRE \
28716                 UINT32_C(0x2)
28717         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
28718         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2GRE \
28719                 UINT32_C(0x3)
28720         /* IP in IP */
28721         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPIP \
28722                 UINT32_C(0x4)
28723         /* Generic Network Virtualization Encapsulation (Geneve) */
28724         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_GENEVE \
28725                 UINT32_C(0x5)
28726         /* Multi-Protocol Lable Switching (MPLS) */
28727         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_MPLS \
28728                 UINT32_C(0x6)
28729         /* Stateless Transport Tunnel (STT) */
28730         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_STT \
28731                 UINT32_C(0x7)
28732         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
28733         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE \
28734                 UINT32_C(0x8)
28735         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
28736         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_V4 \
28737                 UINT32_C(0x9)
28738         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
28739         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_IPGRE_V1 \
28740                 UINT32_C(0xa)
28741         /* Use fixed layer 2 ether type of 0xFFFF */
28742         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_L2_ETYPE \
28743                 UINT32_C(0xb)
28744         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
28745         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_VXLAN_GPE_V6 \
28746                 UINT32_C(0xc)
28747         /* Any tunneled traffic */
28748         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL \
28749                 UINT32_C(0xff)
28750         #define HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_LAST \
28751                 HWRM_CFA_FLOW_TUNNEL_HDR_DATA_TUNNEL_TYPE_ANYTUNNEL
28752         uint8_t unused[3];
28753         /*
28754          * Tunnel identifier.
28755          * Virtual Network Identifier (VNI).
28756          */
28757         uint32_t        tunnel_id;
28758 } __attribute__((packed));
28759
28760 /* hwrm_cfa_flow_l4_key_data (size:64b/8B) */
28761 struct hwrm_cfa_flow_l4_key_data {
28762         /* The value of source port. */
28763         uint16_t        l4_src_port;
28764         /* The value of destination port. */
28765         uint16_t        l4_dst_port;
28766         uint32_t        unused;
28767 } __attribute__((packed));
28768
28769 /* hwrm_cfa_flow_l3_key_data (size:512b/64B) */
28770 struct hwrm_cfa_flow_l3_key_data {
28771         /* The value of ip protocol. */
28772         uint8_t ip_protocol;
28773         uint8_t unused_0[7];
28774         /* The value of destination IPv4/IPv6 address. */
28775         uint32_t        ip_dst[4];
28776         /* The source IPv4/IPv6 address. */
28777         uint32_t        ip_src[4];
28778         /* NAT IPv4/IPv6 address. */
28779         uint32_t        nat_ip_address[4];
28780         uint32_t        unused[2];
28781 } __attribute__((packed));
28782
28783 /* hwrm_cfa_flow_l2_key_data (size:448b/56B) */
28784 struct hwrm_cfa_flow_l2_key_data {
28785         /* Destination MAC address. */
28786         uint16_t        dmac[3];
28787         uint16_t        unused_0;
28788         /* Source MAC address. */
28789         uint16_t        smac[3];
28790         uint16_t        unused_1;
28791         /* L2 header re-write Destination MAC address. */
28792         uint16_t        l2_rewrite_dmac[3];
28793         uint16_t        unused_2;
28794         /* L2 header re-write Source MAC address. */
28795         uint16_t        l2_rewrite_smac[3];
28796         /* Ethertype. */
28797         uint16_t        ethertype;
28798         /* Number of VLAN tags. */
28799         uint16_t        num_vlan_tags;
28800         /* VLAN tpid. */
28801         uint16_t        l2_rewrite_vlan_tpid;
28802         /* VLAN tci. */
28803         uint16_t        l2_rewrite_vlan_tci;
28804         uint8_t unused_3[2];
28805         /* Outer VLAN TPID. */
28806         uint16_t        ovlan_tpid;
28807         /* Outer VLAN TCI. */
28808         uint16_t        ovlan_tci;
28809         /* Inner VLAN TPID. */
28810         uint16_t        ivlan_tpid;
28811         /* Inner VLAN TCI. */
28812         uint16_t        ivlan_tci;
28813         uint8_t unused[8];
28814 } __attribute__((packed));
28815
28816 /* hwrm_cfa_flow_key_data (size:4160b/520B) */
28817 struct hwrm_cfa_flow_key_data {
28818         /* Flow associated tunnel L2 header key info. */
28819         uint32_t        t_l2_key_data[14];
28820         /* Flow associated tunnel L2 header mask info. */
28821         uint32_t        t_l2_key_mask[14];
28822         /* Flow associated tunnel L3 header key info. */
28823         uint32_t        t_l3_key_data[16];
28824         /* Flow associated tunnel L3 header mask info. */
28825         uint32_t        t_l3_key_mask[16];
28826         /* Flow associated tunnel L4 header key info. */
28827         uint32_t        t_l4_key_data[2];
28828         /* Flow associated tunnel L4 header mask info. */
28829         uint32_t        t_l4_key_mask[2];
28830         /* Flow associated tunnel header info. */
28831         uint32_t        tunnel_hdr[2];
28832         /* Flow associated L2 header key info. */
28833         uint32_t        l2_key_data[14];
28834         /* Flow associated L2 header mask info. */
28835         uint32_t        l2_key_mask[14];
28836         /* Flow associated L3 header key info. */
28837         uint32_t        l3_key_data[16];
28838         /* Flow associated L3 header mask info. */
28839         uint32_t        l3_key_mask[16];
28840         /* Flow associated L4 header key info. */
28841         uint32_t        l4_key_data[2];
28842         /* Flow associated L4 header mask info. */
28843         uint32_t        l4_key_mask[2];
28844 } __attribute__((packed));
28845
28846 /**********************
28847  * hwrm_cfa_flow_info *
28848  **********************/
28849
28850
28851 /* hwrm_cfa_flow_info_input (size:256b/32B) */
28852 struct hwrm_cfa_flow_info_input {
28853         /* The HWRM command request type. */
28854         uint16_t        req_type;
28855         /*
28856          * The completion ring to send the completion event on. This should
28857          * be the NQ ID returned from the `nq_alloc` HWRM command.
28858          */
28859         uint16_t        cmpl_ring;
28860         /*
28861          * The sequence ID is used by the driver for tracking multiple
28862          * commands. This ID is treated as opaque data by the firmware and
28863          * the value is returned in the `hwrm_resp_hdr` upon completion.
28864          */
28865         uint16_t        seq_id;
28866         /*
28867          * The target ID of the command:
28868          * * 0x0-0xFFF8 - The function ID
28869          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28870          * * 0xFFFD - Reserved for user-space HWRM interface
28871          * * 0xFFFF - HWRM
28872          */
28873         uint16_t        target_id;
28874         /*
28875          * A physical address pointer pointing to a host buffer that the
28876          * command's response data will be written. This can be either a host
28877          * physical address (HPA) or a guest physical address (GPA) and must
28878          * point to a physically contiguous block of memory.
28879          */
28880         uint64_t        resp_addr;
28881         /* Flow record index. */
28882         uint16_t        flow_handle;
28883         /* Max flow handle */
28884         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_MASK \
28885                 UINT32_C(0xfff)
28886         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_MAX_SFT        0
28887         /* CNP flow handle */
28888         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_CNP_CNT \
28889                 UINT32_C(0x1000)
28890         /* RoCEv1 flow handle */
28891         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV1_CNT \
28892                 UINT32_C(0x2000)
28893         /* RoCEv2 flow handle */
28894         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_ROCEV2_CNT \
28895                 UINT32_C(0x4000)
28896         /* Direction rx = 1 */
28897         #define HWRM_CFA_FLOW_INFO_INPUT_FLOW_HANDLE_DIR_RX \
28898                 UINT32_C(0x8000)
28899         uint8_t unused_0[6];
28900         /* This value identifies a set of CFA data structures used for a flow. */
28901         uint64_t        ext_flow_handle;
28902 } __attribute__((packed));
28903
28904 /* hwrm_cfa_flow_info_output (size:5632b/704B) */
28905 struct hwrm_cfa_flow_info_output {
28906         /* The specific error status for the command. */
28907         uint16_t        error_code;
28908         /* The HWRM command request type. */
28909         uint16_t        req_type;
28910         /* The sequence ID from the original command. */
28911         uint16_t        seq_id;
28912         /* The length of the response data in number of bytes. */
28913         uint16_t        resp_len;
28914         uint8_t flags;
28915         /* When set to 1, indicates the configuration is the TX flow. */
28916         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_TX     UINT32_C(0x1)
28917         /* When set to 1, indicates the configuration is the RX flow. */
28918         #define HWRM_CFA_FLOW_INFO_OUTPUT_FLAGS_PATH_RX     UINT32_C(0x2)
28919         /* profile is 8 b */
28920         uint8_t profile;
28921         /* src_fid is 16 b */
28922         uint16_t        src_fid;
28923         /* dst_fid is 16 b */
28924         uint16_t        dst_fid;
28925         /* l2_ctxt_id is 16 b */
28926         uint16_t        l2_ctxt_id;
28927         /* em_info is 64 b */
28928         uint64_t        em_info;
28929         /* tcam_info is 64 b */
28930         uint64_t        tcam_info;
28931         /* vfp_tcam_info is 64 b */
28932         uint64_t        vfp_tcam_info;
28933         /* ar_id is 16 b */
28934         uint16_t        ar_id;
28935         /* flow_handle is 16 b */
28936         uint16_t        flow_handle;
28937         /* tunnel_handle is 32 b */
28938         uint32_t        tunnel_handle;
28939         /* The flow aging timer for the flow, the unit is 100 milliseconds */
28940         uint16_t        flow_timer;
28941         uint8_t unused_0[6];
28942         /* Flow associated L2, L3 and L4 headers info. */
28943         uint32_t        flow_key_data[130];
28944         /* Flow associated action record info. */
28945         uint32_t        flow_action_info[30];
28946         uint8_t unused_1[7];
28947         /*
28948          * This field is used in Output records to indicate that the output
28949          * is completely written to RAM.  This field should be read as '1'
28950          * to indicate that the output has been completely written.
28951          * When writing a command completion or response to an internal processor,
28952          * the order of writes has to be such that this field is written last.
28953          */
28954         uint8_t valid;
28955 } __attribute__((packed));
28956
28957 /***********************
28958  * hwrm_cfa_flow_flush *
28959  ***********************/
28960
28961
28962 /* hwrm_cfa_flow_flush_input (size:256b/32B) */
28963 struct hwrm_cfa_flow_flush_input {
28964         /* The HWRM command request type. */
28965         uint16_t        req_type;
28966         /*
28967          * The completion ring to send the completion event on. This should
28968          * be the NQ ID returned from the `nq_alloc` HWRM command.
28969          */
28970         uint16_t        cmpl_ring;
28971         /*
28972          * The sequence ID is used by the driver for tracking multiple
28973          * commands. This ID is treated as opaque data by the firmware and
28974          * the value is returned in the `hwrm_resp_hdr` upon completion.
28975          */
28976         uint16_t        seq_id;
28977         /*
28978          * The target ID of the command:
28979          * * 0x0-0xFFF8 - The function ID
28980          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
28981          * * 0xFFFD - Reserved for user-space HWRM interface
28982          * * 0xFFFF - HWRM
28983          */
28984         uint16_t        target_id;
28985         /*
28986          * A physical address pointer pointing to a host buffer that the
28987          * command's response data will be written. This can be either a host
28988          * physical address (HPA) or a guest physical address (GPA) and must
28989          * point to a physically contiguous block of memory.
28990          */
28991         uint64_t        resp_addr;
28992         /* flags is 32 b */
28993         uint32_t        flags;
28994         /*
28995          * Set to 1 to indicate the page size, page layers, and flow_handle_table_dma_addr
28996          * fields are valid. The flow flush operation should only flush the flows from the
28997          * flow table specified. This flag is set to 0 by older driver. For older firmware,
28998          * setting this flag has no effect.
28999          */
29000         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_TABLE_VALID \
29001                 UINT32_C(0x1)
29002         /*
29003          * Set to 1 to indicate flow flush operation to cleanup all the flows, meters, CFA
29004          * context memory tables..etc.  This flag is set to 0 by older driver. For older firmware,
29005          * setting this flag has no effect.
29006          */
29007         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_ALL \
29008                 UINT32_C(0x2)
29009         /*
29010          * Set to 1 to indicate flow flush operation to cleanup all the flows by the caller.
29011          * This flag is set to 0 by older driver. For older firmware, setting this flag has no effect.
29012          */
29013         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_RESET_PORT \
29014                 UINT32_C(0x4)
29015         /* Set to 1 to indicate the flow counter IDs are included in the flow table. */
29016         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_INCL_FC \
29017                 UINT32_C(0x8000000)
29018         /*
29019          * This specifies the size of flow handle entries provided by the driver
29020          * in the flow table specified below. Only two flow handle size enums are defined.
29021          */
29022         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_MASK \
29023                 UINT32_C(0xc0000000)
29024         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_SFT \
29025                 30
29026         /* The flow handle is 16bit */
29027         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_16BIT \
29028                 (UINT32_C(0x0) << 30)
29029         /* The flow handle is 64bit */
29030         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT \
29031                 (UINT32_C(0x1) << 30)
29032         #define HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_LAST \
29033                 HWRM_CFA_FLOW_FLUSH_INPUT_FLAGS_FLOW_HANDLE_ENTRY_SIZE_FLOW_HND_64BIT
29034         /* Specify page size of the flow table memory. */
29035         uint8_t page_size;
29036         /* The page size is 4K */
29037         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
29038         /* The page size is 8K */
29039         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
29040         /* The page size is 64K */
29041         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
29042         /* The page size is 256K */
29043         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
29044         /* The page size is 1M */
29045         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
29046         /* The page size is 2M */
29047         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
29048         /* The page size is 4M */
29049         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
29050         /* The page size is 1G */
29051         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
29052         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_LAST \
29053                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_SIZE_1G
29054         /* FLow table memory indirect levels. */
29055         uint8_t page_level;
29056         /* PBL pointer is physical start address. */
29057         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
29058         /* PBL pointer points to PTE table. */
29059         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
29060         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
29061         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
29062         #define HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LAST \
29063                 HWRM_CFA_FLOW_FLUSH_INPUT_PAGE_LEVEL_LVL_2
29064         /* number of flows in the flow table */
29065         uint16_t        num_flows;
29066         /* Pointer to the PBL, or PDL depending on number of levels */
29067         uint64_t        page_dir;
29068 } __attribute__((packed));
29069
29070 /* hwrm_cfa_flow_flush_output (size:128b/16B) */
29071 struct hwrm_cfa_flow_flush_output {
29072         /* The specific error status for the command. */
29073         uint16_t        error_code;
29074         /* The HWRM command request type. */
29075         uint16_t        req_type;
29076         /* The sequence ID from the original command. */
29077         uint16_t        seq_id;
29078         /* The length of the response data in number of bytes. */
29079         uint16_t        resp_len;
29080         uint8_t unused_0[7];
29081         /*
29082          * This field is used in Output records to indicate that the output
29083          * is completely written to RAM.  This field should be read as '1'
29084          * to indicate that the output has been completely written.
29085          * When writing a command completion or response to an internal processor,
29086          * the order of writes has to be such that this field is written last.
29087          */
29088         uint8_t valid;
29089 } __attribute__((packed));
29090
29091 /***********************
29092  * hwrm_cfa_flow_stats *
29093  ***********************/
29094
29095
29096 /* hwrm_cfa_flow_stats_input (size:640b/80B) */
29097 struct hwrm_cfa_flow_stats_input {
29098         /* The HWRM command request type. */
29099         uint16_t        req_type;
29100         /*
29101          * The completion ring to send the completion event on. This should
29102          * be the NQ ID returned from the `nq_alloc` HWRM command.
29103          */
29104         uint16_t        cmpl_ring;
29105         /*
29106          * The sequence ID is used by the driver for tracking multiple
29107          * commands. This ID is treated as opaque data by the firmware and
29108          * the value is returned in the `hwrm_resp_hdr` upon completion.
29109          */
29110         uint16_t        seq_id;
29111         /*
29112          * The target ID of the command:
29113          * * 0x0-0xFFF8 - The function ID
29114          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29115          * * 0xFFFD - Reserved for user-space HWRM interface
29116          * * 0xFFFF - HWRM
29117          */
29118         uint16_t        target_id;
29119         /*
29120          * A physical address pointer pointing to a host buffer that the
29121          * command's response data will be written. This can be either a host
29122          * physical address (HPA) or a guest physical address (GPA) and must
29123          * point to a physically contiguous block of memory.
29124          */
29125         uint64_t        resp_addr;
29126         /* Flow handle. */
29127         uint16_t        num_flows;
29128         /* Flow handle. */
29129         uint16_t        flow_handle_0;
29130         /* Flow handle. */
29131         uint16_t        flow_handle_1;
29132         /* Flow handle. */
29133         uint16_t        flow_handle_2;
29134         /* Flow handle. */
29135         uint16_t        flow_handle_3;
29136         /* Flow handle. */
29137         uint16_t        flow_handle_4;
29138         /* Flow handle. */
29139         uint16_t        flow_handle_5;
29140         /* Flow handle. */
29141         uint16_t        flow_handle_6;
29142         /* Flow handle. */
29143         uint16_t        flow_handle_7;
29144         /* Flow handle. */
29145         uint16_t        flow_handle_8;
29146         /* Flow handle. */
29147         uint16_t        flow_handle_9;
29148         uint8_t unused_0[2];
29149         /* Flow ID of a flow. */
29150         uint32_t        flow_id_0;
29151         /* Flow ID of a flow. */
29152         uint32_t        flow_id_1;
29153         /* Flow ID of a flow. */
29154         uint32_t        flow_id_2;
29155         /* Flow ID of a flow. */
29156         uint32_t        flow_id_3;
29157         /* Flow ID of a flow. */
29158         uint32_t        flow_id_4;
29159         /* Flow ID of a flow. */
29160         uint32_t        flow_id_5;
29161         /* Flow ID of a flow. */
29162         uint32_t        flow_id_6;
29163         /* Flow ID of a flow. */
29164         uint32_t        flow_id_7;
29165         /* Flow ID of a flow. */
29166         uint32_t        flow_id_8;
29167         /* Flow ID of a flow. */
29168         uint32_t        flow_id_9;
29169 } __attribute__((packed));
29170
29171 /* hwrm_cfa_flow_stats_output (size:1408b/176B) */
29172 struct hwrm_cfa_flow_stats_output {
29173         /* The specific error status for the command. */
29174         uint16_t        error_code;
29175         /* The HWRM command request type. */
29176         uint16_t        req_type;
29177         /* The sequence ID from the original command. */
29178         uint16_t        seq_id;
29179         /* The length of the response data in number of bytes. */
29180         uint16_t        resp_len;
29181         /* packet_0 is 64 b */
29182         uint64_t        packet_0;
29183         /* packet_1 is 64 b */
29184         uint64_t        packet_1;
29185         /* packet_2 is 64 b */
29186         uint64_t        packet_2;
29187         /* packet_3 is 64 b */
29188         uint64_t        packet_3;
29189         /* packet_4 is 64 b */
29190         uint64_t        packet_4;
29191         /* packet_5 is 64 b */
29192         uint64_t        packet_5;
29193         /* packet_6 is 64 b */
29194         uint64_t        packet_6;
29195         /* packet_7 is 64 b */
29196         uint64_t        packet_7;
29197         /* packet_8 is 64 b */
29198         uint64_t        packet_8;
29199         /* packet_9 is 64 b */
29200         uint64_t        packet_9;
29201         /* byte_0 is 64 b */
29202         uint64_t        byte_0;
29203         /* byte_1 is 64 b */
29204         uint64_t        byte_1;
29205         /* byte_2 is 64 b */
29206         uint64_t        byte_2;
29207         /* byte_3 is 64 b */
29208         uint64_t        byte_3;
29209         /* byte_4 is 64 b */
29210         uint64_t        byte_4;
29211         /* byte_5 is 64 b */
29212         uint64_t        byte_5;
29213         /* byte_6 is 64 b */
29214         uint64_t        byte_6;
29215         /* byte_7 is 64 b */
29216         uint64_t        byte_7;
29217         /* byte_8 is 64 b */
29218         uint64_t        byte_8;
29219         /* byte_9 is 64 b */
29220         uint64_t        byte_9;
29221         uint8_t unused_0[7];
29222         /*
29223          * This field is used in Output records to indicate that the output
29224          * is completely written to RAM.  This field should be read as '1'
29225          * to indicate that the output has been completely written.
29226          * When writing a command completion or response to an internal processor,
29227          * the order of writes has to be such that this field is written last.
29228          */
29229         uint8_t valid;
29230 } __attribute__((packed));
29231
29232 /***********************************
29233  * hwrm_cfa_flow_aging_timer_reset *
29234  ***********************************/
29235
29236
29237 /* hwrm_cfa_flow_aging_timer_reset_input (size:256b/32B) */
29238 struct hwrm_cfa_flow_aging_timer_reset_input {
29239         /* The HWRM command request type. */
29240         uint16_t        req_type;
29241         /*
29242          * The completion ring to send the completion event on. This should
29243          * be the NQ ID returned from the `nq_alloc` HWRM command.
29244          */
29245         uint16_t        cmpl_ring;
29246         /*
29247          * The sequence ID is used by the driver for tracking multiple
29248          * commands. This ID is treated as opaque data by the firmware and
29249          * the value is returned in the `hwrm_resp_hdr` upon completion.
29250          */
29251         uint16_t        seq_id;
29252         /*
29253          * The target ID of the command:
29254          * * 0x0-0xFFF8 - The function ID
29255          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29256          * * 0xFFFD - Reserved for user-space HWRM interface
29257          * * 0xFFFF - HWRM
29258          */
29259         uint16_t        target_id;
29260         /*
29261          * A physical address pointer pointing to a host buffer that the
29262          * command's response data will be written. This can be either a host
29263          * physical address (HPA) or a guest physical address (GPA) and must
29264          * point to a physically contiguous block of memory.
29265          */
29266         uint64_t        resp_addr;
29267         /* Flow record index. */
29268         uint16_t        flow_handle;
29269         uint8_t unused_0[2];
29270         /*
29271          * New flow timer value for the flow specified in the ext_flow_handle.
29272          * The flow timer unit is 100ms.
29273          */
29274         uint32_t        flow_timer;
29275         /* This value identifies a set of CFA data structures used for a flow. */
29276         uint64_t        ext_flow_handle;
29277 } __attribute__((packed));
29278
29279 /* hwrm_cfa_flow_aging_timer_reset_output (size:128b/16B) */
29280 struct hwrm_cfa_flow_aging_timer_reset_output {
29281         /* The specific error status for the command. */
29282         uint16_t        error_code;
29283         /* The HWRM command request type. */
29284         uint16_t        req_type;
29285         /* The sequence ID from the original command. */
29286         uint16_t        seq_id;
29287         /* The length of the response data in number of bytes. */
29288         uint16_t        resp_len;
29289         uint8_t unused_0[7];
29290         /*
29291          * This field is used in Output records to indicate that the output
29292          * is completely written to RAM.  This field should be read as '1'
29293          * to indicate that the output has been completely written.
29294          * When writing a command completion or response to an internal processor,
29295          * the order of writes has to be such that this field is written last.
29296          */
29297         uint8_t valid;
29298 } __attribute__((packed));
29299
29300 /***************************
29301  * hwrm_cfa_flow_aging_cfg *
29302  ***************************/
29303
29304
29305 /* hwrm_cfa_flow_aging_cfg_input (size:384b/48B) */
29306 struct hwrm_cfa_flow_aging_cfg_input {
29307         /* The HWRM command request type. */
29308         uint16_t        req_type;
29309         /*
29310          * The completion ring to send the completion event on. This should
29311          * be the NQ ID returned from the `nq_alloc` HWRM command.
29312          */
29313         uint16_t        cmpl_ring;
29314         /*
29315          * The sequence ID is used by the driver for tracking multiple
29316          * commands. This ID is treated as opaque data by the firmware and
29317          * the value is returned in the `hwrm_resp_hdr` upon completion.
29318          */
29319         uint16_t        seq_id;
29320         /*
29321          * The target ID of the command:
29322          * * 0x0-0xFFF8 - The function ID
29323          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29324          * * 0xFFFD - Reserved for user-space HWRM interface
29325          * * 0xFFFF - HWRM
29326          */
29327         uint16_t        target_id;
29328         /*
29329          * A physical address pointer pointing to a host buffer that the
29330          * command's response data will be written. This can be either a host
29331          * physical address (HPA) or a guest physical address (GPA) and must
29332          * point to a physically contiguous block of memory.
29333          */
29334         uint64_t        resp_addr;
29335         /* The bit field to enable per flow aging configuration. */
29336         uint16_t        enables;
29337         /* This bit must be '1' for the tcp flow timer field to be configured */
29338         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FLOW_TIMER \
29339                 UINT32_C(0x1)
29340         /* This bit must be '1' for the tcp finish timer field to be configured */
29341         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_TCP_FIN_TIMER \
29342                 UINT32_C(0x2)
29343         /* This bit must be '1' for the udp flow timer field to be configured */
29344         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_UDP_FLOW_TIMER \
29345                 UINT32_C(0x4)
29346         /* This bit must be '1' for the eem dma interval field to be configured */
29347         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_DMA_INTERVAL \
29348                 UINT32_C(0x8)
29349         /* This bit must be '1' for the eem notice interval field to be configured */
29350         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_NOTICE_INTERVAL \
29351                 UINT32_C(0x10)
29352         /* This bit must be '1' for the eem context memory maximum entries field to be configured */
29353         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MAX_ENTRIES \
29354                 UINT32_C(0x20)
29355         /* This bit must be '1' for the eem context memory ID field to be configured */
29356         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_ID \
29357                 UINT32_C(0x40)
29358         /* This bit must be '1' for the eem context memory type field to be configured */
29359         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_ENABLES_EEM_CTX_MEM_TYPE \
29360                 UINT32_C(0x80)
29361         uint8_t flags;
29362         /* Enumeration denoting the RX, TX type of the resource. */
29363         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH       UINT32_C(0x1)
29364         /* tx path */
29365         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_TX      UINT32_C(0x0)
29366         /* rx path */
29367         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX      UINT32_C(0x1)
29368         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_LAST \
29369                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_PATH_RX
29370         /* Enumeration denoting the enable, disable eem flow aging configuration. */
29371         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM        UINT32_C(0x2)
29372         /* tx path */
29373         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_DISABLE \
29374                 (UINT32_C(0x0) << 1)
29375         /* rx path */
29376         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE \
29377                 (UINT32_C(0x1) << 1)
29378         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_LAST \
29379                 HWRM_CFA_FLOW_AGING_CFG_INPUT_FLAGS_EEM_ENABLE
29380         uint8_t unused_0;
29381         /* The flow aging timer for all TCP flows, the unit is 100 milliseconds. */
29382         uint32_t        tcp_flow_timer;
29383         /* The TCP finished timer for all TCP flows, the unit is 100 milliseconds. */
29384         uint32_t        tcp_fin_timer;
29385         /* The flow aging timer for all UDP flows, the unit is 100 milliseconds. */
29386         uint32_t        udp_flow_timer;
29387         /* The interval to dma eem ejection data to host memory, the unit is milliseconds. */
29388         uint16_t        eem_dma_interval;
29389         /* The interval to notify driver to read the eem ejection data, the unit is milliseconds. */
29390         uint16_t        eem_notice_interval;
29391         /* The maximum entries number in the eem context memory. */
29392         uint32_t        eem_ctx_max_entries;
29393         /* The context memory ID for eem flow aging. */
29394         uint16_t        eem_ctx_id;
29395         uint16_t        eem_ctx_mem_type;
29396         /* The content of context memory is eem ejection data, the size of each entry is 4 bytes. */
29397         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA \
29398                 UINT32_C(0x0)
29399         #define HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_LAST \
29400                 HWRM_CFA_FLOW_AGING_CFG_INPUT_EEM_CTX_MEM_TYPE_EJECTION_DATA
29401         uint8_t unused_1[4];
29402 } __attribute__((packed));
29403
29404 /* hwrm_cfa_flow_aging_cfg_output (size:128b/16B) */
29405 struct hwrm_cfa_flow_aging_cfg_output {
29406         /* The specific error status for the command. */
29407         uint16_t        error_code;
29408         /* The HWRM command request type. */
29409         uint16_t        req_type;
29410         /* The sequence ID from the original command. */
29411         uint16_t        seq_id;
29412         /* The length of the response data in number of bytes. */
29413         uint16_t        resp_len;
29414         uint8_t unused_0[7];
29415         /*
29416          * This field is used in Output records to indicate that the output
29417          * is completely written to RAM.  This field should be read as '1'
29418          * to indicate that the output has been completely written.
29419          * When writing a command completion or response to an internal processor,
29420          * the order of writes has to be such that this field is written last.
29421          */
29422         uint8_t valid;
29423 } __attribute__((packed));
29424
29425 /****************************
29426  * hwrm_cfa_flow_aging_qcfg *
29427  ****************************/
29428
29429
29430 /* hwrm_cfa_flow_aging_qcfg_input (size:192b/24B) */
29431 struct hwrm_cfa_flow_aging_qcfg_input {
29432         /* The HWRM command request type. */
29433         uint16_t        req_type;
29434         /*
29435          * The completion ring to send the completion event on. This should
29436          * be the NQ ID returned from the `nq_alloc` HWRM command.
29437          */
29438         uint16_t        cmpl_ring;
29439         /*
29440          * The sequence ID is used by the driver for tracking multiple
29441          * commands. This ID is treated as opaque data by the firmware and
29442          * the value is returned in the `hwrm_resp_hdr` upon completion.
29443          */
29444         uint16_t        seq_id;
29445         /*
29446          * The target ID of the command:
29447          * * 0x0-0xFFF8 - The function ID
29448          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29449          * * 0xFFFD - Reserved for user-space HWRM interface
29450          * * 0xFFFF - HWRM
29451          */
29452         uint16_t        target_id;
29453         /*
29454          * A physical address pointer pointing to a host buffer that the
29455          * command's response data will be written. This can be either a host
29456          * physical address (HPA) or a guest physical address (GPA) and must
29457          * point to a physically contiguous block of memory.
29458          */
29459         uint64_t        resp_addr;
29460         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
29461         uint8_t flags;
29462         /* Enumeration denoting the RX, TX type of the resource. */
29463         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
29464         /* tx path */
29465         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
29466         /* rx path */
29467         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
29468         #define HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_LAST \
29469                 HWRM_CFA_FLOW_AGING_QCFG_INPUT_FLAGS_PATH_RX
29470         uint8_t unused_0[7];
29471 } __attribute__((packed));
29472
29473 /* hwrm_cfa_flow_aging_qcfg_output (size:320b/40B) */
29474 struct hwrm_cfa_flow_aging_qcfg_output {
29475         /* The specific error status for the command. */
29476         uint16_t        error_code;
29477         /* The HWRM command request type. */
29478         uint16_t        req_type;
29479         /* The sequence ID from the original command. */
29480         uint16_t        seq_id;
29481         /* The length of the response data in number of bytes. */
29482         uint16_t        resp_len;
29483         /* The current flow aging timer for all TCP flows, the unit is 100 millisecond. */
29484         uint32_t        tcp_flow_timer;
29485         /* The current TCP finished timer for all TCP flows, the unit is 100 millisecond. */
29486         uint32_t        tcp_fin_timer;
29487         /* The current flow aging timer for all UDP flows, the unit is 100 millisecond. */
29488         uint32_t        udp_flow_timer;
29489         /* The interval to dma eem ejection data to host memory, the unit is milliseconds. */
29490         uint16_t        eem_dma_interval;
29491         /* The interval to notify driver to read the eem ejection data, the unit is milliseconds. */
29492         uint16_t        eem_notice_interval;
29493         /* The maximum entries number in the eem context memory. */
29494         uint32_t        eem_ctx_max_entries;
29495         /* The context memory ID for eem flow aging. */
29496         uint16_t        eem_ctx_id;
29497         /* The context memory type for eem flow aging. */
29498         uint16_t        eem_ctx_mem_type;
29499         uint8_t unused_0[7];
29500         /*
29501          * This field is used in Output records to indicate that the output
29502          * is completely written to RAM.  This field should be read as '1'
29503          * to indicate that the output has been completely written.
29504          * When writing a command completion or response to an internal processor,
29505          * the order of writes has to be such that this field is written last.
29506          */
29507         uint8_t valid;
29508 } __attribute__((packed));
29509
29510 /*****************************
29511  * hwrm_cfa_flow_aging_qcaps *
29512  *****************************/
29513
29514
29515 /* hwrm_cfa_flow_aging_qcaps_input (size:192b/24B) */
29516 struct hwrm_cfa_flow_aging_qcaps_input {
29517         /* The HWRM command request type. */
29518         uint16_t        req_type;
29519         /*
29520          * The completion ring to send the completion event on. This should
29521          * be the NQ ID returned from the `nq_alloc` HWRM command.
29522          */
29523         uint16_t        cmpl_ring;
29524         /*
29525          * The sequence ID is used by the driver for tracking multiple
29526          * commands. This ID is treated as opaque data by the firmware and
29527          * the value is returned in the `hwrm_resp_hdr` upon completion.
29528          */
29529         uint16_t        seq_id;
29530         /*
29531          * The target ID of the command:
29532          * * 0x0-0xFFF8 - The function ID
29533          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29534          * * 0xFFFD - Reserved for user-space HWRM interface
29535          * * 0xFFFF - HWRM
29536          */
29537         uint16_t        target_id;
29538         /*
29539          * A physical address pointer pointing to a host buffer that the
29540          * command's response data will be written. This can be either a host
29541          * physical address (HPA) or a guest physical address (GPA) and must
29542          * point to a physically contiguous block of memory.
29543          */
29544         uint64_t        resp_addr;
29545         /* The direction for the flow aging configuration, 1 is rx path, 2 is tx path. */
29546         uint8_t flags;
29547         /* Enumeration denoting the RX, TX type of the resource. */
29548         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH     UINT32_C(0x1)
29549         /* tx path */
29550         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
29551         /* rx path */
29552         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
29553         #define HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_LAST \
29554                 HWRM_CFA_FLOW_AGING_QCAPS_INPUT_FLAGS_PATH_RX
29555         uint8_t unused_0[7];
29556 } __attribute__((packed));
29557
29558 /* hwrm_cfa_flow_aging_qcaps_output (size:256b/32B) */
29559 struct hwrm_cfa_flow_aging_qcaps_output {
29560         /* The specific error status for the command. */
29561         uint16_t        error_code;
29562         /* The HWRM command request type. */
29563         uint16_t        req_type;
29564         /* The sequence ID from the original command. */
29565         uint16_t        seq_id;
29566         /* The length of the response data in number of bytes. */
29567         uint16_t        resp_len;
29568         /* The maximum flow aging timer for all TCP flows, the unit is 100 millisecond. */
29569         uint32_t        max_tcp_flow_timer;
29570         /* The maximum TCP finished timer for all TCP flows, the unit is 100 millisecond. */
29571         uint32_t        max_tcp_fin_timer;
29572         /* The maximum flow aging timer for all UDP flows, the unit is 100 millisecond. */
29573         uint32_t        max_udp_flow_timer;
29574         /* The maximum aging flows that HW can support. */
29575         uint32_t        max_aging_flows;
29576         uint8_t unused_0[7];
29577         /*
29578          * This field is used in Output records to indicate that the output
29579          * is completely written to RAM.  This field should be read as '1'
29580          * to indicate that the output has been completely written.
29581          * When writing a command completion or response to an internal processor,
29582          * the order of writes has to be such that this field is written last.
29583          */
29584         uint8_t valid;
29585 } __attribute__((packed));
29586
29587 /**********************************
29588  * hwrm_cfa_tcp_flag_process_qcfg *
29589  **********************************/
29590
29591
29592 /* hwrm_cfa_tcp_flag_process_qcfg_input (size:128b/16B) */
29593 struct hwrm_cfa_tcp_flag_process_qcfg_input {
29594         /* The HWRM command request type. */
29595         uint16_t        req_type;
29596         /*
29597          * The completion ring to send the completion event on. This should
29598          * be the NQ ID returned from the `nq_alloc` HWRM command.
29599          */
29600         uint16_t        cmpl_ring;
29601         /*
29602          * The sequence ID is used by the driver for tracking multiple
29603          * commands. This ID is treated as opaque data by the firmware and
29604          * the value is returned in the `hwrm_resp_hdr` upon completion.
29605          */
29606         uint16_t        seq_id;
29607         /*
29608          * The target ID of the command:
29609          * * 0x0-0xFFF8 - The function ID
29610          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29611          * * 0xFFFD - Reserved for user-space HWRM interface
29612          * * 0xFFFF - HWRM
29613          */
29614         uint16_t        target_id;
29615         /*
29616          * A physical address pointer pointing to a host buffer that the
29617          * command's response data will be written. This can be either a host
29618          * physical address (HPA) or a guest physical address (GPA) and must
29619          * point to a physically contiguous block of memory.
29620          */
29621         uint64_t        resp_addr;
29622 } __attribute__((packed));
29623
29624 /* hwrm_cfa_tcp_flag_process_qcfg_output (size:192b/24B) */
29625 struct hwrm_cfa_tcp_flag_process_qcfg_output {
29626         /* The specific error status for the command. */
29627         uint16_t        error_code;
29628         /* The HWRM command request type. */
29629         uint16_t        req_type;
29630         /* The sequence ID from the original command. */
29631         uint16_t        seq_id;
29632         /* The length of the response data in number of bytes. */
29633         uint16_t        resp_len;
29634         /* The port 0 RX mirror action record ID. */
29635         uint16_t        rx_ar_id_port0;
29636         /* The port 1 RX mirror action record ID. */
29637         uint16_t        rx_ar_id_port1;
29638         /* The port 0 RX action record ID for TX TCP flag packets from loopback path. */
29639         uint16_t        tx_ar_id_port0;
29640         /* The port 1 RX action record ID for TX TCP flag packets from loopback path. */
29641         uint16_t        tx_ar_id_port1;
29642         uint8_t unused_0[7];
29643         /*
29644          * This field is used in Output records to indicate that the output
29645          * is completely written to RAM.  This field should be read as '1'
29646          * to indicate that the output has been completely written.
29647          * When writing a command completion or response to an internal processor,
29648          * the order of writes has to be such that this field is written last.
29649          */
29650         uint8_t valid;
29651 } __attribute__((packed));
29652
29653 /**********************
29654  * hwrm_cfa_pair_info *
29655  **********************/
29656
29657
29658 /* hwrm_cfa_pair_info_input (size:448b/56B) */
29659 struct hwrm_cfa_pair_info_input {
29660         /* The HWRM command request type. */
29661         uint16_t        req_type;
29662         /*
29663          * The completion ring to send the completion event on. This should
29664          * be the NQ ID returned from the `nq_alloc` HWRM command.
29665          */
29666         uint16_t        cmpl_ring;
29667         /*
29668          * The sequence ID is used by the driver for tracking multiple
29669          * commands. This ID is treated as opaque data by the firmware and
29670          * the value is returned in the `hwrm_resp_hdr` upon completion.
29671          */
29672         uint16_t        seq_id;
29673         /*
29674          * The target ID of the command:
29675          * * 0x0-0xFFF8 - The function ID
29676          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29677          * * 0xFFFD - Reserved for user-space HWRM interface
29678          * * 0xFFFF - HWRM
29679          */
29680         uint16_t        target_id;
29681         /*
29682          * A physical address pointer pointing to a host buffer that the
29683          * command's response data will be written. This can be either a host
29684          * physical address (HPA) or a guest physical address (GPA) and must
29685          * point to a physically contiguous block of memory.
29686          */
29687         uint64_t        resp_addr;
29688         uint32_t        flags;
29689         /* If this flag is set, lookup by name else lookup by index. */
29690         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_TYPE      UINT32_C(0x1)
29691         /* If this flag is set, lookup by PF id and VF id. */
29692         #define HWRM_CFA_PAIR_INFO_INPUT_FLAGS_LOOKUP_REPRE     UINT32_C(0x2)
29693         /* Pair table index. */
29694         uint16_t        pair_index;
29695         /* Pair pf index. */
29696         uint8_t pair_pfid;
29697         /* Pair vf index. */
29698         uint8_t pair_vfid;
29699         /* Pair name (32 byte string). */
29700         char    pair_name[32];
29701 } __attribute__((packed));
29702
29703 /* hwrm_cfa_pair_info_output (size:576b/72B) */
29704 struct hwrm_cfa_pair_info_output {
29705         /* The specific error status for the command. */
29706         uint16_t        error_code;
29707         /* The HWRM command request type. */
29708         uint16_t        req_type;
29709         /* The sequence ID from the original command. */
29710         uint16_t        seq_id;
29711         /* The length of the response data in number of bytes. */
29712         uint16_t        resp_len;
29713         /* Pair table index. */
29714         uint16_t        next_pair_index;
29715         /* Pair member a's fid. */
29716         uint16_t        a_fid;
29717         /* Logical host number. */
29718         uint8_t host_a_index;
29719         /* Logical PF number. */
29720         uint8_t pf_a_index;
29721         /* Pair member a's Linux logical VF number. */
29722         uint16_t        vf_a_index;
29723         /* Rx CFA code. */
29724         uint16_t        rx_cfa_code_a;
29725         /* Tx CFA action. */
29726         uint16_t        tx_cfa_action_a;
29727         /* Pair member b's fid. */
29728         uint16_t        b_fid;
29729         /* Logical host number. */
29730         uint8_t host_b_index;
29731         /* Logical PF number. */
29732         uint8_t pf_b_index;
29733         /* Pair member a's Linux logical VF number. */
29734         uint16_t        vf_b_index;
29735         /* Rx CFA code. */
29736         uint16_t        rx_cfa_code_b;
29737         /* Tx CFA action. */
29738         uint16_t        tx_cfa_action_b;
29739         /* Pair mode (0-vf2fn, 1-rep2fn, 2-rep2rep, 3-proxy, 4-pfpair). */
29740         uint8_t pair_mode;
29741         /* Pair between VF on local host with PF or VF on specified host. */
29742         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_VF2FN   UINT32_C(0x0)
29743         /* Pair between REP on local host with PF or VF on specified host. */
29744         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2FN  UINT32_C(0x1)
29745         /* Pair between REP on local host with REP on specified host. */
29746         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_REP2REP UINT32_C(0x2)
29747         /* Pair for the proxy interface. */
29748         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PROXY   UINT32_C(0x3)
29749         /* Pair for the PF interface. */
29750         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR  UINT32_C(0x4)
29751         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_LAST \
29752                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_MODE_PFPAIR
29753         /* Pair state. */
29754         uint8_t pair_state;
29755         /* Pair has been allocated */
29756         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ALLOCATED UINT32_C(0x1)
29757         /* Both pair members are active */
29758         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE    UINT32_C(0x2)
29759         #define HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_LAST \
29760                 HWRM_CFA_PAIR_INFO_OUTPUT_PAIR_STATE_ACTIVE
29761         /* Pair name (32 byte string). */
29762         char    pair_name[32];
29763         uint8_t unused_0[7];
29764         /*
29765          * This field is used in Output records to indicate that the output
29766          * is completely written to RAM.  This field should be read as '1'
29767          * to indicate that the output has been completely written.
29768          * When writing a command completion or response to an internal processor,
29769          * the order of writes has to be such that this field is written last.
29770          */
29771         uint8_t valid;
29772 } __attribute__((packed));
29773
29774 /***************************************
29775  * hwrm_cfa_redirect_query_tunnel_type *
29776  ***************************************/
29777
29778
29779 /* hwrm_cfa_redirect_query_tunnel_type_input (size:192b/24B) */
29780 struct hwrm_cfa_redirect_query_tunnel_type_input {
29781         /* The HWRM command request type. */
29782         uint16_t        req_type;
29783         /*
29784          * The completion ring to send the completion event on. This should
29785          * be the NQ ID returned from the `nq_alloc` HWRM command.
29786          */
29787         uint16_t        cmpl_ring;
29788         /*
29789          * The sequence ID is used by the driver for tracking multiple
29790          * commands. This ID is treated as opaque data by the firmware and
29791          * the value is returned in the `hwrm_resp_hdr` upon completion.
29792          */
29793         uint16_t        seq_id;
29794         /*
29795          * The target ID of the command:
29796          * * 0x0-0xFFF8 - The function ID
29797          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29798          * * 0xFFFD - Reserved for user-space HWRM interface
29799          * * 0xFFFF - HWRM
29800          */
29801         uint16_t        target_id;
29802         /*
29803          * A physical address pointer pointing to a host buffer that the
29804          * command's response data will be written. This can be either a host
29805          * physical address (HPA) or a guest physical address (GPA) and must
29806          * point to a physically contiguous block of memory.
29807          */
29808         uint64_t        resp_addr;
29809         /* The source function id. */
29810         uint16_t        src_fid;
29811         uint8_t unused_0[6];
29812 } __attribute__((packed));
29813
29814 /* hwrm_cfa_redirect_query_tunnel_type_output (size:128b/16B) */
29815 struct hwrm_cfa_redirect_query_tunnel_type_output {
29816         /* The specific error status for the command. */
29817         uint16_t        error_code;
29818         /* The HWRM command request type. */
29819         uint16_t        req_type;
29820         /* The sequence ID from the original command. */
29821         uint16_t        seq_id;
29822         /* The length of the response data in number of bytes. */
29823         uint16_t        resp_len;
29824         /* Tunnel Mask. */
29825         uint32_t        tunnel_mask;
29826         /* Non-tunnel */
29827         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NONTUNNEL \
29828                 UINT32_C(0x1)
29829         /* Virtual eXtensible Local Area Network (VXLAN) */
29830         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN \
29831                 UINT32_C(0x2)
29832         /* Network Virtualization Generic Routing Encapsulation (NVGRE) */
29833         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_NVGRE \
29834                 UINT32_C(0x4)
29835         /* Generic Routing Encapsulation (GRE) inside Ethernet payload */
29836         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2GRE \
29837                 UINT32_C(0x8)
29838         /* IP in IP */
29839         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPIP \
29840                 UINT32_C(0x10)
29841         /* Generic Network Virtualization Encapsulation (Geneve) */
29842         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_GENEVE \
29843                 UINT32_C(0x20)
29844         /* Multi-Protocol Lable Switching (MPLS) */
29845         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_MPLS \
29846                 UINT32_C(0x40)
29847         /* Stateless Transport Tunnel (STT) */
29848         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_STT \
29849                 UINT32_C(0x80)
29850         /* Generic Routing Encapsulation (GRE) inside IP datagram payload */
29851         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE \
29852                 UINT32_C(0x100)
29853         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
29854         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_V4 \
29855                 UINT32_C(0x200)
29856         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
29857         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_IPGRE_V1 \
29858                 UINT32_C(0x400)
29859         /* Any tunneled traffic */
29860         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_ANYTUNNEL \
29861                 UINT32_C(0x800)
29862         /* Use fixed layer 2 ether type of 0xFFFF */
29863         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_L2_ETYPE \
29864                 UINT32_C(0x1000)
29865         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
29866         #define HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE_OUTPUT_TUNNEL_MASK_VXLAN_GPE_V6 \
29867                 UINT32_C(0x2000)
29868         uint8_t unused_0[3];
29869         /*
29870          * This field is used in Output records to indicate that the output
29871          * is completely written to RAM.  This field should be read as '1'
29872          * to indicate that the output has been completely written.
29873          * When writing a command completion or response to an internal processor,
29874          * the order of writes has to be such that this field is written last.
29875          */
29876         uint8_t valid;
29877 } __attribute__((packed));
29878
29879 /*************************
29880  * hwrm_cfa_ctx_mem_rgtr *
29881  *************************/
29882
29883
29884 /* hwrm_cfa_ctx_mem_rgtr_input (size:256b/32B) */
29885 struct hwrm_cfa_ctx_mem_rgtr_input {
29886         /* The HWRM command request type. */
29887         uint16_t        req_type;
29888         /*
29889          * The completion ring to send the completion event on. This should
29890          * be the NQ ID returned from the `nq_alloc` HWRM command.
29891          */
29892         uint16_t        cmpl_ring;
29893         /*
29894          * The sequence ID is used by the driver for tracking multiple
29895          * commands. This ID is treated as opaque data by the firmware and
29896          * the value is returned in the `hwrm_resp_hdr` upon completion.
29897          */
29898         uint16_t        seq_id;
29899         /*
29900          * The target ID of the command:
29901          * * 0x0-0xFFF8 - The function ID
29902          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
29903          * * 0xFFFD - Reserved for user-space HWRM interface
29904          * * 0xFFFF - HWRM
29905          */
29906         uint16_t        target_id;
29907         /*
29908          * A physical address pointer pointing to a host buffer that the
29909          * command's response data will be written. This can be either a host
29910          * physical address (HPA) or a guest physical address (GPA) and must
29911          * point to a physically contiguous block of memory.
29912          */
29913         uint64_t        resp_addr;
29914         uint16_t        flags;
29915         /* Counter PBL indirect levels. */
29916         uint8_t page_level;
29917         /* PBL pointer is physical start address. */
29918         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
29919         /* PBL pointer points to PTE table. */
29920         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
29921         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
29922         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
29923         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LAST \
29924                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_LEVEL_LVL_2
29925         /* Page size. */
29926         uint8_t page_size;
29927         /* 4KB page size. */
29928         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4K   UINT32_C(0x0)
29929         /* 8KB page size. */
29930         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_8K   UINT32_C(0x1)
29931         /* 64KB page size. */
29932         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_64K  UINT32_C(0x4)
29933         /* 256KB page size. */
29934         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_256K UINT32_C(0x6)
29935         /* 1MB page size. */
29936         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1M   UINT32_C(0x8)
29937         /* 2MB page size. */
29938         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_2M   UINT32_C(0x9)
29939         /* 4MB page size. */
29940         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_4M   UINT32_C(0xa)
29941         /* 1GB page size. */
29942         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G   UINT32_C(0x12)
29943         #define HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_LAST \
29944                 HWRM_CFA_CTX_MEM_RGTR_INPUT_PAGE_SIZE_1G
29945         uint32_t        unused_0;
29946         /* Pointer to the PBL, or PDL depending on number of levels */
29947         uint64_t        page_dir;
29948 } __attribute__((packed));
29949
29950 /* hwrm_cfa_ctx_mem_rgtr_output (size:128b/16B) */
29951 struct hwrm_cfa_ctx_mem_rgtr_output {
29952         /* The specific error status for the command. */
29953         uint16_t        error_code;
29954         /* The HWRM command request type. */
29955         uint16_t        req_type;
29956         /* The sequence ID from the original command. */
29957         uint16_t        seq_id;
29958         /* The length of the response data in number of bytes. */
29959         uint16_t        resp_len;
29960         /*
29961          * Id/Handle to the recently register context memory.  This handle is passed
29962          * to the CFA feature.
29963          */
29964         uint16_t        ctx_id;
29965         uint8_t unused_0[5];
29966         /*
29967          * This field is used in Output records to indicate that the output
29968          * is completely written to RAM.  This field should be read as '1'
29969          * to indicate that the output has been completely written.
29970          * When writing a command completion or response to an internal processor,
29971          * the order of writes has to be such that this field is written last.
29972          */
29973         uint8_t valid;
29974 } __attribute__((packed));
29975
29976 /***************************
29977  * hwrm_cfa_ctx_mem_unrgtr *
29978  ***************************/
29979
29980
29981 /* hwrm_cfa_ctx_mem_unrgtr_input (size:192b/24B) */
29982 struct hwrm_cfa_ctx_mem_unrgtr_input {
29983         /* The HWRM command request type. */
29984         uint16_t        req_type;
29985         /*
29986          * The completion ring to send the completion event on. This should
29987          * be the NQ ID returned from the `nq_alloc` HWRM command.
29988          */
29989         uint16_t        cmpl_ring;
29990         /*
29991          * The sequence ID is used by the driver for tracking multiple
29992          * commands. This ID is treated as opaque data by the firmware and
29993          * the value is returned in the `hwrm_resp_hdr` upon completion.
29994          */
29995         uint16_t        seq_id;
29996         /*
29997          * The target ID of the command:
29998          * * 0x0-0xFFF8 - The function ID
29999          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30000          * * 0xFFFD - Reserved for user-space HWRM interface
30001          * * 0xFFFF - HWRM
30002          */
30003         uint16_t        target_id;
30004         /*
30005          * A physical address pointer pointing to a host buffer that the
30006          * command's response data will be written. This can be either a host
30007          * physical address (HPA) or a guest physical address (GPA) and must
30008          * point to a physically contiguous block of memory.
30009          */
30010         uint64_t        resp_addr;
30011         /*
30012          * Id/Handle to the recently register context memory.  This handle is passed
30013          * to the CFA feature.
30014          */
30015         uint16_t        ctx_id;
30016         uint8_t unused_0[6];
30017 } __attribute__((packed));
30018
30019 /* hwrm_cfa_ctx_mem_unrgtr_output (size:128b/16B) */
30020 struct hwrm_cfa_ctx_mem_unrgtr_output {
30021         /* The specific error status for the command. */
30022         uint16_t        error_code;
30023         /* The HWRM command request type. */
30024         uint16_t        req_type;
30025         /* The sequence ID from the original command. */
30026         uint16_t        seq_id;
30027         /* The length of the response data in number of bytes. */
30028         uint16_t        resp_len;
30029         uint8_t unused_0[7];
30030         /*
30031          * This field is used in Output records to indicate that the output
30032          * is completely written to RAM.  This field should be read as '1'
30033          * to indicate that the output has been completely written.
30034          * When writing a command completion or response to an internal processor,
30035          * the order of writes has to be such that this field is written last.
30036          */
30037         uint8_t valid;
30038 } __attribute__((packed));
30039
30040 /*************************
30041  * hwrm_cfa_ctx_mem_qctx *
30042  *************************/
30043
30044
30045 /* hwrm_cfa_ctx_mem_qctx_input (size:192b/24B) */
30046 struct hwrm_cfa_ctx_mem_qctx_input {
30047         /* The HWRM command request type. */
30048         uint16_t        req_type;
30049         /*
30050          * The completion ring to send the completion event on. This should
30051          * be the NQ ID returned from the `nq_alloc` HWRM command.
30052          */
30053         uint16_t        cmpl_ring;
30054         /*
30055          * The sequence ID is used by the driver for tracking multiple
30056          * commands. This ID is treated as opaque data by the firmware and
30057          * the value is returned in the `hwrm_resp_hdr` upon completion.
30058          */
30059         uint16_t        seq_id;
30060         /*
30061          * The target ID of the command:
30062          * * 0x0-0xFFF8 - The function ID
30063          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30064          * * 0xFFFD - Reserved for user-space HWRM interface
30065          * * 0xFFFF - HWRM
30066          */
30067         uint16_t        target_id;
30068         /*
30069          * A physical address pointer pointing to a host buffer that the
30070          * command's response data will be written. This can be either a host
30071          * physical address (HPA) or a guest physical address (GPA) and must
30072          * point to a physically contiguous block of memory.
30073          */
30074         uint64_t        resp_addr;
30075         /*
30076          * Id/Handle to the recently register context memory.  This handle is passed
30077          * to the CFA feature.
30078          */
30079         uint16_t        ctx_id;
30080         uint8_t unused_0[6];
30081 } __attribute__((packed));
30082
30083 /* hwrm_cfa_ctx_mem_qctx_output (size:256b/32B) */
30084 struct hwrm_cfa_ctx_mem_qctx_output {
30085         /* The specific error status for the command. */
30086         uint16_t        error_code;
30087         /* The HWRM command request type. */
30088         uint16_t        req_type;
30089         /* The sequence ID from the original command. */
30090         uint16_t        seq_id;
30091         /* The length of the response data in number of bytes. */
30092         uint16_t        resp_len;
30093         uint16_t        flags;
30094         /* Counter PBL indirect levels. */
30095         uint8_t page_level;
30096         /* PBL pointer is physical start address. */
30097         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_0 UINT32_C(0x0)
30098         /* PBL pointer points to PTE table. */
30099         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_1 UINT32_C(0x1)
30100         /* PBL pointer points to PDE table with each entry pointing to PTE tables. */
30101         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2 UINT32_C(0x2)
30102         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LAST \
30103                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_LEVEL_LVL_2
30104         /* Page size. */
30105         uint8_t page_size;
30106         /* 4KB page size. */
30107         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4K   UINT32_C(0x0)
30108         /* 8KB page size. */
30109         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_8K   UINT32_C(0x1)
30110         /* 64KB page size. */
30111         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_64K  UINT32_C(0x4)
30112         /* 256KB page size. */
30113         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_256K UINT32_C(0x6)
30114         /* 1MB page size. */
30115         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1M   UINT32_C(0x8)
30116         /* 2MB page size. */
30117         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_2M   UINT32_C(0x9)
30118         /* 4MB page size. */
30119         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_4M   UINT32_C(0xa)
30120         /* 1GB page size. */
30121         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G   UINT32_C(0x12)
30122         #define HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_LAST \
30123                 HWRM_CFA_CTX_MEM_QCTX_OUTPUT_PAGE_SIZE_1G
30124         uint8_t unused_0[4];
30125         /* Pointer to the PBL, or PDL depending on number of levels */
30126         uint64_t        page_dir;
30127         uint8_t unused_1[7];
30128         /*
30129          * This field is used in Output records to indicate that the output
30130          * is completely written to RAM.  This field should be read as '1'
30131          * to indicate that the output has been completely written.
30132          * When writing a command completion or response to an internal processor,
30133          * the order of writes has to be such that this field is written last.
30134          */
30135         uint8_t valid;
30136 } __attribute__((packed));
30137
30138 /**************************
30139  * hwrm_cfa_ctx_mem_qcaps *
30140  **************************/
30141
30142
30143 /* hwrm_cfa_ctx_mem_qcaps_input (size:128b/16B) */
30144 struct hwrm_cfa_ctx_mem_qcaps_input {
30145         /* The HWRM command request type. */
30146         uint16_t        req_type;
30147         /*
30148          * The completion ring to send the completion event on. This should
30149          * be the NQ ID returned from the `nq_alloc` HWRM command.
30150          */
30151         uint16_t        cmpl_ring;
30152         /*
30153          * The sequence ID is used by the driver for tracking multiple
30154          * commands. This ID is treated as opaque data by the firmware and
30155          * the value is returned in the `hwrm_resp_hdr` upon completion.
30156          */
30157         uint16_t        seq_id;
30158         /*
30159          * The target ID of the command:
30160          * * 0x0-0xFFF8 - The function ID
30161          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30162          * * 0xFFFD - Reserved for user-space HWRM interface
30163          * * 0xFFFF - HWRM
30164          */
30165         uint16_t        target_id;
30166         /*
30167          * A physical address pointer pointing to a host buffer that the
30168          * command's response data will be written. This can be either a host
30169          * physical address (HPA) or a guest physical address (GPA) and must
30170          * point to a physically contiguous block of memory.
30171          */
30172         uint64_t        resp_addr;
30173 } __attribute__((packed));
30174
30175 /* hwrm_cfa_ctx_mem_qcaps_output (size:128b/16B) */
30176 struct hwrm_cfa_ctx_mem_qcaps_output {
30177         /* The specific error status for the command. */
30178         uint16_t        error_code;
30179         /* The HWRM command request type. */
30180         uint16_t        req_type;
30181         /* The sequence ID from the original command. */
30182         uint16_t        seq_id;
30183         /* The length of the response data in number of bytes. */
30184         uint16_t        resp_len;
30185         /* Indicates the maximum number of context memory which can be registered. */
30186         uint16_t        max_entries;
30187         uint8_t unused_0[5];
30188         /*
30189          * This field is used in Output records to indicate that the output
30190          * is completely written to RAM.  This field should be read as '1'
30191          * to indicate that the output has been completely written.
30192          * When writing a command completion or response to an internal processor,
30193          * the order of writes has to be such that this field is written last.
30194          */
30195         uint8_t valid;
30196 } __attribute__((packed));
30197
30198 /**********************
30199  * hwrm_cfa_eem_qcaps *
30200  **********************/
30201
30202
30203 /* hwrm_cfa_eem_qcaps_input (size:192b/24B) */
30204 struct hwrm_cfa_eem_qcaps_input {
30205         /* The HWRM command request type. */
30206         uint16_t        req_type;
30207         /*
30208          * The completion ring to send the completion event on. This should
30209          * be the NQ ID returned from the `nq_alloc` HWRM command.
30210          */
30211         uint16_t        cmpl_ring;
30212         /*
30213          * The sequence ID is used by the driver for tracking multiple
30214          * commands. This ID is treated as opaque data by the firmware and
30215          * the value is returned in the `hwrm_resp_hdr` upon completion.
30216          */
30217         uint16_t        seq_id;
30218         /*
30219          * The target ID of the command:
30220          * * 0x0-0xFFF8 - The function ID
30221          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30222          * * 0xFFFD - Reserved for user-space HWRM interface
30223          * * 0xFFFF - HWRM
30224          */
30225         uint16_t        target_id;
30226         /*
30227          * A physical address pointer pointing to a host buffer that the
30228          * command's response data will be written. This can be either a host
30229          * physical address (HPA) or a guest physical address (GPA) and must
30230          * point to a physically contiguous block of memory.
30231          */
30232         uint64_t        resp_addr;
30233         uint32_t        flags;
30234         /*
30235          * When set to 1, indicates the configuration will apply to TX flows
30236          * which are to be offloaded.
30237          * Note if this bit is set then the path_rx bit can't be set.
30238          */
30239         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_TX \
30240                 UINT32_C(0x1)
30241         /*
30242          * When set to 1, indicates the configuration will apply to RX flows
30243          * which are to be offloaded.
30244          * Note if this bit is set then the path_tx bit can't be set.
30245          */
30246         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PATH_RX \
30247                 UINT32_C(0x2)
30248         /* When set to 1, all offloaded flows will be sent to EEM. */
30249         #define HWRM_CFA_EEM_QCAPS_INPUT_FLAGS_PREFERRED_OFFLOAD \
30250                 UINT32_C(0x4)
30251         uint32_t        unused_0;
30252 } __attribute__((packed));
30253
30254 /* hwrm_cfa_eem_qcaps_output (size:320b/40B) */
30255 struct hwrm_cfa_eem_qcaps_output {
30256         /* The specific error status for the command. */
30257         uint16_t        error_code;
30258         /* The HWRM command request type. */
30259         uint16_t        req_type;
30260         /* The sequence ID from the original command. */
30261         uint16_t        seq_id;
30262         /* The length of the response data in number of bytes. */
30263         uint16_t        resp_len;
30264         uint32_t        flags;
30265         /*
30266          * When set to 1, indicates the configuration will apply to TX flows
30267          * which are to be offloaded.
30268          * Note if this bit is set then the path_rx bit can't be set.
30269          */
30270         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_TX \
30271                 UINT32_C(0x1)
30272         /*
30273          * When set to 1, indicates the configuration will apply to RX flows
30274          * which are to be offloaded.
30275          * Note if this bit is set then the path_tx bit can't be set.
30276          */
30277         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_PATH_RX \
30278                 UINT32_C(0x2)
30279         /*
30280          * When set to 1, indicates the the FW supports the Centralized
30281          * Memory Model.  The concept designates one entity for the
30282          * memory allocation while all others ‘subscribe’ to it.
30283          */
30284         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
30285                 UINT32_C(0x4)
30286         /*
30287          * When set to 1, indicates the the FW supports the Detached
30288          * Centralized Memory Model.  The memory is allocated and managed
30289          * as a separate entity.  All PFs and VFs will be granted direct
30290          * or semi-direct access to the allocated memory while none of
30291          * which can interfere with the management of the memory.
30292          */
30293         #define HWRM_CFA_EEM_QCAPS_OUTPUT_FLAGS_DETACHED_CENTRALIZED_MEMORY_MODEL_SUPPORTED \
30294                 UINT32_C(0x8)
30295         uint32_t        unused_0;
30296         uint32_t        supported;
30297         /*
30298          * If set to 1, then EEM KEY0 table is supported using crc32 hash.
30299          * If set to 0, EEM KEY0 table is not supported.
30300          */
30301         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY0_TABLE \
30302                 UINT32_C(0x1)
30303         /*
30304          * If set to 1, then EEM KEY1 table is supported using lookup3 hash.
30305          * If set to 0, EEM KEY1 table is not supported.
30306          */
30307         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_KEY1_TABLE \
30308                 UINT32_C(0x2)
30309         /*
30310          * If set to 1, then EEM External Record table is supported.
30311          * If set to 0, EEM External Record table is not supported.
30312          * (This table includes action record, EFC pointers, encap pointers)
30313          */
30314         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_RECORD_TABLE \
30315                 UINT32_C(0x4)
30316         /*
30317          * If set to 1, then EEM External Flow Counters table is supported.
30318          * If set to 0, EEM External Flow Counters table is not supported.
30319          */
30320         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_EXTERNAL_FLOW_COUNTERS_TABLE \
30321                 UINT32_C(0x8)
30322         /*
30323          * If set to 1, then FID table used for implicit flow flush is supported.
30324          * If set to 0, then FID table used for implicit flow flush is not supported.
30325          */
30326         #define HWRM_CFA_EEM_QCAPS_OUTPUT_SUPPORTED_FID_TABLE \
30327                 UINT32_C(0x10)
30328         /*
30329          * The maximum number of entries supported by EEM.   When configuring the host memory
30330          * the number of numbers of entries that can supported are -
30331          *      32k, 64k 128k, 256k, 512k, 1M, 2M, 4M, 8M, 32M, 64M, 128M entries.
30332          * Any value that are not these values, the FW will round down to the closest support
30333          * number of entries.
30334          */
30335         uint32_t        max_entries_supported;
30336         /* The entry size in bytes of each entry in the EEM KEY0/KEY1 tables. */
30337         uint16_t        key_entry_size;
30338         /* The entry size in bytes of each entry in the EEM RECORD tables. */
30339         uint16_t        record_entry_size;
30340         /* The entry size in bytes of each entry in the EEM EFC tables. */
30341         uint16_t        efc_entry_size;
30342         /* The FID size in bytes of each entry in the EEM FID tables. */
30343         uint16_t        fid_entry_size;
30344         uint8_t unused_1[7];
30345         /*
30346          * This field is used in Output records to indicate that the output
30347          * is completely written to RAM.  This field should be read as '1'
30348          * to indicate that the output has been completely written.
30349          * When writing a command completion or response to an internal processor,
30350          * the order of writes has to be such that this field is written last.
30351          */
30352         uint8_t valid;
30353 } __attribute__((packed));
30354
30355 /********************
30356  * hwrm_cfa_eem_cfg *
30357  ********************/
30358
30359
30360 /* hwrm_cfa_eem_cfg_input (size:384b/48B) */
30361 struct hwrm_cfa_eem_cfg_input {
30362         /* The HWRM command request type. */
30363         uint16_t        req_type;
30364         /*
30365          * The completion ring to send the completion event on. This should
30366          * be the NQ ID returned from the `nq_alloc` HWRM command.
30367          */
30368         uint16_t        cmpl_ring;
30369         /*
30370          * The sequence ID is used by the driver for tracking multiple
30371          * commands. This ID is treated as opaque data by the firmware and
30372          * the value is returned in the `hwrm_resp_hdr` upon completion.
30373          */
30374         uint16_t        seq_id;
30375         /*
30376          * The target ID of the command:
30377          * * 0x0-0xFFF8 - The function ID
30378          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30379          * * 0xFFFD - Reserved for user-space HWRM interface
30380          * * 0xFFFF - HWRM
30381          */
30382         uint16_t        target_id;
30383         /*
30384          * A physical address pointer pointing to a host buffer that the
30385          * command's response data will be written. This can be either a host
30386          * physical address (HPA) or a guest physical address (GPA) and must
30387          * point to a physically contiguous block of memory.
30388          */
30389         uint64_t        resp_addr;
30390         uint32_t        flags;
30391         /*
30392          * When set to 1, indicates the configuration will apply to TX flows
30393          * which are to be offloaded.
30394          * Note if this bit is set then the path_rx bit can't be set.
30395          */
30396         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_TX \
30397                 UINT32_C(0x1)
30398         /*
30399          * When set to 1, indicates the configuration will apply to RX flows
30400          * which are to be offloaded.
30401          * Note if this bit is set then the path_tx bit can't be set.
30402          */
30403         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PATH_RX \
30404                 UINT32_C(0x2)
30405         /* When set to 1, all offloaded flows will be sent to EEM. */
30406         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_PREFERRED_OFFLOAD \
30407                 UINT32_C(0x4)
30408         /* When set to 1, secondary, 0 means primary. */
30409         #define HWRM_CFA_EEM_CFG_INPUT_FLAGS_SECONDARY_PF \
30410                 UINT32_C(0x8)
30411         /*
30412          * Group_id which used by Firmware to identify memory pools belonging
30413          * to certain group.
30414          */
30415         uint16_t        group_id;
30416         uint16_t        unused_0;
30417         /*
30418          * Configured EEM with the given number of entries.  All the EEM tables KEY0, KEY1,
30419          * RECORD, EFC all have the same number of entries and all tables will be configured
30420          * using this value.  Current minimum value is 32k. Current maximum value is 128M.
30421          */
30422         uint32_t        num_entries;
30423         uint32_t        unused_1;
30424         /* Configured EEM with the given context if for KEY0 table. */
30425         uint16_t        key0_ctx_id;
30426         /* Configured EEM with the given context if for KEY1 table. */
30427         uint16_t        key1_ctx_id;
30428         /* Configured EEM with the given context if for RECORD table. */
30429         uint16_t        record_ctx_id;
30430         /* Configured EEM with the given context if for EFC table. */
30431         uint16_t        efc_ctx_id;
30432         /* Configured EEM with the given context if for EFC table. */
30433         uint16_t        fid_ctx_id;
30434         uint16_t        unused_2;
30435         uint32_t        unused_3;
30436 } __attribute__((packed));
30437
30438 /* hwrm_cfa_eem_cfg_output (size:128b/16B) */
30439 struct hwrm_cfa_eem_cfg_output {
30440         /* The specific error status for the command. */
30441         uint16_t        error_code;
30442         /* The HWRM command request type. */
30443         uint16_t        req_type;
30444         /* The sequence ID from the original command. */
30445         uint16_t        seq_id;
30446         /* The length of the response data in number of bytes. */
30447         uint16_t        resp_len;
30448         uint8_t unused_0[7];
30449         /*
30450          * This field is used in Output records to indicate that the output
30451          * is completely written to RAM.  This field should be read as '1'
30452          * to indicate that the output has been completely written.
30453          * When writing a command completion or response to an internal processor,
30454          * the order of writes has to be such that this field is written last.
30455          */
30456         uint8_t valid;
30457 } __attribute__((packed));
30458
30459 /*********************
30460  * hwrm_cfa_eem_qcfg *
30461  *********************/
30462
30463
30464 /* hwrm_cfa_eem_qcfg_input (size:192b/24B) */
30465 struct hwrm_cfa_eem_qcfg_input {
30466         /* The HWRM command request type. */
30467         uint16_t        req_type;
30468         /*
30469          * The completion ring to send the completion event on. This should
30470          * be the NQ ID returned from the `nq_alloc` HWRM command.
30471          */
30472         uint16_t        cmpl_ring;
30473         /*
30474          * The sequence ID is used by the driver for tracking multiple
30475          * commands. This ID is treated as opaque data by the firmware and
30476          * the value is returned in the `hwrm_resp_hdr` upon completion.
30477          */
30478         uint16_t        seq_id;
30479         /*
30480          * The target ID of the command:
30481          * * 0x0-0xFFF8 - The function ID
30482          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30483          * * 0xFFFD - Reserved for user-space HWRM interface
30484          * * 0xFFFF - HWRM
30485          */
30486         uint16_t        target_id;
30487         /*
30488          * A physical address pointer pointing to a host buffer that the
30489          * command's response data will be written. This can be either a host
30490          * physical address (HPA) or a guest physical address (GPA) and must
30491          * point to a physically contiguous block of memory.
30492          */
30493         uint64_t        resp_addr;
30494         uint32_t        flags;
30495         /* When set to 1, indicates the configuration is the TX flow. */
30496         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
30497         /* When set to 1, indicates the configuration is the RX flow. */
30498         #define HWRM_CFA_EEM_QCFG_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
30499         uint32_t        unused_0;
30500 } __attribute__((packed));
30501
30502 /* hwrm_cfa_eem_qcfg_output (size:256b/32B) */
30503 struct hwrm_cfa_eem_qcfg_output {
30504         /* The specific error status for the command. */
30505         uint16_t        error_code;
30506         /* The HWRM command request type. */
30507         uint16_t        req_type;
30508         /* The sequence ID from the original command. */
30509         uint16_t        seq_id;
30510         /* The length of the response data in number of bytes. */
30511         uint16_t        resp_len;
30512         uint32_t        flags;
30513         /* When set to 1, indicates the configuration is the TX flow. */
30514         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_TX \
30515                 UINT32_C(0x1)
30516         /* When set to 1, indicates the configuration is the RX flow. */
30517         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PATH_RX \
30518                 UINT32_C(0x2)
30519         /* When set to 1, all offloaded flows will be sent to EEM. */
30520         #define HWRM_CFA_EEM_QCFG_OUTPUT_FLAGS_PREFERRED_OFFLOAD \
30521                 UINT32_C(0x4)
30522         /* The number of entries the FW has configured for EEM. */
30523         uint32_t        num_entries;
30524         /* Configured EEM with the given context if for KEY0 table. */
30525         uint16_t        key0_ctx_id;
30526         /* Configured EEM with the given context if for KEY1 table. */
30527         uint16_t        key1_ctx_id;
30528         /* Configured EEM with the given context if for RECORD table. */
30529         uint16_t        record_ctx_id;
30530         /* Configured EEM with the given context if for EFC table. */
30531         uint16_t        efc_ctx_id;
30532         /* Configured EEM with the given context if for EFC table. */
30533         uint16_t        fid_ctx_id;
30534         uint8_t unused_2[5];
30535         /*
30536          * This field is used in Output records to indicate that the output
30537          * is completely written to RAM.  This field should be read as '1'
30538          * to indicate that the output has been completely written.
30539          * When writing a command completion or response to an internal processor,
30540          * the order of writes has to be such that this field is written last.
30541          */
30542         uint8_t valid;
30543 } __attribute__((packed));
30544
30545 /*******************
30546  * hwrm_cfa_eem_op *
30547  *******************/
30548
30549
30550 /* hwrm_cfa_eem_op_input (size:192b/24B) */
30551 struct hwrm_cfa_eem_op_input {
30552         /* The HWRM command request type. */
30553         uint16_t        req_type;
30554         /*
30555          * The completion ring to send the completion event on. This should
30556          * be the NQ ID returned from the `nq_alloc` HWRM command.
30557          */
30558         uint16_t        cmpl_ring;
30559         /*
30560          * The sequence ID is used by the driver for tracking multiple
30561          * commands. This ID is treated as opaque data by the firmware and
30562          * the value is returned in the `hwrm_resp_hdr` upon completion.
30563          */
30564         uint16_t        seq_id;
30565         /*
30566          * The target ID of the command:
30567          * * 0x0-0xFFF8 - The function ID
30568          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30569          * * 0xFFFD - Reserved for user-space HWRM interface
30570          * * 0xFFFF - HWRM
30571          */
30572         uint16_t        target_id;
30573         /*
30574          * A physical address pointer pointing to a host buffer that the
30575          * command's response data will be written. This can be either a host
30576          * physical address (HPA) or a guest physical address (GPA) and must
30577          * point to a physically contiguous block of memory.
30578          */
30579         uint64_t        resp_addr;
30580         uint32_t        flags;
30581         /*
30582          * When set to 1, indicates the host memory which is passed will be
30583          * used for the TX flow offload function specified in fid.
30584          * Note if this bit is set then the path_rx bit can't be set.
30585          */
30586         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_TX     UINT32_C(0x1)
30587         /*
30588          * When set to 1, indicates the host memory which is passed will be
30589          * used for the RX flow offload function specified in fid.
30590          * Note if this bit is set then the path_tx bit can't be set.
30591          */
30592         #define HWRM_CFA_EEM_OP_INPUT_FLAGS_PATH_RX     UINT32_C(0x2)
30593         uint16_t        unused_0;
30594         /* The number of EEM key table entries to be configured. */
30595         uint16_t        op;
30596         /* This value is reserved and should not be used. */
30597         #define HWRM_CFA_EEM_OP_INPUT_OP_RESERVED    UINT32_C(0x0)
30598         /*
30599          * To properly stop EEM and ensure there are no DMA's, the caller
30600          * must disable EEM for the given PF, using this call.  This will
30601          * safely disable EEM and ensure that all DMA'ed to the
30602          * keys/records/efc have been completed.
30603          */
30604         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_DISABLE UINT32_C(0x1)
30605         /*
30606          * Once the EEM host memory has been configured, EEM options have
30607          * been configured. Then the caller should enable EEM for the given
30608          * PF.  Note once this call has been made, then the EEM mechanism
30609          * will be active and DMA's will occur as packets are processed.
30610          */
30611         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_ENABLE  UINT32_C(0x2)
30612         /*
30613          * Clear EEM settings for the given PF so that the register values
30614          * are reset back to there initial state.
30615          */
30616         #define HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP UINT32_C(0x3)
30617         #define HWRM_CFA_EEM_OP_INPUT_OP_LAST \
30618                 HWRM_CFA_EEM_OP_INPUT_OP_EEM_CLEANUP
30619 } __attribute__((packed));
30620
30621 /* hwrm_cfa_eem_op_output (size:128b/16B) */
30622 struct hwrm_cfa_eem_op_output {
30623         /* The specific error status for the command. */
30624         uint16_t        error_code;
30625         /* The HWRM command request type. */
30626         uint16_t        req_type;
30627         /* The sequence ID from the original command. */
30628         uint16_t        seq_id;
30629         /* The length of the response data in number of bytes. */
30630         uint16_t        resp_len;
30631         uint8_t unused_0[7];
30632         /*
30633          * This field is used in Output records to indicate that the output
30634          * is completely written to RAM.  This field should be read as '1'
30635          * to indicate that the output has been completely written.
30636          * When writing a command completion or response to an internal processor,
30637          * the order of writes has to be such that this field is written last.
30638          */
30639         uint8_t valid;
30640 } __attribute__((packed));
30641
30642 /********************************
30643  * hwrm_cfa_adv_flow_mgnt_qcaps *
30644  ********************************/
30645
30646
30647 /* hwrm_cfa_adv_flow_mgnt_qcaps_input (size:256b/32B) */
30648 struct hwrm_cfa_adv_flow_mgnt_qcaps_input {
30649         /* The HWRM command request type. */
30650         uint16_t        req_type;
30651         /*
30652          * The completion ring to send the completion event on. This should
30653          * be the NQ ID returned from the `nq_alloc` HWRM command.
30654          */
30655         uint16_t        cmpl_ring;
30656         /*
30657          * The sequence ID is used by the driver for tracking multiple
30658          * commands. This ID is treated as opaque data by the firmware and
30659          * the value is returned in the `hwrm_resp_hdr` upon completion.
30660          */
30661         uint16_t        seq_id;
30662         /*
30663          * The target ID of the command:
30664          * * 0x0-0xFFF8 - The function ID
30665          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30666          * * 0xFFFD - Reserved for user-space HWRM interface
30667          * * 0xFFFF - HWRM
30668          */
30669         uint16_t        target_id;
30670         /*
30671          * A physical address pointer pointing to a host buffer that the
30672          * command's response data will be written. This can be either a host
30673          * physical address (HPA) or a guest physical address (GPA) and must
30674          * point to a physically contiguous block of memory.
30675          */
30676         uint64_t        resp_addr;
30677         uint32_t        unused_0[4];
30678 } __attribute__((packed));
30679
30680 /* hwrm_cfa_adv_flow_mgnt_qcaps_output (size:128b/16B) */
30681 struct hwrm_cfa_adv_flow_mgnt_qcaps_output {
30682         /* The specific error status for the command. */
30683         uint16_t        error_code;
30684         /* The HWRM command request type. */
30685         uint16_t        req_type;
30686         /* The sequence ID from the original command. */
30687         uint16_t        seq_id;
30688         /* The length of the response data in number of bytes. */
30689         uint16_t        resp_len;
30690         uint32_t        flags;
30691         /*
30692          * Value of 1 to indicate firmware support 16-bit flow handle.
30693          * Value of 0 to indicate firmware not support 16-bit flow handle.
30694          */
30695         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_16BIT_SUPPORTED \
30696                 UINT32_C(0x1)
30697         /*
30698          * Value of 1 to indicate firmware support 64-bit flow handle.
30699          * Value of 0 to indicate firmware not support 64-bit flow handle.
30700          */
30701         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_HND_64BIT_SUPPORTED \
30702                 UINT32_C(0x2)
30703         /*
30704          * Value of 1 to indicate firmware support flow batch delete operation through
30705          * HWRM_CFA_FLOW_FLUSH command.
30706          * Value of 0 to indicate that the firmware does not support flow batch delete
30707          * operation.
30708          */
30709         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_BATCH_DELETE_SUPPORTED \
30710                 UINT32_C(0x4)
30711         /*
30712          * Value of 1 to indicate that the firmware support flow reset all operation through
30713          * HWRM_CFA_FLOW_FLUSH command.
30714          * Value of 0 indicates firmware does not support flow reset all operation.
30715          */
30716         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_RESET_ALL_SUPPORTED \
30717                 UINT32_C(0x8)
30718         /*
30719          * Value of 1 to indicate that firmware supports use of FID as dest_id in
30720          * HWRM_CFA_NTUPLE_ALLOC/CFG commands.
30721          * Value of 0 indicates firmware does not support use of FID as dest_id.
30722          */
30723         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_NTUPLE_FLOW_DEST_FUNC_SUPPORTED \
30724                 UINT32_C(0x10)
30725         /*
30726          * Value of 1 to indicate that firmware supports TX EEM flows.
30727          * Value of 0 indicates firmware does not support TX EEM flows.
30728          */
30729         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_TX_EEM_FLOW_SUPPORTED \
30730                 UINT32_C(0x20)
30731         /*
30732          * Value of 1 to indicate that firmware supports RX EEM flows.
30733          * Value of 0 indicates firmware does not support RX EEM flows.
30734          */
30735         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RX_EEM_FLOW_SUPPORTED \
30736                 UINT32_C(0x40)
30737         /*
30738          * Value of 1 to indicate that firmware supports the dynamic allocation of an
30739          * on-chip flow counter which can be used for EEM flows.
30740          * Value of 0 indicates firmware does not support the dynamic allocation of an
30741          * on-chip flow counter.
30742          */
30743         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_FLOW_COUNTER_ALLOC_SUPPORTED \
30744                 UINT32_C(0x80)
30745         /*
30746          * Value of 1 to indicate that firmware supports setting of
30747          * rfs_ring_tbl_idx in HWRM_CFA_NTUPLE_ALLOC command.
30748          * Value of 0 indicates firmware does not support rfs_ring_tbl_idx.
30749          */
30750         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_RFS_RING_TBL_IDX_SUPPORTED \
30751                 UINT32_C(0x100)
30752         /*
30753          * Value of 1 to indicate that firmware supports untagged matching
30754          * criteria on HWRM_CFA_L2_FILTER_ALLOC command. Value of 0
30755          * indicates firmware does not support untagged matching.
30756          */
30757         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_UNTAGGED_VLAN_SUPPORTED \
30758                 UINT32_C(0x200)
30759         /*
30760          * Value of 1 to indicate that firmware supports XDP filter. Value
30761          * of 0 indicates firmware does not support XDP filter.
30762          */
30763         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_XDP_SUPPORTED \
30764                 UINT32_C(0x400)
30765         /*
30766          * Value of 1 to indicate that the firmware support L2 header source
30767          * fields matching criteria on HWRM_CFA_L2_FILTER_ALLOC command.
30768          * Value of 0 indicates firmware does not support L2 header source
30769          * fields matching.
30770          */
30771         #define HWRM_CFA_ADV_FLOW_MGNT_QCAPS_OUTPUT_FLAGS_L2_HEADER_SOURCE_FIELDS_SUPPORTED \
30772                 UINT32_C(0x800)
30773         uint8_t unused_0[3];
30774         /*
30775          * This field is used in Output records to indicate that the output
30776          * is completely written to RAM.  This field should be read as '1'
30777          * to indicate that the output has been completely written.
30778          * When writing a command completion or response to an internal processor,
30779          * the order of writes has to be such that this field is written last.
30780          */
30781         uint8_t valid;
30782 } __attribute__((packed));
30783
30784 /******************
30785  * hwrm_cfa_tflib *
30786  ******************/
30787
30788
30789 /* hwrm_cfa_tflib_input (size:1024b/128B) */
30790 struct hwrm_cfa_tflib_input {
30791         /* The HWRM command request type. */
30792         uint16_t        req_type;
30793         /*
30794          * The completion ring to send the completion event on. This should
30795          * be the NQ ID returned from the `nq_alloc` HWRM command.
30796          */
30797         uint16_t        cmpl_ring;
30798         /*
30799          * The sequence ID is used by the driver for tracking multiple
30800          * commands. This ID is treated as opaque data by the firmware and
30801          * the value is returned in the `hwrm_resp_hdr` upon completion.
30802          */
30803         uint16_t        seq_id;
30804         /*
30805          * The target ID of the command:
30806          * * 0x0-0xFFF8 - The function ID
30807          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30808          * * 0xFFFD - Reserved for user-space HWRM interface
30809          * * 0xFFFF - HWRM
30810          */
30811         uint16_t        target_id;
30812         /*
30813          * A physical address pointer pointing to a host buffer that the
30814          * command's response data will be written. This can be either a host
30815          * physical address (HPA) or a guest physical address (GPA) and must
30816          * point to a physically contiguous block of memory.
30817          */
30818         uint64_t        resp_addr;
30819         /* TFLIB message type. */
30820         uint16_t        tf_type;
30821         /* TFLIB message subtype. */
30822         uint16_t        tf_subtype;
30823         /* unused. */
30824         uint8_t unused0[4];
30825         /* TFLIB request data. */
30826         uint32_t        tf_req[26];
30827 } __attribute__((packed));
30828
30829 /* hwrm_cfa_tflib_output (size:5632b/704B) */
30830 struct hwrm_cfa_tflib_output {
30831         /* The specific error status for the command. */
30832         uint16_t        error_code;
30833         /* The HWRM command request type. */
30834         uint16_t        req_type;
30835         /* The sequence ID from the original command. */
30836         uint16_t        seq_id;
30837         /* The length of the response data in number of bytes. */
30838         uint16_t        resp_len;
30839         /* TFLIB message type. */
30840         uint16_t        tf_type;
30841         /* TFLIB message subtype. */
30842         uint16_t        tf_subtype;
30843         /* TFLIB response code */
30844         uint32_t        tf_resp_code;
30845         /* TFLIB response data. */
30846         uint32_t        tf_resp[170];
30847         /* unused. */
30848         uint8_t unused1[7];
30849         /*
30850          * This field is used in Output records to indicate that the output
30851          * is completely written to RAM.  This field should be read as '1'
30852          * to indicate that the output has been completely written.
30853          * When writing a command completion or response to an internal processor,
30854          * the order of writes has to be such that this field is written last.
30855          */
30856         uint8_t valid;
30857 } __attribute__((packed));
30858
30859 /******************************
30860  * hwrm_tunnel_dst_port_query *
30861  ******************************/
30862
30863
30864 /* hwrm_tunnel_dst_port_query_input (size:192b/24B) */
30865 struct hwrm_tunnel_dst_port_query_input {
30866         /* The HWRM command request type. */
30867         uint16_t        req_type;
30868         /*
30869          * The completion ring to send the completion event on. This should
30870          * be the NQ ID returned from the `nq_alloc` HWRM command.
30871          */
30872         uint16_t        cmpl_ring;
30873         /*
30874          * The sequence ID is used by the driver for tracking multiple
30875          * commands. This ID is treated as opaque data by the firmware and
30876          * the value is returned in the `hwrm_resp_hdr` upon completion.
30877          */
30878         uint16_t        seq_id;
30879         /*
30880          * The target ID of the command:
30881          * * 0x0-0xFFF8 - The function ID
30882          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30883          * * 0xFFFD - Reserved for user-space HWRM interface
30884          * * 0xFFFF - HWRM
30885          */
30886         uint16_t        target_id;
30887         /*
30888          * A physical address pointer pointing to a host buffer that the
30889          * command's response data will be written. This can be either a host
30890          * physical address (HPA) or a guest physical address (GPA) and must
30891          * point to a physically contiguous block of memory.
30892          */
30893         uint64_t        resp_addr;
30894         /* Tunnel Type. */
30895         uint8_t tunnel_type;
30896         /* Virtual eXtensible Local Area Network (VXLAN) */
30897         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
30898                 UINT32_C(0x1)
30899         /* Generic Network Virtualization Encapsulation (Geneve) */
30900         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
30901                 UINT32_C(0x5)
30902         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
30903         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_V4 \
30904                 UINT32_C(0x9)
30905         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
30906         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_IPGRE_V1 \
30907                 UINT32_C(0xa)
30908         /* Use fixed layer 2 ether type of 0xFFFF */
30909         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_L2_ETYPE \
30910                 UINT32_C(0xb)
30911         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
30912         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
30913                 UINT32_C(0xc)
30914         #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_LAST \
30915                 HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
30916         uint8_t unused_0[7];
30917 } __attribute__((packed));
30918
30919 /* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
30920 struct hwrm_tunnel_dst_port_query_output {
30921         /* The specific error status for the command. */
30922         uint16_t        error_code;
30923         /* The HWRM command request type. */
30924         uint16_t        req_type;
30925         /* The sequence ID from the original command. */
30926         uint16_t        seq_id;
30927         /* The length of the response data in number of bytes. */
30928         uint16_t        resp_len;
30929         /*
30930          * This field represents the identifier of L4 destination port
30931          * used for the given tunnel type. This field is valid for
30932          * specific tunnel types that use layer 4 (e.g. UDP)
30933          * transports for tunneling.
30934          */
30935         uint16_t        tunnel_dst_port_id;
30936         /*
30937          * This field represents the value of L4 destination port
30938          * identified by tunnel_dst_port_id. This field is valid for
30939          * specific tunnel types that use layer 4 (e.g. UDP)
30940          * transports for tunneling.
30941          * This field is in network byte order.
30942          *
30943          * A value of 0 means that the destination port is not
30944          * configured.
30945          */
30946         uint16_t        tunnel_dst_port_val;
30947         uint8_t unused_0[3];
30948         /*
30949          * This field is used in Output records to indicate that the output
30950          * is completely written to RAM.  This field should be read as '1'
30951          * to indicate that the output has been completely written.
30952          * When writing a command completion or response to an internal processor,
30953          * the order of writes has to be such that this field is written last.
30954          */
30955         uint8_t valid;
30956 } __attribute__((packed));
30957
30958 /******************************
30959  * hwrm_tunnel_dst_port_alloc *
30960  ******************************/
30961
30962
30963 /* hwrm_tunnel_dst_port_alloc_input (size:192b/24B) */
30964 struct hwrm_tunnel_dst_port_alloc_input {
30965         /* The HWRM command request type. */
30966         uint16_t        req_type;
30967         /*
30968          * The completion ring to send the completion event on. This should
30969          * be the NQ ID returned from the `nq_alloc` HWRM command.
30970          */
30971         uint16_t        cmpl_ring;
30972         /*
30973          * The sequence ID is used by the driver for tracking multiple
30974          * commands. This ID is treated as opaque data by the firmware and
30975          * the value is returned in the `hwrm_resp_hdr` upon completion.
30976          */
30977         uint16_t        seq_id;
30978         /*
30979          * The target ID of the command:
30980          * * 0x0-0xFFF8 - The function ID
30981          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
30982          * * 0xFFFD - Reserved for user-space HWRM interface
30983          * * 0xFFFF - HWRM
30984          */
30985         uint16_t        target_id;
30986         /*
30987          * A physical address pointer pointing to a host buffer that the
30988          * command's response data will be written. This can be either a host
30989          * physical address (HPA) or a guest physical address (GPA) and must
30990          * point to a physically contiguous block of memory.
30991          */
30992         uint64_t        resp_addr;
30993         /* Tunnel Type. */
30994         uint8_t tunnel_type;
30995         /* Virtual eXtensible Local Area Network (VXLAN) */
30996         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
30997                 UINT32_C(0x1)
30998         /* Generic Network Virtualization Encapsulation (Geneve) */
30999         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
31000                 UINT32_C(0x5)
31001         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
31002         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_V4 \
31003                 UINT32_C(0x9)
31004         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
31005         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_IPGRE_V1 \
31006                 UINT32_C(0xa)
31007         /* Use fixed layer 2 ether type of 0xFFFF */
31008         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_L2_ETYPE \
31009                 UINT32_C(0xb)
31010         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
31011         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
31012                 UINT32_C(0xc)
31013         #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_LAST \
31014                 HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
31015         uint8_t unused_0;
31016         /*
31017          * This field represents the value of L4 destination port used
31018          * for the given tunnel type. This field is valid for
31019          * specific tunnel types that use layer 4 (e.g. UDP)
31020          * transports for tunneling.
31021          *
31022          * This field is in network byte order.
31023          *
31024          * A value of 0 shall fail the command.
31025          */
31026         uint16_t        tunnel_dst_port_val;
31027         uint8_t unused_1[4];
31028 } __attribute__((packed));
31029
31030 /* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
31031 struct hwrm_tunnel_dst_port_alloc_output {
31032         /* The specific error status for the command. */
31033         uint16_t        error_code;
31034         /* The HWRM command request type. */
31035         uint16_t        req_type;
31036         /* The sequence ID from the original command. */
31037         uint16_t        seq_id;
31038         /* The length of the response data in number of bytes. */
31039         uint16_t        resp_len;
31040         /*
31041          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
31042          * types that has l4 destination port parameters.
31043          */
31044         uint16_t        tunnel_dst_port_id;
31045         uint8_t unused_0[5];
31046         /*
31047          * This field is used in Output records to indicate that the output
31048          * is completely written to RAM.  This field should be read as '1'
31049          * to indicate that the output has been completely written.
31050          * When writing a command completion or response to an internal processor,
31051          * the order of writes has to be such that this field is written last.
31052          */
31053         uint8_t valid;
31054 } __attribute__((packed));
31055
31056 /*****************************
31057  * hwrm_tunnel_dst_port_free *
31058  *****************************/
31059
31060
31061 /* hwrm_tunnel_dst_port_free_input (size:192b/24B) */
31062 struct hwrm_tunnel_dst_port_free_input {
31063         /* The HWRM command request type. */
31064         uint16_t        req_type;
31065         /*
31066          * The completion ring to send the completion event on. This should
31067          * be the NQ ID returned from the `nq_alloc` HWRM command.
31068          */
31069         uint16_t        cmpl_ring;
31070         /*
31071          * The sequence ID is used by the driver for tracking multiple
31072          * commands. This ID is treated as opaque data by the firmware and
31073          * the value is returned in the `hwrm_resp_hdr` upon completion.
31074          */
31075         uint16_t        seq_id;
31076         /*
31077          * The target ID of the command:
31078          * * 0x0-0xFFF8 - The function ID
31079          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31080          * * 0xFFFD - Reserved for user-space HWRM interface
31081          * * 0xFFFF - HWRM
31082          */
31083         uint16_t        target_id;
31084         /*
31085          * A physical address pointer pointing to a host buffer that the
31086          * command's response data will be written. This can be either a host
31087          * physical address (HPA) or a guest physical address (GPA) and must
31088          * point to a physically contiguous block of memory.
31089          */
31090         uint64_t        resp_addr;
31091         /* Tunnel Type. */
31092         uint8_t tunnel_type;
31093         /* Virtual eXtensible Local Area Network (VXLAN) */
31094         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN \
31095                 UINT32_C(0x1)
31096         /* Generic Network Virtualization Encapsulation (Geneve) */
31097         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE \
31098                 UINT32_C(0x5)
31099         /* IPV4 over virtual eXtensible Local Area Network (IPV4oVXLAN) */
31100         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_V4 \
31101                 UINT32_C(0x9)
31102         /* Enhance Generic Routing Encapsulation (GRE version 1) inside IP datagram payload */
31103         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_IPGRE_V1 \
31104                 UINT32_C(0xa)
31105         /* Use fixed layer 2 ether type of 0xFFFF */
31106         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_L2_ETYPE \
31107                 UINT32_C(0xb)
31108         /* IPV6 over virtual eXtensible Local Area Network with GPE header (IPV6oVXLANGPE) */
31109         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6 \
31110                 UINT32_C(0xc)
31111         #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_LAST \
31112                 HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN_GPE_V6
31113         uint8_t unused_0;
31114         /*
31115          * Identifier of a tunnel L4 destination port value. Only applies to tunnel
31116          * types that has l4 destination port parameters.
31117          */
31118         uint16_t        tunnel_dst_port_id;
31119         uint8_t unused_1[4];
31120 } __attribute__((packed));
31121
31122 /* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
31123 struct hwrm_tunnel_dst_port_free_output {
31124         /* The specific error status for the command. */
31125         uint16_t        error_code;
31126         /* The HWRM command request type. */
31127         uint16_t        req_type;
31128         /* The sequence ID from the original command. */
31129         uint16_t        seq_id;
31130         /* The length of the response data in number of bytes. */
31131         uint16_t        resp_len;
31132         uint8_t unused_1[7];
31133         /*
31134          * This field is used in Output records to indicate that the output
31135          * is completely written to RAM.  This field should be read as '1'
31136          * to indicate that the output has been completely written.
31137          * When writing a command completion or response to an internal processor,
31138          * the order of writes has to be such that this field is written last.
31139          */
31140         uint8_t valid;
31141 } __attribute__((packed));
31142
31143 /* Periodic statistics context DMA to host. */
31144 /* ctx_hw_stats (size:1280b/160B) */
31145 struct ctx_hw_stats {
31146         /* Number of received unicast packets */
31147         uint64_t        rx_ucast_pkts;
31148         /* Number of received multicast packets */
31149         uint64_t        rx_mcast_pkts;
31150         /* Number of received broadcast packets */
31151         uint64_t        rx_bcast_pkts;
31152         /* Number of discarded packets on received path */
31153         uint64_t        rx_discard_pkts;
31154         /* Number of dropped packets on received path */
31155         uint64_t        rx_drop_pkts;
31156         /* Number of received bytes for unicast traffic */
31157         uint64_t        rx_ucast_bytes;
31158         /* Number of received bytes for multicast traffic */
31159         uint64_t        rx_mcast_bytes;
31160         /* Number of received bytes for broadcast traffic */
31161         uint64_t        rx_bcast_bytes;
31162         /* Number of transmitted unicast packets */
31163         uint64_t        tx_ucast_pkts;
31164         /* Number of transmitted multicast packets */
31165         uint64_t        tx_mcast_pkts;
31166         /* Number of transmitted broadcast packets */
31167         uint64_t        tx_bcast_pkts;
31168         /* Number of discarded packets on transmit path */
31169         uint64_t        tx_discard_pkts;
31170         /* Number of dropped packets on transmit path */
31171         uint64_t        tx_drop_pkts;
31172         /* Number of transmitted bytes for unicast traffic */
31173         uint64_t        tx_ucast_bytes;
31174         /* Number of transmitted bytes for multicast traffic */
31175         uint64_t        tx_mcast_bytes;
31176         /* Number of transmitted bytes for broadcast traffic */
31177         uint64_t        tx_bcast_bytes;
31178         /* Number of TPA packets */
31179         uint64_t        tpa_pkts;
31180         /* Number of TPA bytes */
31181         uint64_t        tpa_bytes;
31182         /* Number of TPA events */
31183         uint64_t        tpa_events;
31184         /* Number of TPA aborts */
31185         uint64_t        tpa_aborts;
31186 } __attribute__((packed));
31187
31188 /* Periodic statistics context DMA to host. */
31189 /* ctx_hw_stats_ext (size:1344b/168B) */
31190 struct ctx_hw_stats_ext {
31191         /* Number of received unicast packets */
31192         uint64_t        rx_ucast_pkts;
31193         /* Number of received multicast packets */
31194         uint64_t        rx_mcast_pkts;
31195         /* Number of received broadcast packets */
31196         uint64_t        rx_bcast_pkts;
31197         /* Number of discarded packets on received path */
31198         uint64_t        rx_discard_pkts;
31199         /* Number of dropped packets on received path */
31200         uint64_t        rx_drop_pkts;
31201         /* Number of received bytes for unicast traffic */
31202         uint64_t        rx_ucast_bytes;
31203         /* Number of received bytes for multicast traffic */
31204         uint64_t        rx_mcast_bytes;
31205         /* Number of received bytes for broadcast traffic */
31206         uint64_t        rx_bcast_bytes;
31207         /* Number of transmitted unicast packets */
31208         uint64_t        tx_ucast_pkts;
31209         /* Number of transmitted multicast packets */
31210         uint64_t        tx_mcast_pkts;
31211         /* Number of transmitted broadcast packets */
31212         uint64_t        tx_bcast_pkts;
31213         /* Number of discarded packets on transmit path */
31214         uint64_t        tx_discard_pkts;
31215         /* Number of dropped packets on transmit path */
31216         uint64_t        tx_drop_pkts;
31217         /* Number of transmitted bytes for unicast traffic */
31218         uint64_t        tx_ucast_bytes;
31219         /* Number of transmitted bytes for multicast traffic */
31220         uint64_t        tx_mcast_bytes;
31221         /* Number of transmitted bytes for broadcast traffic */
31222         uint64_t        tx_bcast_bytes;
31223         /* Number of TPA eligible packets */
31224         uint64_t        rx_tpa_eligible_pkt;
31225         /* Number of TPA eligible bytes */
31226         uint64_t        rx_tpa_eligible_bytes;
31227         /* Number of TPA packets */
31228         uint64_t        rx_tpa_pkt;
31229         /* Number of TPA bytes */
31230         uint64_t        rx_tpa_bytes;
31231         /* Number of TPA errors */
31232         uint64_t        rx_tpa_errors;
31233 } __attribute__((packed));
31234
31235 /* Periodic Engine statistics context DMA to host. */
31236 /* ctx_eng_stats (size:512b/64B) */
31237 struct ctx_eng_stats {
31238         /*
31239          * Count of data bytes into the Engine.
31240          * This includes any user supplied prefix,
31241          * but does not include any predefined
31242          * prefix data.
31243          */
31244         uint64_t        eng_bytes_in;
31245         /* Count of data bytes out of the Engine. */
31246         uint64_t        eng_bytes_out;
31247         /*
31248          * Count, in 4-byte (dword) units, of bytes
31249          * that are input as auxiliary data.
31250          * This includes the aux_cmd data.
31251          */
31252         uint64_t        aux_bytes_in;
31253         /*
31254          * Count, in 4-byte (dword) units, of bytes
31255          * that are output as auxiliary data.
31256          * This count is the buffer space for aux_data
31257          * output provided in the RQE, not the actual
31258          * aux_data written
31259          */
31260         uint64_t        aux_bytes_out;
31261         /* Count of number of commands executed. */
31262         uint64_t        commands;
31263         /*
31264          * Count of number of error commands.
31265          * These are the commands with a
31266          * non-zero status value.
31267          */
31268         uint64_t        error_commands;
31269         /*
31270          * Compression/Encryption Engine usage,
31271          * the unit is count of clock cycles
31272          */
31273         uint64_t        cce_engine_usage;
31274         /*
31275          * De-Compression/De-cryption Engine usage,
31276          * the unit is count of clock cycles
31277          */
31278         uint64_t        cdd_engine_usage;
31279 } __attribute__((packed));
31280
31281 /***********************
31282  * hwrm_stat_ctx_alloc *
31283  ***********************/
31284
31285
31286 /* hwrm_stat_ctx_alloc_input (size:256b/32B) */
31287 struct hwrm_stat_ctx_alloc_input {
31288         /* The HWRM command request type. */
31289         uint16_t        req_type;
31290         /*
31291          * The completion ring to send the completion event on. This should
31292          * be the NQ ID returned from the `nq_alloc` HWRM command.
31293          */
31294         uint16_t        cmpl_ring;
31295         /*
31296          * The sequence ID is used by the driver for tracking multiple
31297          * commands. This ID is treated as opaque data by the firmware and
31298          * the value is returned in the `hwrm_resp_hdr` upon completion.
31299          */
31300         uint16_t        seq_id;
31301         /*
31302          * The target ID of the command:
31303          * * 0x0-0xFFF8 - The function ID
31304          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31305          * * 0xFFFD - Reserved for user-space HWRM interface
31306          * * 0xFFFF - HWRM
31307          */
31308         uint16_t        target_id;
31309         /*
31310          * A physical address pointer pointing to a host buffer that the
31311          * command's response data will be written. This can be either a host
31312          * physical address (HPA) or a guest physical address (GPA) and must
31313          * point to a physically contiguous block of memory.
31314          */
31315         uint64_t        resp_addr;
31316         /*
31317          * This is the address for statistic block.
31318          * > For new versions of the chip, this address should be 128B
31319          * > aligned.
31320          */
31321         uint64_t        stats_dma_addr;
31322         /*
31323          * The statistic block update period in ms.
31324          * e.g. 250ms, 500ms, 750ms, 1000ms.
31325          * If update_period_ms is 0, then the stats update
31326          * shall be never done and the DMA address shall not be used.
31327          * In this case, the stat block can only be read by
31328          * hwrm_stat_ctx_query command.
31329          * On Ethernet/L2 based devices:
31330          *   if tpa v2 supported (hwrm_vnic_qcaps[max_aggs_supported]>0),
31331          *       ctx_hw_stats_ext is used for DMA,
31332          *   else
31333          *       ctx_hw_stats is used for DMA.
31334          */
31335         uint32_t        update_period_ms;
31336         /*
31337          * This field is used to specify statistics context specific
31338          * configuration flags.
31339          */
31340         uint8_t stat_ctx_flags;
31341         /*
31342          * When this bit is set to '1', the statistics context shall be
31343          * allocated for RoCE traffic only. In this case, traffic other
31344          * than offloaded RoCE traffic shall not be included in this
31345          * statistic context.
31346          * When this bit is set to '0', the statistics context shall be
31347          * used for network traffic or engine traffic.
31348          */
31349         #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE     UINT32_C(0x1)
31350         uint8_t unused_0;
31351         /*
31352          * This is the size of the structure (ctx_hw_stats or
31353          * ctx_hw_stats_ext) that the driver has allocated to be used
31354          * for the periodic DMA updates.
31355          */
31356         uint16_t        stats_dma_length;
31357 } __attribute__((packed));
31358
31359 /* hwrm_stat_ctx_alloc_output (size:128b/16B) */
31360 struct hwrm_stat_ctx_alloc_output {
31361         /* The specific error status for the command. */
31362         uint16_t        error_code;
31363         /* The HWRM command request type. */
31364         uint16_t        req_type;
31365         /* The sequence ID from the original command. */
31366         uint16_t        seq_id;
31367         /* The length of the response data in number of bytes. */
31368         uint16_t        resp_len;
31369         /* This is the statistics context ID value. */
31370         uint32_t        stat_ctx_id;
31371         uint8_t unused_0[3];
31372         /*
31373          * This field is used in Output records to indicate that the output
31374          * is completely written to RAM.  This field should be read as '1'
31375          * to indicate that the output has been completely written.
31376          * When writing a command completion or response to an internal processor,
31377          * the order of writes has to be such that this field is written last.
31378          */
31379         uint8_t valid;
31380 } __attribute__((packed));
31381
31382 /**********************
31383  * hwrm_stat_ctx_free *
31384  **********************/
31385
31386
31387 /* hwrm_stat_ctx_free_input (size:192b/24B) */
31388 struct hwrm_stat_ctx_free_input {
31389         /* The HWRM command request type. */
31390         uint16_t        req_type;
31391         /*
31392          * The completion ring to send the completion event on. This should
31393          * be the NQ ID returned from the `nq_alloc` HWRM command.
31394          */
31395         uint16_t        cmpl_ring;
31396         /*
31397          * The sequence ID is used by the driver for tracking multiple
31398          * commands. This ID is treated as opaque data by the firmware and
31399          * the value is returned in the `hwrm_resp_hdr` upon completion.
31400          */
31401         uint16_t        seq_id;
31402         /*
31403          * The target ID of the command:
31404          * * 0x0-0xFFF8 - The function ID
31405          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31406          * * 0xFFFD - Reserved for user-space HWRM interface
31407          * * 0xFFFF - HWRM
31408          */
31409         uint16_t        target_id;
31410         /*
31411          * A physical address pointer pointing to a host buffer that the
31412          * command's response data will be written. This can be either a host
31413          * physical address (HPA) or a guest physical address (GPA) and must
31414          * point to a physically contiguous block of memory.
31415          */
31416         uint64_t        resp_addr;
31417         /* ID of the statistics context that is being queried. */
31418         uint32_t        stat_ctx_id;
31419         uint8_t unused_0[4];
31420 } __attribute__((packed));
31421
31422 /* hwrm_stat_ctx_free_output (size:128b/16B) */
31423 struct hwrm_stat_ctx_free_output {
31424         /* The specific error status for the command. */
31425         uint16_t        error_code;
31426         /* The HWRM command request type. */
31427         uint16_t        req_type;
31428         /* The sequence ID from the original command. */
31429         uint16_t        seq_id;
31430         /* The length of the response data in number of bytes. */
31431         uint16_t        resp_len;
31432         /* This is the statistics context ID value. */
31433         uint32_t        stat_ctx_id;
31434         uint8_t unused_0[3];
31435         /*
31436          * This field is used in Output records to indicate that the output
31437          * is completely written to RAM.  This field should be read as '1'
31438          * to indicate that the output has been completely written.
31439          * When writing a command completion or response to an internal processor,
31440          * the order of writes has to be such that this field is written last.
31441          */
31442         uint8_t valid;
31443 } __attribute__((packed));
31444
31445 /***********************
31446  * hwrm_stat_ctx_query *
31447  ***********************/
31448
31449
31450 /* hwrm_stat_ctx_query_input (size:192b/24B) */
31451 struct hwrm_stat_ctx_query_input {
31452         /* The HWRM command request type. */
31453         uint16_t        req_type;
31454         /*
31455          * The completion ring to send the completion event on. This should
31456          * be the NQ ID returned from the `nq_alloc` HWRM command.
31457          */
31458         uint16_t        cmpl_ring;
31459         /*
31460          * The sequence ID is used by the driver for tracking multiple
31461          * commands. This ID is treated as opaque data by the firmware and
31462          * the value is returned in the `hwrm_resp_hdr` upon completion.
31463          */
31464         uint16_t        seq_id;
31465         /*
31466          * The target ID of the command:
31467          * * 0x0-0xFFF8 - The function ID
31468          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31469          * * 0xFFFD - Reserved for user-space HWRM interface
31470          * * 0xFFFF - HWRM
31471          */
31472         uint16_t        target_id;
31473         /*
31474          * A physical address pointer pointing to a host buffer that the
31475          * command's response data will be written. This can be either a host
31476          * physical address (HPA) or a guest physical address (GPA) and must
31477          * point to a physically contiguous block of memory.
31478          */
31479         uint64_t        resp_addr;
31480         /* ID of the statistics context that is being queried. */
31481         uint32_t        stat_ctx_id;
31482         uint8_t unused_0[4];
31483 } __attribute__((packed));
31484
31485 /* hwrm_stat_ctx_query_output (size:1408b/176B) */
31486 struct hwrm_stat_ctx_query_output {
31487         /* The specific error status for the command. */
31488         uint16_t        error_code;
31489         /* The HWRM command request type. */
31490         uint16_t        req_type;
31491         /* The sequence ID from the original command. */
31492         uint16_t        seq_id;
31493         /* The length of the response data in number of bytes. */
31494         uint16_t        resp_len;
31495         /* Number of transmitted unicast packets */
31496         uint64_t        tx_ucast_pkts;
31497         /* Number of transmitted multicast packets */
31498         uint64_t        tx_mcast_pkts;
31499         /* Number of transmitted broadcast packets */
31500         uint64_t        tx_bcast_pkts;
31501         /* Number of transmitted packets with error */
31502         uint64_t        tx_err_pkts;
31503         /* Number of dropped packets on transmit path */
31504         uint64_t        tx_drop_pkts;
31505         /* Number of transmitted bytes for unicast traffic */
31506         uint64_t        tx_ucast_bytes;
31507         /* Number of transmitted bytes for multicast traffic */
31508         uint64_t        tx_mcast_bytes;
31509         /* Number of transmitted bytes for broadcast traffic */
31510         uint64_t        tx_bcast_bytes;
31511         /* Number of received unicast packets */
31512         uint64_t        rx_ucast_pkts;
31513         /* Number of received multicast packets */
31514         uint64_t        rx_mcast_pkts;
31515         /* Number of received broadcast packets */
31516         uint64_t        rx_bcast_pkts;
31517         /* Number of received packets with error */
31518         uint64_t        rx_err_pkts;
31519         /* Number of dropped packets on received path */
31520         uint64_t        rx_drop_pkts;
31521         /* Number of received bytes for unicast traffic */
31522         uint64_t        rx_ucast_bytes;
31523         /* Number of received bytes for multicast traffic */
31524         uint64_t        rx_mcast_bytes;
31525         /* Number of received bytes for broadcast traffic */
31526         uint64_t        rx_bcast_bytes;
31527         /* Number of aggregated unicast packets */
31528         uint64_t        rx_agg_pkts;
31529         /* Number of aggregated unicast bytes */
31530         uint64_t        rx_agg_bytes;
31531         /* Number of aggregation events */
31532         uint64_t        rx_agg_events;
31533         /* Number of aborted aggregations */
31534         uint64_t        rx_agg_aborts;
31535         uint8_t unused_0[7];
31536         /*
31537          * This field is used in Output records to indicate that the output
31538          * is completely written to RAM.  This field should be read as '1'
31539          * to indicate that the output has been completely written.
31540          * When writing a command completion or response to an internal processor,
31541          * the order of writes has to be such that this field is written last.
31542          */
31543         uint8_t valid;
31544 } __attribute__((packed));
31545
31546 /***************************
31547  * hwrm_stat_ctx_eng_query *
31548  ***************************/
31549
31550
31551 /* hwrm_stat_ctx_eng_query_input (size:192b/24B) */
31552 struct hwrm_stat_ctx_eng_query_input {
31553         /* The HWRM command request type. */
31554         uint16_t        req_type;
31555         /*
31556          * The completion ring to send the completion event on. This should
31557          * be the NQ ID returned from the `nq_alloc` HWRM command.
31558          */
31559         uint16_t        cmpl_ring;
31560         /*
31561          * The sequence ID is used by the driver for tracking multiple
31562          * commands. This ID is treated as opaque data by the firmware and
31563          * the value is returned in the `hwrm_resp_hdr` upon completion.
31564          */
31565         uint16_t        seq_id;
31566         /*
31567          * The target ID of the command:
31568          * * 0x0-0xFFF8 - The function ID
31569          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31570          * * 0xFFFD - Reserved for user-space HWRM interface
31571          * * 0xFFFF - HWRM
31572          */
31573         uint16_t        target_id;
31574         /*
31575          * A physical address pointer pointing to a host buffer that the
31576          * command's response data will be written. This can be either a host
31577          * physical address (HPA) or a guest physical address (GPA) and must
31578          * point to a physically contiguous block of memory.
31579          */
31580         uint64_t        resp_addr;
31581         /* ID of the statistics context that is being queried. */
31582         uint32_t        stat_ctx_id;
31583         uint8_t unused_0[4];
31584 } __attribute__((packed));
31585
31586 /* hwrm_stat_ctx_eng_query_output (size:640b/80B) */
31587 struct hwrm_stat_ctx_eng_query_output {
31588         /* The specific error status for the command. */
31589         uint16_t        error_code;
31590         /* The HWRM command request type. */
31591         uint16_t        req_type;
31592         /* The sequence ID from the original command. */
31593         uint16_t        seq_id;
31594         /* The length of the response data in number of bytes. */
31595         uint16_t        resp_len;
31596         /*
31597          * Count of data bytes into the Engine.
31598          * This includes any user supplied prefix,
31599          * but does not include any predefined
31600          * prefix data.
31601          */
31602         uint64_t        eng_bytes_in;
31603         /* Count of data bytes out of the Engine. */
31604         uint64_t        eng_bytes_out;
31605         /*
31606          * Count, in 4-byte (dword) units, of bytes
31607          * that are input as auxiliary data.
31608          * This includes the aux_cmd data.
31609          */
31610         uint64_t        aux_bytes_in;
31611         /*
31612          * Count, in 4-byte (dword) units, of bytes
31613          * that are output as auxiliary data.
31614          * This count is the buffer space for aux_data
31615          * output provided in the RQE, not the actual
31616          * aux_data written
31617          */
31618         uint64_t        aux_bytes_out;
31619         /* Count of number of commands executed. */
31620         uint64_t        commands;
31621         /*
31622          * Count of number of error commands.
31623          * These are the commands with a
31624          * non-zero status value.
31625          */
31626         uint64_t        error_commands;
31627         /*
31628          * Compression/Encryption Engine usage,
31629          * the unit is count of clock cycles
31630          */
31631         uint64_t        cce_engine_usage;
31632         /*
31633          * De-Compression/De-cryption Engine usage,
31634          * the unit is count of clock cycles
31635          */
31636         uint64_t        cdd_engine_usage;
31637         uint8_t unused_0[7];
31638         /*
31639          * This field is used in Output records to indicate that the output
31640          * is completely written to RAM.  This field should be read as '1'
31641          * to indicate that the output has been completely written.
31642          * When writing a command completion or response to an internal processor,
31643          * the order of writes has to be such that this field is written last.
31644          */
31645         uint8_t valid;
31646 } __attribute__((packed));
31647
31648 /***************************
31649  * hwrm_stat_ctx_clr_stats *
31650  ***************************/
31651
31652
31653 /* hwrm_stat_ctx_clr_stats_input (size:192b/24B) */
31654 struct hwrm_stat_ctx_clr_stats_input {
31655         /* The HWRM command request type. */
31656         uint16_t        req_type;
31657         /*
31658          * The completion ring to send the completion event on. This should
31659          * be the NQ ID returned from the `nq_alloc` HWRM command.
31660          */
31661         uint16_t        cmpl_ring;
31662         /*
31663          * The sequence ID is used by the driver for tracking multiple
31664          * commands. This ID is treated as opaque data by the firmware and
31665          * the value is returned in the `hwrm_resp_hdr` upon completion.
31666          */
31667         uint16_t        seq_id;
31668         /*
31669          * The target ID of the command:
31670          * * 0x0-0xFFF8 - The function ID
31671          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31672          * * 0xFFFD - Reserved for user-space HWRM interface
31673          * * 0xFFFF - HWRM
31674          */
31675         uint16_t        target_id;
31676         /*
31677          * A physical address pointer pointing to a host buffer that the
31678          * command's response data will be written. This can be either a host
31679          * physical address (HPA) or a guest physical address (GPA) and must
31680          * point to a physically contiguous block of memory.
31681          */
31682         uint64_t        resp_addr;
31683         /* ID of the statistics context that is being queried. */
31684         uint32_t        stat_ctx_id;
31685         uint8_t unused_0[4];
31686 } __attribute__((packed));
31687
31688 /* hwrm_stat_ctx_clr_stats_output (size:128b/16B) */
31689 struct hwrm_stat_ctx_clr_stats_output {
31690         /* The specific error status for the command. */
31691         uint16_t        error_code;
31692         /* The HWRM command request type. */
31693         uint16_t        req_type;
31694         /* The sequence ID from the original command. */
31695         uint16_t        seq_id;
31696         /* The length of the response data in number of bytes. */
31697         uint16_t        resp_len;
31698         uint8_t unused_0[7];
31699         /*
31700          * This field is used in Output records to indicate that the output
31701          * is completely written to RAM.  This field should be read as '1'
31702          * to indicate that the output has been completely written.
31703          * When writing a command completion or response to an internal processor,
31704          * the order of writes has to be such that this field is written last.
31705          */
31706         uint8_t valid;
31707 } __attribute__((packed));
31708
31709 /********************
31710  * hwrm_pcie_qstats *
31711  ********************/
31712
31713
31714 /* hwrm_pcie_qstats_input (size:256b/32B) */
31715 struct hwrm_pcie_qstats_input {
31716         /* The HWRM command request type. */
31717         uint16_t        req_type;
31718         /*
31719          * The completion ring to send the completion event on. This should
31720          * be the NQ ID returned from the `nq_alloc` HWRM command.
31721          */
31722         uint16_t        cmpl_ring;
31723         /*
31724          * The sequence ID is used by the driver for tracking multiple
31725          * commands. This ID is treated as opaque data by the firmware and
31726          * the value is returned in the `hwrm_resp_hdr` upon completion.
31727          */
31728         uint16_t        seq_id;
31729         /*
31730          * The target ID of the command:
31731          * * 0x0-0xFFF8 - The function ID
31732          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31733          * * 0xFFFD - Reserved for user-space HWRM interface
31734          * * 0xFFFF - HWRM
31735          */
31736         uint16_t        target_id;
31737         /*
31738          * A physical address pointer pointing to a host buffer that the
31739          * command's response data will be written. This can be either a host
31740          * physical address (HPA) or a guest physical address (GPA) and must
31741          * point to a physically contiguous block of memory.
31742          */
31743         uint64_t        resp_addr;
31744         /*
31745          * The size of PCIe statistics block in bytes.
31746          * Firmware will DMA the PCIe statistics to
31747          * the host with this field size in the response.
31748          */
31749         uint16_t        pcie_stat_size;
31750         uint8_t unused_0[6];
31751         /*
31752          * This is the host address where
31753          * PCIe statistics will be stored
31754          */
31755         uint64_t        pcie_stat_host_addr;
31756 } __attribute__((packed));
31757
31758 /* hwrm_pcie_qstats_output (size:128b/16B) */
31759 struct hwrm_pcie_qstats_output {
31760         /* The specific error status for the command. */
31761         uint16_t        error_code;
31762         /* The HWRM command request type. */
31763         uint16_t        req_type;
31764         /* The sequence ID from the original command. */
31765         uint16_t        seq_id;
31766         /* The length of the response data in number of bytes. */
31767         uint16_t        resp_len;
31768         /* The size of PCIe statistics block in bytes. */
31769         uint16_t        pcie_stat_size;
31770         uint8_t unused_0[5];
31771         /*
31772          * This field is used in Output records to indicate that the output
31773          * is completely written to RAM.  This field should be read as '1'
31774          * to indicate that the output has been completely written.
31775          * When writing a command completion or response to an internal processor,
31776          * the order of writes has to be such that this field is written last.
31777          */
31778         uint8_t valid;
31779 } __attribute__((packed));
31780
31781 /* PCIe Statistics Formats */
31782 /* pcie_ctx_hw_stats (size:768b/96B) */
31783 struct pcie_ctx_hw_stats {
31784         /* Number of physical layer receiver errors */
31785         uint64_t        pcie_pl_signal_integrity;
31786         /* Number of DLLP CRC errors detected by Data Link Layer */
31787         uint64_t        pcie_dl_signal_integrity;
31788         /*
31789          * Number of TLP LCRC and sequence number errors detected
31790          * by Data Link Layer
31791          */
31792         uint64_t        pcie_tl_signal_integrity;
31793         /* Number of times LTSSM entered Recovery state */
31794         uint64_t        pcie_link_integrity;
31795         /* Number of TLP bytes that have been trasmitted */
31796         uint64_t        pcie_tx_traffic_rate;
31797         /* Number of TLP bytes that have been received */
31798         uint64_t        pcie_rx_traffic_rate;
31799         /* Number of DLLP bytes that have been trasmitted */
31800         uint64_t        pcie_tx_dllp_statistics;
31801         /* Number of DLLP bytes that have been received */
31802         uint64_t        pcie_rx_dllp_statistics;
31803         /*
31804          * Number of times spent in each phase of gen3
31805          * equalization
31806          */
31807         uint64_t        pcie_equalization_time;
31808         /* Records the last 16 transitions of the LTSSM */
31809         uint32_t        pcie_ltssm_histogram[4];
31810         /*
31811          * Record the last 8 reasons on why LTSSM transitioned
31812          * to Recovery
31813          */
31814         uint64_t        pcie_recovery_histogram;
31815 } __attribute__((packed));
31816
31817 /**********************
31818  * hwrm_exec_fwd_resp *
31819  **********************/
31820
31821
31822 /* hwrm_exec_fwd_resp_input (size:1024b/128B) */
31823 struct hwrm_exec_fwd_resp_input {
31824         /* The HWRM command request type. */
31825         uint16_t        req_type;
31826         /*
31827          * The completion ring to send the completion event on. This should
31828          * be the NQ ID returned from the `nq_alloc` HWRM command.
31829          */
31830         uint16_t        cmpl_ring;
31831         /*
31832          * The sequence ID is used by the driver for tracking multiple
31833          * commands. This ID is treated as opaque data by the firmware and
31834          * the value is returned in the `hwrm_resp_hdr` upon completion.
31835          */
31836         uint16_t        seq_id;
31837         /*
31838          * The target ID of the command:
31839          * * 0x0-0xFFF8 - The function ID
31840          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31841          * * 0xFFFD - Reserved for user-space HWRM interface
31842          * * 0xFFFF - HWRM
31843          */
31844         uint16_t        target_id;
31845         /*
31846          * A physical address pointer pointing to a host buffer that the
31847          * command's response data will be written. This can be either a host
31848          * physical address (HPA) or a guest physical address (GPA) and must
31849          * point to a physically contiguous block of memory.
31850          */
31851         uint64_t        resp_addr;
31852         /*
31853          * This is an encapsulated request. This request should
31854          * be executed by the HWRM and the response should be
31855          * provided in the response buffer inside the encapsulated
31856          * request.
31857          */
31858         uint32_t        encap_request[26];
31859         /*
31860          * This value indicates the target id of the response to
31861          * the encapsulated request.
31862          * 0x0 - 0xFFF8 - Used for function ids
31863          * 0xFFF8 - 0xFFFE - Reserved for internal processors
31864          * 0xFFFF - HWRM
31865          */
31866         uint16_t        encap_resp_target_id;
31867         uint8_t unused_0[6];
31868 } __attribute__((packed));
31869
31870 /* hwrm_exec_fwd_resp_output (size:128b/16B) */
31871 struct hwrm_exec_fwd_resp_output {
31872         /* The specific error status for the command. */
31873         uint16_t        error_code;
31874         /* The HWRM command request type. */
31875         uint16_t        req_type;
31876         /* The sequence ID from the original command. */
31877         uint16_t        seq_id;
31878         /* The length of the response data in number of bytes. */
31879         uint16_t        resp_len;
31880         uint8_t unused_0[7];
31881         /*
31882          * This field is used in Output records to indicate that the output
31883          * is completely written to RAM.  This field should be read as '1'
31884          * to indicate that the output has been completely written.
31885          * When writing a command completion or response to an internal processor,
31886          * the order of writes has to be such that this field is written last.
31887          */
31888         uint8_t valid;
31889 } __attribute__((packed));
31890
31891 /************************
31892  * hwrm_reject_fwd_resp *
31893  ************************/
31894
31895
31896 /* hwrm_reject_fwd_resp_input (size:1024b/128B) */
31897 struct hwrm_reject_fwd_resp_input {
31898         /* The HWRM command request type. */
31899         uint16_t        req_type;
31900         /*
31901          * The completion ring to send the completion event on. This should
31902          * be the NQ ID returned from the `nq_alloc` HWRM command.
31903          */
31904         uint16_t        cmpl_ring;
31905         /*
31906          * The sequence ID is used by the driver for tracking multiple
31907          * commands. This ID is treated as opaque data by the firmware and
31908          * the value is returned in the `hwrm_resp_hdr` upon completion.
31909          */
31910         uint16_t        seq_id;
31911         /*
31912          * The target ID of the command:
31913          * * 0x0-0xFFF8 - The function ID
31914          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31915          * * 0xFFFD - Reserved for user-space HWRM interface
31916          * * 0xFFFF - HWRM
31917          */
31918         uint16_t        target_id;
31919         /*
31920          * A physical address pointer pointing to a host buffer that the
31921          * command's response data will be written. This can be either a host
31922          * physical address (HPA) or a guest physical address (GPA) and must
31923          * point to a physically contiguous block of memory.
31924          */
31925         uint64_t        resp_addr;
31926         /*
31927          * This is an encapsulated request. This request should
31928          * be rejected by the HWRM and the error response should be
31929          * provided in the response buffer inside the encapsulated
31930          * request.
31931          */
31932         uint32_t        encap_request[26];
31933         /*
31934          * This value indicates the target id of the response to
31935          * the encapsulated request.
31936          * 0x0 - 0xFFF8 - Used for function ids
31937          * 0xFFF8 - 0xFFFE - Reserved for internal processors
31938          * 0xFFFF - HWRM
31939          */
31940         uint16_t        encap_resp_target_id;
31941         uint8_t unused_0[6];
31942 } __attribute__((packed));
31943
31944 /* hwrm_reject_fwd_resp_output (size:128b/16B) */
31945 struct hwrm_reject_fwd_resp_output {
31946         /* The specific error status for the command. */
31947         uint16_t        error_code;
31948         /* The HWRM command request type. */
31949         uint16_t        req_type;
31950         /* The sequence ID from the original command. */
31951         uint16_t        seq_id;
31952         /* The length of the response data in number of bytes. */
31953         uint16_t        resp_len;
31954         uint8_t unused_0[7];
31955         /*
31956          * This field is used in Output records to indicate that the output
31957          * is completely written to RAM.  This field should be read as '1'
31958          * to indicate that the output has been completely written.
31959          * When writing a command completion or response to an internal processor,
31960          * the order of writes has to be such that this field is written last.
31961          */
31962         uint8_t valid;
31963 } __attribute__((packed));
31964
31965 /*****************
31966  * hwrm_fwd_resp *
31967  *****************/
31968
31969
31970 /* hwrm_fwd_resp_input (size:1024b/128B) */
31971 struct hwrm_fwd_resp_input {
31972         /* The HWRM command request type. */
31973         uint16_t        req_type;
31974         /*
31975          * The completion ring to send the completion event on. This should
31976          * be the NQ ID returned from the `nq_alloc` HWRM command.
31977          */
31978         uint16_t        cmpl_ring;
31979         /*
31980          * The sequence ID is used by the driver for tracking multiple
31981          * commands. This ID is treated as opaque data by the firmware and
31982          * the value is returned in the `hwrm_resp_hdr` upon completion.
31983          */
31984         uint16_t        seq_id;
31985         /*
31986          * The target ID of the command:
31987          * * 0x0-0xFFF8 - The function ID
31988          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
31989          * * 0xFFFD - Reserved for user-space HWRM interface
31990          * * 0xFFFF - HWRM
31991          */
31992         uint16_t        target_id;
31993         /*
31994          * A physical address pointer pointing to a host buffer that the
31995          * command's response data will be written. This can be either a host
31996          * physical address (HPA) or a guest physical address (GPA) and must
31997          * point to a physically contiguous block of memory.
31998          */
31999         uint64_t        resp_addr;
32000         /*
32001          * This value indicates the target id of the encapsulated
32002          * response.
32003          * 0x0 - 0xFFF8 - Used for function ids
32004          * 0xFFF8 - 0xFFFE - Reserved for internal processors
32005          * 0xFFFF - HWRM
32006          */
32007         uint16_t        encap_resp_target_id;
32008         /*
32009          * This value indicates the completion ring the encapsulated
32010          * response will be optionally completed on.  If the value is
32011          * -1, then no CR completion shall be generated for the
32012          * encapsulated response. Any other value must be a
32013          * valid CR ring_id value. If a valid encap_resp_cmpl_ring
32014          * is provided, then a CR completion shall be generated for
32015          * the encapsulated response.
32016          */
32017         uint16_t        encap_resp_cmpl_ring;
32018         /* This field indicates the length of encapsulated response. */
32019         uint16_t        encap_resp_len;
32020         uint8_t unused_0;
32021         uint8_t unused_1;
32022         /*
32023          * This is the host address where the encapsulated response
32024          * will be written.
32025          * This area must be 16B aligned and must be cleared to zero
32026          * before the original request is made.
32027          */
32028         uint64_t        encap_resp_addr;
32029         /* This is an encapsulated response. */
32030         uint32_t        encap_resp[24];
32031 } __attribute__((packed));
32032
32033 /* hwrm_fwd_resp_output (size:128b/16B) */
32034 struct hwrm_fwd_resp_output {
32035         /* The specific error status for the command. */
32036         uint16_t        error_code;
32037         /* The HWRM command request type. */
32038         uint16_t        req_type;
32039         /* The sequence ID from the original command. */
32040         uint16_t        seq_id;
32041         /* The length of the response data in number of bytes. */
32042         uint16_t        resp_len;
32043         uint8_t unused_0[7];
32044         /*
32045          * This field is used in Output records to indicate that the output
32046          * is completely written to RAM.  This field should be read as '1'
32047          * to indicate that the output has been completely written.
32048          * When writing a command completion or response to an internal processor,
32049          * the order of writes has to be such that this field is written last.
32050          */
32051         uint8_t valid;
32052 } __attribute__((packed));
32053
32054 /*****************************
32055  * hwrm_fwd_async_event_cmpl *
32056  *****************************/
32057
32058
32059 /* hwrm_fwd_async_event_cmpl_input (size:320b/40B) */
32060 struct hwrm_fwd_async_event_cmpl_input {
32061         /* The HWRM command request type. */
32062         uint16_t        req_type;
32063         /*
32064          * The completion ring to send the completion event on. This should
32065          * be the NQ ID returned from the `nq_alloc` HWRM command.
32066          */
32067         uint16_t        cmpl_ring;
32068         /*
32069          * The sequence ID is used by the driver for tracking multiple
32070          * commands. This ID is treated as opaque data by the firmware and
32071          * the value is returned in the `hwrm_resp_hdr` upon completion.
32072          */
32073         uint16_t        seq_id;
32074         /*
32075          * The target ID of the command:
32076          * * 0x0-0xFFF8 - The function ID
32077          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32078          * * 0xFFFD - Reserved for user-space HWRM interface
32079          * * 0xFFFF - HWRM
32080          */
32081         uint16_t        target_id;
32082         /*
32083          * A physical address pointer pointing to a host buffer that the
32084          * command's response data will be written. This can be either a host
32085          * physical address (HPA) or a guest physical address (GPA) and must
32086          * point to a physically contiguous block of memory.
32087          */
32088         uint64_t        resp_addr;
32089         /*
32090          * This value indicates the target id of the encapsulated
32091          * asynchronous event.
32092          * 0x0 - 0xFFF8 - Used for function ids
32093          * 0xFFF8 - 0xFFFE - Reserved for internal processors
32094          * 0xFFFF - Broadcast to all children VFs (only applicable when
32095          * a PF is the requester)
32096          */
32097         uint16_t        encap_async_event_target_id;
32098         uint8_t unused_0[6];
32099         /* This is an encapsulated asynchronous event completion. */
32100         uint32_t        encap_async_event_cmpl[4];
32101 } __attribute__((packed));
32102
32103 /* hwrm_fwd_async_event_cmpl_output (size:128b/16B) */
32104 struct hwrm_fwd_async_event_cmpl_output {
32105         /* The specific error status for the command. */
32106         uint16_t        error_code;
32107         /* The HWRM command request type. */
32108         uint16_t        req_type;
32109         /* The sequence ID from the original command. */
32110         uint16_t        seq_id;
32111         /* The length of the response data in number of bytes. */
32112         uint16_t        resp_len;
32113         uint8_t unused_0[7];
32114         /*
32115          * This field is used in Output records to indicate that the output
32116          * is completely written to RAM.  This field should be read as '1'
32117          * to indicate that the output has been completely written.
32118          * When writing a command completion or response to an internal processor,
32119          * the order of writes has to be such that this field is written last.
32120          */
32121         uint8_t valid;
32122 } __attribute__((packed));
32123
32124 /**************************
32125  * hwrm_nvm_raw_write_blk *
32126  **************************/
32127
32128
32129 /* hwrm_nvm_raw_write_blk_input (size:256b/32B) */
32130 struct hwrm_nvm_raw_write_blk_input {
32131         /* The HWRM command request type. */
32132         uint16_t        req_type;
32133         /*
32134          * The completion ring to send the completion event on. This should
32135          * be the NQ ID returned from the `nq_alloc` HWRM command.
32136          */
32137         uint16_t        cmpl_ring;
32138         /*
32139          * The sequence ID is used by the driver for tracking multiple
32140          * commands. This ID is treated as opaque data by the firmware and
32141          * the value is returned in the `hwrm_resp_hdr` upon completion.
32142          */
32143         uint16_t        seq_id;
32144         /*
32145          * The target ID of the command:
32146          * * 0x0-0xFFF8 - The function ID
32147          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32148          * * 0xFFFD - Reserved for user-space HWRM interface
32149          * * 0xFFFF - HWRM
32150          */
32151         uint16_t        target_id;
32152         /*
32153          * A physical address pointer pointing to a host buffer that the
32154          * command's response data will be written. This can be either a host
32155          * physical address (HPA) or a guest physical address (GPA) and must
32156          * point to a physically contiguous block of memory.
32157          */
32158         uint64_t        resp_addr;
32159         /*
32160          * 64-bit Host Source Address.
32161          * This is the loation of the source data to be written.
32162          */
32163         uint64_t        host_src_addr;
32164         /*
32165          * 32-bit Destination Address.
32166          * This is the NVRAM byte-offset where the source data will be written to.
32167          */
32168         uint32_t        dest_addr;
32169         /* Length of data to be written, in bytes. */
32170         uint32_t        len;
32171 } __attribute__((packed));
32172
32173 /* hwrm_nvm_raw_write_blk_output (size:128b/16B) */
32174 struct hwrm_nvm_raw_write_blk_output {
32175         /* The specific error status for the command. */
32176         uint16_t        error_code;
32177         /* The HWRM command request type. */
32178         uint16_t        req_type;
32179         /* The sequence ID from the original command. */
32180         uint16_t        seq_id;
32181         /* The length of the response data in number of bytes. */
32182         uint16_t        resp_len;
32183         uint8_t unused_0[7];
32184         /*
32185          * This field is used in Output records to indicate that the output
32186          * is completely written to RAM.  This field should be read as '1'
32187          * to indicate that the output has been completely written.
32188          * When writing a command completion or response to an internal processor,
32189          * the order of writes has to be such that this field is written last.
32190          */
32191         uint8_t valid;
32192 } __attribute__((packed));
32193
32194 /*****************
32195  * hwrm_nvm_read *
32196  *****************/
32197
32198
32199 /* hwrm_nvm_read_input (size:320b/40B) */
32200 struct hwrm_nvm_read_input {
32201         /* The HWRM command request type. */
32202         uint16_t        req_type;
32203         /*
32204          * The completion ring to send the completion event on. This should
32205          * be the NQ ID returned from the `nq_alloc` HWRM command.
32206          */
32207         uint16_t        cmpl_ring;
32208         /*
32209          * The sequence ID is used by the driver for tracking multiple
32210          * commands. This ID is treated as opaque data by the firmware and
32211          * the value is returned in the `hwrm_resp_hdr` upon completion.
32212          */
32213         uint16_t        seq_id;
32214         /*
32215          * The target ID of the command:
32216          * * 0x0-0xFFF8 - The function ID
32217          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32218          * * 0xFFFD - Reserved for user-space HWRM interface
32219          * * 0xFFFF - HWRM
32220          */
32221         uint16_t        target_id;
32222         /*
32223          * A physical address pointer pointing to a host buffer that the
32224          * command's response data will be written. This can be either a host
32225          * physical address (HPA) or a guest physical address (GPA) and must
32226          * point to a physically contiguous block of memory.
32227          */
32228         uint64_t        resp_addr;
32229         /*
32230          * 64-bit Host Destination Address.
32231          * This is the host address where the data will be written to.
32232          */
32233         uint64_t        host_dest_addr;
32234         /* The 0-based index of the directory entry. */
32235         uint16_t        dir_idx;
32236         uint8_t unused_0[2];
32237         /* The NVRAM byte-offset to read from. */
32238         uint32_t        offset;
32239         /* The length of the data to be read, in bytes. */
32240         uint32_t        len;
32241         uint8_t unused_1[4];
32242 } __attribute__((packed));
32243
32244 /* hwrm_nvm_read_output (size:128b/16B) */
32245 struct hwrm_nvm_read_output {
32246         /* The specific error status for the command. */
32247         uint16_t        error_code;
32248         /* The HWRM command request type. */
32249         uint16_t        req_type;
32250         /* The sequence ID from the original command. */
32251         uint16_t        seq_id;
32252         /* The length of the response data in number of bytes. */
32253         uint16_t        resp_len;
32254         uint8_t unused_0[7];
32255         /*
32256          * This field is used in Output records to indicate that the output
32257          * is completely written to RAM.  This field should be read as '1'
32258          * to indicate that the output has been completely written.
32259          * When writing a command completion or response to an internal processor,
32260          * the order of writes has to be such that this field is written last.
32261          */
32262         uint8_t valid;
32263 } __attribute__((packed));
32264
32265 /*********************
32266  * hwrm_nvm_raw_dump *
32267  *********************/
32268
32269
32270 /* hwrm_nvm_raw_dump_input (size:256b/32B) */
32271 struct hwrm_nvm_raw_dump_input {
32272         /* The HWRM command request type. */
32273         uint16_t        req_type;
32274         /*
32275          * The completion ring to send the completion event on. This should
32276          * be the NQ ID returned from the `nq_alloc` HWRM command.
32277          */
32278         uint16_t        cmpl_ring;
32279         /*
32280          * The sequence ID is used by the driver for tracking multiple
32281          * commands. This ID is treated as opaque data by the firmware and
32282          * the value is returned in the `hwrm_resp_hdr` upon completion.
32283          */
32284         uint16_t        seq_id;
32285         /*
32286          * The target ID of the command:
32287          * * 0x0-0xFFF8 - The function ID
32288          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32289          * * 0xFFFD - Reserved for user-space HWRM interface
32290          * * 0xFFFF - HWRM
32291          */
32292         uint16_t        target_id;
32293         /*
32294          * A physical address pointer pointing to a host buffer that the
32295          * command's response data will be written. This can be either a host
32296          * physical address (HPA) or a guest physical address (GPA) and must
32297          * point to a physically contiguous block of memory.
32298          */
32299         uint64_t        resp_addr;
32300         /*
32301          * 64-bit Host Destination Address.
32302          * This is the host address where the data will be written to.
32303          */
32304         uint64_t        host_dest_addr;
32305         /* 32-bit NVRAM byte-offset to read from. */
32306         uint32_t        offset;
32307         /* Total length of NVRAM contents to be read, in bytes. */
32308         uint32_t        len;
32309 } __attribute__((packed));
32310
32311 /* hwrm_nvm_raw_dump_output (size:128b/16B) */
32312 struct hwrm_nvm_raw_dump_output {
32313         /* The specific error status for the command. */
32314         uint16_t        error_code;
32315         /* The HWRM command request type. */
32316         uint16_t        req_type;
32317         /* The sequence ID from the original command. */
32318         uint16_t        seq_id;
32319         /* The length of the response data in number of bytes. */
32320         uint16_t        resp_len;
32321         uint8_t unused_0[7];
32322         /*
32323          * This field is used in Output records to indicate that the output
32324          * is completely written to RAM.  This field should be read as '1'
32325          * to indicate that the output has been completely written.
32326          * When writing a command completion or response to an internal processor,
32327          * the order of writes has to be such that this field is written last.
32328          */
32329         uint8_t valid;
32330 } __attribute__((packed));
32331
32332 /****************************
32333  * hwrm_nvm_get_dir_entries *
32334  ****************************/
32335
32336
32337 /* hwrm_nvm_get_dir_entries_input (size:192b/24B) */
32338 struct hwrm_nvm_get_dir_entries_input {
32339         /* The HWRM command request type. */
32340         uint16_t        req_type;
32341         /*
32342          * The completion ring to send the completion event on. This should
32343          * be the NQ ID returned from the `nq_alloc` HWRM command.
32344          */
32345         uint16_t        cmpl_ring;
32346         /*
32347          * The sequence ID is used by the driver for tracking multiple
32348          * commands. This ID is treated as opaque data by the firmware and
32349          * the value is returned in the `hwrm_resp_hdr` upon completion.
32350          */
32351         uint16_t        seq_id;
32352         /*
32353          * The target ID of the command:
32354          * * 0x0-0xFFF8 - The function ID
32355          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32356          * * 0xFFFD - Reserved for user-space HWRM interface
32357          * * 0xFFFF - HWRM
32358          */
32359         uint16_t        target_id;
32360         /*
32361          * A physical address pointer pointing to a host buffer that the
32362          * command's response data will be written. This can be either a host
32363          * physical address (HPA) or a guest physical address (GPA) and must
32364          * point to a physically contiguous block of memory.
32365          */
32366         uint64_t        resp_addr;
32367         /*
32368          * 64-bit Host Destination Address.
32369          * This is the host address where the directory will be written.
32370          */
32371         uint64_t        host_dest_addr;
32372 } __attribute__((packed));
32373
32374 /* hwrm_nvm_get_dir_entries_output (size:128b/16B) */
32375 struct hwrm_nvm_get_dir_entries_output {
32376         /* The specific error status for the command. */
32377         uint16_t        error_code;
32378         /* The HWRM command request type. */
32379         uint16_t        req_type;
32380         /* The sequence ID from the original command. */
32381         uint16_t        seq_id;
32382         /* The length of the response data in number of bytes. */
32383         uint16_t        resp_len;
32384         uint8_t unused_0[7];
32385         /*
32386          * This field is used in Output records to indicate that the output
32387          * is completely written to RAM.  This field should be read as '1'
32388          * to indicate that the output has been completely written.
32389          * When writing a command completion or response to an internal processor,
32390          * the order of writes has to be such that this field is written last.
32391          */
32392         uint8_t valid;
32393 } __attribute__((packed));
32394
32395 /*************************
32396  * hwrm_nvm_get_dir_info *
32397  *************************/
32398
32399
32400 /* hwrm_nvm_get_dir_info_input (size:128b/16B) */
32401 struct hwrm_nvm_get_dir_info_input {
32402         /* The HWRM command request type. */
32403         uint16_t        req_type;
32404         /*
32405          * The completion ring to send the completion event on. This should
32406          * be the NQ ID returned from the `nq_alloc` HWRM command.
32407          */
32408         uint16_t        cmpl_ring;
32409         /*
32410          * The sequence ID is used by the driver for tracking multiple
32411          * commands. This ID is treated as opaque data by the firmware and
32412          * the value is returned in the `hwrm_resp_hdr` upon completion.
32413          */
32414         uint16_t        seq_id;
32415         /*
32416          * The target ID of the command:
32417          * * 0x0-0xFFF8 - The function ID
32418          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32419          * * 0xFFFD - Reserved for user-space HWRM interface
32420          * * 0xFFFF - HWRM
32421          */
32422         uint16_t        target_id;
32423         /*
32424          * A physical address pointer pointing to a host buffer that the
32425          * command's response data will be written. This can be either a host
32426          * physical address (HPA) or a guest physical address (GPA) and must
32427          * point to a physically contiguous block of memory.
32428          */
32429         uint64_t        resp_addr;
32430 } __attribute__((packed));
32431
32432 /* hwrm_nvm_get_dir_info_output (size:192b/24B) */
32433 struct hwrm_nvm_get_dir_info_output {
32434         /* The specific error status for the command. */
32435         uint16_t        error_code;
32436         /* The HWRM command request type. */
32437         uint16_t        req_type;
32438         /* The sequence ID from the original command. */
32439         uint16_t        seq_id;
32440         /* The length of the response data in number of bytes. */
32441         uint16_t        resp_len;
32442         /* Number of directory entries in the directory. */
32443         uint32_t        entries;
32444         /* Size of each directory entry, in bytes. */
32445         uint32_t        entry_length;
32446         uint8_t unused_0[7];
32447         /*
32448          * This field is used in Output records to indicate that the output
32449          * is completely written to RAM.  This field should be read as '1'
32450          * to indicate that the output has been completely written.
32451          * When writing a command completion or response to an internal processor,
32452          * the order of writes has to be such that this field is written last.
32453          */
32454         uint8_t valid;
32455 } __attribute__((packed));
32456
32457 /******************
32458  * hwrm_nvm_write *
32459  ******************/
32460
32461
32462 /* hwrm_nvm_write_input (size:384b/48B) */
32463 struct hwrm_nvm_write_input {
32464         /* The HWRM command request type. */
32465         uint16_t        req_type;
32466         /*
32467          * The completion ring to send the completion event on. This should
32468          * be the NQ ID returned from the `nq_alloc` HWRM command.
32469          */
32470         uint16_t        cmpl_ring;
32471         /*
32472          * The sequence ID is used by the driver for tracking multiple
32473          * commands. This ID is treated as opaque data by the firmware and
32474          * the value is returned in the `hwrm_resp_hdr` upon completion.
32475          */
32476         uint16_t        seq_id;
32477         /*
32478          * The target ID of the command:
32479          * * 0x0-0xFFF8 - The function ID
32480          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32481          * * 0xFFFD - Reserved for user-space HWRM interface
32482          * * 0xFFFF - HWRM
32483          */
32484         uint16_t        target_id;
32485         /*
32486          * A physical address pointer pointing to a host buffer that the
32487          * command's response data will be written. This can be either a host
32488          * physical address (HPA) or a guest physical address (GPA) and must
32489          * point to a physically contiguous block of memory.
32490          */
32491         uint64_t        resp_addr;
32492         /*
32493          * 64-bit Host Source Address.
32494          * This is where the source data is.
32495          */
32496         uint64_t        host_src_addr;
32497         /* The Directory Entry Type (valid values are defined in the bnxnvm_directory_type enum defined in the file bnxnvm_defs.h). */
32498         uint16_t        dir_type;
32499         /*
32500          * Directory ordinal.
32501          * The 0-based instance of the combined Directory Entry Type and Extension.
32502          */
32503         uint16_t        dir_ordinal;
32504         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* in the file bnxnvm_defs.h). */
32505         uint16_t        dir_ext;
32506         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file bnxnvm_defs.h). */
32507         uint16_t        dir_attr;
32508         /*
32509          * Length of data to write, in bytes. May be less than or equal to the allocated size for the directory entry.
32510          * The data length stored in the directory entry will be updated to reflect this value once the write is complete.
32511          */
32512         uint32_t        dir_data_length;
32513         /* Option. */
32514         uint16_t        option;
32515         uint16_t        flags;
32516         /*
32517          * When this bit is '1', the original active image
32518          * will not be removed. TBD: what purpose is this?
32519          */
32520         #define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG \
32521                 UINT32_C(0x1)
32522         /*
32523          * 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).
32524          * If this value is less than the specified data length, it will be ignored.
32525          * The response will contain the actual allocated item length, which may be greater than the requested item length.
32526          * 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
32527          * the potential future growth of an item (e.g. upgraded firmware with a size increase, log growth, expanded configuration data).
32528          */
32529         uint32_t        dir_item_length;
32530         uint32_t        unused_0;
32531 } __attribute__((packed));
32532
32533 /* hwrm_nvm_write_output (size:128b/16B) */
32534 struct hwrm_nvm_write_output {
32535         /* The specific error status for the command. */
32536         uint16_t        error_code;
32537         /* The HWRM command request type. */
32538         uint16_t        req_type;
32539         /* The sequence ID from the original command. */
32540         uint16_t        seq_id;
32541         /* The length of the response data in number of bytes. */
32542         uint16_t        resp_len;
32543         /*
32544          * 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.
32545          * The actual item length used when creating a new directory entry will be a multiple of an NVM block size.
32546          */
32547         uint32_t        dir_item_length;
32548         /* The directory index of the created or modified item. */
32549         uint16_t        dir_idx;
32550         uint8_t unused_0;
32551         /*
32552          * This field is used in Output records to indicate that the output
32553          * is completely written to RAM.  This field should be read as '1'
32554          * to indicate that the output has been completely written.
32555          * When writing a command completion or response to an internal processor,
32556          * the order of writes has to be such that this field is written last.
32557          */
32558         uint8_t valid;
32559 } __attribute__((packed));
32560
32561 /* hwrm_nvm_write_cmd_err (size:64b/8B) */
32562 struct hwrm_nvm_write_cmd_err {
32563         /*
32564          * command specific error codes that goes to
32565          * the cmd_err field in Common HWRM Error Response.
32566          */
32567         uint8_t code;
32568         /* Unknown error */
32569         #define HWRM_NVM_WRITE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
32570         /* Unable to complete operation due to fragmentation */
32571         #define HWRM_NVM_WRITE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
32572         /* nvm is completely full. */
32573         #define HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
32574         #define HWRM_NVM_WRITE_CMD_ERR_CODE_LAST \
32575                 HWRM_NVM_WRITE_CMD_ERR_CODE_NO_SPACE
32576         uint8_t unused_0[7];
32577 } __attribute__((packed));
32578
32579 /*******************
32580  * hwrm_nvm_modify *
32581  *******************/
32582
32583
32584 /* hwrm_nvm_modify_input (size:320b/40B) */
32585 struct hwrm_nvm_modify_input {
32586         /* The HWRM command request type. */
32587         uint16_t        req_type;
32588         /*
32589          * The completion ring to send the completion event on. This should
32590          * be the NQ ID returned from the `nq_alloc` HWRM command.
32591          */
32592         uint16_t        cmpl_ring;
32593         /*
32594          * The sequence ID is used by the driver for tracking multiple
32595          * commands. This ID is treated as opaque data by the firmware and
32596          * the value is returned in the `hwrm_resp_hdr` upon completion.
32597          */
32598         uint16_t        seq_id;
32599         /*
32600          * The target ID of the command:
32601          * * 0x0-0xFFF8 - The function ID
32602          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32603          * * 0xFFFD - Reserved for user-space HWRM interface
32604          * * 0xFFFF - HWRM
32605          */
32606         uint16_t        target_id;
32607         /*
32608          * A physical address pointer pointing to a host buffer that the
32609          * command's response data will be written. This can be either a host
32610          * physical address (HPA) or a guest physical address (GPA) and must
32611          * point to a physically contiguous block of memory.
32612          */
32613         uint64_t        resp_addr;
32614         /*
32615          * 64-bit Host Source Address.
32616          * This is where the modified data is.
32617          */
32618         uint64_t        host_src_addr;
32619         /* 16-bit directory entry index. */
32620         uint16_t        dir_idx;
32621         uint8_t unused_0[2];
32622         /* 32-bit NVRAM byte-offset to modify content from. */
32623         uint32_t        offset;
32624         /*
32625          * Length of data to be modified, in bytes. The length shall
32626          * be non-zero.
32627          */
32628         uint32_t        len;
32629         uint8_t unused_1[4];
32630 } __attribute__((packed));
32631
32632 /* hwrm_nvm_modify_output (size:128b/16B) */
32633 struct hwrm_nvm_modify_output {
32634         /* The specific error status for the command. */
32635         uint16_t        error_code;
32636         /* The HWRM command request type. */
32637         uint16_t        req_type;
32638         /* The sequence ID from the original command. */
32639         uint16_t        seq_id;
32640         /* The length of the response data in number of bytes. */
32641         uint16_t        resp_len;
32642         uint8_t unused_0[7];
32643         /*
32644          * This field is used in Output records to indicate that the output
32645          * is completely written to RAM.  This field should be read as '1'
32646          * to indicate that the output has been completely written.
32647          * When writing a command completion or response to an internal processor,
32648          * the order of writes has to be such that this field is written last.
32649          */
32650         uint8_t valid;
32651 } __attribute__((packed));
32652
32653 /***************************
32654  * hwrm_nvm_find_dir_entry *
32655  ***************************/
32656
32657
32658 /* hwrm_nvm_find_dir_entry_input (size:256b/32B) */
32659 struct hwrm_nvm_find_dir_entry_input {
32660         /* The HWRM command request type. */
32661         uint16_t        req_type;
32662         /*
32663          * The completion ring to send the completion event on. This should
32664          * be the NQ ID returned from the `nq_alloc` HWRM command.
32665          */
32666         uint16_t        cmpl_ring;
32667         /*
32668          * The sequence ID is used by the driver for tracking multiple
32669          * commands. This ID is treated as opaque data by the firmware and
32670          * the value is returned in the `hwrm_resp_hdr` upon completion.
32671          */
32672         uint16_t        seq_id;
32673         /*
32674          * The target ID of the command:
32675          * * 0x0-0xFFF8 - The function ID
32676          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32677          * * 0xFFFD - Reserved for user-space HWRM interface
32678          * * 0xFFFF - HWRM
32679          */
32680         uint16_t        target_id;
32681         /*
32682          * A physical address pointer pointing to a host buffer that the
32683          * command's response data will be written. This can be either a host
32684          * physical address (HPA) or a guest physical address (GPA) and must
32685          * point to a physically contiguous block of memory.
32686          */
32687         uint64_t        resp_addr;
32688         uint32_t        enables;
32689         /*
32690          * This bit must be '1' for the dir_idx_valid field to be
32691          * configured.
32692          */
32693         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_ENABLES_DIR_IDX_VALID \
32694                 UINT32_C(0x1)
32695         /* Directory Entry Index */
32696         uint16_t        dir_idx;
32697         /* Directory Entry (Image) Type */
32698         uint16_t        dir_type;
32699         /*
32700          * Directory ordinal.
32701          * The instance of this Directory Type
32702          */
32703         uint16_t        dir_ordinal;
32704         /* The Directory Entry Extension flags. */
32705         uint16_t        dir_ext;
32706         /* This value indicates the search option using dir_ordinal. */
32707         uint8_t opt_ordinal;
32708         /* This value indicates the search option using dir_ordinal. */
32709         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_MASK UINT32_C(0x3)
32710         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_SFT 0
32711         /* Equal to specified ordinal value. */
32712         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_EQ    UINT32_C(0x0)
32713         /* Greater than or equal to specified ordinal value */
32714         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GE    UINT32_C(0x1)
32715         /* Greater than specified ordinal value */
32716         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT    UINT32_C(0x2)
32717         #define HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_LAST \
32718                 HWRM_NVM_FIND_DIR_ENTRY_INPUT_OPT_ORDINAL_GT
32719         uint8_t unused_0[3];
32720 } __attribute__((packed));
32721
32722 /* hwrm_nvm_find_dir_entry_output (size:256b/32B) */
32723 struct hwrm_nvm_find_dir_entry_output {
32724         /* The specific error status for the command. */
32725         uint16_t        error_code;
32726         /* The HWRM command request type. */
32727         uint16_t        req_type;
32728         /* The sequence ID from the original command. */
32729         uint16_t        seq_id;
32730         /* The length of the response data in number of bytes. */
32731         uint16_t        resp_len;
32732         /* Allocated NVRAM for this directory entry, in bytes. */
32733         uint32_t        dir_item_length;
32734         /* Size of the stored data for this directory entry, in bytes. */
32735         uint32_t        dir_data_length;
32736         /*
32737          * Firmware version.
32738          * Only valid if the directory entry is for embedded firmware stored in APE_BIN Format.
32739          */
32740         uint32_t        fw_ver;
32741         /* Directory ordinal. */
32742         uint16_t        dir_ordinal;
32743         /* Directory Entry Index */
32744         uint16_t        dir_idx;
32745         uint8_t unused_0[7];
32746         /*
32747          * This field is used in Output records to indicate that the output
32748          * is completely written to RAM.  This field should be read as '1'
32749          * to indicate that the output has been completely written.
32750          * When writing a command completion or response to an internal processor,
32751          * the order of writes has to be such that this field is written last.
32752          */
32753         uint8_t valid;
32754 } __attribute__((packed));
32755
32756 /****************************
32757  * hwrm_nvm_erase_dir_entry *
32758  ****************************/
32759
32760
32761 /* hwrm_nvm_erase_dir_entry_input (size:192b/24B) */
32762 struct hwrm_nvm_erase_dir_entry_input {
32763         /* The HWRM command request type. */
32764         uint16_t        req_type;
32765         /*
32766          * The completion ring to send the completion event on. This should
32767          * be the NQ ID returned from the `nq_alloc` HWRM command.
32768          */
32769         uint16_t        cmpl_ring;
32770         /*
32771          * The sequence ID is used by the driver for tracking multiple
32772          * commands. This ID is treated as opaque data by the firmware and
32773          * the value is returned in the `hwrm_resp_hdr` upon completion.
32774          */
32775         uint16_t        seq_id;
32776         /*
32777          * The target ID of the command:
32778          * * 0x0-0xFFF8 - The function ID
32779          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32780          * * 0xFFFD - Reserved for user-space HWRM interface
32781          * * 0xFFFF - HWRM
32782          */
32783         uint16_t        target_id;
32784         /*
32785          * A physical address pointer pointing to a host buffer that the
32786          * command's response data will be written. This can be either a host
32787          * physical address (HPA) or a guest physical address (GPA) and must
32788          * point to a physically contiguous block of memory.
32789          */
32790         uint64_t        resp_addr;
32791         /* Directory Entry Index */
32792         uint16_t        dir_idx;
32793         uint8_t unused_0[6];
32794 } __attribute__((packed));
32795
32796 /* hwrm_nvm_erase_dir_entry_output (size:128b/16B) */
32797 struct hwrm_nvm_erase_dir_entry_output {
32798         /* The specific error status for the command. */
32799         uint16_t        error_code;
32800         /* The HWRM command request type. */
32801         uint16_t        req_type;
32802         /* The sequence ID from the original command. */
32803         uint16_t        seq_id;
32804         /* The length of the response data in number of bytes. */
32805         uint16_t        resp_len;
32806         uint8_t unused_0[7];
32807         /*
32808          * This field is used in Output records to indicate that the output
32809          * is completely written to RAM.  This field should be read as '1'
32810          * to indicate that the output has been completely written.
32811          * When writing a command completion or response to an internal processor,
32812          * the order of writes has to be such that this field is written last.
32813          */
32814         uint8_t valid;
32815 } __attribute__((packed));
32816
32817 /*************************
32818  * hwrm_nvm_get_dev_info *
32819  *************************/
32820
32821
32822 /* hwrm_nvm_get_dev_info_input (size:128b/16B) */
32823 struct hwrm_nvm_get_dev_info_input {
32824         /* The HWRM command request type. */
32825         uint16_t        req_type;
32826         /*
32827          * The completion ring to send the completion event on. This should
32828          * be the NQ ID returned from the `nq_alloc` HWRM command.
32829          */
32830         uint16_t        cmpl_ring;
32831         /*
32832          * The sequence ID is used by the driver for tracking multiple
32833          * commands. This ID is treated as opaque data by the firmware and
32834          * the value is returned in the `hwrm_resp_hdr` upon completion.
32835          */
32836         uint16_t        seq_id;
32837         /*
32838          * The target ID of the command:
32839          * * 0x0-0xFFF8 - The function ID
32840          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32841          * * 0xFFFD - Reserved for user-space HWRM interface
32842          * * 0xFFFF - HWRM
32843          */
32844         uint16_t        target_id;
32845         /*
32846          * A physical address pointer pointing to a host buffer that the
32847          * command's response data will be written. This can be either a host
32848          * physical address (HPA) or a guest physical address (GPA) and must
32849          * point to a physically contiguous block of memory.
32850          */
32851         uint64_t        resp_addr;
32852 } __attribute__((packed));
32853
32854 /* hwrm_nvm_get_dev_info_output (size:256b/32B) */
32855 struct hwrm_nvm_get_dev_info_output {
32856         /* The specific error status for the command. */
32857         uint16_t        error_code;
32858         /* The HWRM command request type. */
32859         uint16_t        req_type;
32860         /* The sequence ID from the original command. */
32861         uint16_t        seq_id;
32862         /* The length of the response data in number of bytes. */
32863         uint16_t        resp_len;
32864         /* Manufacturer ID. */
32865         uint16_t        manufacturer_id;
32866         /* Device ID. */
32867         uint16_t        device_id;
32868         /* Sector size of the NVRAM device. */
32869         uint32_t        sector_size;
32870         /* Total size, in bytes of the NVRAM device. */
32871         uint32_t        nvram_size;
32872         uint32_t        reserved_size;
32873         /* Available size that can be used, in bytes.  Available size is the NVRAM size take away the used size and reserved size. */
32874         uint32_t        available_size;
32875         /* This field represents the major version of NVM cfg */
32876         uint8_t nvm_cfg_ver_maj;
32877         /* This field represents the minor version of NVM cfg */
32878         uint8_t nvm_cfg_ver_min;
32879         /* This field represents the update version of NVM cfg */
32880         uint8_t nvm_cfg_ver_upd;
32881         /*
32882          * This field is used in Output records to indicate that the output
32883          * is completely written to RAM.  This field should be read as '1'
32884          * to indicate that the output has been completely written.
32885          * When writing a command completion or response to an internal processor,
32886          * the order of writes has to be such that this field is written last.
32887          */
32888         uint8_t valid;
32889 } __attribute__((packed));
32890
32891 /**************************
32892  * hwrm_nvm_mod_dir_entry *
32893  **************************/
32894
32895
32896 /* hwrm_nvm_mod_dir_entry_input (size:256b/32B) */
32897 struct hwrm_nvm_mod_dir_entry_input {
32898         /* The HWRM command request type. */
32899         uint16_t        req_type;
32900         /*
32901          * The completion ring to send the completion event on. This should
32902          * be the NQ ID returned from the `nq_alloc` HWRM command.
32903          */
32904         uint16_t        cmpl_ring;
32905         /*
32906          * The sequence ID is used by the driver for tracking multiple
32907          * commands. This ID is treated as opaque data by the firmware and
32908          * the value is returned in the `hwrm_resp_hdr` upon completion.
32909          */
32910         uint16_t        seq_id;
32911         /*
32912          * The target ID of the command:
32913          * * 0x0-0xFFF8 - The function ID
32914          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32915          * * 0xFFFD - Reserved for user-space HWRM interface
32916          * * 0xFFFF - HWRM
32917          */
32918         uint16_t        target_id;
32919         /*
32920          * A physical address pointer pointing to a host buffer that the
32921          * command's response data will be written. This can be either a host
32922          * physical address (HPA) or a guest physical address (GPA) and must
32923          * point to a physically contiguous block of memory.
32924          */
32925         uint64_t        resp_addr;
32926         uint32_t        enables;
32927         /*
32928          * This bit must be '1' for the checksum field to be
32929          * configured.
32930          */
32931         #define HWRM_NVM_MOD_DIR_ENTRY_INPUT_ENABLES_CHECKSUM     UINT32_C(0x1)
32932         /* Directory Entry Index */
32933         uint16_t        dir_idx;
32934         /*
32935          * Directory ordinal.
32936          * The (0-based) instance of this Directory Type.
32937          */
32938         uint16_t        dir_ordinal;
32939         /* The Directory Entry Extension flags (see BNX_DIR_EXT_* for extension flag definitions). */
32940         uint16_t        dir_ext;
32941         /* Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute flag definitions). */
32942         uint16_t        dir_attr;
32943         /*
32944          * If valid, then this field updates the checksum
32945          * value of the content in the directory entry.
32946          */
32947         uint32_t        checksum;
32948 } __attribute__((packed));
32949
32950 /* hwrm_nvm_mod_dir_entry_output (size:128b/16B) */
32951 struct hwrm_nvm_mod_dir_entry_output {
32952         /* The specific error status for the command. */
32953         uint16_t        error_code;
32954         /* The HWRM command request type. */
32955         uint16_t        req_type;
32956         /* The sequence ID from the original command. */
32957         uint16_t        seq_id;
32958         /* The length of the response data in number of bytes. */
32959         uint16_t        resp_len;
32960         uint8_t unused_0[7];
32961         /*
32962          * This field is used in Output records to indicate that the output
32963          * is completely written to RAM.  This field should be read as '1'
32964          * to indicate that the output has been completely written.
32965          * When writing a command completion or response to an internal processor,
32966          * the order of writes has to be such that this field is written last.
32967          */
32968         uint8_t valid;
32969 } __attribute__((packed));
32970
32971 /**************************
32972  * hwrm_nvm_verify_update *
32973  **************************/
32974
32975
32976 /* hwrm_nvm_verify_update_input (size:192b/24B) */
32977 struct hwrm_nvm_verify_update_input {
32978         /* The HWRM command request type. */
32979         uint16_t        req_type;
32980         /*
32981          * The completion ring to send the completion event on. This should
32982          * be the NQ ID returned from the `nq_alloc` HWRM command.
32983          */
32984         uint16_t        cmpl_ring;
32985         /*
32986          * The sequence ID is used by the driver for tracking multiple
32987          * commands. This ID is treated as opaque data by the firmware and
32988          * the value is returned in the `hwrm_resp_hdr` upon completion.
32989          */
32990         uint16_t        seq_id;
32991         /*
32992          * The target ID of the command:
32993          * * 0x0-0xFFF8 - The function ID
32994          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
32995          * * 0xFFFD - Reserved for user-space HWRM interface
32996          * * 0xFFFF - HWRM
32997          */
32998         uint16_t        target_id;
32999         /*
33000          * A physical address pointer pointing to a host buffer that the
33001          * command's response data will be written. This can be either a host
33002          * physical address (HPA) or a guest physical address (GPA) and must
33003          * point to a physically contiguous block of memory.
33004          */
33005         uint64_t        resp_addr;
33006         /* Directory Entry Type, to be verified. */
33007         uint16_t        dir_type;
33008         /*
33009          * Directory ordinal.
33010          * The instance of the Directory Type to be verified.
33011          */
33012         uint16_t        dir_ordinal;
33013         /*
33014          * The Directory Entry Extension flags.
33015          * The "UPDATE" extension flag must be set in this value.
33016          * A corresponding directory entry with the same type and ordinal values but *without*
33017          * the "UPDATE" extension flag must also exist. The other flags of the extension must
33018          * be identical between the active and update entries.
33019          */
33020         uint16_t        dir_ext;
33021         uint8_t unused_0[2];
33022 } __attribute__((packed));
33023
33024 /* hwrm_nvm_verify_update_output (size:128b/16B) */
33025 struct hwrm_nvm_verify_update_output {
33026         /* The specific error status for the command. */
33027         uint16_t        error_code;
33028         /* The HWRM command request type. */
33029         uint16_t        req_type;
33030         /* The sequence ID from the original command. */
33031         uint16_t        seq_id;
33032         /* The length of the response data in number of bytes. */
33033         uint16_t        resp_len;
33034         uint8_t unused_0[7];
33035         /*
33036          * This field is used in Output records to indicate that the output
33037          * is completely written to RAM.  This field should be read as '1'
33038          * to indicate that the output has been completely written.
33039          * When writing a command completion or response to an internal processor,
33040          * the order of writes has to be such that this field is written last.
33041          */
33042         uint8_t valid;
33043 } __attribute__((packed));
33044
33045 /***************************
33046  * hwrm_nvm_install_update *
33047  ***************************/
33048
33049
33050 /* hwrm_nvm_install_update_input (size:192b/24B) */
33051 struct hwrm_nvm_install_update_input {
33052         /* The HWRM command request type. */
33053         uint16_t        req_type;
33054         /*
33055          * The completion ring to send the completion event on. This should
33056          * be the NQ ID returned from the `nq_alloc` HWRM command.
33057          */
33058         uint16_t        cmpl_ring;
33059         /*
33060          * The sequence ID is used by the driver for tracking multiple
33061          * commands. This ID is treated as opaque data by the firmware and
33062          * the value is returned in the `hwrm_resp_hdr` upon completion.
33063          */
33064         uint16_t        seq_id;
33065         /*
33066          * The target ID of the command:
33067          * * 0x0-0xFFF8 - The function ID
33068          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33069          * * 0xFFFD - Reserved for user-space HWRM interface
33070          * * 0xFFFF - HWRM
33071          */
33072         uint16_t        target_id;
33073         /*
33074          * A physical address pointer pointing to a host buffer that the
33075          * command's response data will be written. This can be either a host
33076          * physical address (HPA) or a guest physical address (GPA) and must
33077          * point to a physically contiguous block of memory.
33078          */
33079         uint64_t        resp_addr;
33080         /*
33081          * Installation type. If the value 3 through 0xffff is used,
33082          * only packaged items with that type value will be installed and
33083          * conditional installation directives for those packaged items
33084          * will be over-ridden (i.e. 'create' or 'replace' will be treated
33085          * as 'install').
33086          */
33087         uint32_t        install_type;
33088         /*
33089          * Perform a normal package installation. Conditional installation
33090          * directives (e.g. 'create' and 'replace') of packaged items
33091          * will be followed.
33092          */
33093         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_NORMAL UINT32_C(0x0)
33094         /*
33095          * Install all packaged items regardless of installation directive
33096          * (i.e. treat all packaged items as though they have an installation
33097          * directive of 'install').
33098          */
33099         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL \
33100                 UINT32_C(0xffffffff)
33101         #define HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_LAST \
33102                 HWRM_NVM_INSTALL_UPDATE_INPUT_INSTALL_TYPE_ALL
33103         uint16_t        flags;
33104         /* If set to 1, then securely erase all unused locations in persistent storage. */
33105         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ERASE_UNUSED_SPACE \
33106                 UINT32_C(0x1)
33107         /*
33108          * If set to 1, then unspecifed images, images not in the package file, will be safely deleted.
33109          * When combined with erase_unused_space then unspecified images will be securely erased.
33110          */
33111         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_REMOVE_UNUSED_PKG \
33112                 UINT32_C(0x2)
33113         /*
33114          * If set to 1, FW will defragment the NVM if defragmentation is required for the update.
33115          * Allow additional time for this command to complete if this bit is set to 1.
33116          */
33117         #define HWRM_NVM_INSTALL_UPDATE_INPUT_FLAGS_ALLOWED_TO_DEFRAG \
33118                 UINT32_C(0x4)
33119         uint8_t unused_0[2];
33120 } __attribute__((packed));
33121
33122 /* hwrm_nvm_install_update_output (size:192b/24B) */
33123 struct hwrm_nvm_install_update_output {
33124         /* The specific error status for the command. */
33125         uint16_t        error_code;
33126         /* The HWRM command request type. */
33127         uint16_t        req_type;
33128         /* The sequence ID from the original command. */
33129         uint16_t        seq_id;
33130         /* The length of the response data in number of bytes. */
33131         uint16_t        resp_len;
33132         /*
33133          * Bit-mask of successfully installed items.
33134          * Bit-0 corresponding to the first packaged item, Bit-1 for the second item, etc.
33135          * A value of 0 indicates that no items were successfully installed.
33136          */
33137         uint64_t        installed_items;
33138         /* result is 8 b */
33139         uint8_t result;
33140         /* There was no problem with the package installation. */
33141         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS UINT32_C(0x0)
33142         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_LAST \
33143                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESULT_SUCCESS
33144         /* problem_item is 8 b */
33145         uint8_t problem_item;
33146         /* There was no problem with any packaged items. */
33147         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_NONE \
33148                 UINT32_C(0x0)
33149         /* There was a problem with the NVM package itself. */
33150         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE \
33151                 UINT32_C(0xff)
33152         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_LAST \
33153                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_PROBLEM_ITEM_PACKAGE
33154         /* reset_required is 8 b */
33155         uint8_t reset_required;
33156         /*
33157          * No reset is required for installed/updated firmware or
33158          * microcode to take effect.
33159          */
33160         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_NONE \
33161                 UINT32_C(0x0)
33162         /*
33163          * A PCIe reset (e.g. system reboot) is
33164          * required for newly installed/updated firmware or
33165          * microcode to take effect.
33166          */
33167         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_PCI \
33168                 UINT32_C(0x1)
33169         /*
33170          * A controller power reset (e.g. system power-cycle) is
33171          * required for newly installed/updated firmware or
33172          * microcode to take effect. Some newly installed/updated
33173          * firmware or microcode may still take effect upon the
33174          * next PCIe reset.
33175          */
33176         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER \
33177                 UINT32_C(0x2)
33178         #define HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_LAST \
33179                 HWRM_NVM_INSTALL_UPDATE_OUTPUT_RESET_REQUIRED_POWER
33180         uint8_t unused_0[4];
33181         /*
33182          * This field is used in Output records to indicate that the output
33183          * is completely written to RAM.  This field should be read as '1'
33184          * to indicate that the output has been completely written.
33185          * When writing a command completion or response to an internal processor,
33186          * the order of writes has to be such that this field is written last.
33187          */
33188         uint8_t valid;
33189 } __attribute__((packed));
33190
33191 /* hwrm_nvm_install_update_cmd_err (size:64b/8B) */
33192 struct hwrm_nvm_install_update_cmd_err {
33193         /*
33194          * command specific error codes that goes to
33195          * the cmd_err field in Common HWRM Error Response.
33196          */
33197         uint8_t code;
33198         /* Unknown error */
33199         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_UNKNOWN  UINT32_C(0x0)
33200         /* Unable to complete operation due to fragmentation */
33201         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR UINT32_C(0x1)
33202         /* nvm is completely full. */
33203         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE UINT32_C(0x2)
33204         #define HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_LAST \
33205                 HWRM_NVM_INSTALL_UPDATE_CMD_ERR_CODE_NO_SPACE
33206         uint8_t unused_0[7];
33207 } __attribute__((packed));
33208
33209 /******************
33210  * hwrm_nvm_flush *
33211  ******************/
33212
33213
33214 /* hwrm_nvm_flush_input (size:128b/16B) */
33215 struct hwrm_nvm_flush_input {
33216         /* The HWRM command request type. */
33217         uint16_t        req_type;
33218         /*
33219          * The completion ring to send the completion event on. This should
33220          * be the NQ ID returned from the `nq_alloc` HWRM command.
33221          */
33222         uint16_t        cmpl_ring;
33223         /*
33224          * The sequence ID is used by the driver for tracking multiple
33225          * commands. This ID is treated as opaque data by the firmware and
33226          * the value is returned in the `hwrm_resp_hdr` upon completion.
33227          */
33228         uint16_t        seq_id;
33229         /*
33230          * The target ID of the command:
33231          * * 0x0-0xFFF8 - The function ID
33232          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33233          * * 0xFFFD - Reserved for user-space HWRM interface
33234          * * 0xFFFF - HWRM
33235          */
33236         uint16_t        target_id;
33237         /*
33238          * A physical address pointer pointing to a host buffer that the
33239          * command's response data will be written. This can be either a host
33240          * physical address (HPA) or a guest physical address (GPA) and must
33241          * point to a physically contiguous block of memory.
33242          */
33243         uint64_t        resp_addr;
33244 } __attribute__((packed));
33245
33246 /* hwrm_nvm_flush_output (size:128b/16B) */
33247 struct hwrm_nvm_flush_output {
33248         /* The specific error status for the command. */
33249         uint16_t        error_code;
33250         /* The HWRM command request type. */
33251         uint16_t        req_type;
33252         /* The sequence ID from the original command. */
33253         uint16_t        seq_id;
33254         /* The length of the response data in number of bytes. */
33255         uint16_t        resp_len;
33256         uint8_t unused_0[7];
33257         /*
33258          * This field is used in Output records to indicate that the output
33259          * is completely written to RAM.  This field should be read as '1'
33260          * to indicate that the output has been completely written.
33261          * When writing a command completion or response to an internal processor,
33262          * the order of writes has to be such that this field is written last.
33263          */
33264         uint8_t valid;
33265 } __attribute__((packed));
33266
33267 /* hwrm_nvm_flush_cmd_err (size:64b/8B) */
33268 struct hwrm_nvm_flush_cmd_err {
33269         /*
33270          * command specific error codes that goes to
33271          * the cmd_err field in Common HWRM Error Response.
33272          */
33273         uint8_t code;
33274         /* Unknown error */
33275         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
33276         /* flush could not be performed */
33277         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL    UINT32_C(0x1)
33278         #define HWRM_NVM_FLUSH_CMD_ERR_CODE_LAST \
33279                 HWRM_NVM_FLUSH_CMD_ERR_CODE_FAIL
33280         uint8_t unused_0[7];
33281 } __attribute__((packed));
33282
33283 /*************************
33284  * hwrm_nvm_get_variable *
33285  *************************/
33286
33287
33288 /* hwrm_nvm_get_variable_input (size:320b/40B) */
33289 struct hwrm_nvm_get_variable_input {
33290         /* The HWRM command request type. */
33291         uint16_t        req_type;
33292         /*
33293          * The completion ring to send the completion event on. This should
33294          * be the NQ ID returned from the `nq_alloc` HWRM command.
33295          */
33296         uint16_t        cmpl_ring;
33297         /*
33298          * The sequence ID is used by the driver for tracking multiple
33299          * commands. This ID is treated as opaque data by the firmware and
33300          * the value is returned in the `hwrm_resp_hdr` upon completion.
33301          */
33302         uint16_t        seq_id;
33303         /*
33304          * The target ID of the command:
33305          * * 0x0-0xFFF8 - The function ID
33306          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33307          * * 0xFFFD - Reserved for user-space HWRM interface
33308          * * 0xFFFF - HWRM
33309          */
33310         uint16_t        target_id;
33311         /*
33312          * A physical address pointer pointing to a host buffer that the
33313          * command's response data will be written. This can be either a host
33314          * physical address (HPA) or a guest physical address (GPA) and must
33315          * point to a physically contiguous block of memory.
33316          */
33317         uint64_t        resp_addr;
33318         /*
33319          * This is the host address where
33320          * nvm variable will be stored
33321          */
33322         uint64_t        dest_data_addr;
33323         /* size of data in bits */
33324         uint16_t        data_len;
33325         /* nvm cfg option number */
33326         uint16_t        option_num;
33327         /* reserved. */
33328         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
33329         /* reserved. */
33330         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
33331                 UINT32_C(0xffff)
33332         #define HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_LAST \
33333                 HWRM_NVM_GET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
33334         /*
33335          * Number of dimensions for this nvm configuration variable.
33336          * This value indicates how many of the indexN values to use.
33337          * A value of 0 means that none of the indexN values are valid.
33338          * A value of 1 requires at index0 is valued, a value of 2
33339          * requires that index0 and index1 are valid, and so forth
33340          */
33341         uint16_t        dimensions;
33342         /* index for the 1st dimensions */
33343         uint16_t        index_0;
33344         /* index for the 2nd dimensions */
33345         uint16_t        index_1;
33346         /* index for the 3rd dimensions */
33347         uint16_t        index_2;
33348         /* index for the 4th dimensions */
33349         uint16_t        index_3;
33350         uint8_t flags;
33351         /*
33352          * When this bit is set to 1, the factory default value will be returned,
33353          * 0 returns the operational value.
33354          */
33355         #define HWRM_NVM_GET_VARIABLE_INPUT_FLAGS_FACTORY_DFLT \
33356                 UINT32_C(0x1)
33357         uint8_t unused_0;
33358 } __attribute__((packed));
33359
33360 /* hwrm_nvm_get_variable_output (size:128b/16B) */
33361 struct hwrm_nvm_get_variable_output {
33362         /* The specific error status for the command. */
33363         uint16_t        error_code;
33364         /* The HWRM command request type. */
33365         uint16_t        req_type;
33366         /* The sequence ID from the original command. */
33367         uint16_t        seq_id;
33368         /* The length of the response data in number of bytes. */
33369         uint16_t        resp_len;
33370         /* size of data of the actual variable retrieved in bits */
33371         uint16_t        data_len;
33372         /*
33373          * option_num is the option number for the data retrieved.  It is possible in the
33374          * future that the option number returned would be different than requested.  This
33375          * condition could occur if an option is deprecated and a new option id is defined
33376          * with similar characteristics, but has a slightly different definition.  This
33377          * also makes it convenient for the caller to identify the variable result with
33378          * the option id from the response.
33379          */
33380         uint16_t        option_num;
33381         /* reserved. */
33382         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
33383         /* reserved. */
33384         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF \
33385                 UINT32_C(0xffff)
33386         #define HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_LAST \
33387                 HWRM_NVM_GET_VARIABLE_OUTPUT_OPTION_NUM_RSVD_FFFF
33388         uint8_t unused_0[3];
33389         /*
33390          * This field is used in Output records to indicate that the output
33391          * is completely written to RAM.  This field should be read as '1'
33392          * to indicate that the output has been completely written.
33393          * When writing a command completion or response to an internal processor,
33394          * the order of writes has to be such that this field is written last.
33395          */
33396         uint8_t valid;
33397 } __attribute__((packed));
33398
33399 /* hwrm_nvm_get_variable_cmd_err (size:64b/8B) */
33400 struct hwrm_nvm_get_variable_cmd_err {
33401         /*
33402          * command specific error codes that goes to
33403          * the cmd_err field in Common HWRM Error Response.
33404          */
33405         uint8_t code;
33406         /* Unknown error */
33407         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
33408         /* variable does not exist */
33409         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
33410         /* configuration is corrupted and the variable cannot be saved */
33411         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
33412         /* length specified is too small */
33413         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT UINT32_C(0x3)
33414         #define HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LAST \
33415                 HWRM_NVM_GET_VARIABLE_CMD_ERR_CODE_LEN_TOO_SHORT
33416         uint8_t unused_0[7];
33417 } __attribute__((packed));
33418
33419 /*************************
33420  * hwrm_nvm_set_variable *
33421  *************************/
33422
33423
33424 /* hwrm_nvm_set_variable_input (size:320b/40B) */
33425 struct hwrm_nvm_set_variable_input {
33426         /* The HWRM command request type. */
33427         uint16_t        req_type;
33428         /*
33429          * The completion ring to send the completion event on. This should
33430          * be the NQ ID returned from the `nq_alloc` HWRM command.
33431          */
33432         uint16_t        cmpl_ring;
33433         /*
33434          * The sequence ID is used by the driver for tracking multiple
33435          * commands. This ID is treated as opaque data by the firmware and
33436          * the value is returned in the `hwrm_resp_hdr` upon completion.
33437          */
33438         uint16_t        seq_id;
33439         /*
33440          * The target ID of the command:
33441          * * 0x0-0xFFF8 - The function ID
33442          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33443          * * 0xFFFD - Reserved for user-space HWRM interface
33444          * * 0xFFFF - HWRM
33445          */
33446         uint16_t        target_id;
33447         /*
33448          * A physical address pointer pointing to a host buffer that the
33449          * command's response data will be written. This can be either a host
33450          * physical address (HPA) or a guest physical address (GPA) and must
33451          * point to a physically contiguous block of memory.
33452          */
33453         uint64_t        resp_addr;
33454         /*
33455          * This is the host address where
33456          * nvm variable will be copied from
33457          */
33458         uint64_t        src_data_addr;
33459         /* size of data in bits */
33460         uint16_t        data_len;
33461         /* nvm cfg option number */
33462         uint16_t        option_num;
33463         /* reserved. */
33464         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_0    UINT32_C(0x0)
33465         /* reserved. */
33466         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF \
33467                 UINT32_C(0xffff)
33468         #define HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_LAST \
33469                 HWRM_NVM_SET_VARIABLE_INPUT_OPTION_NUM_RSVD_FFFF
33470         /*
33471          * Number of dimensions for this nvm configuration variable.
33472          * This value indicates how many of the indexN values to use.
33473          * A value of 0 means that none of the indexN values are valid.
33474          * A value of 1 requires at index0 is valued, a value of 2
33475          * requires that index0 and index1 are valid, and so forth
33476          */
33477         uint16_t        dimensions;
33478         /* index for the 1st dimensions */
33479         uint16_t        index_0;
33480         /* index for the 2nd dimensions */
33481         uint16_t        index_1;
33482         /* index for the 3rd dimensions */
33483         uint16_t        index_2;
33484         /* index for the 4th dimensions */
33485         uint16_t        index_3;
33486         uint8_t flags;
33487         /* When this bit is 1, flush internal cache after this write operation (see hwrm_nvm_flush command.) */
33488         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FORCE_FLUSH \
33489                 UINT32_C(0x1)
33490         /* encryption method */
33491         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_MASK \
33492                 UINT32_C(0xe)
33493         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_SFT           1
33494         /* No encryption. */
33495         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_NONE \
33496                 (UINT32_C(0x0) << 1)
33497         /* one-way encryption. */
33498         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1 \
33499                 (UINT32_C(0x1) << 1)
33500         /* symmetric AES256 encryption. */
33501         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_AES256 \
33502                 (UINT32_C(0x2) << 1)
33503         /* SHA1 digest appended to plaintext contents, for authentication */
33504         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH \
33505                 (UINT32_C(0x3) << 1)
33506         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_LAST \
33507                 HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_ENCRYPT_MODE_HMAC_SHA1_AUTH
33508         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_MASK \
33509                 UINT32_C(0x70)
33510         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FLAGS_UNUSED_0_SFT         4
33511         /* When this bit is 1, update the factory default region */
33512         #define HWRM_NVM_SET_VARIABLE_INPUT_FLAGS_FACTORY_DEFAULT \
33513                 UINT32_C(0x80)
33514         uint8_t unused_0;
33515 } __attribute__((packed));
33516
33517 /* hwrm_nvm_set_variable_output (size:128b/16B) */
33518 struct hwrm_nvm_set_variable_output {
33519         /* The specific error status for the command. */
33520         uint16_t        error_code;
33521         /* The HWRM command request type. */
33522         uint16_t        req_type;
33523         /* The sequence ID from the original command. */
33524         uint16_t        seq_id;
33525         /* The length of the response data in number of bytes. */
33526         uint16_t        resp_len;
33527         uint8_t unused_0[7];
33528         /*
33529          * This field is used in Output records to indicate that the output
33530          * is completely written to RAM.  This field should be read as '1'
33531          * to indicate that the output has been completely written.
33532          * When writing a command completion or response to an internal processor,
33533          * the order of writes has to be such that this field is written last.
33534          */
33535         uint8_t valid;
33536 } __attribute__((packed));
33537
33538 /* hwrm_nvm_set_variable_cmd_err (size:64b/8B) */
33539 struct hwrm_nvm_set_variable_cmd_err {
33540         /*
33541          * command specific error codes that goes to
33542          * the cmd_err field in Common HWRM Error Response.
33543          */
33544         uint8_t code;
33545         /* Unknown error */
33546         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_UNKNOWN       UINT32_C(0x0)
33547         /* variable does not exist */
33548         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_VAR_NOT_EXIST UINT32_C(0x1)
33549         /* configuration is corrupted and the variable cannot be saved */
33550         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR   UINT32_C(0x2)
33551         #define HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_LAST \
33552                 HWRM_NVM_SET_VARIABLE_CMD_ERR_CODE_CORRUPT_VAR
33553         uint8_t unused_0[7];
33554 } __attribute__((packed));
33555
33556 /****************************
33557  * hwrm_nvm_validate_option *
33558  ****************************/
33559
33560
33561 /* hwrm_nvm_validate_option_input (size:320b/40B) */
33562 struct hwrm_nvm_validate_option_input {
33563         /* The HWRM command request type. */
33564         uint16_t        req_type;
33565         /*
33566          * The completion ring to send the completion event on. This should
33567          * be the NQ ID returned from the `nq_alloc` HWRM command.
33568          */
33569         uint16_t        cmpl_ring;
33570         /*
33571          * The sequence ID is used by the driver for tracking multiple
33572          * commands. This ID is treated as opaque data by the firmware and
33573          * the value is returned in the `hwrm_resp_hdr` upon completion.
33574          */
33575         uint16_t        seq_id;
33576         /*
33577          * The target ID of the command:
33578          * * 0x0-0xFFF8 - The function ID
33579          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33580          * * 0xFFFD - Reserved for user-space HWRM interface
33581          * * 0xFFFF - HWRM
33582          */
33583         uint16_t        target_id;
33584         /*
33585          * A physical address pointer pointing to a host buffer that the
33586          * command's response data will be written. This can be either a host
33587          * physical address (HPA) or a guest physical address (GPA) and must
33588          * point to a physically contiguous block of memory.
33589          */
33590         uint64_t        resp_addr;
33591         /*
33592          * This is the host address where
33593          * nvm variable will be copied from
33594          */
33595         uint64_t        src_data_addr;
33596         /* size of data in bits */
33597         uint16_t        data_len;
33598         /* nvm cfg option number */
33599         uint16_t        option_num;
33600         /* reserved. */
33601         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_0 \
33602                 UINT32_C(0x0)
33603         /* reserved. */
33604         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF \
33605                 UINT32_C(0xffff)
33606         #define HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_LAST \
33607                 HWRM_NVM_VALIDATE_OPTION_INPUT_OPTION_NUM_RSVD_FFFF
33608         /*
33609          * Number of dimensions for this nvm configuration variable.
33610          * This value indicates how many of the indexN values to use.
33611          * A value of 0 means that none of the indexN values are valid.
33612          * A value of 1 requires at index0 is valued, a value of 2
33613          * requires that index0 and index1 are valid, and so forth
33614          */
33615         uint16_t        dimensions;
33616         /* index for the 1st dimensions */
33617         uint16_t        index_0;
33618         /* index for the 2nd dimensions */
33619         uint16_t        index_1;
33620         /* index for the 3rd dimensions */
33621         uint16_t        index_2;
33622         /* index for the 4th dimensions */
33623         uint16_t        index_3;
33624         uint8_t unused_0[2];
33625 } __attribute__((packed));
33626
33627 /* hwrm_nvm_validate_option_output (size:128b/16B) */
33628 struct hwrm_nvm_validate_option_output {
33629         /* The specific error status for the command. */
33630         uint16_t        error_code;
33631         /* The HWRM command request type. */
33632         uint16_t        req_type;
33633         /* The sequence ID from the original command. */
33634         uint16_t        seq_id;
33635         /* The length of the response data in number of bytes. */
33636         uint16_t        resp_len;
33637         uint8_t result;
33638         /* indicates that the value provided for the option is not matching with the saved data. */
33639         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_NOT_MATCH UINT32_C(0x0)
33640         /* indicates that the value provided for the option is matching the saved data. */
33641         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH     UINT32_C(0x1)
33642         #define HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_LAST \
33643                 HWRM_NVM_VALIDATE_OPTION_OUTPUT_RESULT_MATCH
33644         uint8_t unused_0[6];
33645         /*
33646          * This field is used in Output records to indicate that the output
33647          * is completely written to RAM.  This field should be read as '1'
33648          * to indicate that the output has been completely written.
33649          * When writing a command completion or response to an internal processor,
33650          * the order of writes has to be such that this field is written last.
33651          */
33652         uint8_t valid;
33653 } __attribute__((packed));
33654
33655 /* hwrm_nvm_validate_option_cmd_err (size:64b/8B) */
33656 struct hwrm_nvm_validate_option_cmd_err {
33657         /*
33658          * command specific error codes that goes to
33659          * the cmd_err field in Common HWRM Error Response.
33660          */
33661         uint8_t code;
33662         /* Unknown error */
33663         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0)
33664         #define HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_LAST \
33665                 HWRM_NVM_VALIDATE_OPTION_CMD_ERR_CODE_UNKNOWN
33666         uint8_t unused_0[7];
33667 } __attribute__((packed));
33668
33669 /*****************
33670  * hwrm_fw_reset *
33671  ******************/
33672
33673
33674 /* hwrm_fw_reset_input (size:192b/24B) */
33675 struct hwrm_fw_reset_input {
33676         /* The HWRM command request type. */
33677         uint16_t        req_type;
33678         /*
33679          * The completion ring to send the completion event on. This should
33680          * be the NQ ID returned from the `nq_alloc` HWRM command.
33681          */
33682         uint16_t        cmpl_ring;
33683         /*
33684          * The sequence ID is used by the driver for tracking multiple
33685          * commands. This ID is treated as opaque data by the firmware and
33686          * the value is returned in the `hwrm_resp_hdr` upon completion.
33687          */
33688         uint16_t        seq_id;
33689         /*
33690          * The target ID of the command:
33691          * * 0x0-0xFFF8 - The function ID
33692          * * 0xFFF8-0xFFFE - Reserved for internal processors
33693          * * 0xFFFF - HWRM
33694          */
33695         uint16_t        target_id;
33696         /*
33697          * A physical address pointer pointing to a host buffer that the
33698          * command's response data will be written. This can be either a host
33699          * physical address (HPA) or a guest physical address (GPA) and must
33700          * point to a physically contiguous block of memory.
33701          */
33702         uint64_t        resp_addr;
33703         /* Type of embedded processor. */
33704         uint8_t embedded_proc_type;
33705         /* Boot Processor */
33706         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_BOOT \
33707                 UINT32_C(0x0)
33708         /* Management Processor */
33709         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_MGMT \
33710                 UINT32_C(0x1)
33711         /* Network control processor */
33712         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_NETCTRL \
33713                 UINT32_C(0x2)
33714         /* RoCE control processor */
33715         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_ROCE \
33716                 UINT32_C(0x3)
33717         /*
33718          * Host (in multi-host environment): This is only valid if requester is IPC.
33719          * Reinit host hardware resources and PCIe.
33720          */
33721         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST \
33722                 UINT32_C(0x4)
33723         /* AP processor complex (in multi-host environment). Use host_idx to control which core is reset */
33724         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_AP \
33725                 UINT32_C(0x5)
33726         /* Reset all blocks of the chip (including all processors) */
33727         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_CHIP \
33728                 UINT32_C(0x6)
33729         /*
33730          * Host (in multi-host environment): This is only valid if requester is IPC.
33731          * Reinit host hardware resources.
33732          */
33733         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT \
33734                 UINT32_C(0x7)
33735         #define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_LAST \
33736                 HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST_RESOURCE_REINIT
33737         /* Type of self reset. */
33738         uint8_t selfrst_status;
33739         /* No Self Reset */
33740         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTNONE \
33741                 UINT32_C(0x0)
33742         /* Self Reset as soon as possible to do so safely */
33743         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTASAP \
33744                 UINT32_C(0x1)
33745         /* Self Reset on PCIe Reset */
33746         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTPCIERST \
33747                 UINT32_C(0x2)
33748         /* Self Reset immediately after notification to all clients. */
33749         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
33750                 UINT32_C(0x3)
33751         #define HWRM_FW_RESET_INPUT_SELFRST_STATUS_LAST \
33752                 HWRM_FW_RESET_INPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
33753         /*
33754          * Indicate which host is being reset. 0 means first host.
33755          * Only valid when embedded_proc_type is host in multihost
33756          * environment
33757          */
33758         uint8_t host_idx;
33759         uint8_t flags;
33760         /*
33761          * When this bit is '1', then the core firmware initiates
33762          * the reset only after graceful shut down of all registered instances.
33763          * If not, the device will continue with the existing firmware.
33764          */
33765         #define HWRM_FW_RESET_INPUT_FLAGS_RESET_GRACEFUL     UINT32_C(0x1)
33766         uint8_t unused_0[4];
33767 } __attribute__((packed));
33768
33769 /* hwrm_fw_reset_output (size:128b/16B) */
33770 struct hwrm_fw_reset_output {
33771         /* The specific error status for the command. */
33772         uint16_t        error_code;
33773         /* The HWRM command request type. */
33774         uint16_t        req_type;
33775         /* The sequence ID from the original command. */
33776         uint16_t        seq_id;
33777         /* The length of the response data in number of bytes. */
33778         uint16_t        resp_len;
33779         /* Type of self reset. */
33780         uint8_t selfrst_status;
33781         /* No Self Reset */
33782         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTNONE \
33783                 UINT32_C(0x0)
33784         /* Self Reset as soon as possible to do so safely */
33785         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTASAP \
33786                 UINT32_C(0x1)
33787         /* Self Reset on PCIe Reset */
33788         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTPCIERST \
33789                 UINT32_C(0x2)
33790         /* Self Reset immediately after notification to all clients. */
33791         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE \
33792                 UINT32_C(0x3)
33793         #define HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_LAST \
33794                 HWRM_FW_RESET_OUTPUT_SELFRST_STATUS_SELFRSTIMMEDIATE
33795         uint8_t unused_0[6];
33796         /*
33797          * This field is used in Output records to indicate that the output
33798          * is completely written to RAM.  This field should be read as '1'
33799          * to indicate that the output has been completely written.
33800          * When writing a command completion or response to an internal processor,
33801          * the order of writes has to be such that this field is written last.
33802          */
33803         uint8_t valid;
33804 } __attribute__((packed));
33805
33806 /**********************
33807  * hwrm_port_ts_query *
33808  ***********************/
33809
33810
33811 /* hwrm_port_ts_query_input (size:192b/24B) */
33812 struct hwrm_port_ts_query_input {
33813         /* The HWRM command request type. */
33814         uint16_t        req_type;
33815         /*
33816          * The completion ring to send the completion event on. This should
33817          * be the NQ ID returned from the `nq_alloc` HWRM command.
33818          */
33819         uint16_t        cmpl_ring;
33820         /*
33821          * The sequence ID is used by the driver for tracking multiple
33822          * commands. This ID is treated as opaque data by the firmware and
33823          * the value is returned in the `hwrm_resp_hdr` upon completion.
33824          */
33825         uint16_t        seq_id;
33826         /*
33827          * The target ID of the command:
33828          * * 0x0-0xFFF8 - The function ID
33829          * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
33830          * * 0xFFFD - Reserved for user-space HWRM interface
33831          * * 0xFFFF - HWRM
33832          */
33833         uint16_t        target_id;
33834         /*
33835          * A physical address pointer pointing to a host buffer that the
33836          * command's response data will be written. This can be either a host
33837          * physical address (HPA) or a guest physical address (GPA) and must
33838          * point to a physically contiguous block of memory.
33839          */
33840         uint64_t        resp_addr;
33841         uint32_t        flags;
33842         /*
33843          * Enumeration denoting the RX, TX type of the resource.
33844          * This enumeration is used for resources that are similar for both
33845          * TX and RX paths of the chip.
33846          */
33847         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH             0x1UL
33848         /* tx path */
33849         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_TX          0x0UL
33850         /* rx path */
33851         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX          0x1UL
33852         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_LAST        \
33853                 HWRM_PORT_TS_QUERY_INPUT_FLAGS_PATH_RX
33854         /*
33855          * If set, the response includes the current value of the free
33856          * running timer.
33857          */
33858         #define HWRM_PORT_TS_QUERY_INPUT_FLAGS_CURRENT_TIME     0x2UL
33859         /* Port ID of port that is being queried. */
33860         uint16_t        port_id;
33861         uint8_t         unused_0[2];
33862 } __attribute__((packed));
33863
33864 /* hwrm_port_ts_query_output (size:192b/24B) */
33865 struct hwrm_port_ts_query_output {
33866         /* The specific error status for the command. */
33867         uint16_t        error_code;
33868         /* The HWRM command request type. */
33869         uint16_t        req_type;
33870         /* The sequence ID from the original command. */
33871         uint16_t        seq_id;
33872         /* The length of the response data in number of bytes. */
33873         uint16_t        resp_len;
33874         /*
33875          * Timestamp value of PTP message captured, or current value of
33876          * free running timer.
33877          */
33878         uint32_t        ptp_msg_ts[2];
33879         /* Sequence ID of the PTP message captured. */
33880         uint16_t        ptp_msg_seqid;
33881         uint8_t         unused_0[5];
33882         /*
33883          * This field is used in Output records to indicate that the output
33884          * is completely written to RAM.  This field should be read as '1'
33885          * to indicate that the output has been completely written.
33886          * When writing a command completion or response to an internal processor,
33887          * the order of writes has to be such that this field is written last.
33888          */
33889         uint8_t         valid;
33890 } __attribute__((packed));
33891
33892 #endif /* _HSI_STRUCT_DEF_DPDK_H_ */