4 * Copyright(c) 2001-2017 Broadcom Limited.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Broadcom Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef _HSI_STRUCT_DEF_DPDK_
35 #define _HSI_STRUCT_DEF_DPDK_
36 /* HSI and HWRM Specification 1.7.7 */
37 #define HWRM_VERSION_MAJOR 1
38 #define HWRM_VERSION_MINOR 7
39 #define HWRM_VERSION_UPDATE 7
41 #define HWRM_VERSION_STR "1.7.7"
43 * Following is the signature for HWRM message field that indicates not
44 * applicable (All F's). Need to cast it the size of the field if needed.
46 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
47 #define HWRM_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */
48 #define HWRM_MAX_RESP_LEN (248) /* hwrm_selftest_qlist */
49 #define HW_HASH_INDEX_SIZE 0x80 /* 7 bit indirection table index. */
50 #define HW_HASH_KEY_SIZE 40
51 #define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */
52 #define HWRM_ROCE_SP_HSI_VERSION_MAJOR 1
53 #define HWRM_ROCE_SP_HSI_VERSION_MINOR 7
54 #define HWRM_ROCE_SP_HSI_VERSION_UPDATE 4
59 #define HWRM_VER_GET (UINT32_C(0x0))
60 #define HWRM_FUNC_BUF_UNRGTR (UINT32_C(0xe))
61 #define HWRM_FUNC_VF_CFG (UINT32_C(0xf))
62 /* Reserved for future use */
63 #define RESERVED1 (UINT32_C(0x10))
64 #define HWRM_FUNC_RESET (UINT32_C(0x11))
65 #define HWRM_FUNC_GETFID (UINT32_C(0x12))
66 #define HWRM_FUNC_VF_ALLOC (UINT32_C(0x13))
67 #define HWRM_FUNC_VF_FREE (UINT32_C(0x14))
68 #define HWRM_FUNC_QCAPS (UINT32_C(0x15))
69 #define HWRM_FUNC_QCFG (UINT32_C(0x16))
70 #define HWRM_FUNC_CFG (UINT32_C(0x17))
71 #define HWRM_FUNC_QSTATS (UINT32_C(0x18))
72 #define HWRM_FUNC_CLR_STATS (UINT32_C(0x19))
73 #define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))
74 #define HWRM_FUNC_VF_RESC_FREE (UINT32_C(0x1b))
75 #define HWRM_FUNC_VF_VNIC_IDS_QUERY (UINT32_C(0x1c))
76 #define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))
77 #define HWRM_FUNC_DRV_QVER (UINT32_C(0x1e))
78 #define HWRM_FUNC_BUF_RGTR (UINT32_C(0x1f))
79 #define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
80 #define HWRM_PORT_MAC_CFG (UINT32_C(0x21))
81 #define HWRM_PORT_QSTATS (UINT32_C(0x23))
82 #define HWRM_PORT_LPBK_QSTATS (UINT32_C(0x24))
83 #define HWRM_PORT_CLR_STATS (UINT32_C(0x25))
84 #define HWRM_PORT_PHY_QCFG (UINT32_C(0x27))
85 #define HWRM_PORT_MAC_QCFG (UINT32_C(0x28))
86 #define HWRM_PORT_PHY_QCAPS (UINT32_C(0x2a))
87 #define HWRM_PORT_LED_CFG (UINT32_C(0x2d))
88 #define HWRM_PORT_LED_QCFG (UINT32_C(0x2e))
89 #define HWRM_PORT_LED_QCAPS (UINT32_C(0x2f))
90 #define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30))
91 #define HWRM_QUEUE_QCFG (UINT32_C(0x31))
92 #define HWRM_QUEUE_CFG (UINT32_C(0x32))
93 #define HWRM_FUNC_VLAN_CFG (UINT32_C(0x33))
94 #define HWRM_FUNC_VLAN_QCFG (UINT32_C(0x34))
95 #define HWRM_QUEUE_PFCENABLE_QCFG (UINT32_C(0x35))
96 #define HWRM_QUEUE_PFCENABLE_CFG (UINT32_C(0x36))
97 #define HWRM_QUEUE_PRI2COS_QCFG (UINT32_C(0x37))
98 #define HWRM_QUEUE_PRI2COS_CFG (UINT32_C(0x38))
99 #define HWRM_QUEUE_COS2BW_QCFG (UINT32_C(0x39))
100 #define HWRM_QUEUE_COS2BW_CFG (UINT32_C(0x3a))
101 #define HWRM_VNIC_ALLOC (UINT32_C(0x40))
102 #define HWRM_VNIC_ALLOC (UINT32_C(0x40))
103 #define HWRM_VNIC_FREE (UINT32_C(0x41))
104 #define HWRM_VNIC_CFG (UINT32_C(0x42))
105 #define HWRM_VNIC_QCFG (UINT32_C(0x43))
106 #define HWRM_VNIC_TPA_CFG (UINT32_C(0x44))
107 #define HWRM_VNIC_RSS_CFG (UINT32_C(0x46))
108 #define HWRM_VNIC_RSS_QCFG (UINT32_C(0x47))
109 #define HWRM_VNIC_PLCMODES_CFG (UINT32_C(0x48))
110 #define HWRM_VNIC_PLCMODES_QCFG (UINT32_C(0x49))
111 #define HWRM_VNIC_QCAPS (UINT32_C(0x4a))
112 #define HWRM_RING_ALLOC (UINT32_C(0x50))
113 #define HWRM_RING_FREE (UINT32_C(0x51))
114 #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS (UINT32_C(0x52))
115 #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS (UINT32_C(0x53))
116 #define HWRM_RING_RESET (UINT32_C(0x5e))
117 #define HWRM_RING_GRP_ALLOC (UINT32_C(0x60))
118 #define HWRM_RING_GRP_FREE (UINT32_C(0x61))
119 #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC (UINT32_C(0x70))
120 #define HWRM_VNIC_RSS_COS_LB_CTX_FREE (UINT32_C(0x71))
121 #define HWRM_CFA_L2_FILTER_ALLOC (UINT32_C(0x90))
122 #define HWRM_CFA_L2_FILTER_FREE (UINT32_C(0x91))
123 #define HWRM_CFA_L2_FILTER_CFG (UINT32_C(0x92))
124 #define HWRM_CFA_L2_SET_RX_MASK (UINT32_C(0x93))
125 /* Reserved for future use */
126 #define HWRM_CFA_VLAN_ANTISPOOF_CFG (UINT32_C(0x94))
127 #define HWRM_CFA_TUNNEL_FILTER_ALLOC (UINT32_C(0x95))
128 #define HWRM_CFA_TUNNEL_FILTER_FREE (UINT32_C(0x96))
129 #define HWRM_CFA_NTUPLE_FILTER_ALLOC (UINT32_C(0x99))
130 #define HWRM_CFA_NTUPLE_FILTER_FREE (UINT32_C(0x9a))
131 #define HWRM_CFA_NTUPLE_FILTER_CFG (UINT32_C(0x9b))
132 #define HWRM_TUNNEL_DST_PORT_QUERY (UINT32_C(0xa0))
133 #define HWRM_TUNNEL_DST_PORT_ALLOC (UINT32_C(0xa1))
134 #define HWRM_TUNNEL_DST_PORT_FREE (UINT32_C(0xa2))
135 #define HWRM_STAT_CTX_ALLOC (UINT32_C(0xb0))
136 #define HWRM_STAT_CTX_FREE (UINT32_C(0xb1))
137 #define HWRM_STAT_CTX_QUERY (UINT32_C(0xb2))
138 #define HWRM_STAT_CTX_CLR_STATS (UINT32_C(0xb3))
139 #define HWRM_FW_RESET (UINT32_C(0xc0))
140 #define HWRM_FW_QSTATUS (UINT32_C(0xc1))
141 #define HWRM_EXEC_FWD_RESP (UINT32_C(0xd0))
142 #define HWRM_REJECT_FWD_RESP (UINT32_C(0xd1))
143 #define HWRM_FWD_RESP (UINT32_C(0xd2))
144 #define HWRM_FWD_ASYNC_EVENT_CMPL (UINT32_C(0xd3))
145 #define HWRM_TEMP_MONITOR_QUERY (UINT32_C(0xe0))
146 #define HWRM_WOL_FILTER_ALLOC (UINT32_C(0xf0))
147 #define HWRM_WOL_FILTER_FREE (UINT32_C(0xf1))
148 #define HWRM_WOL_FILTER_QCFG (UINT32_C(0xf2))
149 #define HWRM_WOL_REASON_QCFG (UINT32_C(0xf3))
150 #define HWRM_DBG_DUMP (UINT32_C(0xff14))
151 #define HWRM_NVM_VALIDATE_OPTION (UINT32_C(0xffef))
152 #define HWRM_NVM_FLUSH (UINT32_C(0xfff0))
153 #define HWRM_NVM_GET_VARIABLE (UINT32_C(0xfff1))
154 #define HWRM_NVM_SET_VARIABLE (UINT32_C(0xfff2))
155 #define HWRM_NVM_INSTALL_UPDATE (UINT32_C(0xfff3))
156 #define HWRM_NVM_MODIFY (UINT32_C(0xfff4))
157 #define HWRM_NVM_VERIFY_UPDATE (UINT32_C(0xfff5))
158 #define HWRM_NVM_GET_DEV_INFO (UINT32_C(0xfff6))
159 #define HWRM_NVM_ERASE_DIR_ENTRY (UINT32_C(0xfff7))
160 #define HWRM_NVM_MOD_DIR_ENTRY (UINT32_C(0xfff8))
161 #define HWRM_NVM_FIND_DIR_ENTRY (UINT32_C(0xfff9))
162 #define HWRM_NVM_GET_DIR_ENTRIES (UINT32_C(0xfffa))
163 #define HWRM_NVM_GET_DIR_INFO (UINT32_C(0xfffb))
164 #define HWRM_NVM_RAW_DUMP (UINT32_C(0xfffc))
165 #define HWRM_NVM_READ (UINT32_C(0xfffd))
166 #define HWRM_NVM_WRITE (UINT32_C(0xfffe))
167 #define HWRM_NVM_RAW_WRITE_BLK (UINT32_C(0xffff))
170 * Note: The Host Software Interface (HSI) and Hardware Resource Manager (HWRM)
171 * specification describes the data structures used in Ethernet packet or RDMA
172 * message data transfers as well as an abstract interface for managing Ethernet
173 * NIC hardware resources.
175 /* Ethernet Data path Host Structures */
177 * Description: The following three sections document the host structures used
178 * between device and software drivers for communicating Ethernet packets.
180 /* BD Ring Structures */
182 * Description: This structure is used to inform the NIC of a location for and
183 * an aggregation buffer that will be used for packet data that is received. An
184 * aggregation buffer creates a different kind of completion operation for a
185 * packet where a variable number of BDs may be used to place the packet in the
186 * host. RX Rings that have aggregation buffers are known as aggregation rings
187 * and must contain only aggregation buffers.
189 /* Short TX BD (16 bytes) */
193 * All bits in this field must be valid on the first BD of a
194 * packet. Only the packet_end bit must be valid for the
195 * remaining BDs of a packet.
197 /* This value identifies the type of buffer descriptor. */
198 #define TX_BD_SHORT_TYPE_MASK UINT32_C(0x3f)
199 #define TX_BD_SHORT_TYPE_SFT 0
201 * Indicates that this BD is 16B long and is
202 * used for normal L2 packet transmission.
204 #define TX_BD_SHORT_TYPE_TX_BD_SHORT UINT32_C(0x0)
206 * If set to 1, the packet ends with the data in the buffer
207 * pointed to by this descriptor. This flag must be valid on
210 #define TX_BD_SHORT_FLAGS_PACKET_END UINT32_C(0x40)
212 * If set to 1, the device will not generate a completion for
213 * this transmit packet unless there is an error in it's
214 * processing. If this bit is set to 0, then the packet will be
215 * completed normally. This bit must be valid only on the first
218 #define TX_BD_SHORT_FLAGS_NO_CMPL UINT32_C(0x80)
220 * This value indicates how many 16B BD locations are consumed
221 * in the ring by this packet. A value of 1 indicates that this
222 * BD is the only BD (and that the it is a short BD). A value of
223 * 3 indicates either 3 short BDs or 1 long BD and one short BD
224 * in the packet. A value of 0 indicates that there are 32 BD
225 * locations in the packet (the maximum). This field is valid
226 * only on the first BD of a packet.
228 #define TX_BD_SHORT_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
229 #define TX_BD_SHORT_FLAGS_BD_CNT_SFT 8
231 * This value is a hint for the length of the entire packet. It
232 * is used by the chip to optimize internal processing. The
233 * packet will be dropped if the hint is too short. This field
234 * is valid only on the first BD of a packet.
236 #define TX_BD_SHORT_FLAGS_LHINT_MASK UINT32_C(0x6000)
237 #define TX_BD_SHORT_FLAGS_LHINT_SFT 13
238 /* indicates packet length < 512B */
239 #define TX_BD_SHORT_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
240 /* indicates 512 <= packet length < 1KB */
241 #define TX_BD_SHORT_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
242 /* indicates 1KB <= packet length < 2KB */
243 #define TX_BD_SHORT_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
244 /* indicates packet length >= 2KB */
245 #define TX_BD_SHORT_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
246 #define TX_BD_SHORT_FLAGS_LHINT_LAST \
247 TX_BD_SHORT_FLAGS_LHINT_GTE2K
249 * If set to 1, the device immediately updates the Send Consumer
250 * Index after the buffer associated with this descriptor has
251 * been transferred via DMA to NIC memory from host memory. An
252 * interrupt may or may not be generated according to the state
253 * of the interrupt avoidance mechanisms. If this bit is set to
254 * 0, then the Consumer Index is only updated as soon as one of
255 * the host interrupt coalescing conditions has been met. This
256 * bit must be valid on the first BD of a packet.
258 #define TX_BD_SHORT_FLAGS_COAL_NOW UINT32_C(0x8000)
260 * All bits in this field must be valid on the first BD of a
261 * packet. Only the packet_end bit must be valid for the
262 * remaining BDs of a packet.
264 #define TX_BD_SHORT_FLAGS_MASK UINT32_C(0xffc0)
265 #define TX_BD_SHORT_FLAGS_SFT 6
268 * This is the length of the host physical buffer this BD
269 * describes in bytes. This field must be valid on all BDs of a
274 * The opaque data field is pass through to the completion and
275 * can be used for any data that the driver wants to associate
276 * with the transmit BD. This field must be valid on the first
281 * This is the host physical address for the portion of the
282 * packet described by this TX BD. This value must be valid on
283 * all BDs of a packet.
285 } __attribute__((packed));
287 /* Long TX BD (32 bytes split to 2 16-byte struct) */
291 * All bits in this field must be valid on the first BD of a
292 * packet. Only the packet_end bit must be valid for the
293 * remaining BDs of a packet.
295 /* This value identifies the type of buffer descriptor. */
296 #define TX_BD_LONG_TYPE_MASK UINT32_C(0x3f)
297 #define TX_BD_LONG_TYPE_SFT 0
299 * Indicates that this BD is 32B long and is
300 * used for normal L2 packet transmission.
302 #define TX_BD_LONG_TYPE_TX_BD_LONG UINT32_C(0x10)
304 * If set to 1, the packet ends with the data in the buffer
305 * pointed to by this descriptor. This flag must be valid on
308 #define TX_BD_LONG_FLAGS_PACKET_END UINT32_C(0x40)
310 * If set to 1, the device will not generate a completion for
311 * this transmit packet unless there is an error in it's
312 * processing. If this bit is set to 0, then the packet will be
313 * completed normally. This bit must be valid only on the first
316 #define TX_BD_LONG_FLAGS_NO_CMPL UINT32_C(0x80)
318 * This value indicates how many 16B BD locations are consumed
319 * in the ring by this packet. A value of 1 indicates that this
320 * BD is the only BD (and that the it is a short BD). A value of
321 * 3 indicates either 3 short BDs or 1 long BD and one short BD
322 * in the packet. A value of 0 indicates that there are 32 BD
323 * locations in the packet (the maximum). This field is valid
324 * only on the first BD of a packet.
326 #define TX_BD_LONG_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
327 #define TX_BD_LONG_FLAGS_BD_CNT_SFT 8
329 * This value is a hint for the length of the entire packet. It
330 * is used by the chip to optimize internal processing. The
331 * packet will be dropped if the hint is too short. This field
332 * is valid only on the first BD of a packet.
334 #define TX_BD_LONG_FLAGS_LHINT_MASK UINT32_C(0x6000)
335 #define TX_BD_LONG_FLAGS_LHINT_SFT 13
336 /* indicates packet length < 512B */
337 #define TX_BD_LONG_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
338 /* indicates 512 <= packet length < 1KB */
339 #define TX_BD_LONG_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
340 /* indicates 1KB <= packet length < 2KB */
341 #define TX_BD_LONG_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
342 /* indicates packet length >= 2KB */
343 #define TX_BD_LONG_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
344 #define TX_BD_LONG_FLAGS_LHINT_LAST \
345 TX_BD_LONG_FLAGS_LHINT_GTE2K
347 * If set to 1, the device immediately updates the Send Consumer
348 * Index after the buffer associated with this descriptor has
349 * been transferred via DMA to NIC memory from host memory. An
350 * interrupt may or may not be generated according to the state
351 * of the interrupt avoidance mechanisms. If this bit is set to
352 * 0, then the Consumer Index is only updated as soon as one of
353 * the host interrupt coalescing conditions has been met. This
354 * bit must be valid on the first BD of a packet.
356 #define TX_BD_LONG_FLAGS_COAL_NOW UINT32_C(0x8000)
358 * All bits in this field must be valid on the first BD of a
359 * packet. Only the packet_end bit must be valid for the
360 * remaining BDs of a packet.
362 #define TX_BD_LONG_FLAGS_MASK UINT32_C(0xffc0)
363 #define TX_BD_LONG_FLAGS_SFT 6
366 * This is the length of the host physical buffer this BD
367 * describes in bytes. This field must be valid on all BDs of a
372 * The opaque data field is pass through to the completion and
373 * can be used for any data that the driver wants to associate
374 * with the transmit BD. This field must be valid on the first
379 * This is the host physical address for the portion of the
380 * packet described by this TX BD. This value must be valid on
381 * all BDs of a packet.
383 } __attribute__((packed));
385 /* last 16 bytes of Long TX BD */
386 struct tx_bd_long_hi {
389 * All bits in this field must be valid on the first BD of a
390 * packet. Their value on other BDs of the packet will be
394 * If set to 1, the controller replaces the TCP/UPD checksum
395 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
396 * checksum field of the encapsulated TCP/UDP packets with the
397 * hardware calculated TCP/UDP checksum for the packet
398 * associated with this descriptor. The flag is ignored if the
399 * LSO flag is set. This bit must be valid on the first BD of a
402 #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1)
404 * If set to 1, the controller replaces the IP checksum of the
405 * normal packets, or the inner IP checksum of the encapsulated
406 * packets with the hardware calculated IP checksum for the
407 * packet associated with this descriptor. This bit must be
408 * valid on the first BD of a packet.
410 #define TX_BD_LONG_LFLAGS_IP_CHKSUM UINT32_C(0x2)
412 * If set to 1, the controller will not append an Ethernet CRC
413 * to the end of the frame. This bit must be valid on the first
414 * BD of a packet. Packet must be 64B or longer when this flag
415 * is set. It is not useful to use this bit with any form of TX
416 * offload such as CSO or LSO. The intent is that the packet
417 * from the host already has a valid Ethernet CRC on the packet.
419 #define TX_BD_LONG_LFLAGS_NOCRC UINT32_C(0x4)
421 * If set to 1, the device will record the time at which the
422 * packet was actually transmitted at the TX MAC. This bit must
423 * be valid on the first BD of a packet.
425 #define TX_BD_LONG_LFLAGS_STAMP UINT32_C(0x8)
427 * If set to 1, The controller replaces the tunnel IP checksum
428 * field with hardware calculated IP checksum for the IP header
429 * of the packet associated with this descriptor. For outer UDP
430 * checksum, global outer UDP checksum TE_NIC register needs to
431 * be enabled. If the global outer UDP checksum TE_NIC register
432 * bit is set, outer UDP checksum will be calculated for the
433 * following cases: 1. Packets with tcp_udp_chksum flag set to
434 * offload checksum for inner packet AND the inner packet is
435 * TCP/UDP. If the inner packet is ICMP for example (non-
436 * TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
437 * checksum will not be calculated. 2. Packets with lso flag set
438 * which implies inner TCP checksum calculation as part of LSO
441 #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM UINT32_C(0x10)
443 * If set to 1, the device will treat this packet with LSO(Large
444 * Send Offload) processing for both normal or encapsulated
445 * packets, which is a form of TCP segmentation. When this bit
446 * is 1, the hdr_size and mss fields must be valid. The driver
447 * doesn't need to set t_ip_chksum, ip_chksum, and
448 * tcp_udp_chksum flags since the controller will replace the
449 * appropriate checksum fields for segmented packets. When this
450 * bit is 1, the hdr_size and mss fields must be valid.
452 #define TX_BD_LONG_LFLAGS_LSO UINT32_C(0x20)
454 * If set to zero when LSO is '1', then the IPID will be treated
455 * as a 16b number and will be wrapped if it exceeds a value of
456 * 0xffff. If set to one when LSO is '1', then the IPID will be
457 * treated as a 15b number and will be wrapped if it exceeds a
460 #define TX_BD_LONG_LFLAGS_IPID_FMT UINT32_C(0x40)
462 * If set to zero when LSO is '1', then the IPID of the tunnel
463 * IP header will not be modified during LSO operations. If set
464 * to one when LSO is '1', then the IPID of the tunnel IP header
465 * will be incremented for each subsequent segment of an LSO
466 * operation. The flag is ignored if the LSO packet is a normal
467 * (non-tunneled) TCP packet.
469 #define TX_BD_LONG_LFLAGS_T_IPID UINT32_C(0x80)
471 * If set to '1', then the RoCE ICRC will be appended to the
472 * packet. Packet must be a valid RoCE format packet.
474 #define TX_BD_LONG_LFLAGS_ROCE_CRC UINT32_C(0x100)
476 * If set to '1', then the FCoE CRC will be appended to the
477 * packet. Packet must be a valid FCoE format packet.
479 #define TX_BD_LONG_LFLAGS_FCOE_CRC UINT32_C(0x200)
482 * When LSO is '1', this field must contain the offset of the
483 * TCP payload from the beginning of the packet in as 16b words.
484 * In case of encapsulated/tunneling packet, this field contains
485 * the offset of the inner TCP payload from beginning of the
486 * packet as 16-bit words. This value must be valid on the first
489 #define TX_BD_LONG_HDR_SIZE_MASK UINT32_C(0x1ff)
490 #define TX_BD_LONG_HDR_SIZE_SFT 0
493 * This is the MSS value that will be used to do the LSO
494 * processing. The value is the length in bytes of the TCP
495 * payload for each segment generated by the LSO operation. This
496 * value must be valid on the first BD of a packet.
498 #define TX_BD_LONG_MSS_MASK UINT32_C(0x7fff)
499 #define TX_BD_LONG_MSS_SFT 0
503 * This value selects a CFA action to perform on the packet. Set
504 * this value to zero if no CFA action is desired. This value
505 * must be valid on the first BD of a packet.
509 * This value is action meta-data that defines CFA edit
510 * operations that are done in addition to any action editing.
512 /* When key=1, This is the VLAN tag VID value. */
513 #define TX_BD_LONG_CFA_META_VLAN_VID_MASK UINT32_C(0xfff)
514 #define TX_BD_LONG_CFA_META_VLAN_VID_SFT 0
515 /* When key=1, This is the VLAN tag DE value. */
516 #define TX_BD_LONG_CFA_META_VLAN_DE UINT32_C(0x1000)
517 /* When key=1, This is the VLAN tag PRI value. */
518 #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000)
519 #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT 13
520 /* When key=1, This is the VLAN tag TPID select value. */
521 #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000)
522 #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT 16
524 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8 (UINT32_C(0x0) << 16)
526 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100 (UINT32_C(0x1) << 16)
528 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100 (UINT32_C(0x2) << 16)
530 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200 (UINT32_C(0x3) << 16)
532 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300 (UINT32_C(0x4) << 16)
533 /* Value programmed in CFA VLANTPID register. */
534 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG (UINT32_C(0x5) << 16)
535 #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \
536 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
537 /* When key=1, This is the VLAN tag TPID select value. */
538 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
539 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT 19
541 * This field identifies the type of edit to be performed on the
542 * packet. This value must be valid on the first BD of a packet.
544 #define TX_BD_LONG_CFA_META_KEY_MASK UINT32_C(0xf0000000)
545 #define TX_BD_LONG_CFA_META_KEY_SFT 28
547 #define TX_BD_LONG_CFA_META_KEY_NONE (UINT32_C(0x0) << 28)
549 * - meta[17:16] - TPID select value (0 =
550 * 0x8100). - meta[15:12] - PRI/DE value. -
551 * meta[11:0] - VID value.
553 #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG (UINT32_C(0x1) << 28)
554 #define TX_BD_LONG_CFA_META_KEY_LAST \
555 TX_BD_LONG_CFA_META_KEY_VLAN_TAG
556 } __attribute__((packed));
558 /* RX Producer Packet BD (16 bytes) */
559 struct rx_prod_pkt_bd {
561 /* This value identifies the type of buffer descriptor. */
562 #define RX_PROD_PKT_BD_TYPE_MASK UINT32_C(0x3f)
563 #define RX_PROD_PKT_BD_TYPE_SFT 0
565 * Indicates that this BD is 16B long and is an
566 * RX Producer (ie. empty) buffer descriptor.
568 #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT UINT32_C(0x4)
570 * If set to 1, the packet will be placed at the address plus
571 * 2B. The 2 Bytes of padding will be written as zero.
574 * This is intended to be used when the host buffer is cache-
575 * line aligned to produce packets that are easy to parse in
576 * host memory while still allowing writes to be cache line
579 #define RX_PROD_PKT_BD_FLAGS_SOP_PAD UINT32_C(0x40)
581 * If set to 1, the packet write will be padded out to the
582 * nearest cache-line with zero value padding.
585 * If receive buffers start/end on cache-line boundaries, this
586 * feature will ensure that all data writes on the PCI bus
587 * start/end on cache line boundaries.
589 #define RX_PROD_PKT_BD_FLAGS_EOP_PAD UINT32_C(0x80)
591 * This value is the number of additional buffers in the ring
592 * that describe the buffer space to be consumed for the this
593 * packet. If the value is zero, then the packet must fit within
594 * the space described by this BD. If this value is 1 or more,
595 * it indicates how many additional "buffer" BDs are in the ring
596 * immediately following this BD to be used for the same network
597 * packet. Even if the packet to be placed does not need all the
598 * additional buffers, they will be consumed anyway.
600 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
601 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT 8
602 #define RX_PROD_PKT_BD_FLAGS_MASK UINT32_C(0xffc0)
603 #define RX_PROD_PKT_BD_FLAGS_SFT 6
606 * This is the length in Bytes of the host physical buffer where
607 * data for the packet may be placed in host memory.
610 * While this is a Byte resolution value, it is often
611 * advantageous to ensure that the buffers provided end on a
616 * The opaque data field is pass through to the completion and
617 * can be used for any data that the driver wants to associate
618 * with this receive buffer set.
622 * This is the host physical address where data for the packet
623 * may by placed in host memory.
626 * While this is a Byte resolution value, it is often
627 * advantageous to ensure that the buffers provide start on a
630 } __attribute__((packed));
632 /* Completion Ring Structures */
633 /* Note: This structure is used by the HWRM to communicate HWRM Error. */
634 /* Base Completion Record (16 bytes) */
639 * This field indicates the exact type of the completion. By
640 * convention, the LSB identifies the length of the record in
641 * 16B units. Even values indicate 16B records. Odd values
642 * indicate 32B records.
644 #define CMPL_BASE_TYPE_MASK UINT32_C(0x3f)
645 #define CMPL_BASE_TYPE_SFT 0
646 /* TX L2 completion: Completion of TX packet. Length = 16B */
647 #define CMPL_BASE_TYPE_TX_L2 UINT32_C(0x0)
649 * RX L2 completion: Completion of and L2 RX
650 * packet. Length = 32B
652 #define CMPL_BASE_TYPE_RX_L2 UINT32_C(0x11)
654 * RX Aggregation Buffer completion : Completion
655 * of an L2 aggregation buffer in support of
656 * TPA, HDS, or Jumbo packet completion. Length
659 #define CMPL_BASE_TYPE_RX_AGG UINT32_C(0x12)
661 * RX L2 TPA Start Completion: Completion at the
662 * beginning of a TPA operation. Length = 32B
664 #define CMPL_BASE_TYPE_RX_TPA_START UINT32_C(0x13)
666 * RX L2 TPA End Completion: Completion at the
667 * end of a TPA operation. Length = 32B
669 #define CMPL_BASE_TYPE_RX_TPA_END UINT32_C(0x15)
671 * Statistics Ejection Completion: Completion of
672 * statistics data ejection buffer. Length = 16B
674 #define CMPL_BASE_TYPE_STAT_EJECT UINT32_C(0x1a)
675 /* HWRM Command Completion: Completion of an HWRM command. */
676 #define CMPL_BASE_TYPE_HWRM_DONE UINT32_C(0x20)
677 /* Forwarded HWRM Request */
678 #define CMPL_BASE_TYPE_HWRM_FWD_REQ UINT32_C(0x22)
679 /* Forwarded HWRM Response */
680 #define CMPL_BASE_TYPE_HWRM_FWD_RESP UINT32_C(0x24)
681 /* HWRM Asynchronous Event Information */
682 #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
683 /* CQ Notification */
684 #define CMPL_BASE_TYPE_CQ_NOTIFICATION UINT32_C(0x30)
685 /* SRQ Threshold Event */
686 #define CMPL_BASE_TYPE_SRQ_EVENT UINT32_C(0x32)
687 /* DBQ Threshold Event */
688 #define CMPL_BASE_TYPE_DBQ_EVENT UINT32_C(0x34)
689 /* QP Async Notification */
690 #define CMPL_BASE_TYPE_QP_EVENT UINT32_C(0x38)
691 /* Function Async Notification */
692 #define CMPL_BASE_TYPE_FUNC_EVENT UINT32_C(0x3a)
701 * This value is written by the NIC such that it will be
702 * different for each pass through the completion queue. The
703 * even passes will write 1. The odd passes will write 0.
705 #define CMPL_BASE_V UINT32_C(0x1)
707 #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
708 #define CMPL_BASE_INFO3_SFT 1
711 } __attribute__((packed));
713 /* TX Completion Record (16 bytes) */
717 * This field indicates the exact type of the completion. By
718 * convention, the LSB identifies the length of the record in
719 * 16B units. Even values indicate 16B records. Odd values
720 * indicate 32B records.
722 #define TX_CMPL_TYPE_MASK UINT32_C(0x3f)
723 #define TX_CMPL_TYPE_SFT 0
724 /* TX L2 completion: Completion of TX packet. Length = 16B */
725 #define TX_CMPL_TYPE_TX_L2 UINT32_C(0x0)
727 * When this bit is '1', it indicates a packet that has an error
728 * of some type. Type of error is indicated in error_flags.
730 #define TX_CMPL_FLAGS_ERROR UINT32_C(0x40)
732 * When this bit is '1', it indicates that the packet completed
733 * was transmitted using the push acceleration data provided by
734 * the driver. When this bit is '0', it indicates that the
735 * packet had not push acceleration data written or was executed
736 * as a normal packet even though push data was provided.
738 #define TX_CMPL_FLAGS_PUSH UINT32_C(0x80)
739 #define TX_CMPL_FLAGS_MASK UINT32_C(0xffc0)
740 #define TX_CMPL_FLAGS_SFT 6
742 /* unused1 is 16 b */
745 * This is a copy of the opaque field from the first TX BD of
746 * this transmitted packet.
750 * This value is written by the NIC such that it will be
751 * different for each pass through the completion queue. The
752 * even passes will write 1. The odd passes will write 0.
754 #define TX_CMPL_V UINT32_C(0x1)
756 * This error indicates that there was some sort of problem with
757 * the BDs for the packet.
759 #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
760 #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT 1
762 #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR (UINT32_C(0x0) << 1)
763 /* Bad Format: BDs were not formatted correctly. */
764 #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT (UINT32_C(0x2) << 1)
765 #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \
766 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
768 * When this bit is '1', it indicates that the length of the
769 * packet was zero. No packet was transmitted.
771 #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10)
773 * When this bit is '1', it indicates that the packet was longer
774 * than the programmed limit in TDI. No packet was transmitted.
776 #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20)
778 * When this bit is '1', it indicates that one or more of the
779 * BDs associated with this packet generated a PCI error. This
780 * probably means the address was not valid.
782 #define TX_CMPL_ERRORS_DMA_ERROR UINT32_C(0x40)
784 * When this bit is '1', it indicates that the packet was longer
785 * than indicated by the hint. No packet was transmitted.
787 #define TX_CMPL_ERRORS_HINT_TOO_SHORT UINT32_C(0x80)
789 * When this bit is '1', it indicates that the packet was
790 * dropped due to Poison TLP error on one or more of the TLPs in
791 * the PXP completion.
793 #define TX_CMPL_ERRORS_POISON_TLP_ERROR UINT32_C(0x100)
794 #define TX_CMPL_ERRORS_MASK UINT32_C(0xfffe)
795 #define TX_CMPL_ERRORS_SFT 1
797 /* unused2 is 16 b */
799 /* unused3 is 32 b */
800 } __attribute__((packed));
802 /* RX Packet Completion Record (32 bytes split to 2 16-byte struct) */
806 * This field indicates the exact type of the completion. By
807 * convention, the LSB identifies the length of the record in
808 * 16B units. Even values indicate 16B records. Odd values
809 * indicate 32B records.
811 #define RX_PKT_CMPL_TYPE_MASK UINT32_C(0x3f)
812 #define RX_PKT_CMPL_TYPE_SFT 0
814 * RX L2 completion: Completion of and L2 RX
815 * packet. Length = 32B
817 #define RX_PKT_CMPL_TYPE_RX_L2 UINT32_C(0x11)
818 #define RX_PKT_CMPL_TYPE_RX_L2_TPA_START UINT32_C(0x13)
819 #define RX_PKT_CMPL_TYPE_RX_L2_TPA_END UINT32_C(0x15)
821 * When this bit is '1', it indicates a packet that has an error
822 * of some type. Type of error is indicated in error_flags.
824 #define RX_PKT_CMPL_FLAGS_ERROR UINT32_C(0x40)
825 /* This field indicates how the packet was placed in the buffer. */
826 #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
827 #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT 7
828 /* Normal: Packet was placed using normal algorithm. */
829 #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL (UINT32_C(0x0) << 7)
830 /* Jumbo: Packet was placed using jumbo algorithm. */
831 #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
833 * Header/Data Separation: Packet was placed
834 * using Header/Data separation algorithm. The
835 * separation location is indicated by the itype
838 #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
839 #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \
840 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
841 /* This bit is '1' if the RSS field in this completion is valid. */
842 #define RX_PKT_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
844 #define RX_PKT_CMPL_FLAGS_UNUSED UINT32_C(0x800)
846 * This value indicates what the inner packet determined for the
849 #define RX_PKT_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
850 #define RX_PKT_CMPL_FLAGS_ITYPE_SFT 12
851 /* Not Known: Indicates that the packet type was not known. */
852 #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN (UINT32_C(0x0) << 12)
854 * IP Packet: Indicates that the packet was an
855 * IP packet, but further classification was not
858 #define RX_PKT_CMPL_FLAGS_ITYPE_IP (UINT32_C(0x1) << 12)
860 * TCP Packet: Indicates that the packet was IP
861 * and TCP. This indicates that the
862 * payload_offset field is valid.
864 #define RX_PKT_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
866 * UDP Packet: Indicates that the packet was IP
867 * and UDP. This indicates that the
868 * payload_offset field is valid.
870 #define RX_PKT_CMPL_FLAGS_ITYPE_UDP (UINT32_C(0x3) << 12)
872 * FCoE Packet: Indicates that the packet was
873 * recognized as a FCoE. This also indicates
874 * that the payload_offset field is valid.
876 #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE (UINT32_C(0x4) << 12)
878 * RoCE Packet: Indicates that the packet was
879 * recognized as a RoCE. This also indicates
880 * that the payload_offset field is valid.
882 #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE (UINT32_C(0x5) << 12)
884 * ICMP Packet: Indicates that the packet was
885 * recognized as ICMP. This indicates that the
886 * payload_offset field is valid.
888 #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP (UINT32_C(0x7) << 12)
890 * PtP packet wo/timestamp: Indicates that the
891 * packet was recognized as a PtP packet.
893 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP (UINT32_C(0x8) << 12)
895 * PtP packet w/timestamp: Indicates that the
896 * packet was recognized as a PtP packet and
897 * that a timestamp was taken for the packet.
899 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP (UINT32_C(0x9) << 12)
900 #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \
901 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
902 #define RX_PKT_CMPL_FLAGS_MASK UINT32_C(0xffc0)
903 #define RX_PKT_CMPL_FLAGS_SFT 6
906 * This is the length of the data for the packet stored in the
907 * buffer(s) identified by the opaque value. This includes the
908 * packet BD and any associated buffer BDs. This does not
909 * include the the length of any data places in aggregation BDs.
913 * This is a copy of the opaque field from the RX BD this
914 * completion corresponds to.
919 * This value is written by the NIC such that it will be
920 * different for each pass through the completion queue. The
921 * even passes will write 1. The odd passes will write 0.
923 #define RX_PKT_CMPL_V1 UINT32_C(0x1)
925 * This value is the number of aggregation buffers that follow
926 * this entry in the completion ring that are a part of this
927 * packet. If the value is zero, then the packet is completely
928 * contained in the buffer space provided for the packet in the
931 #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
932 #define RX_PKT_CMPL_AGG_BUFS_SFT 1
934 uint8_t rss_hash_type;
936 * This is the RSS hash type for the packet. The value is packed
937 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}
938 * . The value of tuple_extrac_op provides the information about
939 * what fields the hash was computed on. * 0: The RSS hash was
940 * computed over source IP address, destination IP address,
941 * source port, and destination port of inner IP and TCP or UDP
942 * headers. Note: For non-tunneled packets, the packet headers
943 * are considered inner packet headers for the RSS hash
944 * computation purpose. * 1: The RSS hash was computed over
945 * source IP address and destination IP address of inner IP
946 * header. Note: For non-tunneled packets, the packet headers
947 * are considered inner packet headers for the RSS hash
948 * computation purpose. * 2: The RSS hash was computed over
949 * source IP address, destination IP address, source port, and
950 * destination port of IP and TCP or UDP headers of outer tunnel
951 * headers. Note: For non-tunneled packets, this value is not
952 * applicable. * 3: The RSS hash was computed over source IP
953 * address and destination IP address of IP header of outer
954 * tunnel headers. Note: For non-tunneled packets, this value is
955 * not applicable. Note that 4-tuples values listed above are
956 * applicable for layer 4 protocols supported and enabled for
957 * RSS in the hardware, HWRM firmware, and drivers. For example,
958 * if RSS hash is supported and enabled for TCP traffic only,
959 * then the values of tuple_extract_op corresponding to 4-tuples
960 * are only valid for TCP traffic.
962 uint8_t payload_offset;
964 * This value indicates the offset in bytes from the beginning
965 * of the packet where the inner payload starts. This value is
966 * valid for TCP, UDP, FCoE, and RoCE packets. A value of zero
967 * indicates that header is 256B into the packet.
973 * This value is the RSS hash value calculated for the packet
974 * based on the mode bits and key value in the VNIC.
976 } __attribute__((packed));
978 /* last 16 bytes of RX Packet Completion Record */
979 struct rx_pkt_cmpl_hi {
982 * This indicates that the ip checksum was calculated for the
983 * inner packet and that the ip_cs_error field indicates if
984 * there was an error.
986 #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1)
988 * This indicates that the TCP, UDP or ICMP checksum was
989 * calculated for the inner packet and that the l4_cs_error
990 * field indicates if there was an error.
992 #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2)
994 * This indicates that the ip checksum was calculated for the
995 * tunnel header and that the t_ip_cs_error field indicates if
996 * there was an error.
998 #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
1000 * This indicates that the UDP checksum was calculated for the
1001 * tunnel packet and that the t_l4_cs_error field indicates if
1002 * there was an error.
1004 #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
1005 /* This value indicates what format the metadata field is. */
1006 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
1007 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT 4
1008 /* No metadata informtaion. Value is zero. */
1009 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
1011 * The metadata field contains the VLAN tag and
1012 * TPID value. - metadata[11:0] contains the
1013 * vlan VID value. - metadata[12] contains the
1014 * vlan DE value. - metadata[15:13] contains the
1015 * vlan PRI value. - metadata[31:16] contains
1016 * the vlan TPID value.
1018 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
1019 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \
1020 RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
1022 * This field indicates the IP type for the inner-most IP
1023 * header. A value of '0' indicates IPv4. A value of '1'
1024 * indicates IPv6. This value is only valid if itype indicates a
1025 * packet with an IP header.
1027 #define RX_PKT_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
1030 * This is data from the CFA block as indicated by the
1031 * meta_format field.
1033 /* When meta_format=1, this value is the VLAN VID. */
1034 #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
1035 #define RX_PKT_CMPL_METADATA_VID_SFT 0
1036 /* When meta_format=1, this value is the VLAN DE. */
1037 #define RX_PKT_CMPL_METADATA_DE UINT32_C(0x1000)
1038 /* When meta_format=1, this value is the VLAN PRI. */
1039 #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
1040 #define RX_PKT_CMPL_METADATA_PRI_SFT 13
1041 /* When meta_format=1, this value is the VLAN TPID. */
1042 #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
1043 #define RX_PKT_CMPL_METADATA_TPID_SFT 16
1046 * This value is written by the NIC such that it will be
1047 * different for each pass through the completion queue. The
1048 * even passes will write 1. The odd passes will write 0.
1050 #define RX_PKT_CMPL_V2 UINT32_C(0x1)
1052 * This error indicates that there was some sort of problem with
1053 * the BDs for the packet that was found after part of the
1054 * packet was already placed. The packet should be treated as
1057 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
1058 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT 1
1059 /* No buffer error */
1060 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER (UINT32_C(0x0) << 1)
1062 * Did Not Fit: Packet did not fit into packet
1063 * buffer provided. For regular placement, this
1064 * means the packet did not fit in the buffer
1065 * provided. For HDS and jumbo placement, this
1066 * means that the packet could not be placed
1067 * into 7 physical buffers or less.
1069 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
1070 (UINT32_C(0x1) << 1)
1072 * Not On Chip: All BDs needed for the packet
1073 * were not on-chip when the packet arrived.
1075 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
1076 (UINT32_C(0x2) << 1)
1077 /* Bad Format: BDs were not formatted correctly. */
1078 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
1079 (UINT32_C(0x3) << 1)
1080 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \
1081 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT
1082 /* This indicates that there was an error in the IP header checksum. */
1083 #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR UINT32_C(0x10)
1085 * This indicates that there was an error in the TCP, UDP or
1088 #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR UINT32_C(0x20)
1090 * This indicates that there was an error in the tunnel IP
1093 #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR UINT32_C(0x40)
1095 * This indicates that there was an error in the tunnel UDP
1098 #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR UINT32_C(0x80)
1100 * This indicates that there was a CRC error on either an FCoE
1101 * or RoCE packet. The itype indicates the packet type.
1103 #define RX_PKT_CMPL_ERRORS_CRC_ERROR UINT32_C(0x100)
1105 * This indicates that there was an error in the tunnel portion
1106 * of the packet when this field is non-zero.
1108 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK UINT32_C(0xe00)
1109 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT 9
1111 * No additional error occurred on the tunnel
1112 * portion of the packet of the packet does not
1115 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 9)
1117 * Indicates that IP header version does not
1118 * match expectation from L2 Ethertype for IPv4
1119 * and IPv6 in the tunnel header.
1121 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
1122 (UINT32_C(0x1) << 9)
1124 * Indicates that header length is out of range
1125 * in the tunnel header. Valid for IPv4.
1127 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
1128 (UINT32_C(0x2) << 9)
1130 * Indicates that the physical packet is shorter
1131 * than that claimed by the PPPoE header length
1132 * for a tunnel PPPoE packet.
1134 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
1135 (UINT32_C(0x3) << 9)
1137 * Indicates that physical packet is shorter
1138 * than that claimed by the tunnel l3 header
1139 * length. Valid for IPv4, or IPv6 tunnel packet
1142 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
1143 (UINT32_C(0x4) << 9)
1145 * Indicates that the physical packet is shorter
1146 * than that claimed by the tunnel UDP header
1147 * length for a tunnel UDP packet that is not
1150 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
1151 (UINT32_C(0x5) << 9)
1153 * indicates that the IPv4 TTL or IPv6 hop limit
1154 * check have failed (e.g. TTL = 0) in the
1155 * tunnel header. Valid for IPv4, and IPv6.
1157 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
1158 (UINT32_C(0x6) << 9)
1159 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \
1160 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
1162 * This indicates that there was an error in the inner portion
1163 * of the packet when this field is non-zero.
1165 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK UINT32_C(0xf000)
1166 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT 12
1168 * No additional error occurred on the tunnel
1169 * portion of the packet of the packet does not
1172 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 12)
1174 * Indicates that IP header version does not
1175 * match expectation from L2 Ethertype for IPv4
1176 * and IPv6 or that option other than VFT was
1177 * parsed on FCoE packet.
1179 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \
1180 (UINT32_C(0x1) << 12)
1182 * indicates that header length is out of range.
1183 * Valid for IPv4 and RoCE
1185 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
1186 (UINT32_C(0x2) << 12)
1188 * indicates that the IPv4 TTL or IPv6 hop limit
1189 * check have failed (e.g. TTL = 0). Valid for
1192 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL (UINT32_C(0x3) << 12)
1194 * Indicates that physical packet is shorter
1195 * than that claimed by the l3 header length.
1196 * Valid for IPv4, IPv6 packet or RoCE packets.
1198 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
1199 (UINT32_C(0x4) << 12)
1201 * Indicates that the physical packet is shorter
1202 * than that claimed by the UDP header length
1203 * for a UDP packet that is not fragmented.
1205 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
1206 (UINT32_C(0x5) << 12)
1208 * Indicates that TCP header length > IP
1209 * payload. Valid for TCP packets only.
1211 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
1212 (UINT32_C(0x6) << 12)
1213 /* Indicates that TCP header length < 5. Valid for TCP. */
1214 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
1215 (UINT32_C(0x7) << 12)
1217 * Indicates that TCP option headers result in a
1218 * TCP header size that does not match data
1219 * offset in TCP header. Valid for TCP.
1221 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
1222 (UINT32_C(0x8) << 12)
1223 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \
1224 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
1225 #define RX_PKT_CMPL_ERRORS_MASK UINT32_C(0xfffe)
1226 #define RX_PKT_CMPL_ERRORS_SFT 1
1229 * This field identifies the CFA action rule that was used for
1234 * This value holds the reordering sequence number for the
1235 * packet. If the reordering sequence is not valid, then this
1236 * value is zero. The reordering domain for the packet is in the
1237 * bottom 8 to 10b of the rss_hash value. The bottom 20b of this
1238 * value contain the ordering domain value for the packet.
1240 #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
1241 #define RX_PKT_CMPL_REORDER_SFT 0
1242 } __attribute__((packed));
1244 /* RX L2 TPA Start Completion Record (32 bytes split to 2 16-byte struct) */
1245 struct rx_tpa_start_cmpl {
1246 uint16_t flags_type;
1248 * This field indicates the exact type of the completion. By
1249 * convention, the LSB identifies the length of the record in
1250 * 16B units. Even values indicate 16B records. Odd values
1251 * indicate 32B records.
1253 #define RX_TPA_START_CMPL_TYPE_MASK UINT32_C(0x3f)
1254 #define RX_TPA_START_CMPL_TYPE_SFT 0
1256 * RX L2 TPA Start Completion: Completion at the
1257 * beginning of a TPA operation. Length = 32B
1259 #define RX_TPA_START_CMPL_TYPE_RX_TPA_START UINT32_C(0x13)
1260 /* This bit will always be '0' for TPA start completions. */
1261 #define RX_TPA_START_CMPL_FLAGS_ERROR UINT32_C(0x40)
1262 /* This field indicates how the packet was placed in the buffer. */
1263 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
1264 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT 7
1266 * Jumbo: TPA Packet was placed using jumbo
1267 * algorithm. This means that the first buffer
1268 * will be filled with data before moving to
1269 * aggregation buffers. Each aggregation buffer
1270 * will be filled before moving to the next
1271 * aggregation buffer.
1273 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
1275 * Header/Data Separation: Packet was placed
1276 * using Header/Data separation algorithm. The
1277 * separation location is indicated by the itype
1280 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
1282 * GRO/Jumbo: Packet will be placed using
1283 * GRO/Jumbo where the first packet is filled
1284 * with data. Subsequent packets will be placed
1285 * such that any one packet does not span two
1286 * aggregation buffers unless it starts at the
1287 * beginning of an aggregation buffer.
1289 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \
1290 (UINT32_C(0x5) << 7)
1292 * GRO/Header-Data Separation: Packet will be
1293 * placed using GRO/HDS where the header is in
1294 * the first packet. Payload of each packet will
1295 * be placed such that any one packet does not
1296 * span two aggregation buffers unless it starts
1297 * at the beginning of an aggregation buffer.
1299 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
1300 #define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \
1301 RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS
1302 /* This bit is '1' if the RSS field in this completion is valid. */
1303 #define RX_TPA_START_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
1305 #define RX_TPA_START_CMPL_FLAGS_UNUSED UINT32_C(0x800)
1307 * This value indicates what the inner packet determined for the
1310 #define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
1311 #define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT 12
1312 /* TCP Packet: Indicates that the packet was IP and TCP. */
1313 #define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
1314 #define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \
1315 RX_TPA_START_CMPL_FLAGS_ITYPE_TCP
1316 #define RX_TPA_START_CMPL_FLAGS_MASK UINT32_C(0xffc0)
1317 #define RX_TPA_START_CMPL_FLAGS_SFT 6
1320 * This value indicates the amount of packet data written to the
1321 * buffer the opaque field in this completion corresponds to.
1325 * This is a copy of the opaque field from the RX BD this
1326 * completion corresponds to.
1329 /* unused1 is 7 b */
1331 * This value is written by the NIC such that it will be
1332 * different for each pass through the completion queue. The
1333 * even passes will write 1. The odd passes will write 0.
1335 #define RX_TPA_START_CMPL_V1 UINT32_C(0x1)
1336 /* unused1 is 7 b */
1337 uint8_t rss_hash_type;
1339 * This is the RSS hash type for the packet. The value is packed
1340 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}
1341 * . The value of tuple_extrac_op provides the information about
1342 * what fields the hash was computed on. * 0: The RSS hash was
1343 * computed over source IP address, destination IP address,
1344 * source port, and destination port of inner IP and TCP or UDP
1345 * headers. Note: For non-tunneled packets, the packet headers
1346 * are considered inner packet headers for the RSS hash
1347 * computation purpose. * 1: The RSS hash was computed over
1348 * source IP address and destination IP address of inner IP
1349 * header. Note: For non-tunneled packets, the packet headers
1350 * are considered inner packet headers for the RSS hash
1351 * computation purpose. * 2: The RSS hash was computed over
1352 * source IP address, destination IP address, source port, and
1353 * destination port of IP and TCP or UDP headers of outer tunnel
1354 * headers. Note: For non-tunneled packets, this value is not
1355 * applicable. * 3: The RSS hash was computed over source IP
1356 * address and destination IP address of IP header of outer
1357 * tunnel headers. Note: For non-tunneled packets, this value is
1358 * not applicable. Note that 4-tuples values listed above are
1359 * applicable for layer 4 protocols supported and enabled for
1360 * RSS in the hardware, HWRM firmware, and drivers. For example,
1361 * if RSS hash is supported and enabled for TCP traffic only,
1362 * then the values of tuple_extract_op corresponding to 4-tuples
1363 * are only valid for TCP traffic.
1367 * This is the aggregation ID that the completion is associated
1368 * with. Use this number to correlate the TPA start completion
1369 * with the TPA end completion.
1371 /* unused2 is 9 b */
1373 * This is the aggregation ID that the completion is associated
1374 * with. Use this number to correlate the TPA start completion
1375 * with the TPA end completion.
1377 #define RX_TPA_START_CMPL_AGG_ID_MASK UINT32_C(0xfe00)
1378 #define RX_TPA_START_CMPL_AGG_ID_SFT 9
1381 * This value is the RSS hash value calculated for the packet
1382 * based on the mode bits and key value in the VNIC.
1384 } __attribute__((packed));
1386 /* last 16 bytes of RX L2 TPA Start Completion Record */
1387 struct rx_tpa_start_cmpl_hi {
1390 * This indicates that the ip checksum was calculated for the
1391 * inner packet and that the sum passed for all segments
1392 * included in the aggregation.
1394 #define RX_TPA_START_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1)
1396 * This indicates that the TCP, UDP or ICMP checksum was
1397 * calculated for the inner packet and that the sum passed for
1398 * all segments included in the aggregation.
1400 #define RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2)
1402 * This indicates that the ip checksum was calculated for the
1403 * tunnel header and that the sum passed for all segments
1404 * included in the aggregation.
1406 #define RX_TPA_START_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
1408 * This indicates that the UDP checksum was calculated for the
1409 * tunnel packet and that the sum passed for all segments
1410 * included in the aggregation.
1412 #define RX_TPA_START_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
1413 /* This value indicates what format the metadata field is. */
1414 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
1415 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_SFT 4
1416 /* No metadata informtaion. Value is zero. */
1417 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
1419 * The metadata field contains the VLAN tag and
1420 * TPID value. - metadata[11:0] contains the
1421 * vlan VID value. - metadata[12] contains the
1422 * vlan DE value. - metadata[15:13] contains the
1423 * vlan PRI value. - metadata[31:16] contains
1424 * the vlan TPID value.
1426 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
1427 #define RX_TPA_START_CMPL_FLAGS2_META_FORMAT_LAST \
1428 RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN
1430 * This field indicates the IP type for the inner-most IP
1431 * header. A value of '0' indicates IPv4. A value of '1'
1434 #define RX_TPA_START_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
1437 * This is data from the CFA block as indicated by the
1438 * meta_format field.
1440 /* When meta_format=1, this value is the VLAN VID. */
1441 #define RX_TPA_START_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
1442 #define RX_TPA_START_CMPL_METADATA_VID_SFT 0
1443 /* When meta_format=1, this value is the VLAN DE. */
1444 #define RX_TPA_START_CMPL_METADATA_DE UINT32_C(0x1000)
1445 /* When meta_format=1, this value is the VLAN PRI. */
1446 #define RX_TPA_START_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
1447 #define RX_TPA_START_CMPL_METADATA_PRI_SFT 13
1448 /* When meta_format=1, this value is the VLAN TPID. */
1449 #define RX_TPA_START_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
1450 #define RX_TPA_START_CMPL_METADATA_TPID_SFT 16
1452 /* unused4 is 15 b */
1454 * This value is written by the NIC such that it will be
1455 * different for each pass through the completion queue. The
1456 * even passes will write 1. The odd passes will write 0.
1458 #define RX_TPA_START_CMPL_V2 UINT32_C(0x1)
1459 /* unused4 is 15 b */
1462 * This field identifies the CFA action rule that was used for
1465 uint32_t inner_l4_size_inner_l3_offset_inner_l2_offset_outer_l3_offset;
1467 * This is the size in bytes of the inner most L4 header. This
1468 * can be subtracted from the payload_offset to determine the
1469 * start of the inner most L4 header.
1472 * This is the offset from the beginning of the packet in bytes
1473 * for the outer L3 header. If there is no outer L3 header, then
1474 * this value is zero.
1476 #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_MASK UINT32_C(0x1ff)
1477 #define RX_TPA_START_CMPL_OUTER_L3_OFFSET_SFT 0
1479 * This is the offset from the beginning of the packet in bytes
1480 * for the inner most L2 header.
1482 #define RX_TPA_START_CMPL_INNER_L2_OFFSET_MASK UINT32_C(0x3fe00)
1483 #define RX_TPA_START_CMPL_INNER_L2_OFFSET_SFT 9
1485 * This is the offset from the beginning of the packet in bytes
1486 * for the inner most L3 header.
1488 #define RX_TPA_START_CMPL_INNER_L3_OFFSET_MASK UINT32_C(0x7fc0000)
1489 #define RX_TPA_START_CMPL_INNER_L3_OFFSET_SFT 18
1491 * This is the size in bytes of the inner most L4 header. This
1492 * can be subtracted from the payload_offset to determine the
1493 * start of the inner most L4 header.
1495 #define RX_TPA_START_CMPL_INNER_L4_SIZE_MASK UINT32_C(0xf8000000)
1496 #define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT 27
1497 } __attribute__((packed));
1499 /* RX TPA End Completion Record (32 bytes split to 2 16-byte struct) */
1500 struct rx_tpa_end_cmpl {
1501 uint16_t flags_type;
1503 * This field indicates the exact type of the completion. By
1504 * convention, the LSB identifies the length of the record in
1505 * 16B units. Even values indicate 16B records. Odd values
1506 * indicate 32B records.
1508 #define RX_TPA_END_CMPL_TYPE_MASK UINT32_C(0x3f)
1509 #define RX_TPA_END_CMPL_TYPE_SFT 0
1511 * RX L2 TPA End Completion: Completion at the
1512 * end of a TPA operation. Length = 32B
1514 #define RX_TPA_END_CMPL_TYPE_RX_TPA_END UINT32_C(0x15)
1516 * When this bit is '1', it indicates a packet that has an error
1517 * of some type. Type of error is indicated in error_flags.
1519 #define RX_TPA_END_CMPL_FLAGS_ERROR UINT32_C(0x40)
1520 /* This field indicates how the packet was placed in the buffer. */
1521 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
1522 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT 7
1524 * Jumbo: TPA Packet was placed using jumbo
1525 * algorithm. This means that the first buffer
1526 * will be filled with data before moving to
1527 * aggregation buffers. Each aggregation buffer
1528 * will be filled before moving to the next
1529 * aggregation buffer.
1531 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
1533 * Header/Data Separation: Packet was placed
1534 * using Header/Data separation algorithm. The
1535 * separation location is indicated by the itype
1538 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
1540 * GRO/Jumbo: Packet will be placed using
1541 * GRO/Jumbo where the first packet is filled
1542 * with data. Subsequent packets will be placed
1543 * such that any one packet does not span two
1544 * aggregation buffers unless it starts at the
1545 * beginning of an aggregation buffer.
1547 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_JUMBO (UINT32_C(0x5) << 7)
1549 * GRO/Header-Data Separation: Packet will be
1550 * placed using GRO/HDS where the header is in
1551 * the first packet. Payload of each packet will
1552 * be placed such that any one packet does not
1553 * span two aggregation buffers unless it starts
1554 * at the beginning of an aggregation buffer.
1556 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS (UINT32_C(0x6) << 7)
1557 #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \
1558 RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS
1560 #define RX_TPA_END_CMPL_FLAGS_UNUSED_MASK UINT32_C(0xc00)
1561 #define RX_TPA_END_CMPL_FLAGS_UNUSED_SFT 10
1563 * This value indicates what the inner packet determined for the
1564 * packet was. - 2 TCP Packet Indicates that the packet was IP
1565 * and TCP. This indicates that the ip_cs field is valid and
1566 * that the tcp_udp_cs field is valid and contains the TCP
1567 * checksum. This also indicates that the payload_offset field
1570 #define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
1571 #define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT 12
1572 #define RX_TPA_END_CMPL_FLAGS_MASK UINT32_C(0xffc0)
1573 #define RX_TPA_END_CMPL_FLAGS_SFT 6
1576 * This value is zero for TPA End completions. There is no data
1577 * in the buffer that corresponds to the opaque value in this
1582 * This is a copy of the opaque field from the RX BD this
1583 * completion corresponds to.
1585 uint8_t agg_bufs_v1;
1586 /* unused1 is 1 b */
1588 * This value is written by the NIC such that it will be
1589 * different for each pass through the completion queue. The
1590 * even passes will write 1. The odd passes will write 0.
1592 #define RX_TPA_END_CMPL_V1 UINT32_C(0x1)
1594 * This value is the number of aggregation buffers that follow
1595 * this entry in the completion ring that are a part of this
1596 * aggregation packet. If the value is zero, then the packet is
1597 * completely contained in the buffer space provided in the
1598 * aggregation start completion.
1600 #define RX_TPA_END_CMPL_AGG_BUFS_MASK UINT32_C(0x7e)
1601 #define RX_TPA_END_CMPL_AGG_BUFS_SFT 1
1602 /* unused1 is 1 b */
1604 /* This value is the number of segments in the TPA operation. */
1605 uint8_t payload_offset;
1607 * This value indicates the offset in bytes from the beginning
1608 * of the packet where the inner payload starts. This value is
1609 * valid for TCP, UDP, FCoE, and RoCE packets. A value of zero
1610 * indicates an offset of 256 bytes.
1614 * This is the aggregation ID that the completion is associated
1615 * with. Use this number to correlate the TPA start completion
1616 * with the TPA end completion.
1618 /* unused2 is 1 b */
1620 * This is the aggregation ID that the completion is associated
1621 * with. Use this number to correlate the TPA start completion
1622 * with the TPA end completion.
1624 #define RX_TPA_END_CMPL_AGG_ID_MASK UINT32_C(0xfe)
1625 #define RX_TPA_END_CMPL_AGG_ID_SFT 1
1628 * For non-GRO packets, this value is the timestamp delta
1629 * between earliest and latest timestamp values for TPA packet.
1630 * If packets were not time stamped, then delta will be zero.
1631 * For GRO packets, this field is zero except for the following
1632 * sub-fields. - tsdelta[31] Timestamp present indication. When
1633 * '0', no Timestamp option is in the packet. When '1', then a
1634 * Timestamp option is present in the packet.
1636 } __attribute__((packed));
1638 /* last 16 bytes of RX TPA End Completion Record */
1639 struct rx_tpa_end_cmpl_hi {
1640 uint32_t tpa_dup_acks;
1641 /* unused3 is 28 b */
1643 * This value is the number of duplicate ACKs that have been
1644 * received as part of the TPA operation.
1646 #define RX_TPA_END_CMPL_TPA_DUP_ACKS_MASK UINT32_C(0xf)
1647 #define RX_TPA_END_CMPL_TPA_DUP_ACKS_SFT 0
1648 /* unused3 is 28 b */
1649 uint16_t tpa_seg_len;
1651 * This value is the valid when TPA completion is active. It
1652 * indicates the length of the longest segment of the TPA
1653 * operation for LRO mode and the length of the first segment in
1654 * GRO mode. This value may be used by GRO software to re-
1655 * construct the original packet stream from the TPA packet.
1656 * This is the length of all but the last segment for GRO. In
1657 * LRO mode this value may be used to indicate MSS size to the
1661 /* unused4 is 16 b */
1664 * This value is written by the NIC such that it will be
1665 * different for each pass through the completion queue. The
1666 * even passes will write 1. The odd passes will write 0.
1668 #define RX_TPA_END_CMPL_V2 UINT32_C(0x1)
1670 * This error indicates that there was some sort of problem with
1671 * the BDs for the packet that was found after part of the
1672 * packet was already placed. The packet should be treated as
1675 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
1676 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_SFT 1
1678 * This error occurs when there is a fatal HW
1679 * problem in the chip only. It indicates that
1680 * there were not BDs on chip but that there was
1681 * adequate reservation. provided by the TPA
1684 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
1685 (UINT32_C(0x2) << 1)
1687 * This error occurs when TPA block was not
1688 * configured to reserve adequate BDs for TPA
1689 * operations on this RX ring. All data for the
1690 * TPA operation was not placed. This error can
1691 * also be generated when the number of segments
1692 * is not programmed correctly in TPA and the 33
1693 * total aggregation buffers allowed for the TPA
1694 * operation has been exceeded.
1696 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR \
1697 (UINT32_C(0x4) << 1)
1698 #define RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_LAST \
1699 RX_TPA_END_CMPL_ERRORS_BUFFER_ERROR_RSV_ERROR
1700 #define RX_TPA_END_CMPL_ERRORS_MASK UINT32_C(0xfffe)
1701 #define RX_TPA_END_CMPL_ERRORS_SFT 1
1703 /* unused5 is 16 b */
1704 uint32_t start_opaque;
1706 * This is the opaque value that was completed for the TPA start
1707 * completion that corresponds to this TPA end completion.
1709 } __attribute__((packed));
1711 /* HWRM Forwarded Request (16 bytes) */
1712 struct hwrm_fwd_req_cmpl {
1713 uint16_t req_len_type;
1714 /* Length of forwarded request in bytes. */
1716 * This field indicates the exact type of the completion. By
1717 * convention, the LSB identifies the length of the record in
1718 * 16B units. Even values indicate 16B records. Odd values
1719 * indicate 32B records.
1721 #define HWRM_FWD_INPUT_CMPL_TYPE_MASK UINT32_C(0x3f)
1722 #define HWRM_FWD_INPUT_CMPL_TYPE_SFT 0
1723 /* Forwarded HWRM Request */
1724 #define HWRM_FWD_INPUT_CMPL_TYPE_HWRM_FWD_INPUT UINT32_C(0x22)
1725 /* Length of forwarded request in bytes. */
1726 #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK UINT32_C(0xffc0)
1727 #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT 6
1730 * Source ID of this request. Typically used in forwarding
1731 * requests and responses. 0x0 - 0xFFF8 - Used for function ids
1732 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF -
1736 /* unused1 is 32 b */
1737 uint32_t req_buf_addr_v[2];
1738 /* Address of forwarded request. */
1740 * This value is written by the NIC such that it will be
1741 * different for each pass through the completion queue. The
1742 * even passes will write 1. The odd passes will write 0.
1744 #define HWRM_FWD_INPUT_CMPL_V UINT32_C(0x1)
1745 /* Address of forwarded request. */
1746 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
1747 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
1748 } __attribute__((packed));
1750 /* HWRM Asynchronous Event Completion Record (16 bytes) */
1751 struct hwrm_async_event_cmpl {
1753 /* unused1 is 10 b */
1755 * This field indicates the exact type of the completion. By
1756 * convention, the LSB identifies the length of the record in
1757 * 16B units. Even values indicate 16B records. Odd values
1758 * indicate 32B records.
1760 #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK UINT32_C(0x3f)
1761 #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT 0
1762 /* HWRM Asynchronous Event Information */
1763 #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e)
1764 /* unused1 is 10 b */
1766 /* Identifiers of events. */
1767 /* Link status changed */
1768 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE UINT32_C(0x0)
1769 /* Link MTU changed */
1770 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE UINT32_C(0x1)
1771 /* Link speed changed */
1772 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE UINT32_C(0x2)
1773 /* DCB Configuration changed */
1774 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE UINT32_C(0x3)
1775 /* Port connection not allowed */
1776 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED UINT32_C(0x4)
1777 /* Link speed configuration was not allowed */
1778 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
1780 /* Link speed configuration change */
1781 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE UINT32_C(0x6)
1782 /* Port PHY configuration change */
1783 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE UINT32_C(0x7)
1784 /* Function driver unloaded */
1785 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD UINT32_C(0x10)
1786 /* Function driver loaded */
1787 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD UINT32_C(0x11)
1788 /* Function FLR related processing has completed */
1789 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT UINT32_C(0x12)
1790 /* PF driver unloaded */
1791 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD UINT32_C(0x20)
1792 /* PF driver loaded */
1793 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD UINT32_C(0x21)
1794 /* VF Function Level Reset (FLR) */
1795 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR UINT32_C(0x30)
1796 /* VF MAC Address Change */
1797 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE UINT32_C(0x31)
1798 /* PF-VF communication channel status change. */
1799 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
1801 /* VF Configuration Change */
1802 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE UINT32_C(0x33)
1804 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR UINT32_C(0xff)
1805 uint32_t event_data2;
1806 /* Event specific data */
1810 * This value is written by the NIC such that it will be
1811 * different for each pass through the completion queue. The
1812 * even passes will write 1. The odd passes will write 0.
1814 #define HWRM_ASYNC_EVENT_CMPL_V UINT32_C(0x1)
1816 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
1817 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
1818 uint8_t timestamp_lo;
1819 /* 8-lsb timestamp from POR (100-msec resolution) */
1820 uint16_t timestamp_hi;
1821 /* 16-lsb timestamp from POR (100-msec resolution) */
1822 uint32_t event_data1;
1823 /* Event specific data */
1824 } __attribute__((packed));
1828 * Description: This function is called by a driver to determine the HWRM
1829 * interface version supported by the HWRM firmware, the version of HWRM
1830 * firmware implementation, the name of HWRM firmware, the versions of other
1831 * embedded firmwares, and the names of other embedded firmwares, etc. Any
1832 * interface or firmware version with major = 0, minor = 0, and update = 0 shall
1833 * be considered an invalid version.
1835 /* Input (24 bytes) */
1836 struct hwrm_ver_get_input {
1839 * This value indicates what type of request this is. The format
1840 * for the rest of the command is determined by this field.
1844 * This value indicates the what completion ring the request
1845 * will be optionally completed on. If the value is -1, then no
1846 * CR completion will be generated. Any other value must be a
1847 * valid CR ring_id value for this function.
1850 /* This value indicates the command sequence number. */
1853 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
1854 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
1859 * This is the host address where the response will be written
1860 * when the request is complete. This area must be 16B aligned
1861 * and must be cleared to zero before the request is made.
1863 uint8_t hwrm_intf_maj;
1865 * This field represents the major version of HWRM interface
1866 * specification supported by the driver HWRM implementation.
1867 * The interface major version is intended to change only when
1868 * non backward compatible changes are made to the HWRM
1869 * interface specification.
1871 uint8_t hwrm_intf_min;
1873 * This field represents the minor version of HWRM interface
1874 * specification supported by the driver HWRM implementation. A
1875 * change in interface minor version is used to reflect
1876 * significant backward compatible modification to HWRM
1877 * interface specification. This can be due to addition or
1878 * removal of functionality. HWRM interface specifications with
1879 * the same major version but different minor versions are
1882 uint8_t hwrm_intf_upd;
1884 * This field represents the update version of HWRM interface
1885 * specification supported by the driver HWRM implementation.
1886 * The interface update version is used to reflect minor changes
1887 * or bug fixes to a released HWRM interface specification.
1889 uint8_t unused_0[5];
1890 } __attribute__((packed));
1892 /* Output (128 bytes) */
1893 struct hwrm_ver_get_output {
1894 uint16_t error_code;
1896 * Pass/Fail or error type Note: receiver to verify the in
1897 * parameters, and fail the call with an error when appropriate
1900 /* This field returns the type of original request. */
1902 /* This field provides original sequence number of the command. */
1905 * This field is the length of the response in bytes. The last
1906 * byte of the response is a valid flag that will read as '1'
1907 * when the command has been completely written to memory.
1909 uint8_t hwrm_intf_maj;
1911 * This field represents the major version of HWRM interface
1912 * specification supported by the HWRM implementation. The
1913 * interface major version is intended to change only when non
1914 * backward compatible changes are made to the HWRM interface
1915 * specification. A HWRM implementation that is compliant with
1916 * this specification shall provide value of 1 in this field.
1918 uint8_t hwrm_intf_min;
1920 * This field represents the minor version of HWRM interface
1921 * specification supported by the HWRM implementation. A change
1922 * in interface minor version is used to reflect significant
1923 * backward compatible modification to HWRM interface
1924 * specification. This can be due to addition or removal of
1925 * functionality. HWRM interface specifications with the same
1926 * major version but different minor versions are compatible. A
1927 * HWRM implementation that is compliant with this specification
1928 * shall provide value of 2 in this field.
1930 uint8_t hwrm_intf_upd;
1932 * This field represents the update version of HWRM interface
1933 * specification supported by the HWRM implementation. The
1934 * interface update version is used to reflect minor changes or
1935 * bug fixes to a released HWRM interface specification. A HWRM
1936 * implementation that is compliant with this specification
1937 * shall provide value of 2 in this field.
1939 uint8_t hwrm_intf_rsvd;
1940 uint8_t hwrm_fw_maj;
1942 * This field represents the major version of HWRM firmware. A
1943 * change in firmware major version represents a major firmware
1946 uint8_t hwrm_fw_min;
1948 * This field represents the minor version of HWRM firmware. A
1949 * change in firmware minor version represents significant
1950 * firmware functionality changes.
1952 uint8_t hwrm_fw_bld;
1954 * This field represents the build version of HWRM firmware. A
1955 * change in firmware build version represents bug fixes to a
1956 * released firmware.
1958 uint8_t hwrm_fw_rsvd;
1960 * This field is a reserved field. This field can be used to
1961 * represent firmware branches or customer specific releases
1962 * tied to a specific (major,minor,update) version of the HWRM
1965 uint8_t mgmt_fw_maj;
1967 * This field represents the major version of mgmt firmware. A
1968 * change in major version represents a major release.
1970 uint8_t mgmt_fw_min;
1972 * This field represents the minor version of mgmt firmware. A
1973 * change in minor version represents significant functionality
1976 uint8_t mgmt_fw_bld;
1978 * This field represents the build version of mgmt firmware. A
1979 * change in update version represents bug fixes.
1981 uint8_t mgmt_fw_rsvd;
1983 * This field is a reserved field. This field can be used to
1984 * represent firmware branches or customer specific releases
1985 * tied to a specific (major,minor,update) version
1987 uint8_t netctrl_fw_maj;
1989 * This field represents the major version of network control
1990 * firmware. A change in major version represents a major
1993 uint8_t netctrl_fw_min;
1995 * This field represents the minor version of network control
1996 * firmware. A change in minor version represents significant
1997 * functionality changes.
1999 uint8_t netctrl_fw_bld;
2001 * This field represents the build version of network control
2002 * firmware. A change in update version represents bug fixes.
2004 uint8_t netctrl_fw_rsvd;
2006 * This field is a reserved field. This field can be used to
2007 * represent firmware branches or customer specific releases
2008 * tied to a specific (major,minor,update) version
2010 uint32_t dev_caps_cfg;
2012 * This field is used to indicate device's capabilities and
2016 * If set to 1, then secure firmware update behavior is
2017 * supported. If set to 0, then secure firmware update behavior
2020 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_FW_UPD_SUPPORTED \
2023 * If set to 1, then firmware based DCBX agent is supported. If
2024 * set to 0, then firmware based DCBX agent capability is not
2025 * supported on this device.
2027 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_FW_DCBX_AGENT_SUPPORTED \
2030 * If set to 1, then HWRM short command format is supported. If
2031 * set to 0, then HWRM short command format is not supported.
2033 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED \
2036 * If set to 1, then HWRM short command format is required. If
2037 * set to 0, then HWRM short command format is not required.
2039 #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_INPUTUIRED \
2041 uint8_t roce_fw_maj;
2043 * This field represents the major version of RoCE firmware. A
2044 * change in major version represents a major release.
2046 uint8_t roce_fw_min;
2048 * This field represents the minor version of RoCE firmware. A
2049 * change in minor version represents significant functionality
2052 uint8_t roce_fw_bld;
2054 * This field represents the build version of RoCE firmware. A
2055 * change in update version represents bug fixes.
2057 uint8_t roce_fw_rsvd;
2059 * This field is a reserved field. This field can be used to
2060 * represent firmware branches or customer specific releases
2061 * tied to a specific (major,minor,update) version
2063 char hwrm_fw_name[16];
2065 * This field represents the name of HWRM FW (ASCII chars with
2068 char mgmt_fw_name[16];
2070 * This field represents the name of mgmt FW (ASCII chars with
2073 char netctrl_fw_name[16];
2075 * This field represents the name of network control firmware
2076 * (ASCII chars with NULL at the end).
2078 uint32_t reserved2[4];
2080 * This field is reserved for future use. The responder should
2081 * set it to 0. The requester should ignore this field.
2083 char roce_fw_name[16];
2085 * This field represents the name of RoCE FW (ASCII chars with
2089 /* This field returns the chip number. */
2091 /* This field returns the revision of chip. */
2093 /* This field returns the chip metal number. */
2094 uint8_t chip_bond_id;
2095 /* This field returns the bond id of the chip. */
2096 uint8_t chip_platform_type;
2098 * This value indicates the type of platform used for chip
2102 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC UINT32_C(0x0)
2103 /* FPGA platform of the chip. */
2104 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA UINT32_C(0x1)
2105 /* Palladium platform of the chip. */
2106 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM UINT32_C(0x2)
2107 uint16_t max_req_win_len;
2109 * This field returns the maximum value of request window that
2110 * is supported by the HWRM. The request window is mapped into
2111 * device address space using MMIO.
2113 uint16_t max_resp_len;
2114 /* This field returns the maximum value of response buffer in bytes. */
2115 uint16_t def_req_timeout;
2117 * This field returns the default request timeout value in
2125 * This field is used in Output records to indicate that the
2126 * output is completely written to RAM. This field should be
2127 * read as '1' to indicate that the output has been completely
2128 * written. When writing a command completion or response to an
2129 * internal processor, the order of writes has to be such that
2130 * this field is written last.
2132 } __attribute__((packed));
2134 /* hwrm_func_reset */
2136 * Description: This command resets a hardware function (PCIe function) and
2137 * frees any resources used by the function. This command shall be initiated by
2138 * the driver after an FLR has occurred to prepare the function for re-use. This
2139 * command may also be initiated by a driver prior to doing it's own
2140 * configuration. This command puts the function into the reset state. In the
2141 * reset state, global and port related features of the chip are not available.
2144 * Note: This command will reset a function that has already been disabled or
2145 * idled. The command returns all the resources owned by the function so a new
2146 * driver may allocate and configure resources normally.
2148 /* Input (24 bytes) */
2149 struct hwrm_func_reset_input {
2152 * This value indicates what type of request this is. The format
2153 * for the rest of the command is determined by this field.
2157 * This value indicates the what completion ring the request
2158 * will be optionally completed on. If the value is -1, then no
2159 * CR completion will be generated. Any other value must be a
2160 * valid CR ring_id value for this function.
2163 /* This value indicates the command sequence number. */
2166 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2167 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2172 * This is the host address where the response will be written
2173 * when the request is complete. This area must be 16B aligned
2174 * and must be cleared to zero before the request is made.
2177 /* This bit must be '1' for the vf_id_valid field to be configured. */
2178 #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1)
2181 * The ID of the VF that this PF is trying to reset. Only the
2182 * parent PF shall be allowed to reset a child VF. A parent PF
2183 * driver shall use this field only when a specific child VF is
2184 * requested to be reset.
2186 uint8_t func_reset_level;
2187 /* This value indicates the level of a function reset. */
2189 * Reset the caller function and its children
2190 * VFs (if any). If no children functions exist,
2191 * then reset the caller function only.
2193 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL UINT32_C(0x0)
2194 /* Reset the caller function only */
2195 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME UINT32_C(0x1)
2197 * Reset all children VFs of the caller function
2198 * driver if the caller is a PF driver. It is an
2199 * error to specify this level by a VF driver.
2200 * It is an error to specify this level by a PF
2201 * driver with no children VFs.
2203 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \
2206 * Reset a specific VF of the caller function
2207 * driver if the caller is the parent PF driver.
2208 * It is an error to specify this level by a VF
2209 * driver. It is an error to specify this level
2210 * by a PF driver that is not the parent of the
2211 * VF that is being requested to reset.
2213 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF UINT32_C(0x3)
2215 } __attribute__((packed));
2217 /* Output (16 bytes) */
2218 struct hwrm_func_reset_output {
2219 uint16_t error_code;
2221 * Pass/Fail or error type Note: receiver to verify the in
2222 * parameters, and fail the call with an error when appropriate
2225 /* This field returns the type of original request. */
2227 /* This field provides original sequence number of the command. */
2230 * This field is the length of the response in bytes. The last
2231 * byte of the response is a valid flag that will read as '1'
2232 * when the command has been completely written to memory.
2240 * This field is used in Output records to indicate that the
2241 * output is completely written to RAM. This field should be
2242 * read as '1' to indicate that the output has been completely
2243 * written. When writing a command completion or response to an
2244 * internal processor, the order of writes has to be such that
2245 * this field is written last.
2247 } __attribute__((packed));
2249 /* hwrm_func_qcaps */
2251 * Description: This command returns capabilities of a function. The input FID
2252 * value is used to indicate what function is being queried. This allows a
2253 * physical function driver to query virtual functions that are children of the
2254 * physical function. The output FID value is needed to configure Rings and
2255 * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
2257 /* Input (24 bytes) */
2258 struct hwrm_func_qcaps_input {
2261 * This value indicates what type of request this is. The format
2262 * for the rest of the command is determined by this field.
2266 * This value indicates the what completion ring the request
2267 * will be optionally completed on. If the value is -1, then no
2268 * CR completion will be generated. Any other value must be a
2269 * valid CR ring_id value for this function.
2272 /* This value indicates the command sequence number. */
2275 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2276 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2281 * This is the host address where the response will be written
2282 * when the request is complete. This area must be 16B aligned
2283 * and must be cleared to zero before the request is made.
2287 * Function ID of the function that is being queried. 0xFF...
2288 * (All Fs) if the query is for the requesting function.
2290 uint16_t unused_0[3];
2291 } __attribute__((packed));
2293 /* Output (80 bytes) */
2294 struct hwrm_func_qcaps_output {
2295 uint16_t error_code;
2297 * Pass/Fail or error type Note: receiver to verify the in
2298 * parameters, and fail the call with an error when appropriate
2301 /* This field returns the type of original request. */
2303 /* This field provides original sequence number of the command. */
2306 * This field is the length of the response in bytes. The last
2307 * byte of the response is a valid flag that will read as '1'
2308 * when the command has been completely written to memory.
2312 * FID value. This value is used to identify operations on the
2313 * PCI bus as belonging to a particular PCI function.
2317 * Port ID of port that this function is associated with. Valid
2318 * only for the PF. 0xFF... (All Fs) if this function is not
2319 * associated with any port. 0xFF... (All Fs) if this function
2320 * is called from a VF.
2323 /* If 1, then Push mode is supported on this function. */
2324 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
2326 * If 1, then the global MSI-X auto-masking is enabled for the
2329 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
2332 * If 1, then the Precision Time Protocol (PTP) processing is
2333 * supported on this function. The HWRM should enable PTP on
2334 * only a single Physical Function (PF) per port.
2336 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
2338 * If 1, then RDMA over Converged Ethernet (RoCE) v1 is
2339 * supported on this function.
2341 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED UINT32_C(0x8)
2343 * If 1, then RDMA over Converged Ethernet (RoCE) v2 is
2344 * supported on this function.
2346 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED UINT32_C(0x10)
2348 * If 1, then control and configuration of WoL magic packet are
2349 * supported on this function.
2351 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED \
2354 * If 1, then control and configuration of bitmap pattern packet
2355 * are supported on this function.
2357 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED UINT32_C(0x40)
2359 * If set to 1, then the control and configuration of rate limit
2360 * of an allocated TX ring on the queried function is supported.
2362 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED UINT32_C(0x80)
2364 * If 1, then control and configuration of minimum and maximum
2365 * bandwidths are supported on the queried function.
2367 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED UINT32_C(0x100)
2369 * If the query is for a VF, then this flag shall be ignored. If
2370 * this query is for a PF and this flag is set to 1, then the PF
2371 * has the capability to set the rate limits on the TX rings of
2372 * its children VFs. If this query is for a PF and this flag is
2373 * set to 0, then the PF does not have the capability to set the
2374 * rate limits on the TX rings of its children VFs.
2376 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED \
2379 * If the query is for a VF, then this flag shall be ignored. If
2380 * this query is for a PF and this flag is set to 1, then the PF
2381 * has the capability to set the minimum and/or maximum
2382 * bandwidths for its children VFs. If this query is for a PF
2383 * and this flag is set to 0, then the PF does not have the
2384 * capability to set the minimum or maximum bandwidths for its
2387 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED UINT32_C(0x400)
2389 * Standard TX Ring mode is used for the allocation of TX ring
2390 * and underlying scheduling resources that allow bandwidth
2391 * reservation and limit settings on the queried function. If
2392 * set to 1, then standard TX ring mode is supported on the
2393 * queried function. If set to 0, then standard TX ring mode is
2394 * not available on the queried function.
2396 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_STD_TX_RING_MODE_SUPPORTED \
2398 uint8_t mac_address[6];
2400 * This value is current MAC address configured for this
2401 * function. A value of 00-00-00-00-00-00 indicates no MAC
2402 * address is currently configured.
2404 uint16_t max_rsscos_ctx;
2406 * The maximum number of RSS/COS contexts that can be allocated
2409 uint16_t max_cmpl_rings;
2411 * The maximum number of completion rings that can be allocated
2414 uint16_t max_tx_rings;
2416 * The maximum number of transmit rings that can be allocated to
2419 uint16_t max_rx_rings;
2421 * The maximum number of receive rings that can be allocated to
2424 uint16_t max_l2_ctxs;
2426 * The maximum number of L2 contexts that can be allocated to
2431 * The maximum number of VNICs that can be allocated to the
2434 uint16_t first_vf_id;
2436 * The identifier for the first VF enabled on a PF. This is
2437 * valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if
2438 * this command is called on a PF with SR-IOV disabled or on a
2443 * The maximum number of VFs that can be allocated to the
2444 * function. This is valid only on the PF with SR-IOV enabled.
2445 * 0xFF... (All Fs) if this command is called on a PF with SR-
2446 * IOV disabled or on a VF.
2448 uint16_t max_stat_ctx;
2450 * The maximum number of statistic contexts that can be
2451 * allocated to the function.
2453 uint32_t max_encap_records;
2455 * The maximum number of Encapsulation records that can be
2456 * offloaded by this function.
2458 uint32_t max_decap_records;
2460 * The maximum number of decapsulation records that can be
2461 * offloaded by this function.
2463 uint32_t max_tx_em_flows;
2465 * The maximum number of Exact Match (EM) flows that can be
2466 * offloaded by this function on the TX side.
2468 uint32_t max_tx_wm_flows;
2470 * The maximum number of Wildcard Match (WM) flows that can be
2471 * offloaded by this function on the TX side.
2473 uint32_t max_rx_em_flows;
2475 * The maximum number of Exact Match (EM) flows that can be
2476 * offloaded by this function on the RX side.
2478 uint32_t max_rx_wm_flows;
2480 * The maximum number of Wildcard Match (WM) flows that can be
2481 * offloaded by this function on the RX side.
2483 uint32_t max_mcast_filters;
2485 * The maximum number of multicast filters that can be supported
2486 * by this function on the RX side.
2488 uint32_t max_flow_id;
2490 * The maximum value of flow_id that can be supported in
2491 * completion records.
2493 uint32_t max_hw_ring_grps;
2495 * The maximum number of HW ring groups that can be supported on
2498 uint16_t max_sp_tx_rings;
2500 * The maximum number of strict priority transmit rings that can
2501 * be allocated to the function. This number indicates the
2502 * maximum number of TX rings that can be assigned strict
2503 * priorities out of the maximum number of TX rings that can be
2504 * allocated (max_tx_rings) to the function.
2509 * This field is used in Output records to indicate that the
2510 * output is completely written to RAM. This field should be
2511 * read as '1' to indicate that the output has been completely
2512 * written. When writing a command completion or response to an
2513 * internal processor, the order of writes has to be such that
2514 * this field is written last.
2516 } __attribute__((packed));
2518 /* hwrm_func_qcfg */
2520 * Description: This command returns the current configuration of a function.
2521 * The input FID value is used to indicate what function is being queried. This
2522 * allows a physical function driver to query virtual functions that are
2523 * children of the physical function. The output FID value is needed to
2524 * configure Rings and MSI-X vectors so their DMA operations appear correctly on
2525 * the PCI bus. This command should be called by every driver after
2526 * 'hwrm_func_cfg' to get the actual number of resources allocated by the HWRM.
2527 * The values returned by hwrm_func_qcfg are the values the driver shall use.
2528 * These values may be different than what was originally requested in the
2529 * 'hwrm_func_cfg' command.
2531 /* Input (24 bytes) */
2532 struct hwrm_func_qcfg_input {
2535 * This value indicates what type of request this is. The format
2536 * for the rest of the command is determined by this field.
2540 * This value indicates the what completion ring the request
2541 * will be optionally completed on. If the value is -1, then no
2542 * CR completion will be generated. Any other value must be a
2543 * valid CR ring_id value for this function.
2546 /* This value indicates the command sequence number. */
2549 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2550 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2555 * This is the host address where the response will be written
2556 * when the request is complete. This area must be 16B aligned
2557 * and must be cleared to zero before the request is made.
2561 * Function ID of the function that is being queried. 0xFF...
2562 * (All Fs) if the query is for the requesting function.
2564 uint16_t unused_0[3];
2565 } __attribute__((packed));
2567 /* Output (72 bytes) */
2568 struct hwrm_func_qcfg_output {
2569 uint16_t error_code;
2571 * Pass/Fail or error type Note: receiver to verify the in
2572 * parameters, and fail the call with an error when appropriate
2575 /* This field returns the type of original request. */
2577 /* This field provides original sequence number of the command. */
2580 * This field is the length of the response in bytes. The last
2581 * byte of the response is a valid flag that will read as '1'
2582 * when the command has been completely written to memory.
2586 * FID value. This value is used to identify operations on the
2587 * PCI bus as belonging to a particular PCI function.
2591 * Port ID of port that this function is associated with.
2592 * 0xFF... (All Fs) if this function is not associated with any
2597 * This value is the current VLAN setting for this function. The
2598 * value of 0 for this field indicates no priority tagging or
2599 * VLAN is used. This field's format is same as 802.1Q Tag's Tag
2600 * Control Information (TCI) format that includes both Priority
2601 * Code Point (PCP) and VLAN Identifier (VID).
2605 * If 1, then magic packet based Out-Of-Box WoL is enabled on
2606 * the port associated with this function.
2608 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_MAGICPKT_ENABLED \
2611 * If 1, then bitmap pattern based Out-Of-Box WoL packet is
2612 * enabled on the port associated with this function.
2614 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_OOB_WOL_BMP_ENABLED UINT32_C(0x2)
2616 * If set to 1, then FW based DCBX agent is enabled and running
2617 * on the port associated with this function. If set to 0, then
2618 * DCBX agent is not running in the firmware.
2620 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_DCBX_AGENT_ENABLED \
2623 * Standard TX Ring mode is used for the allocation of TX ring
2624 * and underlying scheduling resources that allow bandwidth
2625 * reservation and limit settings on the queried function. If
2626 * set to 1, then standard TX ring mode is enabled on the
2627 * queried function. If set to 0, then the standard TX ring mode
2628 * is disabled on the queried function. In this extended TX ring
2629 * resource mode, the minimum and maximum bandwidth settings are
2630 * not supported to allow the allocation of TX rings to span
2631 * multiple scheduler nodes.
2633 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_STD_TX_RING_MODE_ENABLED \
2636 * If set to 1 then FW based LLDP agent is enabled and running
2637 * on the port associated with this function. If set to 0 then
2638 * the LLDP agent is not running in the firmware.
2640 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_FW_LLDP_AGENT_ENABLED UINT32_C(0x10)
2642 * If set to 1, then multi-host mode is active for this
2643 * function. If set to 0, then multi-host mode is inactive for
2644 * this function or not applicable for this device.
2646 #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST UINT32_C(0x20)
2647 uint8_t mac_address[6];
2649 * This value is current MAC address configured for this
2650 * function. A value of 00-00-00-00-00-00 indicates no MAC
2651 * address is currently configured.
2655 * This value is current PCI ID of this function. If ARI is
2656 * enabled, then it is Bus Number (8b):Function Number(8b).
2657 * Otherwise, it is Bus Number (8b):Device Number (4b):Function
2660 uint16_t alloc_rsscos_ctx;
2662 * The number of RSS/COS contexts currently allocated to the
2665 uint16_t alloc_cmpl_rings;
2667 * The number of completion rings currently allocated to the
2668 * function. This does not include the rings allocated to any
2669 * children functions if any.
2671 uint16_t alloc_tx_rings;
2673 * The number of transmit rings currently allocated to the
2674 * function. This does not include the rings allocated to any
2675 * children functions if any.
2677 uint16_t alloc_rx_rings;
2679 * The number of receive rings currently allocated to the
2680 * function. This does not include the rings allocated to any
2681 * children functions if any.
2683 uint16_t alloc_l2_ctx;
2684 /* The allocated number of L2 contexts to the function. */
2685 uint16_t alloc_vnics;
2686 /* The allocated number of vnics to the function. */
2689 * The maximum transmission unit of the function. For rings
2690 * allocated on this function, this default value is used if
2691 * ring MTU is not specified.
2695 * The maximum receive unit of the function. For vnics allocated
2696 * on this function, this default value is used if vnic MRU is
2699 uint16_t stat_ctx_id;
2700 /* The statistics context assigned to a function. */
2701 uint8_t port_partition_type;
2703 * The HWRM shall return Unknown value for this field when this
2704 * command is used to query VF's configuration.
2706 /* Single physical function */
2707 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF UINT32_C(0x0)
2708 /* Multiple physical functions */
2709 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS UINT32_C(0x1)
2710 /* Network Partitioning 1.0 */
2711 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 UINT32_C(0x2)
2712 /* Network Partitioning 1.5 */
2713 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 UINT32_C(0x3)
2714 /* Network Partitioning 2.0 */
2715 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 UINT32_C(0x4)
2717 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN UINT32_C(0xff)
2718 uint8_t port_pf_cnt;
2720 * This field will indicate number of physical functions on this
2721 * port_partition. HWRM shall return unavail (i.e. value of 0)
2722 * for this field when this command is used to query VF's
2723 * configuration or from older firmware that doesn't support
2726 /* number of PFs is not available */
2727 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PF_CNT_UNAVAIL UINT32_C(0x0)
2728 uint16_t dflt_vnic_id;
2729 /* The default VNIC ID assigned to a function that is being queried. */
2734 * Minimum BW allocated for this function. The HWRM will
2735 * translate this value into byte counter and time interval used
2736 * for the scheduler inside the device. A value of 0 indicates
2737 * the minimum bandwidth is not configured.
2739 /* The bandwidth value. */
2740 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
2741 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_SFT 0
2742 /* The granularity of the value (bits or bytes). */
2743 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE UINT32_C(0x10000000)
2744 /* Value is in bits. */
2745 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
2746 /* Value is in bytes. */
2747 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES \
2748 (UINT32_C(0x1) << 28)
2749 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_SCALE_LAST \
2750 FUNC_QCFG_OUTPUT_MIN_BW_SCALE_BYTES
2751 /* bw_value_unit is 3 b */
2752 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MASK \
2753 UINT32_C(0xe0000000)
2754 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_SFT 29
2755 /* Value is in Mb or MB (base 10). */
2756 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
2757 (UINT32_C(0x0) << 29)
2758 /* Value is in Kb or KB (base 10). */
2759 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_KILO \
2760 (UINT32_C(0x2) << 29)
2761 /* Value is in bits or bytes. */
2762 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_BASE \
2763 (UINT32_C(0x4) << 29)
2764 /* Value is in Gb or GB (base 10). */
2765 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
2766 (UINT32_C(0x6) << 29)
2767 /* Value is in 1/100th of a percentage of total bandwidth. */
2768 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
2769 (UINT32_C(0x1) << 29)
2771 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
2772 (UINT32_C(0x7) << 29)
2773 #define HWRM_FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_LAST \
2774 FUNC_QCFG_OUTPUT_MIN_BW_BW_VALUE_UNIT_INVALID
2777 * Maximum BW allocated for this function. The HWRM will
2778 * translate this value into byte counter and time interval used
2779 * for the scheduler inside the device. A value of 0 indicates
2780 * that the maximum bandwidth is not configured.
2782 /* The bandwidth value. */
2783 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
2784 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_SFT 0
2785 /* The granularity of the value (bits or bytes). */
2786 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE UINT32_C(0x10000000)
2787 /* Value is in bits. */
2788 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
2789 /* Value is in bytes. */
2790 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES \
2791 (UINT32_C(0x1) << 28)
2792 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_SCALE_LAST \
2793 FUNC_QCFG_OUTPUT_MAX_BW_SCALE_BYTES
2794 /* bw_value_unit is 3 b */
2795 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MASK \
2796 UINT32_C(0xe0000000)
2797 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
2798 /* Value is in Mb or MB (base 10). */
2799 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
2800 (UINT32_C(0x0) << 29)
2801 /* Value is in Kb or KB (base 10). */
2802 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_KILO \
2803 (UINT32_C(0x2) << 29)
2804 /* Value is in bits or bytes. */
2805 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_BASE \
2806 (UINT32_C(0x4) << 29)
2807 /* Value is in Gb or GB (base 10). */
2808 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
2809 (UINT32_C(0x6) << 29)
2810 /* Value is in 1/100th of a percentage of total bandwidth. */
2811 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
2812 (UINT32_C(0x1) << 29)
2814 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
2815 (UINT32_C(0x7) << 29)
2816 #define HWRM_FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_LAST \
2817 FUNC_QCFG_OUTPUT_MAX_BW_BW_VALUE_UNIT_INVALID
2820 * This value indicates the Edge virtual bridge mode for the
2821 * domain that this function belongs to.
2823 /* No Edge Virtual Bridging (EVB) */
2824 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
2825 /* Virtual Ethernet Bridge (VEB) */
2826 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB UINT32_C(0x1)
2827 /* Virtual Ethernet Port Aggregator (VEPA) */
2828 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA UINT32_C(0x2)
2832 * The number of VFs that are allocated to the function. This is
2833 * valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if
2834 * this command is called on a PF with SR-IOV disabled or on a
2837 uint32_t alloc_mcast_filters;
2839 * The number of allocated multicast filters for this function
2842 uint32_t alloc_hw_ring_grps;
2843 /* The number of allocated HW ring groups for this function. */
2844 uint16_t alloc_sp_tx_rings;
2846 * The number of strict priority transmit rings out of currently
2847 * allocated TX rings to the function (alloc_tx_rings).
2852 * This field is used in Output records to indicate that the
2853 * output is completely written to RAM. This field should be
2854 * read as '1' to indicate that the output has been completely
2855 * written. When writing a command completion or response to an
2856 * internal processor, the order of writes has to be such that
2857 * this field is written last.
2859 } __attribute__((packed));
2861 /* hwrm_func_vlan_qcfg */
2863 * Description: This command should be called by PF driver to get the current
2864 * C-TAG, S-TAG and correcponsing PCP and TPID values configured for the
2867 /* Input (24 bytes) */
2868 struct hwrm_func_vlan_qcfg_input {
2871 * This value indicates what type of request this is. The format
2872 * for the rest of the command is determined by this field.
2876 * This value indicates the what completion ring the request
2877 * will be optionally completed on. If the value is -1, then no
2878 * CR completion will be generated. Any other value must be a
2879 * valid CR ring_id value for this function.
2882 /* This value indicates the command sequence number. */
2885 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2886 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2891 * This is the host address where the response will be written
2892 * when the request is complete. This area must be 16B aligned
2893 * and must be cleared to zero before the request is made.
2897 * Function ID of the function that is being configured. If set
2898 * to 0xFF... (All Fs), then the configuration is for the
2899 * requesting function.
2901 uint16_t unused_0[3];
2904 /* Output (40 bytes) */
2905 struct hwrm_func_vlan_qcfg_output {
2906 uint16_t error_code;
2908 * Pass/Fail or error type Note: receiver to verify the in
2909 * parameters, and fail the call with an error when appropriate
2912 /* This field returns the type of original request. */
2914 /* This field provides original sequence number of the command. */
2917 * This field is the length of the response in bytes. The last
2918 * byte of the response is a valid flag that will read as '1'
2919 * when the command has been completely written to memory.
2927 * This field is used in Output records to indicate that the
2928 * output is completely written to RAM. This field should be
2929 * read as '1' to indicate that the output has been completely
2930 * written. When writing a command completion or response to an
2931 * internal processor, the order of writes has to be such that
2932 * this field is written last.
2935 /* S-TAG VLAN identifier configured for the function. */
2937 /* S-TAG PCP value configured for the function. */
2941 * S-TAG TPID value configured for the function. This field is
2942 * specified in network byte order.
2945 /* C-TAG VLAN identifier configured for the function. */
2947 /* C-TAG PCP value configured for the function. */
2951 * C-TAG TPID value configured for the function. This field is
2952 * specified in network byte order.
2961 /* hwrm_func_vlan_cfg */
2963 * Description: This command allows PF driver to configure C-TAG, S-TAG and
2964 * corresponding PCP and TPID values for a function.
2966 /* Input (48 bytes) */
2967 struct hwrm_func_vlan_cfg_input {
2970 * This value indicates what type of request this is. The format
2971 * for the rest of the command is determined by this field.
2975 * This value indicates the what completion ring the request
2976 * will be optionally completed on. If the value is -1, then no
2977 * CR completion will be generated. Any other value must be a
2978 * valid CR ring_id value for this function.
2981 /* This value indicates the command sequence number. */
2984 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
2985 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
2990 * This is the host address where the response will be written
2991 * when the request is complete. This area must be 16B aligned
2992 * and must be cleared to zero before the request is made.
2996 * Function ID of the function that is being configured. If set
2997 * to 0xFF... (All Fs), then the configuration is for the
2998 * requesting function.
3003 /* This bit must be '1' for the stag_vid field to be configured. */
3004 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_VID UINT32_C(0x1)
3005 /* This bit must be '1' for the ctag_vid field to be configured. */
3006 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_VID UINT32_C(0x2)
3007 /* This bit must be '1' for the stag_pcp field to be configured. */
3008 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_PCP UINT32_C(0x4)
3009 /* This bit must be '1' for the ctag_pcp field to be configured. */
3010 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_PCP UINT32_C(0x8)
3011 /* This bit must be '1' for the stag_tpid field to be configured. */
3012 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_STAG_TPID UINT32_C(0x10)
3013 /* This bit must be '1' for the ctag_tpid field to be configured. */
3014 #define HWRM_FUNC_VLAN_CFG_INPUT_ENABLES_CTAG_TPID UINT32_C(0x20)
3016 /* S-TAG VLAN identifier configured for the function. */
3018 /* S-TAG PCP value configured for the function. */
3022 * S-TAG TPID value configured for the function. This field is
3023 * specified in network byte order.
3026 /* C-TAG VLAN identifier configured for the function. */
3028 /* C-TAG PCP value configured for the function. */
3032 * C-TAG TPID value configured for the function. This field is
3033 * specified in network byte order.
3042 /* Output (16 bytes) */
3043 struct hwrm_func_vlan_cfg_output {
3044 uint16_t error_code;
3046 * Pass/Fail or error type Note: receiver to verify the in
3047 * parameters, and fail the call with an error when appropriate
3050 /* This field returns the type of original request. */
3052 /* This field provides original sequence number of the command. */
3055 * This field is the length of the response in bytes. The last
3056 * byte of the response is a valid flag that will read as '1'
3057 * when the command has been completely written to memory.
3065 * This field is used in Output records to indicate that the
3066 * output is completely written to RAM. This field should be
3067 * read as '1' to indicate that the output has been completely
3068 * written. When writing a command completion or response to an
3069 * internal processor, the order of writes has to be such that
3070 * this field is written last.
3076 * Description: This command allows configuration of a PF by the corresponding
3077 * PF driver. This command also allows configuration of a child VF by its parent
3078 * PF driver. The input FID value is used to indicate what function is being
3079 * configured. This allows a PF driver to configure the PF owned by itself or a
3080 * virtual function that is a child of the PF. This command allows to reserve
3081 * resources for a VF by its parent PF. To reverse the process, the command
3082 * should be called with all enables flags cleared for resources. This will free
3083 * allocated resources for the VF and return them to the resource pool. If this
3084 * command is requested by a VF driver to configure or reserve resources, then
3085 * the HWRM shall fail this command. If default MAC address and/or VLAN are
3086 * provided in this command, then the HWRM shall set up appropriate MAC/VLAN
3087 * filters for the function that is being configured. If source properties
3088 * checks are enabled and default MAC address and/or IP address are provided in
3089 * this command, then the HWRM shall set appropriate source property checks
3090 * based on provided MAC and/or IP addresses. The parent PF driver should not
3091 * set MTU/MRU for a VF using this command. This is to allow MTU/MRU setting by
3092 * the VF driver. If the MTU or MRU for a VF is set by the PF driver, then the
3093 * HWRM should ignore it. A function's MTU/MRU should be set prior to allocating
3094 * RX VNICs or TX rings. A PF driver calls hwrm_func_cfg to allocate resources
3095 * for itself or its children VFs. All function drivers shall call hwrm_func_cfg
3096 * to reserve resources. A request to hwrm_func_cfg may not be fully granted;
3097 * that is, a request for resources may be larger than what can be supported by
3098 * the device and the HWRM will allocate the best set of resources available,
3099 * but that may be less than requested. If all the amounts requested could not
3100 * be fulfilled, the HWRM shall allocate what it could and return a status code
3101 * of success. A function driver should call hwrm_func_qcfg immediately after
3102 * hwrm_func_cfg to determine what resources were assigned to the configured
3103 * function. A call by a PF driver to hwrm_func_cfg to allocate resources for
3104 * itself shall only allocate resources for the PF driver to use, not for its
3105 * children VFs. Likewise, a call to hwrm_func_qcfg shall return the resources
3106 * available for the PF driver to use, not what is available to its children
3109 /* Input (88 bytes) */
3110 struct hwrm_func_cfg_input {
3113 * This value indicates what type of request this is. The format
3114 * for the rest of the command is determined by this field.
3118 * This value indicates the what completion ring the request
3119 * will be optionally completed on. If the value is -1, then no
3120 * CR completion will be generated. Any other value must be a
3121 * valid CR ring_id value for this function.
3124 /* This value indicates the command sequence number. */
3127 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3128 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3133 * This is the host address where the response will be written
3134 * when the request is complete. This area must be 16B aligned
3135 * and must be cleared to zero before the request is made.
3139 * Function ID of the function that is being configured. If set
3140 * to 0xFF... (All Fs), then the the configuration is for the
3141 * requesting function.
3147 * When this bit is '1', the function is disabled with source
3148 * MAC address check. This is an anti-spoofing check. If this
3149 * flag is set, then the function shall be configured to
3150 * disallow transmission of frames with the source MAC address
3151 * that is configured for this function.
3153 #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE \
3156 * When this bit is '1', the function is enabled with source MAC
3157 * address check. This is an anti-spoofing check. If this flag
3158 * is set, then the function shall be configured to allow
3159 * transmission of frames with the source MAC address that is
3160 * configured for this function.
3162 #define HWRM_FUNC_CFG_INPUT_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE \
3165 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_MASK UINT32_C(0x1fc)
3166 #define HWRM_FUNC_CFG_INPUT_FLAGS_RSVD_SFT 2
3168 * Standard TX Ring mode is used for the allocation of TX ring
3169 * and underlying scheduling resources that allow bandwidth
3170 * reservation and limit settings on the queried function. If
3171 * set to 1, then standard TX ring mode is requested to be
3172 * enabled on the function being configured.
3174 #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_ENABLE \
3177 * Standard TX Ring mode is used for the allocation of TX ring
3178 * and underlying scheduling resources that allow bandwidth
3179 * reservation and limit settings on the queried function. If
3180 * set to 1, then the standard TX ring mode is requested to be
3181 * disabled on the function being configured. In this extended
3182 * TX ring resource mode, the minimum and maximum bandwidth
3183 * settings are not supported to allow the allocation of TX
3184 * rings to span multiple scheduler nodes.
3186 #define HWRM_FUNC_CFG_INPUT_FLAGS_STD_TX_RING_MODE_DISABLE \
3189 * If this bit is set, virtual mac address configured in this
3190 * command will be persistent over warm boot.
3192 #define HWRM_FUNC_CFG_INPUT_FLAGS_VIRT_MAC_PERSIST UINT32_C(0x800)
3194 * This bit only applies to the VF. If this bit is set, the
3195 * statistic context counters will not be cleared when the
3196 * statistic context is freed or a function reset is called on
3197 * VF. This bit will be cleared when the PF is unloaded or a
3198 * function reset is called on the PF.
3200 #define HWRM_FUNC_CFG_INPUT_FLAGS_NO_AUTOCLEAR_STATISTIC \
3203 /* This bit must be '1' for the mtu field to be configured. */
3204 #define HWRM_FUNC_CFG_INPUT_ENABLES_MTU UINT32_C(0x1)
3205 /* This bit must be '1' for the mru field to be configured. */
3206 #define HWRM_FUNC_CFG_INPUT_ENABLES_MRU UINT32_C(0x2)
3208 * This bit must be '1' for the num_rsscos_ctxs field to be
3211 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS UINT32_C(0x4)
3213 * This bit must be '1' for the num_cmpl_rings field to be
3216 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_CMPL_RINGS UINT32_C(0x8)
3217 /* This bit must be '1' for the num_tx_rings field to be configured. */
3218 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_TX_RINGS UINT32_C(0x10)
3219 /* This bit must be '1' for the num_rx_rings field to be configured. */
3220 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_RX_RINGS UINT32_C(0x20)
3221 /* This bit must be '1' for the num_l2_ctxs field to be configured. */
3222 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_L2_CTXS UINT32_C(0x40)
3223 /* This bit must be '1' for the num_vnics field to be configured. */
3224 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS UINT32_C(0x80)
3226 * This bit must be '1' for the num_stat_ctxs field to be
3229 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_STAT_CTXS UINT32_C(0x100)
3231 * This bit must be '1' for the dflt_mac_addr field to be
3234 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR UINT32_C(0x200)
3235 /* This bit must be '1' for the dflt_vlan field to be configured. */
3236 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_VLAN UINT32_C(0x400)
3237 /* This bit must be '1' for the dflt_ip_addr field to be configured. */
3238 #define HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_IP_ADDR UINT32_C(0x800)
3239 /* This bit must be '1' for the min_bw field to be configured. */
3240 #define HWRM_FUNC_CFG_INPUT_ENABLES_MIN_BW UINT32_C(0x1000)
3241 /* This bit must be '1' for the max_bw field to be configured. */
3242 #define HWRM_FUNC_CFG_INPUT_ENABLES_MAX_BW UINT32_C(0x2000)
3244 * This bit must be '1' for the async_event_cr field to be
3247 #define HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR UINT32_C(0x4000)
3249 * This bit must be '1' for the vlan_antispoof_mode field to be
3252 #define HWRM_FUNC_CFG_INPUT_ENABLES_VLAN_ANTISPOOF_MODE UINT32_C(0x8000)
3254 * This bit must be '1' for the allowed_vlan_pris field to be
3257 #define HWRM_FUNC_CFG_INPUT_ENABLES_ALLOWED_VLAN_PRIS UINT32_C(0x10000)
3258 /* This bit must be '1' for the evb_mode field to be configured. */
3259 #define HWRM_FUNC_CFG_INPUT_ENABLES_EVB_MODE UINT32_C(0x20000)
3261 * This bit must be '1' for the num_mcast_filters field to be
3264 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_MCAST_FILTERS UINT32_C(0x40000)
3266 * This bit must be '1' for the num_hw_ring_grps field to be
3269 #define HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS UINT32_C(0x80000)
3272 * The maximum transmission unit of the function. The HWRM
3273 * should make sure that the mtu of the function does not exceed
3274 * the mtu of the physical port that this function is associated
3275 * with. In addition to configuring mtu per function, it is
3276 * possible to configure mtu per transmit ring. By default, the
3277 * mtu of each transmit ring associated with a function is equal
3278 * to the mtu of the function. The HWRM should make sure that
3279 * the mtu of each transmit ring that is assigned to a function
3284 * The maximum receive unit of the function. The HWRM should
3285 * make sure that the mru of the function does not exceed the
3286 * mru of the physical port that this function is associated
3287 * with. In addition to configuring mru per function, it is
3288 * possible to configure mru per vnic. By default, the mru of
3289 * each vnic associated with a function is equal to the mru of
3290 * the function. The HWRM should make sure that the mru of each
3291 * vnic that is assigned to a function has a valid mru.
3293 uint16_t num_rsscos_ctxs;
3294 /* The number of RSS/COS contexts requested for the function. */
3295 uint16_t num_cmpl_rings;
3297 * The number of completion rings requested for the function.
3298 * This does not include the rings allocated to any children
3301 uint16_t num_tx_rings;
3303 * The number of transmit rings requested for the function. This
3304 * does not include the rings allocated to any children
3307 uint16_t num_rx_rings;
3309 * The number of receive rings requested for the function. This
3310 * does not include the rings allocated to any children
3313 uint16_t num_l2_ctxs;
3314 /* The requested number of L2 contexts for the function. */
3316 /* The requested number of vnics for the function. */
3317 uint16_t num_stat_ctxs;
3318 /* The requested number of statistic contexts for the function. */
3319 uint16_t num_hw_ring_grps;
3321 * The number of HW ring groups that should be reserved for this
3324 uint8_t dflt_mac_addr[6];
3325 /* The default MAC address for the function being configured. */
3328 * The default VLAN for the function being configured. This
3329 * field's format is same as 802.1Q Tag's Tag Control
3330 * Information (TCI) format that includes both Priority Code
3331 * Point (PCP) and VLAN Identifier (VID).
3333 uint32_t dflt_ip_addr[4];
3335 * The default IP address for the function being configured.
3336 * This address is only used in enabling source property check.
3340 * Minimum BW allocated for this function. The HWRM will
3341 * translate this value into byte counter and time interval used
3342 * for the scheduler inside the device.
3344 /* The bandwidth value. */
3345 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
3346 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_SFT 0
3347 /* The granularity of the value (bits or bytes). */
3348 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE UINT32_C(0x10000000)
3349 /* Value is in bits. */
3350 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BITS (UINT32_C(0x0) << 28)
3351 /* Value is in bytes. */
3352 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
3353 #define HWRM_FUNC_CFG_INPUT_MIN_BW_SCALE_LAST \
3354 FUNC_CFG_INPUT_MIN_BW_SCALE_BYTES
3355 /* bw_value_unit is 3 b */
3356 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MASK \
3357 UINT32_C(0xe0000000)
3358 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_SFT 29
3359 /* Value is in Mb or MB (base 10). */
3360 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_MEGA \
3361 (UINT32_C(0x0) << 29)
3362 /* Value is in Kb or KB (base 10). */
3363 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_KILO \
3364 (UINT32_C(0x2) << 29)
3365 /* Value is in bits or bytes. */
3366 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_BASE \
3367 (UINT32_C(0x4) << 29)
3368 /* Value is in Gb or GB (base 10). */
3369 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_GIGA \
3370 (UINT32_C(0x6) << 29)
3371 /* Value is in 1/100th of a percentage of total bandwidth. */
3372 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_PERCENT1_100 \
3373 (UINT32_C(0x1) << 29)
3375 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID \
3376 (UINT32_C(0x7) << 29)
3377 #define HWRM_FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_LAST \
3378 FUNC_CFG_INPUT_MIN_BW_BW_VALUE_UNIT_INVALID
3381 * Maximum BW allocated for this function. The HWRM will
3382 * translate this value into byte counter and time interval used
3383 * for the scheduler inside the device.
3385 /* The bandwidth value. */
3386 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_MASK \
3388 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_SFT 0
3389 /* The granularity of the value (bits or bytes). */
3390 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE UINT32_C(0x10000000)
3391 /* Value is in bits. */
3392 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
3393 /* Value is in bytes. */
3394 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
3395 #define HWRM_FUNC_CFG_INPUT_MAX_BW_SCALE_LAST \
3396 FUNC_CFG_INPUT_MAX_BW_SCALE_BYTES
3397 /* bw_value_unit is 3 b */
3398 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
3399 UINT32_C(0xe0000000)
3400 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
3401 /* Value is in Mb or MB (base 10). */
3402 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
3403 (UINT32_C(0x0) << 29)
3404 /* Value is in Kb or KB (base 10). */
3405 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
3406 (UINT32_C(0x2) << 29)
3407 /* Value is in bits or bytes. */
3408 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
3409 (UINT32_C(0x4) << 29)
3410 /* Value is in Gb or GB (base 10). */
3411 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
3412 (UINT32_C(0x6) << 29)
3413 /* Value is in 1/100th of a percentage of total bandwidth. */
3414 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
3415 (UINT32_C(0x1) << 29)
3417 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
3418 (UINT32_C(0x7) << 29)
3419 #define HWRM_FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
3420 FUNC_CFG_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
3421 uint16_t async_event_cr;
3423 * ID of the target completion ring for receiving asynchronous
3424 * event completions. If this field is not valid, then the HWRM
3425 * shall use the default completion ring of the function that is
3426 * being configured as the target completion ring for providing
3427 * any asynchronous event completions for that function. If this
3428 * field is valid, then the HWRM shall use the completion ring
3429 * identified by this ID as the target completion ring for
3430 * providing any asynchronous event completions for the function
3431 * that is being configured.
3433 uint8_t vlan_antispoof_mode;
3434 /* VLAN Anti-spoofing mode. */
3435 /* No VLAN anti-spoofing checks are enabled */
3436 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_NOCHECK UINT32_C(0x0)
3437 /* Validate VLAN against the configured VLAN(s) */
3438 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN \
3440 /* Insert VLAN if it does not exist, otherwise discard */
3441 #define HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE \
3444 * Insert VLAN if it does not exist, override
3448 HWRM_FUNC_CFG_INPUT_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN \
3450 uint8_t allowed_vlan_pris;
3452 * This bit field defines VLAN PRIs that are allowed on this
3453 * function. If nth bit is set, then VLAN PRI n is allowed on
3458 * The HWRM shall allow a PF driver to change EVB mode for the
3459 * partition it belongs to. The HWRM shall not allow a VF driver
3460 * to change the EVB mode. The HWRM shall take into account the
3461 * switching of EVB mode from one to another and reconfigure
3462 * hardware resources as appropriately. The switching from VEB
3463 * to VEPA mode requires the disabling of the loopback traffic.
3464 * Additionally, source knock outs are handled differently in
3465 * VEB and VEPA modes.
3467 /* No Edge Virtual Bridging (EVB) */
3468 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_NO_EVB UINT32_C(0x0)
3469 /* Virtual Ethernet Bridge (VEB) */
3470 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEB UINT32_C(0x1)
3471 /* Virtual Ethernet Port Aggregator (VEPA) */
3472 #define HWRM_FUNC_CFG_INPUT_EVB_MODE_VEPA UINT32_C(0x2)
3474 uint16_t num_mcast_filters;
3476 * The number of multicast filters that should be reserved for
3477 * this function on the RX side.
3479 } __attribute__((packed));
3481 /* Output (16 bytes) */
3482 struct hwrm_func_cfg_output {
3483 uint16_t error_code;
3485 * Pass/Fail or error type Note: receiver to verify the in
3486 * parameters, and fail the call with an error when appropriate
3489 /* This field returns the type of original request. */
3491 /* This field provides original sequence number of the command. */
3494 * This field is the length of the response in bytes. The last
3495 * byte of the response is a valid flag that will read as '1'
3496 * when the command has been completely written to memory.
3504 * This field is used in Output records to indicate that the
3505 * output is completely written to RAM. This field should be
3506 * read as '1' to indicate that the output has been completely
3507 * written. When writing a command completion or response to an
3508 * internal processor, the order of writes has to be such that
3509 * this field is written last.
3511 } __attribute__((packed));
3513 /* hwrm_func_qstats */
3515 * Description: This command returns statistics of a function. The input FID
3516 * value is used to indicate what function is being queried. This allows a
3517 * physical function driver to query virtual functions that are children of the
3518 * physical function. The HWRM shall return any unsupported counter with a value
3519 * of 0xFFFFFFFF for 32-bit counters and 0xFFFFFFFFFFFFFFFF for 64-bit counters.
3521 /* Input (24 bytes) */
3522 struct hwrm_func_qstats_input {
3525 * This value indicates what type of request this is. The format
3526 * for the rest of the command is determined by this field.
3530 * This value indicates the what completion ring the request
3531 * will be optionally completed on. If the value is -1, then no
3532 * CR completion will be generated. Any other value must be a
3533 * valid CR ring_id value for this function.
3536 /* This value indicates the command sequence number. */
3539 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3540 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3545 * This is the host address where the response will be written
3546 * when the request is complete. This area must be 16B aligned
3547 * and must be cleared to zero before the request is made.
3551 * Function ID of the function that is being queried. 0xFF...
3552 * (All Fs) if the query is for the requesting function.
3554 uint16_t unused_0[3];
3555 } __attribute__((packed));
3557 /* Output (176 bytes) */
3558 struct hwrm_func_qstats_output {
3559 uint16_t error_code;
3561 * Pass/Fail or error type Note: receiver to verify the in
3562 * parameters, and fail the call with an error when appropriate
3565 /* This field returns the type of original request. */
3567 /* This field provides original sequence number of the command. */
3570 * This field is the length of the response in bytes. The last
3571 * byte of the response is a valid flag that will read as '1'
3572 * when the command has been completely written to memory.
3574 uint64_t tx_ucast_pkts;
3575 /* Number of transmitted unicast packets on the function. */
3576 uint64_t tx_mcast_pkts;
3577 /* Number of transmitted multicast packets on the function. */
3578 uint64_t tx_bcast_pkts;
3579 /* Number of transmitted broadcast packets on the function. */
3580 uint64_t tx_err_pkts;
3582 * Number of transmitted packets that were discarded due to
3583 * internal NIC resource problems. For transmit, this can only
3584 * happen if TMP is configured to allow dropping in HOL blocking
3585 * conditions, which is not a normal configuration.
3587 uint64_t tx_drop_pkts;
3589 * Number of dropped packets on transmit path on the function.
3590 * These are packets that have been marked for drop by the TE
3591 * CFA block or are packets that exceeded the transmit MTU limit
3594 uint64_t tx_ucast_bytes;
3595 /* Number of transmitted bytes for unicast traffic on the function. */
3596 uint64_t tx_mcast_bytes;
3598 * Number of transmitted bytes for multicast traffic on the
3601 uint64_t tx_bcast_bytes;
3603 * Number of transmitted bytes for broadcast traffic on the
3606 uint64_t rx_ucast_pkts;
3607 /* Number of received unicast packets on the function. */
3608 uint64_t rx_mcast_pkts;
3609 /* Number of received multicast packets on the function. */
3610 uint64_t rx_bcast_pkts;
3611 /* Number of received broadcast packets on the function. */
3612 uint64_t rx_err_pkts;
3614 * Number of received packets that were discarded on the
3615 * function due to resource limitations. This can happen for 3
3616 * reasons. # The BD used for the packet has a bad format. #
3617 * There were no BDs available in the ring for the packet. #
3618 * There were no BDs available on-chip for the packet.
3620 uint64_t rx_drop_pkts;
3622 * Number of dropped packets on received path on the function.
3623 * These are packets that have been marked for drop by the RE
3626 uint64_t rx_ucast_bytes;
3627 /* Number of received bytes for unicast traffic on the function. */
3628 uint64_t rx_mcast_bytes;
3629 /* Number of received bytes for multicast traffic on the function. */
3630 uint64_t rx_bcast_bytes;
3631 /* Number of received bytes for broadcast traffic on the function. */
3632 uint64_t rx_agg_pkts;
3633 /* Number of aggregated unicast packets on the function. */
3634 uint64_t rx_agg_bytes;
3635 /* Number of aggregated unicast bytes on the function. */
3636 uint64_t rx_agg_events;
3637 /* Number of aggregation events on the function. */
3638 uint64_t rx_agg_aborts;
3639 /* Number of aborted aggregations on the function. */
3646 * This field is used in Output records to indicate that the
3647 * output is completely written to RAM. This field should be
3648 * read as '1' to indicate that the output has been completely
3649 * written. When writing a command completion or response to an
3650 * internal processor, the order of writes has to be such that
3651 * this field is written last.
3653 } __attribute__((packed));
3655 /* hwrm_func_clr_stats */
3657 * Description: This command clears statistics of a function. The input FID
3658 * value is used to indicate what function's statistics is being cleared. This
3659 * allows a physical function driver to clear statistics of virtual functions
3660 * that are children of the physical function.
3662 /* Input (24 bytes) */
3663 struct hwrm_func_clr_stats_input {
3666 * This value indicates what type of request this is. The format
3667 * for the rest of the command is determined by this field.
3671 * This value indicates the what completion ring the request
3672 * will be optionally completed on. If the value is -1, then no
3673 * CR completion will be generated. Any other value must be a
3674 * valid CR ring_id value for this function.
3677 /* This value indicates the command sequence number. */
3680 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3681 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3686 * This is the host address where the response will be written
3687 * when the request is complete. This area must be 16B aligned
3688 * and must be cleared to zero before the request is made.
3692 * Function ID of the function. 0xFF... (All Fs) if the query is
3693 * for the requesting function.
3695 uint16_t unused_0[3];
3696 } __attribute__((packed));
3698 /* Output (16 bytes) */
3699 struct hwrm_func_clr_stats_output {
3700 uint16_t error_code;
3702 * Pass/Fail or error type Note: receiver to verify the in
3703 * parameters, and fail the call with an error when appropriate
3706 /* This field returns the type of original request. */
3708 /* This field provides original sequence number of the command. */
3711 * This field is the length of the response in bytes. The last
3712 * byte of the response is a valid flag that will read as '1'
3713 * when the command has been completely written to memory.
3721 * This field is used in Output records to indicate that the
3722 * output is completely written to RAM. This field should be
3723 * read as '1' to indicate that the output has been completely
3724 * written. When writing a command completion or response to an
3725 * internal processor, the order of writes has to be such that
3726 * this field is written last.
3728 } __attribute__((packed));
3730 /* hwrm_func_vf_vnic_ids_query */
3731 /* Description: This command is used to query vf vnic ids. */
3732 /* Input (32 bytes) */
3733 struct hwrm_func_vf_vnic_ids_query_input {
3736 * This value indicates what type of request this is. The format
3737 * for the rest of the command is determined by this field.
3741 * This value indicates the what completion ring the request
3742 * will be optionally completed on. If the value is -1, then no
3743 * CR completion will be generated. Any other value must be a
3744 * valid CR ring_id value for this function.
3747 /* This value indicates the command sequence number. */
3750 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3751 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3756 * This is the host address where the response will be written
3757 * when the request is complete. This area must be 16B aligned
3758 * and must be cleared to zero before the request is made.
3762 * This value is used to identify a Virtual Function (VF). The
3763 * scope of VF ID is local within a PF.
3767 uint32_t max_vnic_id_cnt;
3768 /* Max number of vnic ids in vnic id table */
3769 uint64_t vnic_id_tbl_addr;
3770 /* This is the address for VF VNIC ID table */
3771 } __attribute__((packed));
3773 /* Output (16 bytes) */
3774 struct hwrm_func_vf_vnic_ids_query_output {
3775 uint16_t error_code;
3777 * Pass/Fail or error type Note: receiver to verify the in
3778 * parameters, and fail the call with an error when appropriate
3781 /* This field returns the type of original request. */
3783 /* This field provides original sequence number of the command. */
3786 * This field is the length of the response in bytes. The last
3787 * byte of the response is a valid flag that will read as '1'
3788 * when the command has been completely written to memory.
3790 uint32_t vnic_id_cnt;
3792 * Actual number of vnic ids Each VNIC ID is written as a 32-bit
3800 * This field is used in Output records to indicate that the
3801 * output is completely written to RAM. This field should be
3802 * read as '1' to indicate that the output has been completely
3803 * written. When writing a command completion or response to an
3804 * internal processor, the order of writes has to be such that
3805 * this field is written last.
3807 } __attribute__((packed));
3809 /* hwrm_func_drv_rgtr */
3811 * Description: This command is used by the function driver to register its
3812 * information with the HWRM. A function driver shall implement this command. A
3813 * function driver shall use this command during the driver initialization right
3814 * after the HWRM version discovery and default ring resources allocation.
3816 /* Input (80 bytes) */
3817 struct hwrm_func_drv_rgtr_input {
3820 * This value indicates what type of request this is. The format
3821 * for the rest of the command is determined by this field.
3825 * This value indicates the what completion ring the request
3826 * will be optionally completed on. If the value is -1, then no
3827 * CR completion will be generated. Any other value must be a
3828 * valid CR ring_id value for this function.
3831 /* This value indicates the command sequence number. */
3834 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3835 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3840 * This is the host address where the response will be written
3841 * when the request is complete. This area must be 16B aligned
3842 * and must be cleared to zero before the request is made.
3846 * When this bit is '1', the function driver is requesting all
3847 * requests from its children VF drivers to be forwarded to
3848 * itself. This flag can only be set by the PF driver. If a VF
3849 * driver sets this flag, it should be ignored by the HWRM.
3851 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
3853 * When this bit is '1', the function is requesting none of the
3854 * requests from its children VF drivers to be forwarded to
3855 * itself. This flag can only be set by the PF driver. If a VF
3856 * driver sets this flag, it should be ignored by the HWRM.
3858 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
3860 /* This bit must be '1' for the os_type field to be configured. */
3861 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
3862 /* This bit must be '1' for the ver field to be configured. */
3863 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
3864 /* This bit must be '1' for the timestamp field to be configured. */
3865 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
3866 /* This bit must be '1' for the vf_req_fwd field to be configured. */
3867 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_INPUT_FWD UINT32_C(0x8)
3869 * This bit must be '1' for the async_event_fwd field to be
3872 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD UINT32_C(0x10)
3875 * This value indicates the type of OS. The values are based on
3876 * CIM_OperatingSystem.mof file as published by the DMTF.
3879 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN UINT32_C(0x0)
3880 /* Other OS not listed below. */
3881 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER UINT32_C(0x1)
3883 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS UINT32_C(0xe)
3885 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS UINT32_C(0x12)
3887 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS UINT32_C(0x1d)
3889 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX UINT32_C(0x24)
3891 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD UINT32_C(0x2a)
3892 /* VMware ESXi OS. */
3893 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI UINT32_C(0x68)
3894 /* Microsoft Windows 8 64-bit OS. */
3895 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 UINT32_C(0x73)
3896 /* Microsoft Windows Server 2012 R2 OS. */
3897 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 UINT32_C(0x74)
3899 /* This is the major version of the driver. */
3901 /* This is the minor version of the driver. */
3903 /* This is the update version of the driver. */
3908 * This is a 32-bit timestamp provided by the driver for keep
3909 * alive. The timestamp is in multiples of 1ms.
3912 uint32_t vf_req_fwd[8];
3914 * This is a 256-bit bit mask provided by the PF driver for
3915 * letting the HWRM know what commands issued by the VF driver
3916 * to the HWRM should be forwarded to the PF driver. Nth bit
3917 * refers to the Nth req_type. Setting Nth bit to 1 indicates
3918 * that requests from the VF driver with req_type equal to N
3919 * shall be forwarded to the parent PF driver. This field is not
3920 * valid for the VF driver.
3922 uint32_t async_event_fwd[8];
3924 * This is a 256-bit bit mask provided by the function driver
3925 * (PF or VF driver) to indicate the list of asynchronous event
3926 * completions to be forwarded. Nth bit refers to the Nth
3927 * event_id. Setting Nth bit to 1 by the function driver shall
3928 * result in the HWRM forwarding asynchronous event completion
3929 * with event_id equal to N. If all bits are set to 0 (value of
3930 * 0), then the HWRM shall not forward any asynchronous event
3931 * completion to this function driver.
3933 } __attribute__((packed));
3935 /* Output (16 bytes) */
3936 struct hwrm_func_drv_rgtr_output {
3937 uint16_t error_code;
3939 * Pass/Fail or error type Note: receiver to verify the in
3940 * parameters, and fail the call with an error when appropriate
3943 /* This field returns the type of original request. */
3945 /* This field provides original sequence number of the command. */
3948 * This field is the length of the response in bytes. The last
3949 * byte of the response is a valid flag that will read as '1'
3950 * when the command has been completely written to memory.
3958 * This field is used in Output records to indicate that the
3959 * output is completely written to RAM. This field should be
3960 * read as '1' to indicate that the output has been completely
3961 * written. When writing a command completion or response to an
3962 * internal processor, the order of writes has to be such that
3963 * this field is written last.
3965 } __attribute__((packed));
3967 /* hwrm_func_drv_unrgtr */
3969 * Description: This command is used by the function driver to un register with
3970 * the HWRM. A function driver shall implement this command. A function driver
3971 * shall use this command during the driver unloading.
3973 /* Input (24 bytes) */
3974 struct hwrm_func_drv_unrgtr_input {
3977 * This value indicates what type of request this is. The format
3978 * for the rest of the command is determined by this field.
3982 * This value indicates the what completion ring the request
3983 * will be optionally completed on. If the value is -1, then no
3984 * CR completion will be generated. Any other value must be a
3985 * valid CR ring_id value for this function.
3988 /* This value indicates the command sequence number. */
3991 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
3992 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
3997 * This is the host address where the response will be written
3998 * when the request is complete. This area must be 16B aligned
3999 * and must be cleared to zero before the request is made.
4003 * When this bit is '1', the function driver is notifying the
4004 * HWRM to prepare for the shutdown.
4006 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
4009 } __attribute__((packed));
4011 /* Output (16 bytes) */
4012 struct hwrm_func_drv_unrgtr_output {
4013 uint16_t error_code;
4015 * Pass/Fail or error type Note: receiver to verify the in
4016 * parameters, and fail the call with an error when appropriate
4019 /* This field returns the type of original request. */
4021 /* This field provides original sequence number of the command. */
4024 * This field is the length of the response in bytes. The last
4025 * byte of the response is a valid flag that will read as '1'
4026 * when the command has been completely written to memory.
4034 * This field is used in Output records to indicate that the
4035 * output is completely written to RAM. This field should be
4036 * read as '1' to indicate that the output has been completely
4037 * written. When writing a command completion or response to an
4038 * internal processor, the order of writes has to be such that
4039 * this field is written last.
4041 } __attribute__((packed));
4043 /* hwrm_func_buf_rgtr */
4045 * Description: This command is used by the PF driver to register buffers used
4046 * in the PF-VF communication with the HWRM. The PF driver uses this command to
4047 * register buffers for each PF-VF channel. A parent PF may issue this command
4048 * per child VF. If VF ID is not valid, then this command is used to register
4049 * buffers for all children VFs of the PF.
4051 /* Input (128 bytes) */
4052 struct hwrm_func_buf_rgtr_input {
4055 * This value indicates what type of request this is. The format
4056 * for the rest of the command is determined by this field.
4060 * This value indicates the what completion ring the request
4061 * will be optionally completed on. If the value is -1, then no
4062 * CR completion will be generated. Any other value must be a
4063 * valid CR ring_id value for this function.
4066 /* This value indicates the command sequence number. */
4069 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4070 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4075 * This is the host address where the response will be written
4076 * when the request is complete. This area must be 16B aligned
4077 * and must be cleared to zero before the request is made.
4080 /* This bit must be '1' for the vf_id field to be configured. */
4081 #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_VF_ID UINT32_C(0x1)
4082 /* This bit must be '1' for the err_buf_addr field to be configured. */
4083 #define HWRM_FUNC_BUF_RGTR_INPUT_ENABLES_ERR_BUF_ADDR UINT32_C(0x2)
4086 * This value is used to identify a Virtual Function (VF). The
4087 * scope of VF ID is local within a PF.
4089 uint16_t req_buf_num_pages;
4091 * This field represents the number of pages used for request
4094 uint16_t req_buf_page_size;
4095 /* This field represents the page size used for request buffer(s). */
4097 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_16B UINT32_C(0x4)
4099 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_4K UINT32_C(0xc)
4101 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_8K UINT32_C(0xd)
4103 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_64K UINT32_C(0x10)
4105 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_2M UINT32_C(0x15)
4107 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_4M UINT32_C(0x16)
4109 #define HWRM_FUNC_BUF_RGTR_INPUT_INPUT_BUF_PAGE_SIZE_1G UINT32_C(0x1e)
4110 uint16_t req_buf_len;
4111 /* The length of the request buffer per VF in bytes. */
4112 uint16_t resp_buf_len;
4113 /* The length of the response buffer in bytes. */
4116 uint64_t req_buf_page_addr[10];
4117 /* This field represents the page address of req buffer. */
4118 uint64_t error_buf_addr;
4120 * This field is used to receive the error reporting from the
4121 * chipset. Only applicable for PFs.
4123 uint64_t resp_buf_addr;
4124 /* This field is used to receive the response forwarded by the HWRM. */
4125 } __attribute__((packed));
4127 /* Output (16 bytes) */
4128 struct hwrm_func_buf_rgtr_output {
4129 uint16_t error_code;
4131 * Pass/Fail or error type Note: receiver to verify the in
4132 * parameters, and fail the call with an error when appropriate
4135 /* This field returns the type of original request. */
4137 /* This field provides original sequence number of the command. */
4140 * This field is the length of the response in bytes. The last
4141 * byte of the response is a valid flag that will read as '1'
4142 * when the command has been completely written to memory.
4150 * This field is used in Output records to indicate that the
4151 * output is completely written to RAM. This field should be
4152 * read as '1' to indicate that the output has been completely
4153 * written. When writing a command completion or response to an
4154 * internal processor, the order of writes has to be such that
4155 * this field is written last.
4157 } __attribute__((packed));
4159 /* hwrm_func_buf_unrgtr */
4161 * Description: This command is used by the PF driver to unregister buffers used
4162 * in the PF-VF communication with the HWRM. The PF driver uses this command to
4163 * unregister buffers for PF-VF communication. A parent PF may issue this
4164 * command to unregister buffers for communication between the PF and a specific
4165 * VF. If the VF ID is not valid, then this command is used to unregister
4166 * buffers used for communications with all children VFs of the PF.
4168 /* Input (24 bytes) */
4169 struct hwrm_func_buf_unrgtr_input {
4172 * This value indicates what type of request this is. The format
4173 * for the rest of the command is determined by this field.
4177 * This value indicates the what completion ring the request
4178 * will be optionally completed on. If the value is -1, then no
4179 * CR completion will be generated. Any other value must be a
4180 * valid CR ring_id value for this function.
4183 /* This value indicates the command sequence number. */
4186 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4187 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4192 * This is the host address where the response will be written
4193 * when the request is complete. This area must be 16B aligned
4194 * and must be cleared to zero before the request is made.
4197 /* This bit must be '1' for the vf_id field to be configured. */
4198 #define HWRM_FUNC_BUF_UNRGTR_INPUT_ENABLES_VF_ID UINT32_C(0x1)
4201 * This value is used to identify a Virtual Function (VF). The
4202 * scope of VF ID is local within a PF.
4205 } __attribute__((packed));
4207 /* Output (16 bytes) */
4208 struct hwrm_func_buf_unrgtr_output {
4209 uint16_t error_code;
4211 * Pass/Fail or error type Note: receiver to verify the in
4212 * parameters, and fail the call with an error when appropriate
4215 /* This field returns the type of original request. */
4217 /* This field provides original sequence number of the command. */
4220 * This field is the length of the response in bytes. The last
4221 * byte of the response is a valid flag that will read as '1'
4222 * when the command has been completely written to memory.
4230 * This field is used in Output records to indicate that the
4231 * output is completely written to RAM. This field should be
4232 * read as '1' to indicate that the output has been completely
4233 * written. When writing a command completion or response to an
4234 * internal processor, the order of writes has to be such that
4235 * this field is written last.
4237 } __attribute__((packed));
4239 /* hwrm_func_vf_cfg */
4241 * Description: This command allows configuration of a VF by its driver. If this
4242 * function is called by a PF driver, then the HWRM shall fail this command. If
4243 * guest VLAN and/or MAC address are provided in this command, then the HWRM
4244 * shall set up appropriate MAC/VLAN filters for the VF that is being
4245 * configured. A VF driver should set VF MTU/MRU using this command prior to
4246 * allocating RX VNICs or TX rings for the corresponding VF.
4248 /* Input (32 bytes) */
4250 struct hwrm_func_vf_cfg_input {
4253 * This value indicates what type of request this is. The format for the
4254 * rest of the command is determined by this field.
4258 * This value indicates the what completion ring the request will be
4259 * optionally completed on. If the value is -1, then no CR completion
4260 * will be generated. Any other value must be a valid CR ring_id value
4261 * for this function.
4264 /* This value indicates the command sequence number. */
4267 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4268 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4272 * This is the host address where the response will be written when the
4273 * request is complete. This area must be 16B aligned and must be
4274 * cleared to zero before the request is made.
4277 /* This bit must be '1' for the mtu field to be configured. */
4278 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_MTU UINT32_C(0x1)
4279 /* This bit must be '1' for the guest_vlan field to be configured. */
4280 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_GUEST_VLAN UINT32_C(0x2)
4282 * This bit must be '1' for the async_event_cr field to be configured.
4284 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR UINT32_C(0x4)
4285 /* This bit must be '1' for the dflt_mac_addr field to be configured. */
4286 #define HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR UINT32_C(0x8)
4289 * The maximum transmission unit requested on the function. The HWRM
4290 * should make sure that the mtu of the function does not exceed the mtu
4291 * of the physical port that this function is associated with. In
4292 * addition to requesting mtu per function, it is possible to configure
4293 * mtu per transmit ring. By default, the mtu of each transmit ring
4294 * associated with a function is equal to the mtu of the function. The
4295 * HWRM should make sure that the mtu of each transmit ring that is
4296 * assigned to a function has a valid mtu.
4298 uint16_t guest_vlan;
4300 * The guest VLAN for the function being configured. This field's format
4301 * is same as 802.1Q Tag's Tag Control Information (TCI) format that
4302 * includes both Priority Code Point (PCP) and VLAN Identifier (VID).
4304 uint16_t async_event_cr;
4306 * ID of the target completion ring for receiving asynchronous event
4307 * completions. If this field is not valid, then the HWRM shall use the
4308 * default completion ring of the function that is being configured as
4309 * the target completion ring for providing any asynchronous event
4310 * completions for that function. If this field is valid, then the HWRM
4311 * shall use the completion ring identified by this ID as the target
4312 * completion ring for providing any asynchronous event completions for
4313 * the function that is being configured.
4315 uint8_t dflt_mac_addr[6];
4317 * This value is the current MAC address requested by the VF driver to
4318 * be configured on this VF. A value of 00-00-00-00-00-00 indicates no
4319 * MAC address configuration is requested by the VF driver. The parent
4320 * PF driver may reject or overwrite this MAC address.
4322 } __attribute__((packed));
4324 /* Output (16 bytes) */
4326 struct hwrm_func_vf_cfg_output {
4327 uint16_t error_code;
4329 * Pass/Fail or error type Note: receiver to verify the in parameters,
4330 * and fail the call with an error when appropriate
4333 /* This field returns the type of original request. */
4335 /* This field provides original sequence number of the command. */
4338 * This field is the length of the response in bytes. The last
4339 * byte of the response is a valid flag that will read as '1'
4340 * when the command has been completely written to memory.
4348 * This field is used in Output records to indicate that the output is
4349 * completely written to RAM. This field should be read as '1' to
4350 * indicate that the output has been completely written. When writing a
4351 * command completion or response to an internal processor, the order of
4352 * writes has to be such that this field is written last.
4354 } __attribute__((packed));
4356 /* hwrm_port_phy_cfg */
4358 * Description: This command configures the PHY device for the port. It allows
4359 * setting of the most generic settings for the PHY. The HWRM shall complete
4360 * this command as soon as PHY settings are configured. They may not be applied
4361 * when the command response is provided. A VF driver shall not be allowed to
4362 * configure PHY using this command. In a network partition mode, a PF driver
4363 * shall not be allowed to configure PHY using this command.
4365 /* Input (56 bytes) */
4366 struct hwrm_port_phy_cfg_input {
4369 * This value indicates what type of request this is. The format
4370 * for the rest of the command is determined by this field.
4374 * This value indicates the what completion ring the request
4375 * will be optionally completed on. If the value is -1, then no
4376 * CR completion will be generated. Any other value must be a
4377 * valid CR ring_id value for this function.
4380 /* This value indicates the command sequence number. */
4383 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4384 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4389 * This is the host address where the response will be written
4390 * when the request is complete. This area must be 16B aligned
4391 * and must be cleared to zero before the request is made.
4395 * When this bit is set to '1', the PHY for the port shall be
4396 * reset. # If this bit is set to 1, then the HWRM shall reset
4397 * the PHY after applying PHY configuration changes specified in
4398 * this command. # In order to guarantee that PHY configuration
4399 * changes specified in this command take effect, the HWRM
4400 * client should set this flag to 1. # If this bit is not set to
4401 * 1, then the HWRM may reset the PHY depending on the current
4402 * PHY configuration and settings specified in this command.
4404 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY UINT32_C(0x1)
4405 /* deprecated bit. Do not use!!! */
4406 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_DEPRECATED UINT32_C(0x2)
4408 * When this bit is set to '1', the link shall be forced to the
4409 * force_link_speed value. When this bit is set to '1', the HWRM
4410 * client should not enable any of the auto negotiation related
4411 * fields represented by auto_XXX fields in this command. When
4412 * this bit is set to '1' and the HWRM client has enabled a
4413 * auto_XXX field in this command, then the HWRM shall ignore
4414 * the enabled auto_XXX field. When this bit is set to zero, the
4415 * link shall be allowed to autoneg.
4417 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE UINT32_C(0x4)
4419 * When this bit is set to '1', the auto-negotiation process
4420 * shall be restarted on the link.
4422 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG UINT32_C(0x8)
4424 * When this bit is set to '1', Energy Efficient Ethernet (EEE)
4425 * is requested to be enabled on this link. If EEE is not
4426 * supported on this port, then this flag shall be ignored by
4429 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE UINT32_C(0x10)
4431 * When this bit is set to '1', Energy Efficient Ethernet (EEE)
4432 * is requested to be disabled on this link. If EEE is not
4433 * supported on this port, then this flag shall be ignored by
4436 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE UINT32_C(0x20)
4438 * When this bit is set to '1' and EEE is enabled on this link,
4439 * then TX LPI is requested to be enabled on the link. If EEE is
4440 * not supported on this port, then this flag shall be ignored
4441 * by the HWRM. If EEE is disabled on this port, then this flag
4442 * shall be ignored by the HWRM.
4444 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_ENABLE UINT32_C(0x40)
4446 * When this bit is set to '1' and EEE is enabled on this link,
4447 * then TX LPI is requested to be disabled on the link. If EEE
4448 * is not supported on this port, then this flag shall be
4449 * ignored by the HWRM. If EEE is disabled on this port, then
4450 * this flag shall be ignored by the HWRM.
4452 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI_DISABLE UINT32_C(0x80)
4454 * When set to 1, then the HWRM shall enable FEC
4455 * autonegotitation on this port if supported. When set to 0,
4456 * then this flag shall be ignored. If FEC autonegotiation is
4457 * not supported, then the HWRM shall ignore this flag.
4459 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_ENABLE UINT32_C(0x100)
4461 * When set to 1, then the HWRM shall disable FEC
4462 * autonegotiation on this port if supported. When set to 0,
4463 * then this flag shall be ignored. If FEC autonegotiation is
4464 * not supported, then the HWRM shall ignore this flag.
4466 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_AUTONEG_DISABLE \
4469 * When set to 1, then the HWRM shall enable FEC CLAUSE 74 (Fire
4470 * Code) on this port if supported. When set to 0, then this
4471 * flag shall be ignored. If FEC CLAUSE 74 is not supported,
4472 * then the HWRM shall ignore this flag.
4474 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_ENABLE \
4477 * When set to 1, then the HWRM shall disable FEC CLAUSE 74
4478 * (Fire Code) on this port if supported. When set to 0, then
4479 * this flag shall be ignored. If FEC CLAUSE 74 is not
4480 * supported, then the HWRM shall ignore this flag.
4482 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE74_DISABLE \
4485 * When set to 1, then the HWRM shall enable FEC CLAUSE 91 (Reed
4486 * Solomon) on this port if supported. When set to 0, then this
4487 * flag shall be ignored. If FEC CLAUSE 91 is not supported,
4488 * then the HWRM shall ignore this flag.
4490 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_ENABLE \
4493 * When set to 1, then the HWRM shall disable FEC CLAUSE 91
4494 * (Reed Solomon) on this port if supported. When set to 0, then
4495 * this flag shall be ignored. If FEC CLAUSE 91 is not
4496 * supported, then the HWRM shall ignore this flag.
4498 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FEC_CLAUSE91_DISABLE \
4501 * When this bit is set to '1', the link shall be forced to be
4502 * taken down. # When this bit is set to '1", all other command
4503 * input settings related to the link speed shall be ignored.
4504 * Once the link state is forced down, it can be explicitly
4505 * cleared from that state by setting this flag to '0'. # If
4506 * this flag is set to '0', then the link shall be cleared from
4507 * forced down state if the link is in forced down state. There
4508 * may be conditions (e.g. out-of-band or sideband configuration
4509 * changes for the link) outside the scope of the HWRM
4510 * implementation that may clear forced down link state.
4512 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DWN UINT32_C(0x4000)
4514 /* This bit must be '1' for the auto_mode field to be configured. */
4515 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE UINT32_C(0x1)
4516 /* This bit must be '1' for the auto_duplex field to be configured. */
4517 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX UINT32_C(0x2)
4518 /* This bit must be '1' for the auto_pause field to be configured. */
4519 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE UINT32_C(0x4)
4521 * This bit must be '1' for the auto_link_speed field to be
4524 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED UINT32_C(0x8)
4526 * This bit must be '1' for the auto_link_speed_mask field to be
4529 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
4531 /* This bit must be '1' for the wirespeed field to be configured. */
4532 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIOUTPUTEED UINT32_C(0x20)
4533 /* This bit must be '1' for the lpbk field to be configured. */
4534 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK UINT32_C(0x40)
4535 /* This bit must be '1' for the preemphasis field to be configured. */
4536 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS UINT32_C(0x80)
4537 /* This bit must be '1' for the force_pause field to be configured. */
4538 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE UINT32_C(0x100)
4540 * This bit must be '1' for the eee_link_speed_mask field to be
4543 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
4545 /* This bit must be '1' for the tx_lpi_timer field to be configured. */
4546 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER UINT32_C(0x400)
4548 /* Port ID of port that is to be configured. */
4549 uint16_t force_link_speed;
4551 * This is the speed that will be used if the force bit is '1'.
4552 * If unsupported speed is selected, an error will be generated.
4554 /* 100Mb link speed */
4555 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
4556 /* 1Gb link speed */
4557 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB UINT32_C(0xa)
4558 /* 2Gb link speed */
4559 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB UINT32_C(0x14)
4560 /* 2.5Gb link speed */
4561 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
4562 /* 10Gb link speed */
4563 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB UINT32_C(0x64)
4564 /* 20Mb link speed */
4565 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB UINT32_C(0xc8)
4566 /* 25Gb link speed */
4567 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB UINT32_C(0xfa)
4568 /* 40Gb link speed */
4569 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB UINT32_C(0x190)
4570 /* 50Gb link speed */
4571 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB UINT32_C(0x1f4)
4572 /* 100Gb link speed */
4573 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
4574 /* 10Mb link speed */
4575 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB UINT32_C(0xffff)
4578 * This value is used to identify what autoneg mode is used when
4579 * the link speed is not being forced.
4582 * Disable autoneg or autoneg disabled. No
4583 * speeds are selected.
4585 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE UINT32_C(0x0)
4586 /* Select all possible speeds for autoneg mode. */
4587 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1)
4589 * Select only the auto_link_speed speed for
4590 * autoneg mode. This mode has been DEPRECATED.
4591 * An HWRM client should not use this mode.
4593 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED UINT32_C(0x2)
4595 * Select the auto_link_speed or any speed below
4596 * that speed for autoneg. This mode has been
4597 * DEPRECATED. An HWRM client should not use
4600 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
4602 * Select the speeds based on the corresponding
4603 * link speed mask value that is provided.
4605 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK UINT32_C(0x4)
4606 uint8_t auto_duplex;
4608 * This is the duplex setting that will be used if the
4609 * autoneg_mode is "one_speed" or "one_or_below".
4611 /* Half Duplex will be requested. */
4612 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF UINT32_C(0x0)
4613 /* Full duplex will be requested. */
4614 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL UINT32_C(0x1)
4615 /* Both Half and Full dupex will be requested. */
4616 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH UINT32_C(0x2)
4619 * This value is used to configure the pause that will be used
4620 * for autonegotiation. Add text on the usage of auto_pause and
4624 * When this bit is '1', Generation of tx pause messages has
4625 * been requested. Disabled otherwise.
4627 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX UINT32_C(0x1)
4629 * When this bit is '1', Reception of rx pause messages has been
4630 * requested. Disabled otherwise.
4632 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX UINT32_C(0x2)
4634 * When set to 1, the advertisement of pause is enabled. # When
4635 * the auto_mode is not set to none and this flag is set to 1,
4636 * then the auto_pause bits on this port are being advertised
4637 * and autoneg pause results are being interpreted. # When the
4638 * auto_mode is not set to none and this flag is set to 0, the
4639 * pause is forced as indicated in force_pause, and also
4640 * advertised as auto_pause bits, but the autoneg results are
4641 * not interpreted since the pause configuration is being
4642 * forced. # When the auto_mode is set to none and this flag is
4643 * set to 1, auto_pause bits should be ignored and should be set
4646 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
4648 uint16_t auto_link_speed;
4650 * This is the speed that will be used if the autoneg_mode is
4651 * "one_speed" or "one_or_below". If an unsupported speed is
4652 * selected, an error will be generated.
4654 /* 100Mb link speed */
4655 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
4656 /* 1Gb link speed */
4657 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB UINT32_C(0xa)
4658 /* 2Gb link speed */
4659 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB UINT32_C(0x14)
4660 /* 2.5Gb link speed */
4661 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
4662 /* 10Gb link speed */
4663 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB UINT32_C(0x64)
4664 /* 20Mb link speed */
4665 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB UINT32_C(0xc8)
4666 /* 25Gb link speed */
4667 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB UINT32_C(0xfa)
4668 /* 40Gb link speed */
4669 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB UINT32_C(0x190)
4670 /* 50Gb link speed */
4671 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB UINT32_C(0x1f4)
4672 /* 100Gb link speed */
4673 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
4674 /* 10Mb link speed */
4675 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB UINT32_C(0xffff)
4676 uint16_t auto_link_speed_mask;
4678 * This is a mask of link speeds that will be used if
4679 * autoneg_mode is "mask". If unsupported speed is enabled an
4680 * error will be generated.
4682 /* 100Mb link speed (Half-duplex) */
4683 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
4685 /* 100Mb link speed (Full-duplex) */
4686 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
4688 /* 1Gb link speed (Half-duplex) */
4689 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
4691 /* 1Gb link speed (Full-duplex) */
4692 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
4694 /* 2Gb link speed */
4695 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
4697 /* 2.5Gb link speed */
4698 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
4700 /* 10Gb link speed */
4701 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB UINT32_C(0x40)
4702 /* 20Gb link speed */
4703 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB UINT32_C(0x80)
4704 /* 25Gb link speed */
4705 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
4707 /* 40Gb link speed */
4708 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
4710 /* 50Gb link speed */
4711 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
4713 /* 100Gb link speed */
4714 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
4716 /* 10Mb link speed (Half-duplex) */
4717 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
4719 /* 10Mb link speed (Full-duplex) */
4720 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
4723 /* This value controls the wirespeed feature. */
4724 /* Wirespeed feature is disabled. */
4725 #define HWRM_PORT_PHY_CFG_INPUT_WIOUTPUTEED_OFF UINT32_C(0x0)
4726 /* Wirespeed feature is enabled. */
4727 #define HWRM_PORT_PHY_CFG_INPUT_WIOUTPUTEED_ON UINT32_C(0x1)
4729 /* This value controls the loopback setting for the PHY. */
4730 /* No loopback is selected. Normal operation. */
4731 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE UINT32_C(0x0)
4733 * The HW will be configured with local loopback
4734 * such that host data is sent back to the host
4735 * without modification.
4737 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL UINT32_C(0x1)
4739 * The HW will be configured with remote
4740 * loopback such that port logic will send
4741 * packets back out the transmitter that are
4744 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE UINT32_C(0x2)
4745 uint8_t force_pause;
4747 * This value is used to configure the pause that will be used
4751 * When this bit is '1', Generation of tx pause messages is
4752 * supported. Disabled otherwise.
4754 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1)
4756 * When this bit is '1', Reception of rx pause messages is
4757 * supported. Disabled otherwise.
4759 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2)
4761 uint32_t preemphasis;
4763 * This value controls the pre-emphasis to be used for the link.
4764 * Driver should not set this value (use enable.preemphasis = 0)
4765 * unless driver is sure of setting. Normally HWRM FW will
4766 * determine proper pre-emphasis.
4768 uint16_t eee_link_speed_mask;
4770 * Setting for link speed mask that is used to advertise speeds
4771 * during autonegotiation when EEE is enabled. This field is
4772 * valid only when EEE is enabled. The speeds specified in this
4773 * field shall be a subset of speeds specified in
4774 * auto_link_speed_mask. If EEE is enabled,then at least one
4775 * speed shall be provided in this mask.
4778 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
4779 /* 100Mb link speed (Full-duplex) */
4780 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
4782 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
4783 /* 1Gb link speed (Full-duplex) */
4784 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
4786 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 UINT32_C(0x10)
4788 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 UINT32_C(0x20)
4789 /* 10Gb link speed */
4790 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB UINT32_C(0x40)
4793 uint32_t tx_lpi_timer;
4796 * Reuested setting of TX LPI timer in microseconds. This field
4797 * is valid only when EEE is enabled and TX LPI is enabled.
4799 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
4800 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
4801 } __attribute__((packed));
4803 /* Output (16 bytes) */
4804 struct hwrm_port_phy_cfg_output {
4805 uint16_t error_code;
4807 * Pass/Fail or error type Note: receiver to verify the in
4808 * parameters, and fail the call with an error when appropriate
4811 /* This field returns the type of original request. */
4813 /* This field provides original sequence number of the command. */
4816 * This field is the length of the response in bytes. The last
4817 * byte of the response is a valid flag that will read as '1'
4818 * when the command has been completely written to memory.
4826 * This field is used in Output records to indicate that the
4827 * output is completely written to RAM. This field should be
4828 * read as '1' to indicate that the output has been completely
4829 * written. When writing a command completion or response to an
4830 * internal processor, the order of writes has to be such that
4831 * this field is written last.
4833 } __attribute__((packed));
4835 /* hwrm_port_phy_qcfg */
4836 /* Description: This command queries the PHY configuration for the port. */
4837 /* Input (24 bytes) */
4838 struct hwrm_port_phy_qcfg_input {
4841 * This value indicates what type of request this is. The format
4842 * for the rest of the command is determined by this field.
4846 * This value indicates the what completion ring the request
4847 * will be optionally completed on. If the value is -1, then no
4848 * CR completion will be generated. Any other value must be a
4849 * valid CR ring_id value for this function.
4852 /* This value indicates the command sequence number. */
4855 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
4856 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
4861 * This is the host address where the response will be written
4862 * when the request is complete. This area must be 16B aligned
4863 * and must be cleared to zero before the request is made.
4866 /* Port ID of port that is to be queried. */
4867 uint16_t unused_0[3];
4868 } __attribute__((packed));
4870 /* Output (96 bytes) */
4871 struct hwrm_port_phy_qcfg_output {
4872 uint16_t error_code;
4874 * Pass/Fail or error type Note: receiver to verify the in
4875 * parameters, and fail the call with an error when appropriate
4878 /* This field returns the type of original request. */
4880 /* This field provides original sequence number of the command. */
4883 * This field is the length of the response in bytes. The last
4884 * byte of the response is a valid flag that will read as '1'
4885 * when the command has been completely written to memory.
4888 /* This value indicates the current link status. */
4889 /* There is no link or cable detected. */
4890 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK UINT32_C(0x0)
4891 /* There is no link, but a cable has been detected. */
4892 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL UINT32_C(0x1)
4893 /* There is a link. */
4894 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK UINT32_C(0x2)
4896 uint16_t link_speed;
4897 /* This value indicates the current link speed of the connection. */
4898 /* 100Mb link speed */
4899 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB UINT32_C(0x1)
4900 /* 1Gb link speed */
4901 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB UINT32_C(0xa)
4902 /* 2Gb link speed */
4903 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB UINT32_C(0x14)
4904 /* 2.5Gb link speed */
4905 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB UINT32_C(0x19)
4906 /* 10Gb link speed */
4907 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB UINT32_C(0x64)
4908 /* 20Mb link speed */
4909 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB UINT32_C(0xc8)
4910 /* 25Gb link speed */
4911 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB UINT32_C(0xfa)
4912 /* 40Gb link speed */
4913 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB UINT32_C(0x190)
4914 /* 50Gb link speed */
4915 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB UINT32_C(0x1f4)
4916 /* 100Gb link speed */
4917 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB UINT32_C(0x3e8)
4918 /* 10Mb link speed */
4919 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB UINT32_C(0xffff)
4921 /* This value is indicates the duplex of the current connection. */
4922 /* Half Duplex connection. */
4923 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_HALF UINT32_C(0x0)
4924 /* Full duplex connection. */
4925 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_FULL UINT32_C(0x1)
4928 * This value is used to indicate the current pause
4929 * configuration. When autoneg is enabled, this value represents
4930 * the autoneg results of pause configuration.
4933 * When this bit is '1', Generation of tx pause messages is
4934 * supported. Disabled otherwise.
4936 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX UINT32_C(0x1)
4938 * When this bit is '1', Reception of rx pause messages is
4939 * supported. Disabled otherwise.
4941 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX UINT32_C(0x2)
4942 uint16_t support_speeds;
4944 * The supported speeds for the port. This is a bit mask. For
4945 * each speed that is supported, the corrresponding bit will be
4948 /* 100Mb link speed (Half-duplex) */
4949 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD UINT32_C(0x1)
4950 /* 100Mb link speed (Full-duplex) */
4951 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB UINT32_C(0x2)
4952 /* 1Gb link speed (Half-duplex) */
4953 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD UINT32_C(0x4)
4954 /* 1Gb link speed (Full-duplex) */
4955 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB UINT32_C(0x8)
4956 /* 2Gb link speed */
4957 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB UINT32_C(0x10)
4958 /* 2.5Gb link speed */
4959 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB UINT32_C(0x20)
4960 /* 10Gb link speed */
4961 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB UINT32_C(0x40)
4962 /* 20Gb link speed */
4963 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB UINT32_C(0x80)
4964 /* 25Gb link speed */
4965 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB UINT32_C(0x100)
4966 /* 40Gb link speed */
4967 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB UINT32_C(0x200)
4968 /* 50Gb link speed */
4969 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB UINT32_C(0x400)
4970 /* 100Gb link speed */
4971 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB UINT32_C(0x800)
4972 /* 10Mb link speed (Half-duplex) */
4973 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD UINT32_C(0x1000)
4974 /* 10Mb link speed (Full-duplex) */
4975 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB UINT32_C(0x2000)
4976 uint16_t force_link_speed;
4978 * Current setting of forced link speed. When the link speed is
4979 * not being forced, this value shall be set to 0.
4981 /* 100Mb link speed */
4982 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB UINT32_C(0x1)
4983 /* 1Gb link speed */
4984 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB UINT32_C(0xa)
4985 /* 2Gb link speed */
4986 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB UINT32_C(0x14)
4987 /* 2.5Gb link speed */
4988 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB UINT32_C(0x19)
4989 /* 10Gb link speed */
4990 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB UINT32_C(0x64)
4991 /* 20Mb link speed */
4992 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB UINT32_C(0xc8)
4993 /* 25Gb link speed */
4994 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB UINT32_C(0xfa)
4995 /* 40Gb link speed */
4996 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB UINT32_C(0x190)
4997 /* 50Gb link speed */
4998 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB UINT32_C(0x1f4)
4999 /* 100Gb link speed */
5000 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB UINT32_C(0x3e8)
5001 /* 10Mb link speed */
5002 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB UINT32_C(0xffff)
5004 /* Current setting of auto negotiation mode. */
5006 * Disable autoneg or autoneg disabled. No
5007 * speeds are selected.
5009 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE UINT32_C(0x0)
5010 /* Select all possible speeds for autoneg mode. */
5011 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS UINT32_C(0x1)
5013 * Select only the auto_link_speed speed for
5014 * autoneg mode. This mode has been DEPRECATED.
5015 * An HWRM client should not use this mode.
5017 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED UINT32_C(0x2)
5019 * Select the auto_link_speed or any speed below
5020 * that speed for autoneg. This mode has been
5021 * DEPRECATED. An HWRM client should not use
5024 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW UINT32_C(0x3)
5026 * Select the speeds based on the corresponding
5027 * link speed mask value that is provided.
5029 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK UINT32_C(0x4)
5032 * Current setting of pause autonegotiation. Move autoneg_pause
5036 * When this bit is '1', Generation of tx pause messages has
5037 * been requested. Disabled otherwise.
5039 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX UINT32_C(0x1)
5041 * When this bit is '1', Reception of rx pause messages has been
5042 * requested. Disabled otherwise.
5044 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX UINT32_C(0x2)
5046 * When set to 1, the advertisement of pause is enabled. # When
5047 * the auto_mode is not set to none and this flag is set to 1,
5048 * then the auto_pause bits on this port are being advertised
5049 * and autoneg pause results are being interpreted. # When the
5050 * auto_mode is not set to none and this flag is set to 0, the
5051 * pause is forced as indicated in force_pause, and also
5052 * advertised as auto_pause bits, but the autoneg results are
5053 * not interpreted since the pause configuration is being
5054 * forced. # When the auto_mode is set to none and this flag is
5055 * set to 1, auto_pause bits should be ignored and should be set
5058 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
5059 uint16_t auto_link_speed;
5061 * Current setting for auto_link_speed. This field is only valid
5062 * when auto_mode is set to "one_speed" or "one_or_below".
5064 /* 100Mb link speed */
5065 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB UINT32_C(0x1)
5066 /* 1Gb link speed */
5067 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB UINT32_C(0xa)
5068 /* 2Gb link speed */
5069 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB UINT32_C(0x14)
5070 /* 2.5Gb link speed */
5071 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB UINT32_C(0x19)
5072 /* 10Gb link speed */
5073 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB UINT32_C(0x64)
5074 /* 20Mb link speed */
5075 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB UINT32_C(0xc8)
5076 /* 25Gb link speed */
5077 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB UINT32_C(0xfa)
5078 /* 40Gb link speed */
5079 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB UINT32_C(0x190)
5080 /* 50Gb link speed */
5081 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB UINT32_C(0x1f4)
5082 /* 100Gb link speed */
5083 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB UINT32_C(0x3e8)
5084 /* 10Mb link speed */
5085 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB UINT32_C(0xffff)
5086 uint16_t auto_link_speed_mask;
5088 * Current setting for auto_link_speed_mask that is used to
5089 * advertise speeds during autonegotiation. This field is only
5090 * valid when auto_mode is set to "mask". The speeds specified
5091 * in this field shall be a subset of supported speeds on this
5094 /* 100Mb link speed (Half-duplex) */
5095 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
5097 /* 100Mb link speed (Full-duplex) */
5098 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
5100 /* 1Gb link speed (Half-duplex) */
5101 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
5103 /* 1Gb link speed (Full-duplex) */
5104 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB UINT32_C(0x8)
5105 /* 2Gb link speed */
5106 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
5108 /* 2.5Gb link speed */
5109 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
5111 /* 10Gb link speed */
5112 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
5114 /* 20Gb link speed */
5115 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
5117 /* 25Gb link speed */
5118 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
5120 /* 40Gb link speed */
5121 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
5123 /* 50Gb link speed */
5124 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
5126 /* 100Gb link speed */
5127 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
5129 /* 10Mb link speed (Half-duplex) */
5130 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
5132 /* 10Mb link speed (Full-duplex) */
5133 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
5136 /* Current setting for wirespeed. */
5137 /* Wirespeed feature is disabled. */
5138 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIOUTPUTEED_OFF UINT32_C(0x0)
5139 /* Wirespeed feature is enabled. */
5140 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIOUTPUTEED_ON UINT32_C(0x1)
5142 /* Current setting for loopback. */
5143 /* No loopback is selected. Normal operation. */
5144 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE UINT32_C(0x0)
5146 * The HW will be configured with local loopback
5147 * such that host data is sent back to the host
5148 * without modification.
5150 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL UINT32_C(0x1)
5152 * The HW will be configured with remote
5153 * loopback such that port logic will send
5154 * packets back out the transmitter that are
5157 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE UINT32_C(0x2)
5158 uint8_t force_pause;
5160 * Current setting of forced pause. When the pause configuration
5161 * is not being forced, then this value shall be set to 0.
5164 * When this bit is '1', Generation of tx pause messages is
5165 * supported. Disabled otherwise.
5167 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX UINT32_C(0x1)
5169 * When this bit is '1', Reception of rx pause messages is
5170 * supported. Disabled otherwise.
5172 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX UINT32_C(0x2)
5173 uint8_t module_status;
5175 * This value indicates the current status of the optics module
5178 /* Module is inserted and accepted */
5179 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE UINT32_C(0x0)
5180 /* Module is rejected and transmit side Laser is disabled. */
5181 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX UINT32_C(0x1)
5182 /* Module mismatch warning. */
5183 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG UINT32_C(0x2)
5184 /* Module is rejected and powered down. */
5185 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN UINT32_C(0x3)
5186 /* Module is not inserted. */
5187 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
5189 /* Module status is not applicable. */
5190 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
5192 uint32_t preemphasis;
5193 /* Current setting for preemphasis. */
5195 /* This field represents the major version of the PHY. */
5197 /* This field represents the minor version of the PHY. */
5199 /* This field represents the build version of the PHY. */
5201 /* This value represents a PHY type. */
5203 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN UINT32_C(0x0)
5205 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR UINT32_C(0x1)
5206 /* BASE-KR4 (Deprecated) */
5207 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 UINT32_C(0x2)
5209 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR UINT32_C(0x3)
5211 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR UINT32_C(0x4)
5212 /* BASE-KR2 (Deprecated) */
5213 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 UINT32_C(0x5)
5215 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX UINT32_C(0x6)
5217 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR UINT32_C(0x7)
5219 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET UINT32_C(0x8)
5220 /* EEE capable BASE-T */
5221 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE UINT32_C(0x9)
5222 /* SGMII connected external PHY */
5223 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY UINT32_C(0xa)
5224 /* 25G_BASECR_CA_L */
5225 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_L UINT32_C(0xb)
5226 /* 25G_BASECR_CA_S */
5227 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_S UINT32_C(0xc)
5228 /* 25G_BASECR_CA_N */
5229 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASECR_CA_N UINT32_C(0xd)
5231 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_25G_BASESR UINT32_C(0xe)
5233 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASECR4 UINT32_C(0xf)
5235 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR4 UINT32_C(0x10)
5237 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASELR4 UINT32_C(0x11)
5239 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASEER4 UINT32_C(0x12)
5241 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_100G_BASESR10 UINT32_C(0x13)
5243 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASECR4 UINT32_C(0x14)
5245 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASESR4 UINT32_C(0x15)
5247 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASELR4 UINT32_C(0x16)
5249 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_BASEER4 UINT32_C(0x17)
5250 /* 40G_ACTIVE_CABLE */
5251 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE \
5254 /* This value represents a media type. */
5256 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN UINT32_C(0x0)
5258 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP UINT32_C(0x1)
5259 /* Direct Attached Copper */
5260 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC UINT32_C(0x2)
5262 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE UINT32_C(0x3)
5263 uint8_t xcvr_pkg_type;
5264 /* This value represents a transceiver type. */
5265 /* PHY and MAC are in the same package */
5266 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
5268 /* PHY and MAC are in different packages */
5269 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
5271 uint8_t eee_config_phy_addr;
5273 * This field represents flags related to EEE configuration.
5274 * These EEE configuration flags are valid only when the
5275 * auto_mode is not set to none (in other words autonegotiation
5278 /* This field represents PHY address. */
5279 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK UINT32_C(0x1f)
5280 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT 0
5282 * When set to 1, Energy Efficient Ethernet (EEE) mode is
5283 * enabled. Speeds for autoneg with EEE mode enabled are based
5284 * on eee_link_speed_mask.
5286 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED UINT32_C(0x20)
5288 * This flag is valid only when eee_enabled is set to 1. # If
5289 * eee_enabled is set to 0, then EEE mode is disabled and this
5290 * flag shall be ignored. # If eee_enabled is set to 1 and this
5291 * flag is set to 1, then Energy Efficient Ethernet (EEE) mode
5292 * is enabled and in use. # If eee_enabled is set to 1 and this
5293 * flag is set to 0, then Energy Efficient Ethernet (EEE) mode
5294 * is enabled but is currently not in use.
5296 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE UINT32_C(0x40)
5298 * This flag is valid only when eee_enabled is set to 1. # If
5299 * eee_enabled is set to 0, then EEE mode is disabled and this
5300 * flag shall be ignored. # If eee_enabled is set to 1 and this
5301 * flag is set to 1, then Energy Efficient Ethernet (EEE) mode
5302 * is enabled and TX LPI is enabled. # If eee_enabled is set to
5303 * 1 and this flag is set to 0, then Energy Efficient Ethernet
5304 * (EEE) mode is enabled but TX LPI is disabled.
5306 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI UINT32_C(0x80)
5308 * This field represents flags related to EEE configuration.
5309 * These EEE configuration flags are valid only when the
5310 * auto_mode is not set to none (in other words autonegotiation
5313 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK UINT32_C(0xe0)
5314 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT 5
5315 uint8_t parallel_detect;
5316 /* Reserved field, set to 0 */
5318 * When set to 1, the parallel detection is used to determine
5319 * the speed of the link partner. Parallel detection is used
5320 * when a autonegotiation capable device is connected to a link
5321 * parter that is not capable of autonegotiation.
5323 #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT UINT32_C(0x1)
5324 /* Reserved field, set to 0 */
5325 #define HWRM_PORT_PHY_QCFG_OUTPUT_RESERVED_MASK UINT32_C(0xfe)
5326 #define HWRM_PORT_PHY_QCFG_OUTPUT_RESERVED_SFT 1
5327 uint16_t link_partner_adv_speeds;
5329 * The advertised speeds for the port by the link partner. Each
5330 * advertised speed will be set to '1'.
5332 /* 100Mb link speed (Half-duplex) */
5333 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
5335 /* 100Mb link speed (Full-duplex) */
5336 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
5338 /* 1Gb link speed (Half-duplex) */
5339 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
5341 /* 1Gb link speed (Full-duplex) */
5342 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
5344 /* 2Gb link speed */
5345 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
5347 /* 2.5Gb link speed */
5348 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
5350 /* 10Gb link speed */
5351 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
5353 /* 20Gb link speed */
5354 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
5356 /* 25Gb link speed */
5357 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
5359 /* 40Gb link speed */
5360 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
5362 /* 50Gb link speed */
5363 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
5365 /* 100Gb link speed */
5366 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
5368 /* 10Mb link speed (Half-duplex) */
5369 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
5371 /* 10Mb link speed (Full-duplex) */
5372 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
5374 uint8_t link_partner_adv_auto_mode;
5376 * The advertised autoneg for the port by the link partner. This
5377 * field is deprecated and should be set to 0.
5380 * Disable autoneg or autoneg disabled. No
5381 * speeds are selected.
5383 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
5385 /* Select all possible speeds for autoneg mode. */
5387 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS \
5390 * Select only the auto_link_speed speed for
5391 * autoneg mode. This mode has been DEPRECATED.
5392 * An HWRM client should not use this mode.
5395 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
5398 * Select the auto_link_speed or any speed below
5399 * that speed for autoneg. This mode has been
5400 * DEPRECATED. An HWRM client should not use
5404 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
5407 * Select the speeds based on the corresponding
5408 * link speed mask value that is provided.
5411 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK \
5413 uint8_t link_partner_adv_pause;
5414 /* The advertised pause settings on the port by the link partner. */
5416 * When this bit is '1', Generation of tx pause messages is
5417 * supported. Disabled otherwise.
5419 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
5422 * When this bit is '1', Reception of rx pause messages is
5423 * supported. Disabled otherwise.
5425 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
5427 uint16_t adv_eee_link_speed_mask;
5429 * Current setting for link speed mask that is used to advertise
5430 * speeds during autonegotiation when EEE is enabled. This field
5431 * is valid only when eee_enabled flags is set to 1. The speeds
5432 * specified in this field shall be a subset of speeds specified
5433 * in auto_link_speed_mask.
5436 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
5438 /* 100Mb link speed (Full-duplex) */
5439 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
5442 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
5444 /* 1Gb link speed (Full-duplex) */
5445 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
5448 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
5451 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
5453 /* 10Gb link speed */
5454 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
5456 uint16_t link_partner_adv_eee_link_speed_mask;
5458 * Current setting for link speed mask that is advertised by the
5459 * link partner when EEE is enabled. This field is valid only
5460 * when eee_enabled flags is set to 1.
5464 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
5466 /* 100Mb link speed (Full-duplex) */
5468 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
5472 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
5474 /* 1Gb link speed (Full-duplex) */
5476 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
5480 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
5484 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
5486 /* 10Gb link speed */
5488 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
5490 uint32_t xcvr_identifier_type_tx_lpi_timer;
5491 /* This value represents transceiver identifier type. */
5493 * Current setting of TX LPI timer in microseconds. This field
5494 * is valid only when_eee_enabled flag is set to 1 and
5495 * tx_lpi_enabled is set to 1.
5497 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK UINT32_C(0xffffff)
5498 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT 0
5499 /* This value represents transceiver identifier type. */
5500 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
5501 UINT32_C(0xff000000)
5502 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT 24
5504 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
5505 (UINT32_C(0x0) << 24)
5506 /* SFP/SFP+/SFP28 */
5507 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
5508 (UINT32_C(0x3) << 24)
5510 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
5511 (UINT32_C(0xc) << 24)
5513 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
5514 (UINT32_C(0xd) << 24)
5516 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
5517 (UINT32_C(0x11) << 24)
5520 * This value represents the current configuration of Forward
5521 * Error Correction (FEC) on the port.
5524 * When set to 1, then FEC is not supported on this port. If
5525 * this flag is set to 1, then all other FEC configuration flags
5526 * shall be ignored. When set to 0, then FEC is supported as
5527 * indicated by other configuration flags. If no cable is
5528 * attached and the HWRM does not yet know the FEC capability,
5529 * then the HWRM shall set this flag to 1 when reporting FEC
5532 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_NONE_SUPPORTED \
5535 * When set to 1, then FEC autonegotiation is supported on this
5536 * port. When set to 0, then FEC autonegotiation is not
5537 * supported on this port.
5539 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_SUPPORTED \
5542 * When set to 1, then FEC autonegotiation is enabled on this
5543 * port. When set to 0, then FEC autonegotiation is disabled if
5544 * supported. This flag should be ignored if FEC autonegotiation
5545 * is not supported on this port.
5547 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_AUTONEG_ENABLED \
5550 * When set to 1, then FEC CLAUSE 74 (Fire Code) is supported on
5551 * this port. When set to 0, then FEC CLAUSE 74 (Fire Code) is
5552 * not supported on this port.
5554 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_SUPPORTED \
5557 * When set to 1, then FEC CLAUSE 74 (Fire Code) is enabled on
5558 * this port. When set to 0, then FEC CLAUSE 74 (Fire Code) is
5559 * disabled if supported. This flag should be ignored if FEC
5560 * CLAUSE 74 is not supported on this port.
5562 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE74_ENABLED \
5565 * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is supported
5566 * on this port. When set to 0, then FEC CLAUSE 91 (Reed
5567 * Solomon) is not supported on this port.
5569 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_SUPPORTED \
5572 * When set to 1, then FEC CLAUSE 91 (Reed Solomon) is enabled
5573 * on this port. When set to 0, then FEC CLAUSE 91 (Reed
5574 * Solomon) is disabled if supported. This flag should be
5575 * ignored if FEC CLAUSE 91 is not supported on this port.
5577 #define HWRM_PORT_PHY_QCFG_OUTPUT_FEC_CFG_FEC_CLAUSE91_ENABLED \
5581 char phy_vendor_name[16];
5583 * Up to 16 bytes of null padded ASCII string representing PHY
5584 * vendor. If the string is set to null, then the vendor name is
5587 char phy_vendor_partnumber[16];
5589 * Up to 16 bytes of null padded ASCII string that identifies
5590 * vendor specific part number of the PHY. If the string is set
5591 * to null, then the vendor specific part number is not
5600 * This field is used in Output records to indicate that the
5601 * output is completely written to RAM. This field should be
5602 * read as '1' to indicate that the output has been completely
5603 * written. When writing a command completion or response to an
5604 * internal processor, the order of writes has to be such that
5605 * this field is written last.
5607 } __attribute__((packed));
5609 /* hwrm_port_qstats */
5610 /* Description: This function returns per port Ethernet statistics. */
5611 /* Input (40 bytes) */
5612 struct hwrm_port_qstats_input {
5615 * This value indicates what type of request this is. The format
5616 * for the rest of the command is determined by this field.
5620 * This value indicates the what completion ring the request
5621 * will be optionally completed on. If the value is -1, then no
5622 * CR completion will be generated. Any other value must be a
5623 * valid CR ring_id value for this function.
5626 /* This value indicates the command sequence number. */
5629 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
5630 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
5635 * This is the host address where the response will be written
5636 * when the request is complete. This area must be 16B aligned
5637 * and must be cleared to zero before the request is made.
5640 /* Port ID of port that is being queried. */
5643 uint8_t unused_2[3];
5645 uint64_t tx_stat_host_addr;
5646 /* This is the host address where Tx port statistics will be stored */
5647 uint64_t rx_stat_host_addr;
5648 /* This is the host address where Rx port statistics will be stored */
5649 } __attribute__((packed));
5651 /* Output (16 bytes) */
5652 struct hwrm_port_qstats_output {
5653 uint16_t error_code;
5655 * Pass/Fail or error type Note: receiver to verify the in
5656 * parameters, and fail the call with an error when appropriate
5659 /* This field returns the type of original request. */
5661 /* This field provides original sequence number of the command. */
5664 * This field is the length of the response in bytes. The last
5665 * byte of the response is a valid flag that will read as '1'
5666 * when the command has been completely written to memory.
5668 uint16_t tx_stat_size;
5669 /* The size of TX port statistics block in bytes. */
5670 uint16_t rx_stat_size;
5671 /* The size of RX port statistics block in bytes. */
5677 * This field is used in Output records to indicate that the
5678 * output is completely written to RAM. This field should be
5679 * read as '1' to indicate that the output has been completely
5680 * written. When writing a command completion or response to an
5681 * internal processor, the order of writes has to be such that
5682 * this field is written last.
5684 } __attribute__((packed));
5686 /* hwrm_port_clr_stats */
5688 * Description: This function clears per port statistics. The HWRM shall not
5689 * allow a VF driver to clear port statistics. The HWRM shall not allow a PF
5690 * driver to clear port statistics in a partitioning mode. The HWRM may allow a
5691 * PF driver to clear port statistics in the non-partitioning mode.
5693 /* Input (24 bytes) */
5694 struct hwrm_port_clr_stats_input {
5697 * This value indicates what type of request this is. The format
5698 * for the rest of the command is determined by this field.
5702 * This value indicates the what completion ring the request
5703 * will be optionally completed on. If the value is -1, then no
5704 * CR completion will be generated. Any other value must be a
5705 * valid CR ring_id value for this function.
5708 /* This value indicates the command sequence number. */
5711 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
5712 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
5717 * This is the host address where the response will be written
5718 * when the request is complete. This area must be 16B aligned
5719 * and must be cleared to zero before the request is made.
5722 /* Port ID of port that is being queried. */
5723 uint16_t unused_0[3];
5724 } __attribute__((packed));
5726 /* Output (16 bytes) */
5727 struct hwrm_port_clr_stats_output {
5728 uint16_t error_code;
5730 * Pass/Fail or error type Note: receiver to verify the in
5731 * parameters, and fail the call with an error when appropriate
5734 /* This field returns the type of original request. */
5736 /* This field provides original sequence number of the command. */
5739 * This field is the length of the response in bytes. The last
5740 * byte of the response is a valid flag that will read as '1'
5741 * when the command has been completely written to memory.
5749 * This field is used in Output records to indicate that the
5750 * output is completely written to RAM. This field should be
5751 * read as '1' to indicate that the output has been completely
5752 * written. When writing a command completion or response to an
5753 * internal processor, the order of writes has to be such that
5754 * this field is written last.
5756 } __attribute__((packed));
5758 /* hwrm_port_led_cfg */
5760 * Description: This function is used to configure LEDs on a given port. Each
5761 * port has individual set of LEDs associated with it. These LEDs are used for
5762 * speed/link configuration as well as activity indicator configuration. Up to
5763 * three LEDs can be configured, one for activity and two for speeds.
5765 /* Input (64 bytes) */
5766 struct hwrm_port_led_cfg_input {
5769 * This value indicates what type of request this is. The format
5770 * for the rest of the command is determined by this field.
5774 * This value indicates the what completion ring the request
5775 * will be optionally completed on. If the value is -1, then no
5776 * CR completion will be generated. Any other value must be a
5777 * valid CR ring_id value for this function.
5780 /* This value indicates the command sequence number. */
5783 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
5784 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
5789 * This is the host address where the response will be written
5790 * when the request is complete. This area must be 16B aligned
5791 * and must be cleared to zero before the request is made.
5794 /* This bit must be '1' for the led0_id field to be configured. */
5795 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_ID UINT32_C(0x1)
5796 /* This bit must be '1' for the led0_state field to be configured. */
5797 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_STATE UINT32_C(0x2)
5798 /* This bit must be '1' for the led0_color field to be configured. */
5799 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_COLOR UINT32_C(0x4)
5801 * This bit must be '1' for the led0_blink_on field to be
5804 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_ON UINT32_C(0x8)
5806 * This bit must be '1' for the led0_blink_off field to be
5809 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_BLINK_OFF UINT32_C(0x10)
5811 * This bit must be '1' for the led0_group_id field to be
5814 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED0_GROUP_ID UINT32_C(0x20)
5815 /* This bit must be '1' for the led1_id field to be configured. */
5816 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_ID UINT32_C(0x40)
5817 /* This bit must be '1' for the led1_state field to be configured. */
5818 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_STATE UINT32_C(0x80)
5819 /* This bit must be '1' for the led1_color field to be configured. */
5820 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_COLOR UINT32_C(0x100)
5822 * This bit must be '1' for the led1_blink_on field to be
5825 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_ON UINT32_C(0x200)
5827 * This bit must be '1' for the led1_blink_off field to be
5830 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_BLINK_OFF UINT32_C(0x400)
5832 * This bit must be '1' for the led1_group_id field to be
5835 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED1_GROUP_ID UINT32_C(0x800)
5836 /* This bit must be '1' for the led2_id field to be configured. */
5837 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_ID UINT32_C(0x1000)
5838 /* This bit must be '1' for the led2_state field to be configured. */
5839 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_STATE UINT32_C(0x2000)
5840 /* This bit must be '1' for the led2_color field to be configured. */
5841 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_COLOR UINT32_C(0x4000)
5843 * This bit must be '1' for the led2_blink_on field to be
5846 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_ON UINT32_C(0x8000)
5848 * This bit must be '1' for the led2_blink_off field to be
5851 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_BLINK_OFF UINT32_C(0x10000)
5853 * This bit must be '1' for the led2_group_id field to be
5856 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED2_GROUP_ID UINT32_C(0x20000)
5857 /* This bit must be '1' for the led3_id field to be configured. */
5858 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_ID UINT32_C(0x40000)
5859 /* This bit must be '1' for the led3_state field to be configured. */
5860 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_STATE UINT32_C(0x80000)
5861 /* This bit must be '1' for the led3_color field to be configured. */
5862 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_COLOR UINT32_C(0x100000)
5864 * This bit must be '1' for the led3_blink_on field to be
5867 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_ON UINT32_C(0x200000)
5869 * This bit must be '1' for the led3_blink_off field to be
5872 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_BLINK_OFF \
5875 * This bit must be '1' for the led3_group_id field to be
5878 #define HWRM_PORT_LED_CFG_INPUT_ENABLES_LED3_GROUP_ID UINT32_C(0x800000)
5880 /* Port ID of port whose LEDs are configured. */
5883 * The number of LEDs that are being configured. Up to 4 LEDs
5884 * can be configured with this command.
5887 /* Reserved field. */
5889 /* An identifier for the LED #0. */
5891 /* The requested state of the LED #0. */
5892 /* Default state of the LED */
5893 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_DEFAULT UINT32_C(0x0)
5895 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_OFF UINT32_C(0x1)
5897 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_ON UINT32_C(0x2)
5899 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINK UINT32_C(0x3)
5900 /* Blink Alternately */
5901 #define HWRM_PORT_LED_CFG_INPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
5903 /* The requested color of LED #0. */
5905 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_DEFAULT UINT32_C(0x0)
5907 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_AMBER UINT32_C(0x1)
5909 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREEN UINT32_C(0x2)
5910 /* Green or Amber */
5911 #define HWRM_PORT_LED_CFG_INPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
5913 uint16_t led0_blink_on;
5915 * If the LED #0 state is "blink" or "blinkalt", then this field
5916 * represents the requested time in milliseconds to keep LED on
5919 uint16_t led0_blink_off;
5921 * If the LED #0 state is "blink" or "blinkalt", then this field
5922 * represents the requested time in milliseconds to keep LED off
5925 uint8_t led0_group_id;
5927 * An identifier for the group of LEDs that LED #0 belongs to.
5928 * If set to 0, then the LED #0 shall not be grouped and shall
5929 * be treated as an individual resource. For all other non-zero
5930 * values of this field, LED #0 shall be grouped together with
5931 * the LEDs with the same group ID value.
5934 /* Reserved field. */
5936 /* An identifier for the LED #1. */
5938 /* The requested state of the LED #1. */
5939 /* Default state of the LED */
5940 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_DEFAULT UINT32_C(0x0)
5942 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_OFF UINT32_C(0x1)
5944 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_ON UINT32_C(0x2)
5946 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINK UINT32_C(0x3)
5947 /* Blink Alternately */
5948 #define HWRM_PORT_LED_CFG_INPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
5950 /* The requested color of LED #1. */
5952 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_DEFAULT UINT32_C(0x0)
5954 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_AMBER UINT32_C(0x1)
5956 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREEN UINT32_C(0x2)
5957 /* Green or Amber */
5958 #define HWRM_PORT_LED_CFG_INPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
5960 uint16_t led1_blink_on;
5962 * If the LED #1 state is "blink" or "blinkalt", then this field
5963 * represents the requested time in milliseconds to keep LED on
5966 uint16_t led1_blink_off;
5968 * If the LED #1 state is "blink" or "blinkalt", then this field
5969 * represents the requested time in milliseconds to keep LED off
5972 uint8_t led1_group_id;
5974 * An identifier for the group of LEDs that LED #1 belongs to.
5975 * If set to 0, then the LED #1 shall not be grouped and shall
5976 * be treated as an individual resource. For all other non-zero
5977 * values of this field, LED #1 shall be grouped together with
5978 * the LEDs with the same group ID value.
5981 /* Reserved field. */
5983 /* An identifier for the LED #2. */
5985 /* The requested state of the LED #2. */
5986 /* Default state of the LED */
5987 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_DEFAULT UINT32_C(0x0)
5989 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_OFF UINT32_C(0x1)
5991 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_ON UINT32_C(0x2)
5993 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINK UINT32_C(0x3)
5994 /* Blink Alternately */
5995 #define HWRM_PORT_LED_CFG_INPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
5997 /* The requested color of LED #2. */
5999 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_DEFAULT UINT32_C(0x0)
6001 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_AMBER UINT32_C(0x1)
6003 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREEN UINT32_C(0x2)
6004 /* Green or Amber */
6005 #define HWRM_PORT_LED_CFG_INPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
6007 uint16_t led2_blink_on;
6009 * If the LED #2 state is "blink" or "blinkalt", then this field
6010 * represents the requested time in milliseconds to keep LED on
6013 uint16_t led2_blink_off;
6015 * If the LED #2 state is "blink" or "blinkalt", then this field
6016 * represents the requested time in milliseconds to keep LED off
6019 uint8_t led2_group_id;
6021 * An identifier for the group of LEDs that LED #2 belongs to.
6022 * If set to 0, then the LED #2 shall not be grouped and shall
6023 * be treated as an individual resource. For all other non-zero
6024 * values of this field, LED #2 shall be grouped together with
6025 * the LEDs with the same group ID value.
6028 /* Reserved field. */
6030 /* An identifier for the LED #3. */
6032 /* The requested state of the LED #3. */
6033 /* Default state of the LED */
6034 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_DEFAULT UINT32_C(0x0)
6036 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_OFF UINT32_C(0x1)
6038 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_ON UINT32_C(0x2)
6040 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINK UINT32_C(0x3)
6041 /* Blink Alternately */
6042 #define HWRM_PORT_LED_CFG_INPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
6044 /* The requested color of LED #3. */
6046 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_DEFAULT UINT32_C(0x0)
6048 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_AMBER UINT32_C(0x1)
6050 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREEN UINT32_C(0x2)
6051 /* Green or Amber */
6052 #define HWRM_PORT_LED_CFG_INPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
6054 uint16_t led3_blink_on;
6056 * If the LED #3 state is "blink" or "blinkalt", then this field
6057 * represents the requested time in milliseconds to keep LED on
6060 uint16_t led3_blink_off;
6062 * If the LED #3 state is "blink" or "blinkalt", then this field
6063 * represents the requested time in milliseconds to keep LED off
6066 uint8_t led3_group_id;
6068 * An identifier for the group of LEDs that LED #3 belongs to.
6069 * If set to 0, then the LED #3 shall not be grouped and shall
6070 * be treated as an individual resource. For all other non-zero
6071 * values of this field, LED #3 shall be grouped together with
6072 * the LEDs with the same group ID value.
6075 /* Reserved field. */
6076 } __attribute__((packed));
6078 /* Output (16 bytes) */
6079 struct hwrm_port_led_cfg_output {
6080 uint16_t error_code;
6082 * Pass/Fail or error type Note: receiver to verify the in
6083 * parameters, and fail the call with an error when appropriate
6086 /* This field returns the type of original request. */
6088 /* This field provides original sequence number of the command. */
6091 * This field is the length of the response in bytes. The last
6092 * byte of the response is a valid flag that will read as '1'
6093 * when the command has been completely written to memory.
6101 * This field is used in Output records to indicate that the
6102 * output is completely written to RAM. This field should be
6103 * read as '1' to indicate that the output has been completely
6104 * written. When writing a command completion or response to an
6105 * internal processor, the order of writes has to be such that
6106 * this field is written last.
6108 } __attribute__((packed));
6110 /* hwrm_port_led_qcfg */
6112 * Description: This function is used to query configuration of LEDs on a given
6113 * port. Each port has individual set of LEDs associated with it. These LEDs are
6114 * used for speed/link configuration as well as activity indicator
6115 * configuration. Up to three LEDs can be configured, one for activity and two
6118 /* Input (24 bytes) */
6119 struct hwrm_port_led_qcfg_input {
6122 * This value indicates what type of request this is. The format
6123 * for the rest of the command is determined by this field.
6127 * This value indicates the what completion ring the request
6128 * will be optionally completed on. If the value is -1, then no
6129 * CR completion will be generated. Any other value must be a
6130 * valid CR ring_id value for this function.
6133 /* This value indicates the command sequence number. */
6136 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6137 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6142 * This is the host address where the response will be written
6143 * when the request is complete. This area must be 16B aligned
6144 * and must be cleared to zero before the request is made.
6147 /* Port ID of port whose LED configuration is being queried. */
6148 uint16_t unused_0[3];
6149 } __attribute__((packed));
6151 /* Output (56 bytes) */
6152 struct hwrm_port_led_qcfg_output {
6153 uint16_t error_code;
6155 * Pass/Fail or error type Note: receiver to verify the in
6156 * parameters, and fail the call with an error when appropriate
6159 /* This field returns the type of original request. */
6161 /* This field provides original sequence number of the command. */
6164 * This field is the length of the response in bytes. The last
6165 * byte of the response is a valid flag that will read as '1'
6166 * when the command has been completely written to memory.
6170 * The number of LEDs that are configured on this port. Up to 4
6171 * LEDs can be returned in the response.
6174 /* An identifier for the LED #0. */
6176 /* The type of LED #0. */
6178 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_SPEED UINT32_C(0x0)
6180 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
6182 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_TYPE_INVALID UINT32_C(0xff)
6184 /* The current state of the LED #0. */
6185 /* Default state of the LED */
6186 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_DEFAULT UINT32_C(0x0)
6188 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_OFF UINT32_C(0x1)
6190 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_ON UINT32_C(0x2)
6192 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINK UINT32_C(0x3)
6193 /* Blink Alternately */
6194 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_STATE_BLINKALT UINT32_C(0x4)
6196 /* The color of LED #0. */
6198 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_DEFAULT UINT32_C(0x0)
6200 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_AMBER UINT32_C(0x1)
6202 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREEN UINT32_C(0x2)
6203 /* Green or Amber */
6204 #define HWRM_PORT_LED_QCFG_OUTPUT_LED0_COLOR_GREENAMBER UINT32_C(0x3)
6206 uint16_t led0_blink_on;
6208 * If the LED #0 state is "blink" or "blinkalt", then this field
6209 * represents the requested time in milliseconds to keep LED on
6212 uint16_t led0_blink_off;
6214 * If the LED #0 state is "blink" or "blinkalt", then this field
6215 * represents the requested time in milliseconds to keep LED off
6218 uint8_t led0_group_id;
6220 * An identifier for the group of LEDs that LED #0 belongs to.
6221 * If set to 0, then the LED #0 is not grouped. For all other
6222 * non-zero values of this field, LED #0 is grouped together
6223 * with the LEDs with the same group ID value.
6226 /* An identifier for the LED #1. */
6228 /* The type of LED #1. */
6230 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_SPEED UINT32_C(0x0)
6232 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
6234 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_TYPE_INVALID UINT32_C(0xff)
6236 /* The current state of the LED #1. */
6237 /* Default state of the LED */
6238 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_DEFAULT UINT32_C(0x0)
6240 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_OFF UINT32_C(0x1)
6242 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_ON UINT32_C(0x2)
6244 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINK UINT32_C(0x3)
6245 /* Blink Alternately */
6246 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_STATE_BLINKALT UINT32_C(0x4)
6248 /* The color of LED #1. */
6250 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_DEFAULT UINT32_C(0x0)
6252 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_AMBER UINT32_C(0x1)
6254 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREEN UINT32_C(0x2)
6255 /* Green or Amber */
6256 #define HWRM_PORT_LED_QCFG_OUTPUT_LED1_COLOR_GREENAMBER UINT32_C(0x3)
6258 uint16_t led1_blink_on;
6260 * If the LED #1 state is "blink" or "blinkalt", then this field
6261 * represents the requested time in milliseconds to keep LED on
6264 uint16_t led1_blink_off;
6266 * If the LED #1 state is "blink" or "blinkalt", then this field
6267 * represents the requested time in milliseconds to keep LED off
6270 uint8_t led1_group_id;
6272 * An identifier for the group of LEDs that LED #1 belongs to.
6273 * If set to 0, then the LED #1 is not grouped. For all other
6274 * non-zero values of this field, LED #1 is grouped together
6275 * with the LEDs with the same group ID value.
6278 /* An identifier for the LED #2. */
6280 /* The type of LED #2. */
6282 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_SPEED UINT32_C(0x0)
6284 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
6286 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_TYPE_INVALID UINT32_C(0xff)
6288 /* The current state of the LED #2. */
6289 /* Default state of the LED */
6290 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_DEFAULT UINT32_C(0x0)
6292 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_OFF UINT32_C(0x1)
6294 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_ON UINT32_C(0x2)
6296 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINK UINT32_C(0x3)
6297 /* Blink Alternately */
6298 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_STATE_BLINKALT UINT32_C(0x4)
6300 /* The color of LED #2. */
6302 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_DEFAULT UINT32_C(0x0)
6304 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_AMBER UINT32_C(0x1)
6306 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREEN UINT32_C(0x2)
6307 /* Green or Amber */
6308 #define HWRM_PORT_LED_QCFG_OUTPUT_LED2_COLOR_GREENAMBER UINT32_C(0x3)
6310 uint16_t led2_blink_on;
6312 * If the LED #2 state is "blink" or "blinkalt", then this field
6313 * represents the requested time in milliseconds to keep LED on
6316 uint16_t led2_blink_off;
6318 * If the LED #2 state is "blink" or "blinkalt", then this field
6319 * represents the requested time in milliseconds to keep LED off
6322 uint8_t led2_group_id;
6324 * An identifier for the group of LEDs that LED #2 belongs to.
6325 * If set to 0, then the LED #2 is not grouped. For all other
6326 * non-zero values of this field, LED #2 is grouped together
6327 * with the LEDs with the same group ID value.
6330 /* An identifier for the LED #3. */
6332 /* The type of LED #3. */
6334 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_SPEED UINT32_C(0x0)
6336 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
6338 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_TYPE_INVALID UINT32_C(0xff)
6340 /* The current state of the LED #3. */
6341 /* Default state of the LED */
6342 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_DEFAULT UINT32_C(0x0)
6344 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_OFF UINT32_C(0x1)
6346 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_ON UINT32_C(0x2)
6348 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINK UINT32_C(0x3)
6349 /* Blink Alternately */
6350 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_STATE_BLINKALT UINT32_C(0x4)
6352 /* The color of LED #3. */
6354 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_DEFAULT UINT32_C(0x0)
6356 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_AMBER UINT32_C(0x1)
6358 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREEN UINT32_C(0x2)
6359 /* Green or Amber */
6360 #define HWRM_PORT_LED_QCFG_OUTPUT_LED3_COLOR_GREENAMBER UINT32_C(0x3)
6362 uint16_t led3_blink_on;
6364 * If the LED #3 state is "blink" or "blinkalt", then this field
6365 * represents the requested time in milliseconds to keep LED on
6368 uint16_t led3_blink_off;
6370 * If the LED #3 state is "blink" or "blinkalt", then this field
6371 * represents the requested time in milliseconds to keep LED off
6374 uint8_t led3_group_id;
6376 * An identifier for the group of LEDs that LED #3 belongs to.
6377 * If set to 0, then the LED #3 is not grouped. For all other
6378 * non-zero values of this field, LED #3 is grouped together
6379 * with the LEDs with the same group ID value.
6388 * This field is used in Output records to indicate that the
6389 * output is completely written to RAM. This field should be
6390 * read as '1' to indicate that the output has been completely
6391 * written. When writing a command completion or response to an
6392 * internal processor, the order of writes has to be such that
6393 * this field is written last.
6395 } __attribute__((packed));
6397 /* hwrm_port_led_qcaps */
6399 * Description: This function is used to query capabilities of LEDs on a given
6400 * port. Each port has individual set of LEDs associated with it. These LEDs are
6401 * used for speed/link configuration as well as activity indicator
6404 /* Input (24 bytes) */
6405 struct hwrm_port_led_qcaps_input {
6408 * This value indicates what type of request this is. The format
6409 * for the rest of the command is determined by this field.
6413 * This value indicates the what completion ring the request
6414 * will be optionally completed on. If the value is -1, then no
6415 * CR completion will be generated. Any other value must be a
6416 * valid CR ring_id value for this function.
6419 /* This value indicates the command sequence number. */
6422 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6423 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6428 * This is the host address where the response will be written
6429 * when the request is complete. This area must be 16B aligned
6430 * and must be cleared to zero before the request is made.
6433 /* Port ID of port whose LED configuration is being queried. */
6434 uint16_t unused_0[3];
6435 } __attribute__((packed));
6437 /* Output (48 bytes) */
6438 struct hwrm_port_led_qcaps_output {
6439 uint16_t error_code;
6441 * Pass/Fail or error type Note: receiver to verify the in
6442 * parameters, and fail the call with an error when appropriate
6445 /* This field returns the type of original request. */
6447 /* This field provides original sequence number of the command. */
6450 * This field is the length of the response in bytes. The last
6451 * byte of the response is a valid flag that will read as '1'
6452 * when the command has been completely written to memory.
6456 * The number of LEDs that are configured on this port. Up to 4
6457 * LEDs can be returned in the response.
6459 uint8_t unused_0[3];
6460 /* Reserved for future use. */
6462 /* An identifier for the LED #0. */
6464 /* The type of LED #0. */
6466 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_SPEED UINT32_C(0x0)
6468 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_ACTIVITY UINT32_C(0x1)
6470 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_TYPE_INVALID UINT32_C(0xff)
6471 uint8_t led0_group_id;
6473 * An identifier for the group of LEDs that LED #0 belongs to.
6474 * If set to 0, then the LED #0 cannot be grouped. For all other
6475 * non-zero values of this field, LED #0 is grouped together
6476 * with the LEDs with the same group ID value.
6479 uint16_t led0_state_caps;
6480 /* The states supported by LED #0. */
6482 * If set to 1, this LED is enabled. If set to 0, this LED is
6485 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ENABLED UINT32_C(0x1)
6487 * If set to 1, off state is supported on this LED. If set to 0,
6488 * off state is not supported on this LED.
6490 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_OFF_SUPPORTED \
6493 * If set to 1, on state is supported on this LED. If set to 0,
6494 * on state is not supported on this LED.
6496 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_ON_SUPPORTED \
6499 * If set to 1, blink state is supported on this LED. If set to
6500 * 0, blink state is not supported on this LED.
6502 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_SUPPORTED \
6505 * If set to 1, blink_alt state is supported on this LED. If set
6506 * to 0, blink_alt state is not supported on this LED.
6508 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_STATE_CAPS_BLINK_ALT_SUPPORTED \
6510 uint16_t led0_color_caps;
6511 /* The colors supported by LED #0. */
6513 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_RSVD UINT32_C(0x1)
6515 * If set to 1, Amber color is supported on this LED. If set to
6516 * 0, Amber color is not supported on this LED.
6518 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_AMBER_SUPPORTED \
6521 * If set to 1, Green color is supported on this LED. If set to
6522 * 0, Green color is not supported on this LED.
6524 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED0_COLOR_CAPS_GREEN_SUPPORTED \
6527 /* An identifier for the LED #1. */
6529 /* The type of LED #1. */
6531 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_SPEED UINT32_C(0x0)
6533 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_ACTIVITY UINT32_C(0x1)
6535 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_TYPE_INVALID UINT32_C(0xff)
6536 uint8_t led1_group_id;
6538 * An identifier for the group of LEDs that LED #1 belongs to.
6539 * If set to 0, then the LED #0 cannot be grouped. For all other
6540 * non-zero values of this field, LED #0 is grouped together
6541 * with the LEDs with the same group ID value.
6544 uint16_t led1_state_caps;
6545 /* The states supported by LED #1. */
6547 * If set to 1, this LED is enabled. If set to 0, this LED is
6550 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ENABLED UINT32_C(0x1)
6552 * If set to 1, off state is supported on this LED. If set to 0,
6553 * off state is not supported on this LED.
6555 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_OFF_SUPPORTED \
6558 * If set to 1, on state is supported on this LED. If set to 0,
6559 * on state is not supported on this LED.
6561 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_ON_SUPPORTED \
6564 * If set to 1, blink state is supported on this LED. If set to
6565 * 0, blink state is not supported on this LED.
6567 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_SUPPORTED \
6570 * If set to 1, blink_alt state is supported on this LED. If set
6571 * to 0, blink_alt state is not supported on this LED.
6573 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_STATE_CAPS_BLINK_ALT_SUPPORTED \
6575 uint16_t led1_color_caps;
6576 /* The colors supported by LED #1. */
6578 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_RSVD UINT32_C(0x1)
6580 * If set to 1, Amber color is supported on this LED. If set to
6581 * 0, Amber color is not supported on this LED.
6583 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_AMBER_SUPPORTED \
6586 * If set to 1, Green color is supported on this LED. If set to
6587 * 0, Green color is not supported on this LED.
6589 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED1_COLOR_CAPS_GREEN_SUPPORTED \
6592 /* An identifier for the LED #2. */
6594 /* The type of LED #2. */
6596 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_SPEED UINT32_C(0x0)
6598 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_ACTIVITY UINT32_C(0x1)
6600 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_TYPE_INVALID UINT32_C(0xff)
6601 uint8_t led2_group_id;
6603 * An identifier for the group of LEDs that LED #0 belongs to.
6604 * If set to 0, then the LED #0 cannot be grouped. For all other
6605 * non-zero values of this field, LED #0 is grouped together
6606 * with the LEDs with the same group ID value.
6609 uint16_t led2_state_caps;
6610 /* The states supported by LED #2. */
6612 * If set to 1, this LED is enabled. If set to 0, this LED is
6615 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ENABLED UINT32_C(0x1)
6617 * If set to 1, off state is supported on this LED. If set to 0,
6618 * off state is not supported on this LED.
6620 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_OFF_SUPPORTED \
6623 * If set to 1, on state is supported on this LED. If set to 0,
6624 * on state is not supported on this LED.
6626 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_ON_SUPPORTED \
6629 * If set to 1, blink state is supported on this LED. If set to
6630 * 0, blink state is not supported on this LED.
6632 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_SUPPORTED \
6635 * If set to 1, blink_alt state is supported on this LED. If set
6636 * to 0, blink_alt state is not supported on this LED.
6638 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_STATE_CAPS_BLINK_ALT_SUPPORTED \
6640 uint16_t led2_color_caps;
6641 /* The colors supported by LED #2. */
6643 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_RSVD UINT32_C(0x1)
6645 * If set to 1, Amber color is supported on this LED. If set to
6646 * 0, Amber color is not supported on this LED.
6648 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_AMBER_SUPPORTED \
6651 * If set to 1, Green color is supported on this LED. If set to
6652 * 0, Green color is not supported on this LED.
6654 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED2_COLOR_CAPS_GREEN_SUPPORTED \
6657 /* An identifier for the LED #3. */
6659 /* The type of LED #3. */
6661 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_SPEED UINT32_C(0x0)
6663 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_ACTIVITY UINT32_C(0x1)
6665 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_TYPE_INVALID UINT32_C(0xff)
6666 uint8_t led3_group_id;
6668 * An identifier for the group of LEDs that LED #3 belongs to.
6669 * If set to 0, then the LED #0 cannot be grouped. For all other
6670 * non-zero values of this field, LED #0 is grouped together
6671 * with the LEDs with the same group ID value.
6674 uint16_t led3_state_caps;
6675 /* The states supported by LED #3. */
6677 * If set to 1, this LED is enabled. If set to 0, this LED is
6680 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ENABLED UINT32_C(0x1)
6682 * If set to 1, off state is supported on this LED. If set to 0,
6683 * off state is not supported on this LED.
6685 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_OFF_SUPPORTED \
6688 * If set to 1, on state is supported on this LED. If set to 0,
6689 * on state is not supported on this LED.
6691 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_ON_SUPPORTED \
6694 * If set to 1, blink state is supported on this LED. If set to
6695 * 0, blink state is not supported on this LED.
6697 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_SUPPORTED \
6700 * If set to 1, blink_alt state is supported on this LED. If set
6701 * to 0, blink_alt state is not supported on this LED.
6703 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_STATE_CAPS_BLINK_ALT_SUPPORTED \
6705 uint16_t led3_color_caps;
6706 /* The colors supported by LED #3. */
6708 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_RSVD UINT32_C(0x1)
6710 * If set to 1, Amber color is supported on this LED. If set to
6711 * 0, Amber color is not supported on this LED.
6713 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_AMBER_SUPPORTED \
6716 * If set to 1, Green color is supported on this LED. If set to
6717 * 0, Green color is not supported on this LED.
6719 #define HWRM_PORT_LED_QCAPS_OUTPUT_LED3_COLOR_CAPS_GREEN_SUPPORTED \
6726 * This field is used in Output records to indicate that the
6727 * output is completely written to RAM. This field should be
6728 * read as '1' to indicate that the output has been completely
6729 * written. When writing a command completion or response to an
6730 * internal processor, the order of writes has to be such that
6731 * this field is written last.
6733 } __attribute__((packed));
6735 /* hwrm_queue_qportcfg */
6737 * Description: This function is called by a driver to query queue configuration
6738 * of a port. # The HWRM shall at least advertise one queue with lossy service
6739 * profile. # The driver shall use this command to query queue ids before
6740 * configuring or using any queues. # If a service profile is not set for a
6741 * queue, then the driver shall not use that queue without configuring a service
6742 * profile for it. # If the driver is not allowed to configure service profiles,
6743 * then the driver shall only use queues for which service profiles are pre-
6746 /* Input (24 bytes) */
6747 struct hwrm_queue_qportcfg_input {
6750 * This value indicates what type of request this is. The format
6751 * for the rest of the command is determined by this field.
6755 * This value indicates the what completion ring the request
6756 * will be optionally completed on. If the value is -1, then no
6757 * CR completion will be generated. Any other value must be a
6758 * valid CR ring_id value for this function.
6761 /* This value indicates the command sequence number. */
6764 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
6765 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
6770 * This is the host address where the response will be written
6771 * when the request is complete. This area must be 16B aligned
6772 * and must be cleared to zero before the request is made.
6776 * Enumeration denoting the RX, TX type of the resource. This
6777 * enumeration is used for resources that are similar for both
6778 * TX and RX paths of the chip.
6780 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH UINT32_C(0x1)
6782 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX UINT32_C(0x0)
6784 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX UINT32_C(0x1)
6785 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
6786 QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
6789 * Port ID of port for which the queue configuration is being
6790 * queried. This field is only required when sent by IPC.
6793 } __attribute__((packed));
6795 /* Output (32 bytes) */
6796 struct hwrm_queue_qportcfg_output {
6797 uint16_t error_code;
6799 * Pass/Fail or error type Note: receiver to verify the in
6800 * parameters, and fail the call with an error when appropriate
6803 /* This field returns the type of original request. */
6805 /* This field provides original sequence number of the command. */
6808 * This field is the length of the response in bytes. The last
6809 * byte of the response is a valid flag that will read as '1'
6810 * when the command has been completely written to memory.
6812 uint8_t max_configurable_queues;
6814 * The maximum number of queues that can be configured on this
6815 * port. Valid values range from 1 through 8.
6817 uint8_t max_configurable_lossless_queues;
6819 * The maximum number of lossless queues that can be configured
6820 * on this port. Valid values range from 0 through 8.
6822 uint8_t queue_cfg_allowed;
6824 * Bitmask indicating which queues can be configured by the
6825 * hwrm_queue_cfg command. Each bit represents a specific queue
6826 * where bit 0 represents queue 0 and bit 7 represents queue 7.
6827 * # A value of 0 indicates that the queue is not configurable
6828 * by the hwrm_queue_cfg command. # A value of 1 indicates that
6829 * the queue is configurable. # A hwrm_queue_cfg command shall
6830 * return error when trying to configure a queue not
6833 uint8_t queue_cfg_info;
6834 /* Information about queue configuration. */
6836 * If this flag is set to '1', then the queues are configured
6837 * asymmetrically on TX and RX sides. If this flag is set to
6838 * '0', then the queues are configured symmetrically on TX and
6839 * RX sides. For symmetric configuration, the queue
6840 * configuration including queue ids and service profiles on the
6841 * TX side is the same as the corresponding queue configuration
6844 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG UINT32_C(0x1)
6845 uint8_t queue_pfcenable_cfg_allowed;
6847 * Bitmask indicating which queues can be configured by the
6848 * hwrm_queue_pfcenable_cfg command. Each bit represents a
6849 * specific priority where bit 0 represents priority 0 and bit 7
6850 * represents priority 7. # A value of 0 indicates that the
6851 * priority is not configurable by the hwrm_queue_pfcenable_cfg
6852 * command. # A value of 1 indicates that the priority is
6853 * configurable. # A hwrm_queue_pfcenable_cfg command shall
6854 * return error when trying to configure a priority that is not
6857 uint8_t queue_pri2cos_cfg_allowed;
6859 * Bitmask indicating which queues can be configured by the
6860 * hwrm_queue_pri2cos_cfg command. Each bit represents a
6861 * specific queue where bit 0 represents queue 0 and bit 7
6862 * represents queue 7. # A value of 0 indicates that the queue
6863 * is not configurable by the hwrm_queue_pri2cos_cfg command. #
6864 * A value of 1 indicates that the queue is configurable. # A
6865 * hwrm_queue_pri2cos_cfg command shall return error when trying
6866 * to configure a queue that is not configurable.
6868 uint8_t queue_cos2bw_cfg_allowed;
6870 * Bitmask indicating which queues can be configured by the
6871 * hwrm_queue_pri2cos_cfg command. Each bit represents a
6872 * specific queue where bit 0 represents queue 0 and bit 7
6873 * represents queue 7. # A value of 0 indicates that the queue
6874 * is not configurable by the hwrm_queue_pri2cos_cfg command. #
6875 * A value of 1 indicates that the queue is configurable. # A
6876 * hwrm_queue_pri2cos_cfg command shall return error when trying
6877 * to configure a queue not configurable.
6881 * ID of CoS Queue 0. FF - Invalid id # This ID can be used on
6882 * any subsequent call to an hwrm command that takes a queue id.
6883 * # IDs must always be queried by this command before any use
6884 * by the driver or software. # Any driver or software should
6885 * not make any assumptions about queue IDs. # A value of 0xff
6886 * indicates that the queue is not available. # Available queues
6887 * may not be in sequential order.
6889 uint8_t queue_id0_service_profile;
6890 /* This value is applicable to CoS queues only. */
6891 /* Lossy (best-effort) */
6892 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
6895 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
6898 * Set to 0xFF... (All Fs) if there is no
6899 * service profile specified
6901 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
6905 * ID of CoS Queue 1. FF - Invalid id # This ID can be used on
6906 * any subsequent call to an hwrm command that takes a queue id.
6907 * # IDs must always be queried by this command before any use
6908 * by the driver or software. # Any driver or software should
6909 * not make any assumptions about queue IDs. # A value of 0xff
6910 * indicates that the queue is not available. # Available queues
6911 * may not be in sequential order.
6913 uint8_t queue_id1_service_profile;
6914 /* This value is applicable to CoS queues only. */
6915 /* Lossy (best-effort) */
6916 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
6919 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
6922 * Set to 0xFF... (All Fs) if there is no
6923 * service profile specified
6925 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
6929 * ID of CoS Queue 2. FF - Invalid id # This ID can be used on
6930 * any subsequent call to an hwrm command that takes a queue id.
6931 * # IDs must always be queried by this command before any use
6932 * by the driver or software. # Any driver or software should
6933 * not make any assumptions about queue IDs. # A value of 0xff
6934 * indicates that the queue is not available. # Available queues
6935 * may not be in sequential order.
6937 uint8_t queue_id2_service_profile;
6938 /* This value is applicable to CoS queues only. */
6939 /* Lossy (best-effort) */
6940 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
6943 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
6946 * Set to 0xFF... (All Fs) if there is no
6947 * service profile specified
6949 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
6953 * ID of CoS Queue 3. FF - Invalid id # This ID can be used on
6954 * any subsequent call to an hwrm command that takes a queue id.
6955 * # IDs must always be queried by this command before any use
6956 * by the driver or software. # Any driver or software should
6957 * not make any assumptions about queue IDs. # A value of 0xff
6958 * indicates that the queue is not available. # Available queues
6959 * may not be in sequential order.
6961 uint8_t queue_id3_service_profile;
6962 /* This value is applicable to CoS queues only. */
6963 /* Lossy (best-effort) */
6964 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
6967 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
6970 * Set to 0xFF... (All Fs) if there is no
6971 * service profile specified
6973 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
6977 * ID of CoS Queue 4. FF - Invalid id # This ID can be used on
6978 * any subsequent call to an hwrm command that takes a queue id.
6979 * # IDs must always be queried by this command before any use
6980 * by the driver or software. # Any driver or software should
6981 * not make any assumptions about queue IDs. # A value of 0xff
6982 * indicates that the queue is not available. # Available queues
6983 * may not be in sequential order.
6985 uint8_t queue_id4_service_profile;
6986 /* This value is applicable to CoS queues only. */
6987 /* Lossy (best-effort) */
6988 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
6991 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
6994 * Set to 0xFF... (All Fs) if there is no
6995 * service profile specified
6997 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
7001 * ID of CoS Queue 5. FF - Invalid id # This ID can be used on
7002 * any subsequent call to an hwrm command that takes a queue id.
7003 * # IDs must always be queried by this command before any use
7004 * by the driver or software. # Any driver or software should
7005 * not make any assumptions about queue IDs. # A value of 0xff
7006 * indicates that the queue is not available. # Available queues
7007 * may not be in sequential order.
7009 uint8_t queue_id5_service_profile;
7010 /* This value is applicable to CoS queues only. */
7011 /* Lossy (best-effort) */
7012 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
7015 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
7018 * Set to 0xFF... (All Fs) if there is no
7019 * service profile specified
7021 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
7025 * ID of CoS Queue 6. FF - Invalid id # This ID can be used on
7026 * any subsequent call to an hwrm command that takes a queue id.
7027 * # IDs must always be queried by this command before any use
7028 * by the driver or software. # Any driver or software should
7029 * not make any assumptions about queue IDs. # A value of 0xff
7030 * indicates that the queue is not available. # Available queues
7031 * may not be in sequential order.
7033 uint8_t queue_id6_service_profile;
7034 /* This value is applicable to CoS queues only. */
7035 /* Lossy (best-effort) */
7036 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
7039 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
7042 * Set to 0xFF... (All Fs) if there is no
7043 * service profile specified
7045 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
7049 * ID of CoS Queue 7. FF - Invalid id # This ID can be used on
7050 * any subsequent call to an hwrm command that takes a queue id.
7051 * # IDs must always be queried by this command before any use
7052 * by the driver or software. # Any driver or software should
7053 * not make any assumptions about queue IDs. # A value of 0xff
7054 * indicates that the queue is not available. # Available queues
7055 * may not be in sequential order.
7057 uint8_t queue_id7_service_profile;
7058 /* This value is applicable to CoS queues only. */
7059 /* Lossy (best-effort) */
7060 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
7063 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
7066 * Set to 0xFF... (All Fs) if there is no
7067 * service profile specified
7069 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
7073 * This field is used in Output records to indicate that the
7074 * output is completely written to RAM. This field should be
7075 * read as '1' to indicate that the output has been completely
7076 * written. When writing a command completion or response to an
7077 * internal processor, the order of writes has to be such that
7078 * this field is written last.
7080 } __attribute__((packed));
7082 /* hwrm_vnic_alloc */
7084 * Description: This VNIC is a resource in the RX side of the chip that is used
7085 * to represent a virtual host "interface". # At the time of VNIC allocation or
7086 * configuration, the function can specify whether it wants the requested VNIC
7087 * to be the default VNIC for the function or not. # If a function requests
7088 * allocation of a VNIC for the first time and a VNIC is successfully allocated
7089 * by the HWRM, then the HWRM shall make the allocated VNIC as the default VNIC
7090 * for that function. # The default VNIC shall be used for the default action
7091 * for a partition or function. # For each VNIC allocated on a function, a
7092 * mapping on the RX side to map the allocated VNIC to source virtual interface
7093 * shall be performed by the HWRM. This should be hidden to the function driver
7094 * requesting the VNIC allocation. This enables broadcast/multicast replication
7095 * with source knockout. # If multicast replication with source knockout is
7096 * enabled, then the internal VNIC to SVIF mapping data structures shall be
7097 * programmed at the time of VNIC allocation.
7099 /* Input (24 bytes) */
7100 struct hwrm_vnic_alloc_input {
7103 * This value indicates what type of request this is. The format
7104 * for the rest of the command is determined by this field.
7108 * This value indicates the what completion ring the request
7109 * will be optionally completed on. If the value is -1, then no
7110 * CR completion will be generated. Any other value must be a
7111 * valid CR ring_id value for this function.
7114 /* This value indicates the command sequence number. */
7117 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7118 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7123 * This is the host address where the response will be written
7124 * when the request is complete. This area must be 16B aligned
7125 * and must be cleared to zero before the request is made.
7129 * When this bit is '1', this VNIC is requested to be the
7130 * default VNIC for this function.
7132 #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT UINT32_C(0x1)
7134 } __attribute__((packed));
7136 /* Output (16 bytes) */
7137 struct hwrm_vnic_alloc_output {
7138 uint16_t error_code;
7140 * Pass/Fail or error type Note: receiver to verify the in
7141 * parameters, and fail the call with an error when appropriate
7144 /* This field returns the type of original request. */
7146 /* This field provides original sequence number of the command. */
7149 * This field is the length of the response in bytes. The last
7150 * byte of the response is a valid flag that will read as '1'
7151 * when the command has been completely written to memory.
7154 /* Logical vnic ID */
7160 * This field is used in Output records to indicate that the
7161 * output is completely written to RAM. This field should be
7162 * read as '1' to indicate that the output has been completely
7163 * written. When writing a command completion or response to an
7164 * internal processor, the order of writes has to be such that
7165 * this field is written last.
7167 } __attribute__((packed));
7169 /* hwrm_vnic_free */
7171 * Description: Free a VNIC resource. Idle any resources associated with the
7172 * VNIC as well as the VNIC. Reset and release all resources associated with the
7175 /* Input (24 bytes) */
7176 struct hwrm_vnic_free_input {
7179 * This value indicates what type of request this is. The format
7180 * for the rest of the command is determined by this field.
7184 * This value indicates the what completion ring the request
7185 * will be optionally completed on. If the value is -1, then no
7186 * CR completion will be generated. Any other value must be a
7187 * valid CR ring_id value for this function.
7190 /* This value indicates the command sequence number. */
7193 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7194 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7199 * This is the host address where the response will be written
7200 * when the request is complete. This area must be 16B aligned
7201 * and must be cleared to zero before the request is made.
7204 /* Logical vnic ID */
7206 } __attribute__((packed));
7208 /* Output (16 bytes) */
7209 struct hwrm_vnic_free_output {
7210 uint16_t error_code;
7212 * Pass/Fail or error type Note: receiver to verify the in
7213 * parameters, and fail the call with an error when appropriate
7216 /* This field returns the type of original request. */
7218 /* This field provides original sequence number of the command. */
7221 * This field is the length of the response in bytes. The last
7222 * byte of the response is a valid flag that will read as '1'
7223 * when the command has been completely written to memory.
7231 * This field is used in Output records to indicate that the
7232 * output is completely written to RAM. This field should be
7233 * read as '1' to indicate that the output has been completely
7234 * written. When writing a command completion or response to an
7235 * internal processor, the order of writes has to be such that
7236 * this field is written last.
7238 } __attribute__((packed));
7241 /* Description: Configure the RX VNIC structure. */
7242 /* Input (40 bytes) */
7243 struct hwrm_vnic_cfg_input {
7246 * This value indicates what type of request this is. The format
7247 * for the rest of the command is determined by this field.
7251 * This value indicates the what completion ring the request
7252 * will be optionally completed on. If the value is -1, then no
7253 * CR completion will be generated. Any other value must be a
7254 * valid CR ring_id value for this function.
7257 /* This value indicates the command sequence number. */
7260 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7261 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7266 * This is the host address where the response will be written
7267 * when the request is complete. This area must be 16B aligned
7268 * and must be cleared to zero before the request is made.
7272 * When this bit is '1', the VNIC is requested to be the default
7273 * VNIC for the function.
7275 #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT UINT32_C(0x1)
7277 * When this bit is '1', the VNIC is being configured to strip
7278 * VLAN in the RX path. If set to '0', then VLAN stripping is
7279 * disabled on this VNIC.
7281 #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE UINT32_C(0x2)
7283 * When this bit is '1', the VNIC is being configured to buffer
7284 * receive packets in the hardware until the host posts new
7285 * receive buffers. If set to '0', then bd_stall is being
7286 * configured to be disabled on this VNIC.
7288 #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE UINT32_C(0x4)
7290 * When this bit is '1', the VNIC is being configured to receive
7291 * both RoCE and non-RoCE traffic. If set to '0', then this VNIC
7292 * is not configured to be operating in dual VNIC mode.
7294 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE UINT32_C(0x8)
7296 * When this flag is set to '1', the VNIC is requested to be
7297 * configured to receive only RoCE traffic. If this flag is set
7298 * to '0', then this flag shall be ignored by the HWRM. If
7299 * roce_dual_vnic_mode flag is set to '1', then the HWRM client
7300 * shall not set this flag to '1'.
7302 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE UINT32_C(0x10)
7304 * When a VNIC uses one destination ring group for certain
7305 * application (e.g. Receive Flow Steering) where exact match is
7306 * used to direct packets to a VNIC with one destination ring
7307 * group only, there is no need to configure RSS indirection
7308 * table for that VNIC as only one destination ring group is
7309 * used. This flag is used to enable a mode where RSS is enabled
7310 * in the VNIC using a RSS context for computing RSS hash but
7311 * the RSS indirection table is not configured using
7312 * hwrm_vnic_rss_cfg. If this mode is enabled, then the driver
7313 * should not program RSS indirection table for the RSS context
7314 * that is used for computing RSS hash only.
7316 #define HWRM_VNIC_CFG_INPUT_FLAGS_RSS_DFLT_CR_MODE UINT32_C(0x20)
7319 * This bit must be '1' for the dflt_ring_grp field to be
7322 #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP UINT32_C(0x1)
7323 /* This bit must be '1' for the rss_rule field to be configured. */
7324 #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE UINT32_C(0x2)
7325 /* This bit must be '1' for the cos_rule field to be configured. */
7326 #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE UINT32_C(0x4)
7327 /* This bit must be '1' for the lb_rule field to be configured. */
7328 #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE UINT32_C(0x8)
7329 /* This bit must be '1' for the mru field to be configured. */
7330 #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU UINT32_C(0x10)
7332 /* Logical vnic ID */
7333 uint16_t dflt_ring_grp;
7335 * Default Completion ring for the VNIC. This ring will be
7336 * chosen if packet does not match any RSS rules and if there is
7341 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if
7342 * there is no RSS rule.
7346 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if
7347 * there is no COS rule.
7351 * RSS ID for load balancing rule/table structure. 0xFF... (All
7352 * Fs) if there is no LB rule.
7356 * The maximum receive unit of the vnic. Each vnic is associated
7357 * with a function. The vnic mru value overwrites the mru
7358 * setting of the associated function. The HWRM shall make sure
7359 * that vnic mru does not exceed the mru of the port the
7360 * function is associated with.
7363 } __attribute__((packed));
7365 /* Output (16 bytes) */
7366 struct hwrm_vnic_cfg_output {
7367 uint16_t error_code;
7369 * Pass/Fail or error type Note: receiver to verify the in
7370 * parameters, and fail the call with an error when appropriate
7373 /* This field returns the type of original request. */
7375 /* This field provides original sequence number of the command. */
7378 * This field is the length of the response in bytes. The last
7379 * byte of the response is a valid flag that will read as '1'
7380 * when the command has been completely written to memory.
7388 * This field is used in Output records to indicate that the
7389 * output is completely written to RAM. This field should be
7390 * read as '1' to indicate that the output has been completely
7391 * written. When writing a command completion or response to an
7392 * internal processor, the order of writes has to be such that
7393 * this field is written last.
7395 } __attribute__((packed));
7397 /* hwrm_vnic_qcfg */
7399 * Description: Query the RX VNIC structure. This function can be used by a PF
7400 * driver to query its own VNIC resource or VNIC resource of its child VF. This
7401 * function can also be used by a VF driver to query its own VNIC resource.
7403 /* Input (32 bytes) */
7404 struct hwrm_vnic_qcfg_input {
7407 * This value indicates what type of request this is. The format
7408 * for the rest of the command is determined by this field.
7412 * This value indicates the what completion ring the request
7413 * will be optionally completed on. If the value is -1, then no
7414 * CR completion will be generated. Any other value must be a
7415 * valid CR ring_id value for this function.
7418 /* This value indicates the command sequence number. */
7421 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7422 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7427 * This is the host address where the response will be written
7428 * when the request is complete. This area must be 16B aligned
7429 * and must be cleared to zero before the request is made.
7432 /* This bit must be '1' for the vf_id_valid field to be configured. */
7433 #define HWRM_VNIC_QCFG_INPUT_ENABLES_VF_ID_VALID UINT32_C(0x1)
7435 /* Logical vnic ID */
7437 /* ID of Virtual Function whose VNIC resource is being queried. */
7438 uint16_t unused_0[3];
7439 } __attribute__((packed));
7441 /* Output (32 bytes) */
7442 struct hwrm_vnic_qcfg_output {
7443 uint16_t error_code;
7445 * Pass/Fail or error type Note: receiver to verify the in
7446 * parameters, and fail the call with an error when appropriate
7449 /* This field returns the type of original request. */
7451 /* This field provides original sequence number of the command. */
7454 * This field is the length of the response in bytes. The last
7455 * byte of the response is a valid flag that will read as '1'
7456 * when the command has been completely written to memory.
7458 uint16_t dflt_ring_grp;
7459 /* Default Completion ring for the VNIC. */
7462 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if
7463 * there is no RSS rule.
7467 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if
7468 * there is no COS rule.
7472 * RSS ID for load balancing rule/table structure. 0xFF... (All
7473 * Fs) if there is no LB rule.
7476 /* The maximum receive unit of the vnic. */
7481 * When this bit is '1', the VNIC is the default VNIC for the
7484 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_DEFAULT UINT32_C(0x1)
7486 * When this bit is '1', the VNIC is configured to strip VLAN in
7487 * the RX path. If set to '0', then VLAN stripping is disabled
7490 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE UINT32_C(0x2)
7492 * When this bit is '1', the VNIC is configured to buffer
7493 * receive packets in the hardware until the host posts new
7494 * receive buffers. If set to '0', then bd_stall is disabled on
7497 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE UINT32_C(0x4)
7499 * When this bit is '1', the VNIC is configured to receive both
7500 * RoCE and non-RoCE traffic. If set to '0', then this VNIC is
7501 * not configured to operate in dual VNIC mode.
7503 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE UINT32_C(0x8)
7505 * When this flag is set to '1', the VNIC is configured to
7506 * receive only RoCE traffic. When this flag is set to '0', the
7507 * VNIC is not configured to receive only RoCE traffic. If
7508 * roce_dual_vnic_mode flag and this flag both are set to '1',
7509 * then it is an invalid configuration of the VNIC. The HWRM
7510 * should not allow that type of mis-configuration by HWRM
7513 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE UINT32_C(0x10)
7515 * When a VNIC uses one destination ring group for certain
7516 * application (e.g. Receive Flow Steering) where exact match is
7517 * used to direct packets to a VNIC with one destination ring
7518 * group only, there is no need to configure RSS indirection
7519 * table for that VNIC as only one destination ring group is
7520 * used. When this bit is set to '1', then the VNIC is enabled
7521 * in a mode where RSS is enabled in the VNIC using a RSS
7522 * context for computing RSS hash but the RSS indirection table
7523 * is not configured.
7525 #define HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE UINT32_C(0x20)
7532 * This field is used in Output records to indicate that the
7533 * output is completely written to RAM. This field should be
7534 * read as '1' to indicate that the output has been completely
7535 * written. When writing a command completion or response to an
7536 * internal processor, the order of writes has to be such that
7537 * this field is written last.
7539 } __attribute__((packed));
7541 /* hwrm_vnic_rss_cfg */
7542 /* Description: This function is used to enable RSS configuration. */
7543 /* Input (48 bytes) */
7544 struct hwrm_vnic_rss_cfg_input {
7547 * This value indicates what type of request this is. The format
7548 * for the rest of the command is determined by this field.
7552 * This value indicates the what completion ring the request
7553 * will be optionally completed on. If the value is -1, then no
7554 * CR completion will be generated. Any other value must be a
7555 * valid CR ring_id value for this function.
7558 /* This value indicates the command sequence number. */
7561 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7562 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7567 * This is the host address where the response will be written
7568 * when the request is complete. This area must be 16B aligned
7569 * and must be cleared to zero before the request is made.
7573 * When this bit is '1', the RSS hash shall be computed over
7574 * source and destination IPv4 addresses of IPv4 packets.
7576 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4 UINT32_C(0x1)
7578 * When this bit is '1', the RSS hash shall be computed over
7579 * source/destination IPv4 addresses and source/destination
7580 * ports of TCP/IPv4 packets.
7582 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2)
7584 * When this bit is '1', the RSS hash shall be computed over
7585 * source/destination IPv4 addresses and source/destination
7586 * ports of UDP/IPv4 packets.
7588 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4)
7590 * When this bit is '1', the RSS hash shall be computed over
7591 * source and destination IPv4 addresses of IPv6 packets.
7593 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6 UINT32_C(0x8)
7595 * When this bit is '1', the RSS hash shall be computed over
7596 * source/destination IPv6 addresses and source/destination
7597 * ports of TCP/IPv6 packets.
7599 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10)
7601 * When this bit is '1', the RSS hash shall be computed over
7602 * source/destination IPv6 addresses and source/destination
7603 * ports of UDP/IPv6 packets.
7605 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20)
7607 uint64_t ring_grp_tbl_addr;
7608 /* This is the address for rss ring group table */
7609 uint64_t hash_key_tbl_addr;
7610 /* This is the address for rss hash key table */
7611 uint16_t rss_ctx_idx;
7612 /* Index to the rss indirection table. */
7613 uint16_t unused_1[3];
7614 } __attribute__((packed));
7616 /* Output (16 bytes) */
7617 struct hwrm_vnic_rss_cfg_output {
7618 uint16_t error_code;
7620 * Pass/Fail or error type Note: receiver to verify the in
7621 * parameters, and fail the call with an error when appropriate
7624 /* This field returns the type of original request. */
7626 /* This field provides original sequence number of the command. */
7629 * This field is the length of the response in bytes. The last
7630 * byte of the response is a valid flag that will read as '1'
7631 * when the command has been completely written to memory.
7639 * This field is used in Output records to indicate that the
7640 * output is completely written to RAM. This field should be
7641 * read as '1' to indicate that the output has been completely
7642 * written. When writing a command completion or response to an
7643 * internal processor, the order of writes has to be such that
7644 * this field is written last.
7646 } __attribute__((packed));
7648 /* hwrm_vnic_plcmodes_cfg */
7650 * Description: This function can be used to set placement mode configuration of
7653 /* Input (40 bytes) */
7655 struct hwrm_vnic_plcmodes_cfg_input {
7658 * This value indicates what type of request this is. The format for the
7659 * rest of the command is determined by this field.
7663 * This value indicates the what completion ring the request will be
7664 * optionally completed on. If the value is -1, then no CR completion
7665 * will be generated. Any other value must be a valid CR ring_id value
7666 * for this function.
7669 /* This value indicates the command sequence number. */
7672 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
7673 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
7677 * This is the host address where the response will be written when the
7678 * request is complete. This area must be 16B aligned and must be
7679 * cleared to zero before the request is made.
7683 * When this bit is '1', the VNIC shall be configured to use regular
7684 * placement algorithm. By default, the regular placement algorithm
7685 * shall be enabled on the VNIC.
7687 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_REGULAR_PLACEMENT \
7690 * When this bit is '1', the VNIC shall be configured use the jumbo
7691 * placement algorithm.
7693 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_JUMBO_PLACEMENT \
7696 * When this bit is '1', the VNIC shall be configured to enable Header-
7697 * Data split for IPv4 packets according to the following rules: # If
7698 * the packet is identified as TCP/IPv4, then the packet is split at the
7699 * beginning of the TCP payload. # If the packet is identified as
7700 * UDP/IPv4, then the packet is split at the beginning of UDP payload. #
7701 * If the packet is identified as non-TCP and non-UDP IPv4 packet, then
7702 * the packet is split at the beginning of the upper layer protocol
7703 * header carried in the IPv4 packet.
7705 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV4 UINT32_C(0x4)
7707 * When this bit is '1', the VNIC shall be configured to enable Header-
7708 * Data split for IPv6 packets according to the following rules: # If
7709 * the packet is identified as TCP/IPv6, then the packet is split at the
7710 * beginning of the TCP payload. # If the packet is identified as
7711 * UDP/IPv6, then the packet is split at the beginning of UDP payload. #
7712 * If the packet is identified as non-TCP and non-UDP IPv6 packet, then
7713 * the packet is split at the beginning of the upper layer protocol
7714 * header carried in the IPv6 packet.
7716 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_IPV6 UINT32_C(0x8)
7718 * When this bit is '1', the VNIC shall be configured to enable Header-
7719 * Data split for FCoE packets at the beginning of FC payload.
7721 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_FCOE UINT32_C(0x10)
7723 * When this bit is '1', the VNIC shall be configured to enable Header-
7724 * Data split for RoCE packets at the beginning of RoCE payload (after
7727 #define HWRM_VNIC_PLCMODES_CFG_INPUT_FLAGS_HDS_ROCE UINT32_C(0x20)
7730 * This bit must be '1' for the jumbo_thresh_valid field to be
7733 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_JUMBO_THRESH_VALID \
7736 * This bit must be '1' for the hds_offset_valid field to be configured.
7738 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_OFFSET_VALID \
7741 * This bit must be '1' for the hds_threshold_valid field to be
7744 #define HWRM_VNIC_PLCMODES_CFG_INPUT_ENABLES_HDS_THRESHOLD_VALID \
7747 /* Logical vnic ID */
7748 uint16_t jumbo_thresh;
7750 * When jumbo placement algorithm is enabled, this value is used to
7751 * determine the threshold for jumbo placement. Packets with length
7752 * larger than this value will be placed according to the jumbo
7753 * placement algorithm.
7755 uint16_t hds_offset;
7757 * This value is used to determine the offset into packet buffer where
7758 * the split data (payload) will be placed according to one of of HDS
7759 * placement algorithm. The lengths of packet buffers provided for split
7760 * data shall be larger than this value.
7762 uint16_t hds_threshold;
7764 * When one of the HDS placement algorithm is enabled, this value is
7765 * used to determine the threshold for HDS placement. Packets with
7766 * length larger than this value will be placed according to the HDS
7767 * placement algorithm. This value shall be in multiple of 4 bytes.
7769 uint16_t unused_0[3];
7770 } __attribute__((packed));
7772 /* Output (16 bytes) */
7774 struct hwrm_vnic_plcmodes_cfg_output {
7775 uint16_t error_code;
7777 * Pass/Fail or error type Note: receiver to verify the in parameters,
7778 * and fail the call with an error when appropriate
7781 /* This field returns the type of original request. */
7783 /* This field provides original sequence number of the command. */
7786 * This field is the length of the response in bytes. The last byte of
7787 * the response is a valid flag that will read as '1' when the command
7788 * has been completely written to memory.
7796 * This field is used in Output records to indicate that the output is
7797 * completely written to RAM. This field should be read as '1' to
7798 * indicate that the output has been completely written. When writing a
7799 * command completion or response to an internal processor, the order of
7800 * writes has to be such that this field is written last.
7802 } __attribute__((packed));
7804 /* hwrm_vnic_plcmodes_qcfg */
7806 * Description: This function can be used to query placement mode configuration
7809 /* Input (24 bytes) */
7811 struct hwrm_vnic_plcmodes_qcfg_input {
7814 * This value indicates what type of request this is. The format for the
7815 * rest of the command is determined by this field.
7819 * This value indicates the what completion ring the request will be
7820 * optionally completed on. If the value is -1, then no CR completion
7821 * will be generated. Any other value must be a valid CR ring_id value
7822 * for this function.
7825 /* This value indicates the command sequence number. */
7828 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
7829 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
7833 * This is the host address where the response will be written when the
7834 * request is complete. This area must be 16B aligned and must be
7835 * cleared to zero before the request is made.
7838 /* Logical vnic ID */
7840 } __attribute__((packed));
7842 /* Output (24 bytes) */
7844 struct hwrm_vnic_plcmodes_qcfg_output {
7845 uint16_t error_code;
7847 * Pass/Fail or error type Note: receiver to verify the in parameters,
7848 * and fail the call with an error when appropriate
7851 /* This field returns the type of original request. */
7853 /* This field provides original sequence number of the command. */
7856 * This field is the length of the response in bytes. The last byte of
7857 * the response is a valid flag that will read as '1' when the command
7858 * has been completely written to memory.
7862 * When this bit is '1', the VNIC is configured to use regular placement
7865 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_REGULAR_PLACEMENT \
7868 * When this bit is '1', the VNIC is configured to use the jumbo
7869 * placement algorithm.
7871 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_JUMBO_PLACEMENT \
7874 * When this bit is '1', the VNIC is configured to enable Header-Data
7875 * split for IPv4 packets.
7877 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV4 UINT32_C(0x4)
7879 * When this bit is '1', the VNIC is configured to enable Header-Data
7880 * split for IPv6 packets.
7882 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_IPV6 UINT32_C(0x8)
7884 * When this bit is '1', the VNIC is configured to enable Header-Data
7885 * split for FCoE packets.
7887 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_FCOE UINT32_C(0x10)
7889 * When this bit is '1', the VNIC is configured to enable Header-Data
7890 * split for RoCE packets.
7892 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_HDS_ROCE UINT32_C(0x20)
7894 * When this bit is '1', the VNIC is configured to be the default VNIC
7895 * of the requesting function.
7897 #define HWRM_VNIC_PLCMODES_QCFG_OUTPUT_FLAGS_DFLT_VNIC UINT32_C(0x40)
7898 uint16_t jumbo_thresh;
7900 * When jumbo placement algorithm is enabled, this value is used to
7901 * determine the threshold for jumbo placement. Packets with length
7902 * larger than this value will be placed according to the jumbo
7903 * placement algorithm.
7905 uint16_t hds_offset;
7907 * This value is used to determine the offset into packet buffer where
7908 * the split data (payload) will be placed according to one of of HDS
7909 * placement algorithm. The lengths of packet buffers provided for split
7910 * data shall be larger than this value.
7912 uint16_t hds_threshold;
7914 * When one of the HDS placement algorithm is enabled, this value is
7915 * used to determine the threshold for HDS placement. Packets with
7916 * length larger than this value will be placed according to the HDS
7917 * placement algorithm. This value shall be in multiple of 4 bytes.
7926 * This field is used in Output records to indicate that the output is
7927 * completely written to RAM. This field should be read as '1' to
7928 * indicate that the output has been completely written. When writing a
7929 * command completion or response to an internal processor, the order of
7930 * writes has to be such that this field is written last.
7932 } __attribute__((packed));
7934 /* hwrm_vnic_rss_cos_lb_ctx_alloc */
7935 /* Description: This function is used to allocate COS/Load Balance context. */
7936 /* Input (16 bytes) */
7937 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
7940 * This value indicates what type of request this is. The format
7941 * for the rest of the command is determined by this field.
7945 * This value indicates the what completion ring the request
7946 * will be optionally completed on. If the value is -1, then no
7947 * CR completion will be generated. Any other value must be a
7948 * valid CR ring_id value for this function.
7951 /* This value indicates the command sequence number. */
7954 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
7955 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
7960 * This is the host address where the response will be written
7961 * when the request is complete. This area must be 16B aligned
7962 * and must be cleared to zero before the request is made.
7964 } __attribute__((packed));
7966 /* Output (16 bytes) */
7967 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
7968 uint16_t error_code;
7970 * Pass/Fail or error type Note: receiver to verify the in
7971 * parameters, and fail the call with an error when appropriate
7974 /* This field returns the type of original request. */
7976 /* This field provides original sequence number of the command. */
7979 * This field is the length of the response in bytes. The last
7980 * byte of the response is a valid flag that will read as '1'
7981 * when the command has been completely written to memory.
7983 uint16_t rss_cos_lb_ctx_id;
7984 /* rss_cos_lb_ctx_id is 16 b */
7992 * This field is used in Output records to indicate that the
7993 * output is completely written to RAM. This field should be
7994 * read as '1' to indicate that the output has been completely
7995 * written. When writing a command completion or response to an
7996 * internal processor, the order of writes has to be such that
7997 * this field is written last.
7999 } __attribute__((packed));
8001 /* hwrm_vnic_rss_cos_lb_ctx_free */
8002 /* Description: This function can be used to free COS/Load Balance context. */
8003 /* Input (24 bytes) */
8004 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
8007 * This value indicates what type of request this is. The format
8008 * for the rest of the command is determined by this field.
8012 * This value indicates the what completion ring the request
8013 * will be optionally completed on. If the value is -1, then no
8014 * CR completion will be generated. Any other value must be a
8015 * valid CR ring_id value for this function.
8018 /* This value indicates the command sequence number. */
8021 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8022 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8027 * This is the host address where the response will be written
8028 * when the request is complete. This area must be 16B aligned
8029 * and must be cleared to zero before the request is made.
8031 uint16_t rss_cos_lb_ctx_id;
8032 /* rss_cos_lb_ctx_id is 16 b */
8033 uint16_t unused_0[3];
8034 } __attribute__((packed));
8036 /* Output (16 bytes) */
8037 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
8038 uint16_t error_code;
8040 * Pass/Fail or error type Note: receiver to verify the in
8041 * parameters, and fail the call with an error when appropriate
8044 /* This field returns the type of original request. */
8046 /* This field provides original sequence number of the command. */
8049 * This field is the length of the response in bytes. The last
8050 * byte of the response is a valid flag that will read as '1'
8051 * when the command has been completely written to memory.
8059 * This field is used in Output records to indicate that the
8060 * output is completely written to RAM. This field should be
8061 * read as '1' to indicate that the output has been completely
8062 * written. When writing a command completion or response to an
8063 * internal processor, the order of writes has to be such that
8064 * this field is written last.
8066 } __attribute__((packed));
8068 /* hwrm_vnic_tpa_cfg */
8069 /* Description: This function is used to enable/configure TPA on the VNIC. */
8070 /* Input (40 bytes) */
8071 struct hwrm_vnic_tpa_cfg_input {
8074 * This value indicates what type of request this is. The format
8075 * for the rest of the command is determined by this field.
8079 * This value indicates the what completion ring the request
8080 * will be optionally completed on. If the value is -1, then no
8081 * CR completion will be generated. Any other value must be a
8082 * valid CR ring_id value for this function.
8085 /* This value indicates the command sequence number. */
8088 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8089 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8094 * This is the host address where the response will be written
8095 * when the request is complete. This area must be 16B aligned
8096 * and must be cleared to zero before the request is made.
8100 * When this bit is '1', the VNIC shall be configured to perform
8101 * transparent packet aggregation (TPA) of non-tunneled TCP
8104 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA UINT32_C(0x1)
8106 * When this bit is '1', the VNIC shall be configured to perform
8107 * transparent packet aggregation (TPA) of tunneled TCP packets.
8109 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA UINT32_C(0x2)
8111 * When this bit is '1', the VNIC shall be configured to perform
8112 * transparent packet aggregation (TPA) according to Windows
8113 * Receive Segment Coalescing (RSC) rules.
8115 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE UINT32_C(0x4)
8117 * When this bit is '1', the VNIC shall be configured to perform
8118 * transparent packet aggregation (TPA) according to Linux
8119 * Generic Receive Offload (GRO) rules.
8121 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO UINT32_C(0x8)
8123 * When this bit is '1', the VNIC shall be configured to perform
8124 * transparent packet aggregation (TPA) for TCP packets with IP
8125 * ECN set to non-zero.
8127 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN UINT32_C(0x10)
8129 * When this bit is '1', the VNIC shall be configured to perform
8130 * transparent packet aggregation (TPA) for GRE tunneled TCP
8131 * packets only if all packets have the same GRE sequence.
8133 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ \
8136 * When this bit is '1' and the GRO mode is enabled, the VNIC
8137 * shall be configured to perform transparent packet aggregation
8138 * (TPA) for TCP/IPv4 packets with consecutively increasing
8139 * IPIDs. In other words, the last packet that is being
8140 * aggregated to an already existing aggregation context shall
8141 * have IPID 1 more than the IPID of the last packet that was
8142 * aggregated in that aggregation context.
8144 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_IPID_CHECK UINT32_C(0x40)
8146 * When this bit is '1' and the GRO mode is enabled, the VNIC
8147 * shall be configured to perform transparent packet aggregation
8148 * (TPA) for TCP packets with the same TTL (IPv4) or Hop limit
8151 #define HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO_TTL_CHECK UINT32_C(0x80)
8153 /* This bit must be '1' for the max_agg_segs field to be configured. */
8154 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS UINT32_C(0x1)
8155 /* This bit must be '1' for the max_aggs field to be configured. */
8156 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS UINT32_C(0x2)
8158 * This bit must be '1' for the max_agg_timer field to be
8161 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER UINT32_C(0x4)
8162 /* This bit must be '1' for the min_agg_len field to be configured. */
8163 #define HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN UINT32_C(0x8)
8165 /* Logical vnic ID */
8166 uint16_t max_agg_segs;
8168 * This is the maximum number of TCP segments that can be
8169 * aggregated (unit is Log2). Max value is 31.
8172 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_1 UINT32_C(0x0)
8174 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_2 UINT32_C(0x1)
8176 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_4 UINT32_C(0x2)
8178 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_8 UINT32_C(0x3)
8179 /* Any segment size larger than this is not valid */
8180 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX UINT32_C(0x1f)
8183 * This is the maximum number of aggregations this VNIC is
8184 * allowed (unit is Log2). Max value is 7
8187 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_1 UINT32_C(0x0)
8188 /* 2 aggregations */
8189 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_2 UINT32_C(0x1)
8190 /* 4 aggregations */
8191 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_4 UINT32_C(0x2)
8192 /* 8 aggregations */
8193 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_8 UINT32_C(0x3)
8194 /* 16 aggregations */
8195 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_16 UINT32_C(0x4)
8196 /* Any aggregation size larger than this is not valid */
8197 #define HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX UINT32_C(0x7)
8200 uint32_t max_agg_timer;
8202 * This is the maximum amount of time allowed for an aggregation
8203 * context to complete after it was initiated.
8205 uint32_t min_agg_len;
8207 * This is the minimum amount of payload length required to
8208 * start an aggregation context.
8210 } __attribute__((packed));
8212 /* Output (16 bytes) */
8213 struct hwrm_vnic_tpa_cfg_output {
8214 uint16_t error_code;
8216 * Pass/Fail or error type Note: receiver to verify the in
8217 * parameters, and fail the call with an error when appropriate
8220 /* This field returns the type of original request. */
8222 /* This field provides original sequence number of the command. */
8225 * This field is the length of the response in bytes. The last
8226 * byte of the response is a valid flag that will read as '1'
8227 * when the command has been completely written to memory.
8235 * This field is used in Output records to indicate that the
8236 * output is completely written to RAM. This field should be
8237 * read as '1' to indicate that the output has been completely
8238 * written. When writing a command completion or response to an
8239 * internal processor, the order of writes has to be such that
8240 * this field is written last.
8242 } __attribute__((packed));
8244 /* hwrm_ring_alloc */
8246 * Description: This command allocates and does basic preparation for a ring.
8248 /* Input (80 bytes) */
8249 struct hwrm_ring_alloc_input {
8252 * This value indicates what type of request this is. The format
8253 * for the rest of the command is determined by this field.
8257 * This value indicates the what completion ring the request
8258 * will be optionally completed on. If the value is -1, then no
8259 * CR completion will be generated. Any other value must be a
8260 * valid CR ring_id value for this function.
8263 /* This value indicates the command sequence number. */
8266 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8267 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8272 * This is the host address where the response will be written
8273 * when the request is complete. This area must be 16B aligned
8274 * and must be cleared to zero before the request is made.
8277 /* This bit must be '1' for the Reserved1 field to be configured. */
8278 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED1 UINT32_C(0x1)
8279 /* This bit must be '1' for the ring_arb_cfg field to be configured. */
8280 #define HWRM_RING_ALLOC_INPUT_ENABLES_RING_ARB_CFG UINT32_C(0x2)
8281 /* This bit must be '1' for the Reserved3 field to be configured. */
8282 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED3 UINT32_C(0x4)
8284 * This bit must be '1' for the stat_ctx_id_valid field to be
8287 #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID UINT32_C(0x8)
8288 /* This bit must be '1' for the Reserved4 field to be configured. */
8289 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED4 UINT32_C(0x10)
8290 /* This bit must be '1' for the max_bw_valid field to be configured. */
8291 #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID UINT32_C(0x20)
8294 /* L2 Completion Ring (CR) */
8295 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
8297 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX UINT32_C(0x1)
8299 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX UINT32_C(0x2)
8300 /* RoCE Notification Completion Ring (ROCE_CR) */
8301 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
8304 uint64_t page_tbl_addr;
8305 /* This value is a pointer to the page table for the Ring. */
8307 /* First Byte Offset of the first entry in the first page. */
8310 * Actual page size in 2^page_size. The supported range is
8311 * increments in powers of 2 from 16 bytes to 1GB. - 4 = 16 B
8312 * Page size is 16 B. - 12 = 4 KB Page size is 4 KB. - 13 = 8 KB
8313 * Page size is 8 KB. - 16 = 64 KB Page size is 64 KB. - 21 = 2
8314 * MB Page size is 2 MB. - 22 = 4 MB Page size is 4 MB. - 30 = 1
8315 * GB Page size is 1 GB.
8317 uint8_t page_tbl_depth;
8319 * This value indicates the depth of page table. For this
8320 * version of the specification, value other than 0 or 1 shall
8321 * be considered as an invalid value. When the page_tbl_depth =
8322 * 0, then it is treated as a special case with the following.
8323 * 1. FBO and page size fields are not valid. 2. page_tbl_addr
8324 * is the physical address of the first element of the ring.
8330 * Number of 16B units in the ring. Minimum size for a ring is
8333 uint16_t logical_id;
8335 * Logical ring number for the ring to be allocated. This value
8336 * determines the position in the doorbell area where the update
8337 * to the ring will be made. For completion rings, this value is
8338 * also the MSI-X vector number for the function the completion
8339 * ring is associated with.
8341 uint16_t cmpl_ring_id;
8343 * This field is used only when ring_type is a TX ring. This
8344 * value indicates what completion ring the TX ring is
8349 * This field is used only when ring_type is a TX ring. This
8350 * value indicates what CoS queue the TX ring is associated
8356 /* This field is reserved for the future use. It shall be set to 0. */
8357 uint16_t ring_arb_cfg;
8359 * This field is used only when ring_type is a TX ring. This
8360 * field is used to configure arbitration related parameters for
8363 /* Arbitration policy used for the ring. */
8364 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_MASK UINT32_C(0xf)
8365 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SFT 0
8367 * Use strict priority for the TX ring. Priority
8368 * value is specified in arb_policy_param
8370 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_SP \
8371 (UINT32_C(0x1) << 0)
8373 * Use weighted fair queue arbitration for the
8374 * TX ring. Weight is specified in
8377 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ \
8378 (UINT32_C(0x2) << 0)
8379 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_LAST \
8380 RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_WFQ
8381 /* Reserved field. */
8382 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_MASK UINT32_C(0xf0)
8383 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_RSVD_SFT 4
8385 * Arbitration policy specific parameter. # For strict priority
8386 * arbitration policy, this field represents a priority value.
8387 * If set to 0, then the priority is not specified and the HWRM
8388 * is allowed to select any priority for this TX ring. # For
8389 * weighted fair queue arbitration policy, this field represents
8390 * a weight value. If set to 0, then the weight is not specified
8391 * and the HWRM is allowed to select any weight for this TX
8394 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_MASK \
8396 #define HWRM_RING_ALLOC_INPUT_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8
8400 /* This field is reserved for the future use. It shall be set to 0. */
8401 uint32_t stat_ctx_id;
8403 * This field is used only when ring_type is a TX ring. This
8404 * input indicates what statistics context this ring should be
8408 /* This field is reserved for the future use. It shall be set to 0. */
8411 * This field is used only when ring_type is a TX ring to
8412 * specify maximum BW allocated to the TX ring. The HWRM will
8413 * translate this value into byte counter and time interval used
8414 * for this ring inside the device.
8416 /* The bandwidth value. */
8417 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_MASK UINT32_C(0xfffffff)
8418 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_SFT 0
8419 /* The granularity of the value (bits or bytes). */
8420 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE UINT32_C(0x10000000)
8421 /* Value is in bits. */
8422 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BITS (UINT32_C(0x0) << 28)
8423 /* Value is in bytes. */
8424 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES (UINT32_C(0x1) << 28)
8425 #define HWRM_RING_ALLOC_INPUT_MAX_BW_SCALE_LAST \
8426 RING_ALLOC_INPUT_MAX_BW_SCALE_BYTES
8427 /* bw_value_unit is 3 b */
8428 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MASK \
8429 UINT32_C(0xe0000000)
8430 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_SFT 29
8431 /* Value is in Mb or MB (base 10). */
8432 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_MEGA \
8433 (UINT32_C(0x0) << 29)
8434 /* Value is in Kb or KB (base 10). */
8435 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_KILO \
8436 (UINT32_C(0x2) << 29)
8437 /* Value is in bits or bytes. */
8438 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_BASE \
8439 (UINT32_C(0x4) << 29)
8440 /* Value is in Gb or GB (base 10). */
8441 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_GIGA \
8442 (UINT32_C(0x6) << 29)
8443 /* Value is in 1/100th of a percentage of total bandwidth. */
8444 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 \
8445 (UINT32_C(0x1) << 29)
8447 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID \
8448 (UINT32_C(0x7) << 29)
8449 #define HWRM_RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_LAST \
8450 RING_ALLOC_INPUT_MAX_BW_BW_VALUE_UNIT_INVALID
8453 * This field is used only when ring_type is a Completion ring.
8454 * This value indicates what interrupt mode should be used on
8455 * this completion ring. Note: In the legacy interrupt mode, no
8456 * more than 16 completion rings are allowed.
8459 #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY UINT32_C(0x0)
8461 #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD UINT32_C(0x1)
8463 #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX UINT32_C(0x2)
8464 /* No Interrupt - Polled mode */
8465 #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL UINT32_C(0x3)
8466 uint8_t unused_8[3];
8467 } __attribute__((packed));
8469 /* Output (16 bytes) */
8470 struct hwrm_ring_alloc_output {
8471 uint16_t error_code;
8473 * Pass/Fail or error type Note: receiver to verify the in
8474 * parameters, and fail the call with an error when appropriate
8477 /* This field returns the type of original request. */
8479 /* This field provides original sequence number of the command. */
8482 * This field is the length of the response in bytes. The last
8483 * byte of the response is a valid flag that will read as '1'
8484 * when the command has been completely written to memory.
8488 * Physical number of ring allocated. This value shall be unique
8491 uint16_t logical_ring_id;
8492 /* Logical number of ring allocated. */
8498 * This field is used in Output records to indicate that the
8499 * output is completely written to RAM. This field should be
8500 * read as '1' to indicate that the output has been completely
8501 * written. When writing a command completion or response to an
8502 * internal processor, the order of writes has to be such that
8503 * this field is written last.
8505 } __attribute__((packed));
8507 /* hwrm_ring_free */
8509 * Description: This command is used to free a ring and associated resources.
8510 * With QoS and DCBx agents, it is possible the traffic classes will be moved
8511 * from one CoS queue to another. When this occurs, the driver shall call
8512 * 'hwrm_ring_free' to free the allocated rings and then call 'hwrm_ring_alloc'
8513 * to re-allocate each ring and assign it to a new CoS queue. hwrm_ring_free
8514 * shall be called on a ring only after it has been idle for 500ms or more and
8515 * no frames have been posted to the ring during this time. All frames queued
8516 * for transmission shall be completed and at least 500ms time elapsed from the
8517 * last completion before calling this command.
8519 /* Input (24 bytes) */
8520 struct hwrm_ring_free_input {
8523 * This value indicates what type of request this is. The format
8524 * for the rest of the command is determined by this field.
8528 * This value indicates the what completion ring the request
8529 * will be optionally completed on. If the value is -1, then no
8530 * CR completion will be generated. Any other value must be a
8531 * valid CR ring_id value for this function.
8534 /* This value indicates the command sequence number. */
8537 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8538 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8543 * This is the host address where the response will be written
8544 * when the request is complete. This area must be 16B aligned
8545 * and must be cleared to zero before the request is made.
8549 /* L2 Completion Ring (CR) */
8550 #define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)
8552 #define HWRM_RING_FREE_INPUT_RING_TYPE_TX UINT32_C(0x1)
8554 #define HWRM_RING_FREE_INPUT_RING_TYPE_RX UINT32_C(0x2)
8555 /* RoCE Notification Completion Ring (ROCE_CR) */
8556 #define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)
8559 /* Physical number of ring allocated. */
8561 } __attribute__((packed));
8563 /* Output (16 bytes) */
8564 struct hwrm_ring_free_output {
8565 uint16_t error_code;
8567 * Pass/Fail or error type Note: receiver to verify the in
8568 * parameters, and fail the call with an error when appropriate
8571 /* This field returns the type of original request. */
8573 /* This field provides original sequence number of the command. */
8576 * This field is the length of the response in bytes. The last
8577 * byte of the response is a valid flag that will read as '1'
8578 * when the command has been completely written to memory.
8586 * This field is used in Output records to indicate that the
8587 * output is completely written to RAM. This field should be
8588 * read as '1' to indicate that the output has been completely
8589 * written. When writing a command completion or response to an
8590 * internal processor, the order of writes has to be such that
8591 * this field is written last.
8593 } __attribute__((packed));
8595 /* hwrm_ring_grp_alloc */
8597 * Description: This API allocates and does basic preparation for a ring group.
8599 /* Input (24 bytes) */
8600 struct hwrm_ring_grp_alloc_input {
8603 * This value indicates what type of request this is. The format
8604 * for the rest of the command is determined by this field.
8608 * This value indicates the what completion ring the request
8609 * will be optionally completed on. If the value is -1, then no
8610 * CR completion will be generated. Any other value must be a
8611 * valid CR ring_id value for this function.
8614 /* This value indicates the command sequence number. */
8617 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8618 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8623 * This is the host address where the response will be written
8624 * when the request is complete. This area must be 16B aligned
8625 * and must be cleared to zero before the request is made.
8628 /* This value identifies the CR associated with the ring group. */
8630 /* This value identifies the main RR associated with the ring group. */
8633 * This value identifies the aggregation RR associated with the
8634 * ring group. If this value is 0xFF... (All Fs), then no
8635 * Aggregation ring will be set.
8639 * This value identifies the statistics context associated with
8642 } __attribute__((packed));
8644 /* Output (16 bytes) */
8645 struct hwrm_ring_grp_alloc_output {
8646 uint16_t error_code;
8648 * Pass/Fail or error type Note: receiver to verify the in
8649 * parameters, and fail the call with an error when appropriate
8652 /* This field returns the type of original request. */
8654 /* This field provides original sequence number of the command. */
8657 * This field is the length of the response in bytes. The last
8658 * byte of the response is a valid flag that will read as '1'
8659 * when the command has been completely written to memory.
8661 uint32_t ring_group_id;
8663 * This is the ring group ID value. Use this value to program
8664 * the default ring group for the VNIC or as table entries in an
8672 * This field is used in Output records to indicate that the
8673 * output is completely written to RAM. This field should be
8674 * read as '1' to indicate that the output has been completely
8675 * written. When writing a command completion or response to an
8676 * internal processor, the order of writes has to be such that
8677 * this field is written last.
8679 } __attribute__((packed));
8681 /* hwrm_ring_grp_free */
8683 * Description: This API frees a ring group and associated resources. # If a
8684 * ring in the ring group is reset or free, then the associated rings in the
8685 * ring group shall also be reset/free using hwrm_ring_free. # A function driver
8686 * shall always use hwrm_ring_grp_free after freeing all rings in a group. # As
8687 * a part of executing this command, the HWRM shall reset all associated ring
8690 /* Input (24 bytes) */
8691 struct hwrm_ring_grp_free_input {
8694 * This value indicates what type of request this is. The format
8695 * for the rest of the command is determined by this field.
8699 * This value indicates the what completion ring the request
8700 * will be optionally completed on. If the value is -1, then no
8701 * CR completion will be generated. Any other value must be a
8702 * valid CR ring_id value for this function.
8705 /* This value indicates the command sequence number. */
8708 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8709 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8714 * This is the host address where the response will be written
8715 * when the request is complete. This area must be 16B aligned
8716 * and must be cleared to zero before the request is made.
8718 uint32_t ring_group_id;
8719 /* This is the ring group ID value. */
8721 } __attribute__((packed));
8723 /* Output (16 bytes) */
8724 struct hwrm_ring_grp_free_output {
8725 uint16_t error_code;
8727 * Pass/Fail or error type Note: receiver to verify the in
8728 * parameters, and fail the call with an error when appropriate
8731 /* This field returns the type of original request. */
8733 /* This field provides original sequence number of the command. */
8736 * This field is the length of the response in bytes. The last
8737 * byte of the response is a valid flag that will read as '1'
8738 * when the command has been completely written to memory.
8746 * This field is used in Output records to indicate that the
8747 * output is completely written to RAM. This field should be
8748 * read as '1' to indicate that the output has been completely
8749 * written. When writing a command completion or response to an
8750 * internal processor, the order of writes has to be such that
8751 * this field is written last.
8753 } __attribute__((packed));
8755 /* hwrm_cfa_l2_filter_alloc */
8757 * Description: An L2 filter is a filter resource that is used to identify a
8758 * vnic or ring for a packet based on layer 2 fields. Layer 2 fields for
8759 * encapsulated packets include both outer L2 header and/or inner l2 header of
8760 * encapsulated packet. The L2 filter resource covers the following OS specific
8761 * L2 filters. Linux/FreeBSD (per function): # Broadcast enable/disable # List
8762 * of individual multicast filters # All multicast enable/disable filter #
8763 * Unicast filters # Promiscuous mode VMware: # Broadcast enable/disable (per
8764 * physical function) # All multicast enable/disable (per function) # Unicast
8765 * filters per ring or vnic # Promiscuous mode per PF Windows: # Broadcast
8766 * enable/disable (per physical function) # List of individual multicast filters
8767 * (Driver needs to advertise the maximum number of filters supported) # All
8768 * multicast enable/disable per physical function # Unicast filters per vnic #
8769 * Promiscuous mode per PF Implementation notes on the use of VNIC in this
8770 * command: # By default, these filters belong to default vnic for the function.
8771 * # Once these filters are set up, only destination VNIC can be modified. # If
8772 * the destination VNIC is not specified in this command, then the HWRM shall
8773 * only create an l2 context id. HWRM Implementation notes for multicast
8774 * filters: # The hwrm_filter_alloc command can be used to set up multicast
8775 * filters (perfect match or partial match). Each individual function driver can
8776 * set up multicast filters independently. # The HWRM needs to keep track of
8777 * multicast filters set up by function drivers and maintain multicast group
8778 * replication records to enable a subset of functions to receive traffic for a
8779 * specific multicast address. # When a specific multicast filter cannot be set,
8780 * the HWRM shall return an error. In this error case, the driver should fall
8781 * back to using one general filter (rather than specific) for all multicast
8782 * traffic. # When the SR-IOV is enabled, the HWRM needs to additionally track
8783 * source knockout per multicast group record. Examples of setting unicast
8784 * filters: For a unicast MAC based filter, one can use a combination of the
8785 * fields and masks provided in this command to set up the filter. Below are
8786 * some examples: # MAC + no VLAN filter: This filter is used to identify
8787 * traffic that does not contain any VLAN tags and matches destination (or
8788 * source) MAC address. This filter can be set up by setting only l2_addr field
8789 * to be a valid field. All other fields are not valid. The following value is
8790 * set for l2_addr. l2_addr = MAC # MAC + Any VLAN filter: This filter is used
8791 * to identify traffic that carries single VLAN tag and matches (destination or
8792 * source) MAC address. This filter can be set up by setting only l2_addr and
8793 * l2_ovlan_mask fields to be valid fields. All other fields are not valid. The
8794 * following values are set for those two valid fields. l2_addr = MAC,
8795 * l2_ovlan_mask = 0xFFFF # MAC + no VLAN or VLAN ID=0: This filter is used to
8796 * identify untagged traffic that does not contain any VLAN tags or a VLAN tag
8797 * with VLAN ID = 0 and matches destination (or source) MAC address. This filter
8798 * can be set up by setting only l2_addr and l2_ovlan fields to be valid fields.
8799 * All other fields are not valid. The following value are set for l2_addr and
8800 * l2_ovlan. l2_addr = MAC, l2_ovlan = 0x0 # MAC + no VLAN or any VLAN: This
8801 * filter is used to identify traffic that contains zero or 1 VLAN tag and
8802 * matches destination (or source) MAC address. This filter can be set up by
8803 * setting only l2_addr, l2_ovlan, and l2_mask fields to be valid fields. All
8804 * other fields are not valid. The following value are set for l2_addr,
8805 * l2_ovlan, and l2_mask fields. l2_addr = MAC, l2_ovlan = 0x0, l2_ovlan_mask =
8806 * 0xFFFF # MAC + VLAN ID filter: This filter can be set up by setting only
8807 * l2_addr, l2_ovlan, and l2_ovlan_mask fields to be valid fields. All other
8808 * fields are not valid. The following values are set for those three valid
8809 * fields. l2_addr = MAC, l2_ovlan = VLAN ID, l2_ovlan_mask = 0xF000
8811 /* Input (96 bytes) */
8812 struct hwrm_cfa_l2_filter_alloc_input {
8815 * This value indicates what type of request this is. The format
8816 * for the rest of the command is determined by this field.
8820 * This value indicates the what completion ring the request
8821 * will be optionally completed on. If the value is -1, then no
8822 * CR completion will be generated. Any other value must be a
8823 * valid CR ring_id value for this function.
8826 /* This value indicates the command sequence number. */
8829 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
8830 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
8835 * This is the host address where the response will be written
8836 * when the request is complete. This area must be 16B aligned
8837 * and must be cleared to zero before the request is made.
8841 * Enumeration denoting the RX, TX type of the resource. This
8842 * enumeration is used for resources that are similar for both
8843 * TX and RX paths of the chip.
8845 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH UINT32_C(0x1)
8847 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
8848 (UINT32_C(0x0) << 0)
8850 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
8851 (UINT32_C(0x1) << 0)
8852 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
8853 CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
8855 * Setting of this flag indicates the applicability to the
8858 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK UINT32_C(0x2)
8860 * Setting of this flag indicates drop action. If this flag is
8861 * not set, then it should be considered accept action.
8863 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP UINT32_C(0x4)
8865 * If this flag is set, all t_l2_* fields are invalid and they
8866 * should not be specified. If this flag is set, then l2_*
8867 * fields refer to fields of outermost L2 header.
8869 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST UINT32_C(0x8)
8871 /* This bit must be '1' for the l2_addr field to be configured. */
8872 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR UINT32_C(0x1)
8873 /* This bit must be '1' for the l2_addr_mask field to be configured. */
8874 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
8876 /* This bit must be '1' for the l2_ovlan field to be configured. */
8877 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN UINT32_C(0x4)
8879 * This bit must be '1' for the l2_ovlan_mask field to be
8882 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
8884 /* This bit must be '1' for the l2_ivlan field to be configured. */
8885 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN UINT32_C(0x10)
8887 * This bit must be '1' for the l2_ivlan_mask field to be
8890 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
8892 /* This bit must be '1' for the t_l2_addr field to be configured. */
8893 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR UINT32_C(0x40)
8895 * This bit must be '1' for the t_l2_addr_mask field to be
8898 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
8900 /* This bit must be '1' for the t_l2_ovlan field to be configured. */
8901 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
8904 * This bit must be '1' for the t_l2_ovlan_mask field to be
8907 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
8909 /* This bit must be '1' for the t_l2_ivlan field to be configured. */
8910 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
8913 * This bit must be '1' for the t_l2_ivlan_mask field to be
8916 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
8918 /* This bit must be '1' for the src_type field to be configured. */
8919 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE UINT32_C(0x1000)
8920 /* This bit must be '1' for the src_id field to be configured. */
8921 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID UINT32_C(0x2000)
8922 /* This bit must be '1' for the tunnel_type field to be configured. */
8923 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
8925 /* This bit must be '1' for the dst_id field to be configured. */
8926 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID UINT32_C(0x8000)
8928 * This bit must be '1' for the mirror_vnic_id field to be
8931 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
8935 * This value sets the match value for the L2 MAC address.
8936 * Destination MAC address for RX path. Source MAC address for
8941 uint8_t l2_addr_mask[6];
8943 * This value sets the mask value for the L2 address. A value of
8944 * 0 will mask the corresponding bit from compare.
8947 /* This value sets VLAN ID value for outer VLAN. */
8948 uint16_t l2_ovlan_mask;
8950 * This value sets the mask value for the ovlan id. A value of 0
8951 * will mask the corresponding bit from compare.
8954 /* This value sets VLAN ID value for inner VLAN. */
8955 uint16_t l2_ivlan_mask;
8957 * This value sets the mask value for the ivlan id. A value of 0
8958 * will mask the corresponding bit from compare.
8962 uint8_t t_l2_addr[6];
8964 * This value sets the match value for the tunnel L2 MAC
8965 * address. Destination MAC address for RX path. Source MAC
8966 * address for TX path.
8970 uint8_t t_l2_addr_mask[6];
8972 * This value sets the mask value for the tunnel L2 address. A
8973 * value of 0 will mask the corresponding bit from compare.
8975 uint16_t t_l2_ovlan;
8976 /* This value sets VLAN ID value for tunnel outer VLAN. */
8977 uint16_t t_l2_ovlan_mask;
8979 * This value sets the mask value for the tunnel ovlan id. A
8980 * value of 0 will mask the corresponding bit from compare.
8982 uint16_t t_l2_ivlan;
8983 /* This value sets VLAN ID value for tunnel inner VLAN. */
8984 uint16_t t_l2_ivlan_mask;
8986 * This value sets the mask value for the tunnel ivlan id. A
8987 * value of 0 will mask the corresponding bit from compare.
8990 /* This value identifies the type of source of the packet. */
8992 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT UINT32_C(0x0)
8993 /* Physical function */
8994 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF UINT32_C(0x1)
8995 /* Virtual function */
8996 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF UINT32_C(0x2)
8997 /* Virtual NIC of a function */
8998 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC UINT32_C(0x3)
8999 /* Embedded processor for CFA management */
9000 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG UINT32_C(0x4)
9001 /* Embedded processor for OOB management */
9002 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE UINT32_C(0x5)
9003 /* Embedded processor for RoCE */
9004 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO UINT32_C(0x6)
9005 /* Embedded processor for network proxy functions */
9006 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG UINT32_C(0x7)
9010 * This value is the id of the source. For a network port, it
9011 * represents port_id. For a physical function, it represents
9012 * fid. For a virtual function, it represents vf_id. For a vnic,
9013 * it represents vnic_id. For embedded processors, this id is
9014 * not valid. Notes: 1. The function ID is implied if it src_id
9015 * is not provided for a src_type that is either
9017 uint8_t tunnel_type;
9020 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
9022 /* Virtual eXtensible Local Area Network (VXLAN) */
9023 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
9026 * Network Virtualization Generic Routing
9027 * Encapsulation (NVGRE)
9029 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
9032 * Generic Routing Encapsulation (GRE) inside
9035 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE UINT32_C(0x3)
9037 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP UINT32_C(0x4)
9038 /* Generic Network Virtualization Encapsulation (Geneve) */
9039 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
9040 /* Multi-Protocol Lable Switching (MPLS) */
9041 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS UINT32_C(0x6)
9042 /* Stateless Transport Tunnel (STT) */
9043 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT UINT32_C(0x7)
9045 * Generic Routing Encapsulation (GRE) inside IP
9048 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE UINT32_C(0x8)
9049 /* Any tunneled traffic */
9050 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
9055 * If set, this value shall represent the Logical VNIC ID of the
9056 * destination VNIC for the RX path and network port id of the
9057 * destination port for the TX path.
9059 uint16_t mirror_vnic_id;
9060 /* Logical VNIC ID of the VNIC where traffic is mirrored. */
9063 * This hint is provided to help in placing the filter in the
9067 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
9069 /* Above the given filter */
9070 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
9072 /* Below the given filter */
9073 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
9075 /* As high as possible */
9076 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX UINT32_C(0x3)
9077 /* As low as possible */
9078 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN UINT32_C(0x4)
9081 uint64_t l2_filter_id_hint;
9083 * This is the ID of the filter that goes along with the
9084 * pri_hint. This field is valid only for the following values.
9085 * 1 - Above the given filter 2 - Below the given filter
9087 } __attribute__((packed));
9089 /* Output (24 bytes) */
9090 struct hwrm_cfa_l2_filter_alloc_output {
9091 uint16_t error_code;
9093 * Pass/Fail or error type Note: receiver to verify the in
9094 * parameters, and fail the call with an error when appropriate
9097 /* This field returns the type of original request. */
9099 /* This field provides original sequence number of the command. */
9102 * This field is the length of the response in bytes. The last
9103 * byte of the response is a valid flag that will read as '1'
9104 * when the command has been completely written to memory.
9106 uint64_t l2_filter_id;
9108 * This value identifies a set of CFA data structures used for
9113 * This is the ID of the flow associated with this filter. This
9114 * value shall be used to match and associate the flow
9115 * identifier returned in completion records. A value of
9116 * 0xFFFFFFFF shall indicate no flow id.
9123 * This field is used in Output records to indicate that the
9124 * output is completely written to RAM. This field should be
9125 * read as '1' to indicate that the output has been completely
9126 * written. When writing a command completion or response to an
9127 * internal processor, the order of writes has to be such that
9128 * this field is written last.
9130 } __attribute__((packed));
9132 /* hwrm_cfa_l2_filter_free */
9134 * Description: Free a L2 filter. The HWRM shall free all associated filter
9135 * resources with the L2 filter.
9137 /* Input (24 bytes) */
9138 struct hwrm_cfa_l2_filter_free_input {
9141 * This value indicates what type of request this is. The format
9142 * for the rest of the command is determined by this field.
9146 * This value indicates the what completion ring the request
9147 * will be optionally completed on. If the value is -1, then no
9148 * CR completion will be generated. Any other value must be a
9149 * valid CR ring_id value for this function.
9152 /* This value indicates the command sequence number. */
9155 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9156 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9161 * This is the host address where the response will be written
9162 * when the request is complete. This area must be 16B aligned
9163 * and must be cleared to zero before the request is made.
9165 uint64_t l2_filter_id;
9167 * This value identifies a set of CFA data structures used for
9170 } __attribute__((packed));
9172 /* Output (16 bytes) */
9173 struct hwrm_cfa_l2_filter_free_output {
9174 uint16_t error_code;
9176 * Pass/Fail or error type Note: receiver to verify the in
9177 * parameters, and fail the call with an error when appropriate
9180 /* This field returns the type of original request. */
9182 /* This field provides original sequence number of the command. */
9185 * This field is the length of the response in bytes. The last
9186 * byte of the response is a valid flag that will read as '1'
9187 * when the command has been completely written to memory.
9195 * This field is used in Output records to indicate that the
9196 * output is completely written to RAM. This field should be
9197 * read as '1' to indicate that the output has been completely
9198 * written. When writing a command completion or response to an
9199 * internal processor, the order of writes has to be such that
9200 * this field is written last.
9202 } __attribute__((packed));
9204 /* hwrm_cfa_l2_filter_cfg */
9205 /* Description: Change the configuration of an existing L2 filter */
9206 /* Input (40 bytes) */
9207 struct hwrm_cfa_l2_filter_cfg_input {
9210 * This value indicates what type of request this is. The format
9211 * for the rest of the command is determined by this field.
9215 * This value indicates the what completion ring the request
9216 * will be optionally completed on. If the value is -1, then no
9217 * CR completion will be generated. Any other value must be a
9218 * valid CR ring_id value for this function.
9221 /* This value indicates the command sequence number. */
9224 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9225 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9230 * This is the host address where the response will be written
9231 * when the request is complete. This area must be 16B aligned
9232 * and must be cleared to zero before the request is made.
9236 * Enumeration denoting the RX, TX type of the resource. This
9237 * enumeration is used for resources that are similar for both
9238 * TX and RX paths of the chip.
9240 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH UINT32_C(0x1)
9242 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_TX \
9243 (UINT32_C(0x0) << 0)
9245 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX \
9246 (UINT32_C(0x1) << 0)
9247 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_LAST \
9248 CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX
9250 * Setting of this flag indicates drop action. If this flag is
9251 * not set, then it should be considered accept action.
9253 #define HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_DROP UINT32_C(0x2)
9255 /* This bit must be '1' for the dst_id field to be configured. */
9256 #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_DST_ID UINT32_C(0x1)
9258 * This bit must be '1' for the new_mirror_vnic_id field to be
9261 #define HWRM_CFA_L2_FILTER_CFG_INPUT_ENABLES_NEW_MIRROR_VNIC_ID \
9263 uint64_t l2_filter_id;
9265 * This value identifies a set of CFA data structures used for
9270 * If set, this value shall represent the Logical VNIC ID of the
9271 * destination VNIC for the RX path and network port id of the
9272 * destination port for the TX path.
9274 uint32_t new_mirror_vnic_id;
9275 /* New Logical VNIC ID of the VNIC where traffic is mirrored. */
9276 } __attribute__((packed));
9278 /* Output (16 bytes) */
9279 struct hwrm_cfa_l2_filter_cfg_output {
9280 uint16_t error_code;
9282 * Pass/Fail or error type Note: receiver to verify the in
9283 * parameters, and fail the call with an error when appropriate
9286 /* This field returns the type of original request. */
9288 /* This field provides original sequence number of the command. */
9291 * This field is the length of the response in bytes. The last
9292 * byte of the response is a valid flag that will read as '1'
9293 * when the command has been completely written to memory.
9301 * This field is used in Output records to indicate that the
9302 * output is completely written to RAM. This field should be
9303 * read as '1' to indicate that the output has been completely
9304 * written. When writing a command completion or response to an
9305 * internal processor, the order of writes has to be such that
9306 * this field is written last.
9308 } __attribute__((packed));
9310 /* hwrm_cfa_l2_set_rx_mask */
9311 /* Description: This command will set rx mask of the function. */
9312 /* Input (56 bytes) */
9313 struct hwrm_cfa_l2_set_rx_mask_input {
9316 * This value indicates what type of request this is. The format
9317 * for the rest of the command is determined by this field.
9321 * This value indicates the what completion ring the request
9322 * will be optionally completed on. If the value is -1, then no
9323 * CR completion will be generated. Any other value must be a
9324 * valid CR ring_id value for this function.
9327 /* This value indicates the command sequence number. */
9330 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9331 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9336 * This is the host address where the response will be written
9337 * when the request is complete. This area must be 16B aligned
9338 * and must be cleared to zero before the request is made.
9343 /* Reserved for future use. */
9344 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_RESERVED UINT32_C(0x1)
9346 * When this bit is '1', the function is requested to accept
9347 * multi-cast packets specified by the multicast addr table.
9349 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST UINT32_C(0x2)
9351 * When this bit is '1', the function is requested to accept all
9352 * multi-cast packets.
9354 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST UINT32_C(0x4)
9356 * When this bit is '1', the function is requested to accept
9357 * broadcast packets.
9359 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST UINT32_C(0x8)
9361 * When this bit is '1', the function is requested to be put in
9362 * the promiscuous mode. The HWRM should accept any function to
9363 * set up promiscuous mode. The HWRM shall follow the semantics
9364 * below for the promiscuous mode support. # When partitioning
9365 * is not enabled on a port (i.e. single PF on the port), then
9366 * the PF shall be allowed to be in the promiscuous mode. When
9367 * the PF is in the promiscuous mode, then it shall receive all
9368 * host bound traffic on that port. # When partitioning is
9369 * enabled on a port (i.e. multiple PFs per port) and a PF on
9370 * that port is in the promiscuous mode, then the PF receives
9371 * all traffic within that partition as identified by a unique
9372 * identifier for the PF (e.g. S-Tag). If a unique outer VLAN
9373 * for the PF is specified, then the setting of promiscuous mode
9374 * on that PF shall result in the PF receiving all host bound
9375 * traffic with matching outer VLAN. # A VF shall can be set in
9376 * the promiscuous mode. In the promiscuous mode, the VF does
9377 * not receive any traffic unless a unique outer VLAN for the VF
9378 * is specified. If a unique outer VLAN for the VF is specified,
9379 * then the setting of promiscuous mode on that VF shall result
9380 * in the VF receiving all host bound traffic with the matching
9381 * outer VLAN. # The HWRM shall allow the setting of promiscuous
9382 * mode on a function independently from the promiscuous mode
9383 * settings on other functions.
9385 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS UINT32_C(0x10)
9387 * If this flag is set, the corresponding RX filters shall be
9388 * set up to cover multicast/broadcast filters for the outermost
9389 * Layer 2 destination MAC address field.
9391 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST UINT32_C(0x20)
9393 * If this flag is set, the corresponding RX filters shall be
9394 * set up to cover multicast/broadcast filters for the VLAN-
9395 * tagged packets that match the TPID and VID fields of VLAN
9396 * tags in the VLAN tag table specified in this command.
9398 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY UINT32_C(0x40)
9400 * If this flag is set, the corresponding RX filters shall be
9401 * set up to cover multicast/broadcast filters for non-VLAN
9402 * tagged packets and VLAN-tagged packets that match the TPID
9403 * and VID fields of VLAN tags in the VLAN tag table specified
9406 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN UINT32_C(0x80)
9408 * If this flag is set, the corresponding RX filters shall be
9409 * set up to cover multicast/broadcast filters for non-VLAN
9410 * tagged packets and VLAN-tagged packets matching any VLAN tag.
9411 * If this flag is set, then the HWRM shall ignore VLAN tags
9412 * specified in vlan_tag_tbl. If none of vlanonly, vlan_nonvlan,
9413 * and anyvlan_nonvlan flags is set, then the HWRM shall ignore
9414 * VLAN tags specified in vlan_tag_tbl. The HWRM client shall
9415 * set at most one flag out of vlanonly, vlan_nonvlan, and
9418 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN \
9420 uint64_t mc_tbl_addr;
9421 /* This is the address for mcast address tbl. */
9422 uint32_t num_mc_entries;
9424 * This value indicates how many entries in mc_tbl are valid.
9425 * Each entry is 6 bytes.
9428 uint64_t vlan_tag_tbl_addr;
9430 * This is the address for VLAN tag table. Each VLAN entry in
9431 * the table is 4 bytes of a VLAN tag including TPID, PCP, DEI,
9432 * and VID fields in network byte order.
9434 uint32_t num_vlan_tags;
9436 * This value indicates how many entries in vlan_tag_tbl are
9437 * valid. Each entry is 4 bytes.
9440 } __attribute__((packed));
9442 /* Output (16 bytes) */
9443 struct hwrm_cfa_l2_set_rx_mask_output {
9444 uint16_t error_code;
9446 * Pass/Fail or error type Note: receiver to verify the in
9447 * parameters, and fail the call with an error when appropriate
9450 /* This field returns the type of original request. */
9452 /* This field provides original sequence number of the command. */
9455 * This field is the length of the response in bytes. The last
9456 * byte of the response is a valid flag that will read as '1'
9457 * when the command has been completely written to memory.
9465 * This field is used in Output records to indicate that the
9466 * output is completely written to RAM. This field should be
9467 * read as '1' to indicate that the output has been completely
9468 * written. When writing a command completion or response to an
9469 * internal processor, the order of writes has to be such that
9470 * this field is written last.
9472 } __attribute__((packed));
9474 /* hwrm_cfa_vlan_antispoof_cfg */
9475 /* Description: Configures vlan anti-spoof filters for VF. */
9476 /* Input (32 bytes) */
9477 struct hwrm_cfa_vlan_antispoof_cfg_input {
9480 * This value indicates what type of request this is. The format for the
9481 * rest of the command is determined by this field.
9485 * This value indicates the what completion ring the request will be
9486 * optionally completed on. If the value is -1, then no CR completion
9487 * will be generated. Any other value must be a valid CR ring_id value
9488 * for this function.
9491 /* This value indicates the command sequence number. */
9494 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
9495 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
9499 * This is the host address where the response will be written when the
9500 * request is complete. This area must be 16B aligned and must be
9501 * cleared to zero before the request is made.
9505 * Function ID of the function that is being configured. Only valid for
9506 * a VF FID configured by the PF.
9510 uint32_t num_vlan_entries;
9511 /* Number of VLAN entries in the vlan_tag_mask_tbl. */
9512 uint64_t vlan_tag_mask_tbl_addr;
9514 * The vlan_tag_mask_tbl_addr is the DMA address of the VLAN antispoof
9515 * table. Each table entry contains the 16-bit TPID (0x8100 or 0x88a8
9516 * only), 16-bit VLAN ID, and a 16-bit mask, all in network order to
9517 * match hwrm_cfa_l2_set_rx_mask. For an individual VLAN entry, the mask
9518 * value should be 0xfff for the 12-bit VLAN ID.
9522 /* Output (16 bytes) */
9523 struct hwrm_cfa_vlan_antispoof_cfg_output {
9524 uint16_t error_code;
9526 * Pass/Fail or error type Note: receiver to verify the in parameters,
9527 * and fail the call with an error when appropriate
9530 /* This field returns the type of original request. */
9532 /* This field provides original sequence number of the command. */
9535 * This field is the length of the response in bytes. The last byte of
9536 * the response is a valid flag that will read as '1' when the command
9537 * has been completely written to memory.
9545 * This field is used in Output records to indicate that the output is
9546 * completely written to RAM. This field should be read as '1' to
9547 * indicate that the output has been completely written. When writing a
9548 * command completion or response to an internal processor, the order of
9549 * writes has to be such that this field is written last.
9553 /* hwrm_tunnel_dst_port_query */
9555 * Description: This function is called by a driver to query tunnel type
9556 * specific destination port configuration.
9558 /* Input (24 bytes) */
9559 struct hwrm_tunnel_dst_port_query_input {
9562 * This value indicates what type of request this is. The format
9563 * for the rest of the command is determined by this field.
9567 * This value indicates the what completion ring the request
9568 * will be optionally completed on. If the value is -1, then no
9569 * CR completion will be generated. Any other value must be a
9570 * valid CR ring_id value for this function.
9573 /* This value indicates the command sequence number. */
9576 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9577 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9582 * This is the host address where the response will be written
9583 * when the request is complete. This area must be 16B aligned
9584 * and must be cleared to zero before the request is made.
9586 uint8_t tunnel_type;
9588 /* Virtual eXtensible Local Area Network (VXLAN) */
9589 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_VXLAN \
9591 /* Generic Network Virtualization Encapsulation (Geneve) */
9592 #define HWRM_TUNNEL_DST_PORT_QUERY_INPUT_TUNNEL_TYPE_GENEVE \
9594 uint8_t unused_0[7];
9595 } __attribute__((packed));
9597 /* Output (16 bytes) */
9598 struct hwrm_tunnel_dst_port_query_output {
9599 uint16_t error_code;
9601 * Pass/Fail or error type Note: receiver to verify the in
9602 * parameters, and fail the call with an error when appropriate
9605 /* This field returns the type of original request. */
9607 /* This field provides original sequence number of the command. */
9610 * This field is the length of the response in bytes. The last
9611 * byte of the response is a valid flag that will read as '1'
9612 * when the command has been completely written to memory.
9614 uint16_t tunnel_dst_port_id;
9616 * This field represents the identifier of L4 destination port
9617 * used for the given tunnel type. This field is valid for
9618 * specific tunnel types that use layer 4 (e.g. UDP) transports
9621 uint16_t tunnel_dst_port_val;
9623 * This field represents the value of L4 destination port
9624 * identified by tunnel_dst_port_id. This field is valid for
9625 * specific tunnel types that use layer 4 (e.g. UDP) transports
9626 * for tunneling. This field is in network byte order. A value
9627 * of 0 means that the destination port is not configured.
9634 * This field is used in Output records to indicate that the
9635 * output is completely written to RAM. This field should be
9636 * read as '1' to indicate that the output has been completely
9637 * written. When writing a command completion or response to an
9638 * internal processor, the order of writes has to be such that
9639 * this field is written last.
9641 } __attribute__((packed));
9643 /* hwrm_tunnel_dst_port_alloc */
9645 * Description: This function is called by a driver to allocate l4 destination
9646 * port for a specific tunnel type. The destination port value is provided in
9647 * the input. If the HWRM supports only one global destination port for a tunnel
9648 * type, then the HWRM shall keep track of its usage as described below. # The
9649 * first caller that allocates a destination port shall always succeed and the
9650 * HWRM shall save the destination port configuration for that tunnel type and
9651 * increment the usage count to 1. # Subsequent callers allocating the same
9652 * destination port for that tunnel type shall succeed and the HWRM shall
9653 * increment the usage count for that port for each subsequent caller that
9654 * succeeds. # Any subsequent caller trying to allocate a different destination
9655 * port for that tunnel type shall fail until the usage count for the original
9656 * destination port goes to zero. # A caller that frees a port will cause the
9657 * usage count for that port to decrement.
9659 /* Input (24 bytes) */
9660 struct hwrm_tunnel_dst_port_alloc_input {
9663 * This value indicates what type of request this is. The format
9664 * for the rest of the command is determined by this field.
9668 * This value indicates the what completion ring the request
9669 * will be optionally completed on. If the value is -1, then no
9670 * CR completion will be generated. Any other value must be a
9671 * valid CR ring_id value for this function.
9674 /* This value indicates the command sequence number. */
9677 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9678 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9683 * This is the host address where the response will be written
9684 * when the request is complete. This area must be 16B aligned
9685 * and must be cleared to zero before the request is made.
9687 uint8_t tunnel_type;
9689 /* Virtual eXtensible Local Area Network (VXLAN) */
9690 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
9691 /* Generic Network Virtualization Encapsulation (Geneve) */
9692 #define HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
9695 uint16_t tunnel_dst_port_val;
9697 * This field represents the value of L4 destination port used
9698 * for the given tunnel type. This field is valid for specific
9699 * tunnel types that use layer 4 (e.g. UDP) transports for
9700 * tunneling. This field is in network byte order. A value of 0
9701 * shall fail the command.
9704 } __attribute__((packed));
9706 /* Output (16 bytes) */
9707 struct hwrm_tunnel_dst_port_alloc_output {
9708 uint16_t error_code;
9710 * Pass/Fail or error type Note: receiver to verify the in
9711 * parameters, and fail the call with an error when appropriate
9714 /* This field returns the type of original request. */
9716 /* This field provides original sequence number of the command. */
9719 * This field is the length of the response in bytes. The last
9720 * byte of the response is a valid flag that will read as '1'
9721 * when the command has been completely written to memory.
9723 uint16_t tunnel_dst_port_id;
9725 * Identifier of a tunnel L4 destination port value. Only
9726 * applies to tunnel types that has l4 destination port
9736 * This field is used in Output records to indicate that the
9737 * output is completely written to RAM. This field should be
9738 * read as '1' to indicate that the output has been completely
9739 * written. When writing a command completion or response to an
9740 * internal processor, the order of writes has to be such that
9741 * this field is written last.
9743 } __attribute__((packed));
9745 /* hwrm_tunnel_dst_port_free */
9747 * Description: This function is called by a driver to free l4 destination port
9748 * for a specific tunnel type.
9750 /* Input (24 bytes) */
9751 struct hwrm_tunnel_dst_port_free_input {
9754 * This value indicates what type of request this is. The format
9755 * for the rest of the command is determined by this field.
9759 * This value indicates the what completion ring the request
9760 * will be optionally completed on. If the value is -1, then no
9761 * CR completion will be generated. Any other value must be a
9762 * valid CR ring_id value for this function.
9765 /* This value indicates the command sequence number. */
9768 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9769 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9774 * This is the host address where the response will be written
9775 * when the request is complete. This area must be 16B aligned
9776 * and must be cleared to zero before the request is made.
9778 uint8_t tunnel_type;
9780 /* Virtual eXtensible Local Area Network (VXLAN) */
9781 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN UINT32_C(0x1)
9782 /* Generic Network Virtualization Encapsulation (Geneve) */
9783 #define HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE UINT32_C(0x5)
9785 uint16_t tunnel_dst_port_id;
9787 * Identifier of a tunnel L4 destination port value. Only
9788 * applies to tunnel types that has l4 destination port
9792 } __attribute__((packed));
9794 /* Output (16 bytes) */
9795 struct hwrm_tunnel_dst_port_free_output {
9796 uint16_t error_code;
9798 * Pass/Fail or error type Note: receiver to verify the in
9799 * parameters, and fail the call with an error when appropriate
9802 /* This field returns the type of original request. */
9804 /* This field provides original sequence number of the command. */
9807 * This field is the length of the response in bytes. The last
9808 * byte of the response is a valid flag that will read as '1'
9809 * when the command has been completely written to memory.
9817 * This field is used in Output records to indicate that the
9818 * output is completely written to RAM. This field should be
9819 * read as '1' to indicate that the output has been completely
9820 * written. When writing a command completion or response to an
9821 * internal processor, the order of writes has to be such that
9822 * this field is written last.
9824 } __attribute__((packed));
9826 /* hwrm_stat_ctx_alloc */
9828 * Description: This command allocates and does basic preparation for a stat
9831 /* Input (32 bytes) */
9832 struct hwrm_stat_ctx_alloc_input {
9835 * This value indicates what type of request this is. The format
9836 * for the rest of the command is determined by this field.
9840 * This value indicates the what completion ring the request
9841 * will be optionally completed on. If the value is -1, then no
9842 * CR completion will be generated. Any other value must be a
9843 * valid CR ring_id value for this function.
9846 /* This value indicates the command sequence number. */
9849 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9850 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9855 * This is the host address where the response will be written
9856 * when the request is complete. This area must be 16B aligned
9857 * and must be cleared to zero before the request is made.
9859 uint64_t stats_dma_addr;
9860 /* This is the address for statistic block. */
9861 uint32_t update_period_ms;
9863 * The statistic block update period in ms. e.g. 250ms, 500ms,
9864 * 750ms, 1000ms. If update_period_ms is 0, then the stats
9865 * update shall be never done and the DMA address shall not be
9866 * used. In this case, the stat block can only be read by
9867 * hwrm_stat_ctx_query command.
9869 uint8_t stat_ctx_flags;
9871 * This field is used to specify statistics context specific
9872 * configuration flags.
9875 * When this bit is set to '1', the statistics context shall be
9876 * allocated for RoCE traffic only. In this case, traffic other
9877 * than offloaded RoCE traffic shall not be included in this
9878 * statistic context. When this bit is set to '0', the
9879 * statistics context shall be used for the network traffic
9880 * other than offloaded RoCE traffic.
9882 #define HWRM_STAT_CTX_ALLOC_INPUT_STAT_CTX_FLAGS_ROCE UINT32_C(0x1)
9883 uint8_t unused_0[3];
9884 } __attribute__((packed));
9886 /* Output (16 bytes) */
9887 struct hwrm_stat_ctx_alloc_output {
9888 uint16_t error_code;
9890 * Pass/Fail or error type Note: receiver to verify the in
9891 * parameters, and fail the call with an error when appropriate
9894 /* This field returns the type of original request. */
9896 /* This field provides original sequence number of the command. */
9899 * This field is the length of the response in bytes. The last
9900 * byte of the response is a valid flag that will read as '1'
9901 * when the command has been completely written to memory.
9903 uint32_t stat_ctx_id;
9904 /* This is the statistics context ID value. */
9910 * This field is used in Output records to indicate that the
9911 * output is completely written to RAM. This field should be
9912 * read as '1' to indicate that the output has been completely
9913 * written. When writing a command completion or response to an
9914 * internal processor, the order of writes has to be such that
9915 * this field is written last.
9917 } __attribute__((packed));
9919 /* hwrm_stat_ctx_free */
9920 /* Description: This command is used to free a stat context. */
9921 /* Input (24 bytes) */
9922 struct hwrm_stat_ctx_free_input {
9925 * This value indicates what type of request this is. The format
9926 * for the rest of the command is determined by this field.
9930 * This value indicates the what completion ring the request
9931 * will be optionally completed on. If the value is -1, then no
9932 * CR completion will be generated. Any other value must be a
9933 * valid CR ring_id value for this function.
9936 /* This value indicates the command sequence number. */
9939 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
9940 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
9945 * This is the host address where the response will be written
9946 * when the request is complete. This area must be 16B aligned
9947 * and must be cleared to zero before the request is made.
9949 uint32_t stat_ctx_id;
9950 /* ID of the statistics context that is being queried. */
9952 } __attribute__((packed));
9954 /* Output (16 bytes) */
9955 struct hwrm_stat_ctx_free_output {
9956 uint16_t error_code;
9958 * Pass/Fail or error type Note: receiver to verify the in
9959 * parameters, and fail the call with an error when appropriate
9962 /* This field returns the type of original request. */
9964 /* This field provides original sequence number of the command. */
9967 * This field is the length of the response in bytes. The last
9968 * byte of the response is a valid flag that will read as '1'
9969 * when the command has been completely written to memory.
9971 uint32_t stat_ctx_id;
9972 /* This is the statistics context ID value. */
9978 * This field is used in Output records to indicate that the
9979 * output is completely written to RAM. This field should be
9980 * read as '1' to indicate that the output has been completely
9981 * written. When writing a command completion or response to an
9982 * internal processor, the order of writes has to be such that
9983 * this field is written last.
9985 } __attribute__((packed));
9987 /* hwrm_stat_ctx_clr_stats */
9988 /* Description: This command clears statistics of a context. */
9989 /* Input (24 bytes) */
9990 struct hwrm_stat_ctx_clr_stats_input {
9993 * This value indicates what type of request this is. The format
9994 * for the rest of the command is determined by this field.
9998 * This value indicates the what completion ring the request
9999 * will be optionally completed on. If the value is -1, then no
10000 * CR completion will be generated. Any other value must be a
10001 * valid CR ring_id value for this function.
10004 /* This value indicates the command sequence number. */
10005 uint16_t target_id;
10007 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
10008 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
10011 uint64_t resp_addr;
10013 * This is the host address where the response will be written
10014 * when the request is complete. This area must be 16B aligned
10015 * and must be cleared to zero before the request is made.
10017 uint32_t stat_ctx_id;
10018 /* ID of the statistics context that is being queried. */
10020 } __attribute__((packed));
10022 /* Output (16 bytes) */
10023 struct hwrm_stat_ctx_clr_stats_output {
10024 uint16_t error_code;
10026 * Pass/Fail or error type Note: receiver to verify the in
10027 * parameters, and fail the call with an error when appropriate
10030 /* This field returns the type of original request. */
10032 /* This field provides original sequence number of the command. */
10035 * This field is the length of the response in bytes. The last
10036 * byte of the response is a valid flag that will read as '1'
10037 * when the command has been completely written to memory.
10045 * This field is used in Output records to indicate that the
10046 * output is completely written to RAM. This field should be
10047 * read as '1' to indicate that the output has been completely
10048 * written. When writing a command completion or response to an
10049 * internal processor, the order of writes has to be such that
10050 * this field is written last.
10052 } __attribute__((packed));
10054 /* hwrm_stat_ctx_query */
10055 /* Description: This command returns statistics of a context. */
10056 /* Input (24 bytes) */
10058 struct hwrm_stat_ctx_query_input {
10061 * This value indicates what type of request this is. The format for the
10062 * rest of the command is determined by this field.
10064 uint16_t cmpl_ring;
10066 * This value indicates the what completion ring the request will be
10067 * optionally completed on. If the value is -1, then no CR completion
10068 * will be generated. Any other value must be a valid CR ring_id value
10069 * for this function.
10072 /* This value indicates the command sequence number. */
10073 uint16_t target_id;
10075 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
10076 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
10078 uint64_t resp_addr;
10080 * This is the host address where the response will be written when the
10081 * request is complete. This area must be 16B aligned and must be
10082 * cleared to zero before the request is made.
10084 uint32_t stat_ctx_id;
10085 /* ID of the statistics context that is being queried. */
10087 } __attribute__((packed));
10089 /* Output (176 bytes) */
10091 struct hwrm_stat_ctx_query_output {
10092 uint16_t error_code;
10094 * Pass/Fail or error type Note: receiver to verify the in parameters,
10095 * and fail the call with an error when appropriate
10098 /* This field returns the type of original request. */
10100 /* This field provides original sequence number of the command. */
10103 * This field is the length of the response in bytes. The last byte of
10104 * the response is a valid flag that will read as '1' when the command
10105 * has been completely written to memory.
10107 uint64_t tx_ucast_pkts;
10108 /* Number of transmitted unicast packets */
10109 uint64_t tx_mcast_pkts;
10110 /* Number of transmitted multicast packets */
10111 uint64_t tx_bcast_pkts;
10112 /* Number of transmitted broadcast packets */
10113 uint64_t tx_err_pkts;
10114 /* Number of transmitted packets with error */
10115 uint64_t tx_drop_pkts;
10116 /* Number of dropped packets on transmit path */
10117 uint64_t tx_ucast_bytes;
10118 /* Number of transmitted bytes for unicast traffic */
10119 uint64_t tx_mcast_bytes;
10120 /* Number of transmitted bytes for multicast traffic */
10121 uint64_t tx_bcast_bytes;
10122 /* Number of transmitted bytes for broadcast traffic */
10123 uint64_t rx_ucast_pkts;
10124 /* Number of received unicast packets */
10125 uint64_t rx_mcast_pkts;
10126 /* Number of received multicast packets */
10127 uint64_t rx_bcast_pkts;
10128 /* Number of received broadcast packets */
10129 uint64_t rx_err_pkts;
10130 /* Number of received packets with error */
10131 uint64_t rx_drop_pkts;
10132 /* Number of dropped packets on received path */
10133 uint64_t rx_ucast_bytes;
10134 /* Number of received bytes for unicast traffic */
10135 uint64_t rx_mcast_bytes;
10136 /* Number of received bytes for multicast traffic */
10137 uint64_t rx_bcast_bytes;
10138 /* Number of received bytes for broadcast traffic */
10139 uint64_t rx_agg_pkts;
10140 /* Number of aggregated unicast packets */
10141 uint64_t rx_agg_bytes;
10142 /* Number of aggregated unicast bytes */
10143 uint64_t rx_agg_events;
10144 /* Number of aggregation events */
10145 uint64_t rx_agg_aborts;
10146 /* Number of aborted aggregations */
10153 * This field is used in Output records to indicate that the output is
10154 * completely written to RAM. This field should be read as '1' to
10155 * indicate that the output has been completely written. When writing a
10156 * command completion or response to an internal processor, the order of
10157 * writes has to be such that this field is written last.
10159 } __attribute__((packed));
10161 /* hwrm_exec_fwd_resp */
10163 * Description: This command is used to send an encapsulated request to the
10164 * HWRM. This command instructs the HWRM to execute the request and forward the
10165 * response of the encapsulated request to the location specified in the
10166 * original request that is encapsulated. The target id of this command shall be
10167 * set to 0xFFFF (HWRM). The response location in this command shall be used to
10168 * acknowledge the receipt of the encapsulated request and forwarding of the
10171 /* Input (128 bytes) */
10172 struct hwrm_exec_fwd_resp_input {
10175 * This value indicates what type of request this is. The format
10176 * for the rest of the command is determined by this field.
10178 uint16_t cmpl_ring;
10180 * This value indicates the what completion ring the request
10181 * will be optionally completed on. If the value is -1, then no
10182 * CR completion will be generated. Any other value must be a
10183 * valid CR ring_id value for this function.
10186 /* This value indicates the command sequence number. */
10187 uint16_t target_id;
10189 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
10190 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
10193 uint64_t resp_addr;
10195 * This is the host address where the response will be written
10196 * when the request is complete. This area must be 16B aligned
10197 * and must be cleared to zero before the request is made.
10199 uint32_t encap_request[26];
10201 * This is an encapsulated request. This request should be
10202 * executed by the HWRM and the response should be provided in
10203 * the response buffer inside the encapsulated request.
10205 uint16_t encap_resp_target_id;
10207 * This value indicates the target id of the response to the
10208 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids
10209 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF -
10212 uint16_t unused_0[3];
10213 } __attribute__((packed));
10215 /* Output (16 bytes) */
10216 struct hwrm_exec_fwd_resp_output {
10217 uint16_t error_code;
10219 * Pass/Fail or error type Note: receiver to verify the in
10220 * parameters, and fail the call with an error when appropriate
10223 /* This field returns the type of original request. */
10225 /* This field provides original sequence number of the command. */
10228 * This field is the length of the response in bytes. The last
10229 * byte of the response is a valid flag that will read as '1'
10230 * when the command has been completely written to memory.
10238 * This field is used in Output records to indicate that the
10239 * output is completely written to RAM. This field should be
10240 * read as '1' to indicate that the output has been completely
10241 * written. When writing a command completion or response to an
10242 * internal processor, the order of writes has to be such that
10243 * this field is written last.
10245 } __attribute__((packed));
10247 /* hwrm_reject_fwd_resp */
10249 * Description: This command is used to send an encapsulated request to the
10250 * HWRM. This command instructs the HWRM to reject the request and forward the
10251 * error response of the encapsulated request to the location specified in the
10252 * original request that is encapsulated. The target id of this command shall be
10253 * set to 0xFFFF (HWRM). The response location in this command shall be used to
10254 * acknowledge the receipt of the encapsulated request and forwarding of the
10257 /* Input (128 bytes) */
10258 struct hwrm_reject_fwd_resp_input {
10261 * This value indicates what type of request this is. The format
10262 * for the rest of the command is determined by this field.
10264 uint16_t cmpl_ring;
10266 * This value indicates the what completion ring the request
10267 * will be optionally completed on. If the value is -1, then no
10268 * CR completion will be generated. Any other value must be a
10269 * valid CR ring_id value for this function.
10272 /* This value indicates the command sequence number. */
10273 uint16_t target_id;
10275 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
10276 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
10279 uint64_t resp_addr;
10281 * This is the host address where the response will be written
10282 * when the request is complete. This area must be 16B aligned
10283 * and must be cleared to zero before the request is made.
10285 uint32_t encap_request[26];
10287 * This is an encapsulated request. This request should be
10288 * rejected by the HWRM and the error response should be
10289 * provided in the response buffer inside the encapsulated
10292 uint16_t encap_resp_target_id;
10294 * This value indicates the target id of the response to the
10295 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids
10296 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF -
10299 uint16_t unused_0[3];
10300 } __attribute__((packed));
10302 /* Output (16 bytes) */
10303 struct hwrm_reject_fwd_resp_output {
10304 uint16_t error_code;
10306 * Pass/Fail or error type Note: receiver to verify the in
10307 * parameters, and fail the call with an error when appropriate
10310 /* This field returns the type of original request. */
10312 /* This field provides original sequence number of the command. */
10315 * This field is the length of the response in bytes. The last
10316 * byte of the response is a valid flag that will read as '1'
10317 * when the command has been completely written to memory.
10325 * This field is used in Output records to indicate that the
10326 * output is completely written to RAM. This field should be
10327 * read as '1' to indicate that the output has been completely
10328 * written. When writing a command completion or response to an
10329 * internal processor, the order of writes has to be such that
10330 * this field is written last.
10332 } __attribute__((packed));
10334 /* Hardware Resource Manager Specification */
10335 /* Description: This structure is used to specify port description. */
10337 * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
10338 * inside the chip. The HWRM is implemented in firmware, and runs on embedded
10339 * processors inside the chip. This firmware service is vital part of the chip.
10340 * The chip can not be used by a driver or HWRM client without the HWRM.
10342 /* Input (16 bytes) */
10346 * This value indicates what type of request this is. The format
10347 * for the rest of the command is determined by this field.
10349 uint16_t cmpl_ring;
10351 * This value indicates the what completion ring the request
10352 * will be optionally completed on. If the value is -1, then no
10353 * CR completion will be generated. Any other value must be a
10354 * valid CR ring_id value for this function.
10357 /* This value indicates the command sequence number. */
10358 uint16_t target_id;
10360 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
10361 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
10364 uint64_t resp_addr;
10366 * This is the host address where the response will be written
10367 * when the request is complete. This area must be 16B aligned
10368 * and must be cleared to zero before the request is made.
10370 } __attribute__((packed));
10372 /* Output (8 bytes) */
10374 uint16_t error_code;
10376 * Pass/Fail or error type Note: receiver to verify the in
10377 * parameters, and fail the call with an error when appropriate
10380 /* This field returns the type of original request. */
10382 /* This field provides original sequence number of the command. */
10385 * This field is the length of the response in bytes. The last
10386 * byte of the response is a valid flag that will read as '1'
10387 * when the command has been completely written to memory.
10389 } __attribute__((packed));
10391 /* Short Command Structure (16 bytes) */
10392 struct hwrm_short_input {
10394 uint16_t signature;
10395 #define HWRM_SHORT_REQ_SIGNATURE_SHORT_CMD (UINT32_C(0x4321))
10399 } __attribute__((packed));
10401 #define HWRM_GET_HWRM_ERROR_CODE(arg) \
10403 typeof(arg) x = (arg); \
10404 ((x) == 0xf ? "HWRM_ERROR" : \
10405 ((x) == 0xffff ? "CMD_NOT_SUPPORTED" : \
10406 ((x) == 0xfffe ? "UNKNOWN_ERR" : \
10407 ((x) == 0x4 ? "RESOURCE_ALLOC_ERROR" : \
10408 ((x) == 0x5 ? "INVALID_FLAGS" : \
10409 ((x) == 0x6 ? "INVALID_ENABLES" : \
10410 ((x) == 0x0 ? "SUCCESS" : \
10411 ((x) == 0x1 ? "FAIL" : \
10412 ((x) == 0x2 ? "INVALID_PARAMS" : \
10413 ((x) == 0x3 ? "RESOURCE_ACCESS_DENIED" : \
10414 "Unknown error_code")))))))))) \
10417 /* Return Codes (8 bytes) */
10419 uint16_t error_code;
10420 /* These are numbers assigned to return/error codes. */
10421 /* Request was successfully executed by the HWRM. */
10422 #define HWRM_ERR_CODE_SUCCESS (UINT32_C(0x0))
10423 /* THe HWRM failed to execute the request. */
10424 #define HWRM_ERR_CODE_FAIL (UINT32_C(0x1))
10426 * The request contains invalid argument(s) or
10427 * input parameters.
10429 #define HWRM_ERR_CODE_INVALID_PARAMS (UINT32_C(0x2))
10431 * The requester is not allowed to access the
10432 * requested resource. This error code shall be
10433 * provided in a response to a request to query
10434 * or modify an existing resource that is not
10435 * accessible by the requester.
10437 #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED (UINT32_C(0x3))
10439 * The HWRM is unable to allocate the requested
10440 * resource. This code only applies to requests
10441 * for HWRM resource allocations.
10443 #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR (UINT32_C(0x4))
10444 /* Invalid combination of flags is specified in the request. */
10445 #define HWRM_ERR_CODE_INVALID_FLAGS (UINT32_C(0x5))
10447 * Invalid combination of enables fields is
10448 * specified in the request.
10450 #define HWRM_ERR_CODE_INVALID_ENABLES (UINT32_C(0x6))
10452 * Generic HWRM execution error that represents
10453 * an internal error.
10455 #define HWRM_ERR_CODE_HWRM_ERROR (UINT32_C(0xf))
10456 /* Unknown error */
10457 #define HWRM_ERR_CODE_UNKNOWN_ERR (UINT32_C(0xfffe))
10458 /* Unsupported or invalid command */
10459 #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED (UINT32_C(0xffff))
10460 uint16_t unused_0[3];
10461 } __attribute__((packed));
10463 /* Output (16 bytes) */
10464 struct hwrm_err_output {
10465 uint16_t error_code;
10467 * Pass/Fail or error type Note: receiver to verify the in
10468 * parameters, and fail the call with an error when appropriate
10471 /* This field returns the type of original request. */
10473 /* This field provides original sequence number of the command. */
10476 * This field is the length of the response in bytes. The last
10477 * byte of the response is a valid flag that will read as '1'
10478 * when the command has been completely written to memory.
10481 /* debug info for this error response. */
10483 /* debug info for this error response. */
10486 * In the case of an error response, command specific error code
10487 * is returned in this field.
10491 * This field is used in Output records to indicate that the
10492 * output is completely written to RAM. This field should be
10493 * read as '1' to indicate that the output has been completely
10494 * written. When writing a command completion or response to an
10495 * internal processor, the order of writes has to be such that
10496 * this field is written last.
10498 } __attribute__((packed));
10500 /* Port Tx Statistics Formats (408 bytes) */
10501 struct tx_port_stats {
10502 uint64_t tx_64b_frames;
10503 /* Total Number of 64 Bytes frames transmitted */
10504 uint64_t tx_65b_127b_frames;
10505 /* Total Number of 65-127 Bytes frames transmitted */
10506 uint64_t tx_128b_255b_frames;
10507 /* Total Number of 128-255 Bytes frames transmitted */
10508 uint64_t tx_256b_511b_frames;
10509 /* Total Number of 256-511 Bytes frames transmitted */
10510 uint64_t tx_512b_1023b_frames;
10511 /* Total Number of 512-1023 Bytes frames transmitted */
10512 uint64_t tx_1024b_1518_frames;
10513 /* Total Number of 1024-1518 Bytes frames transmitted */
10514 uint64_t tx_good_vlan_frames;
10516 * Total Number of each good VLAN (exludes FCS errors) frame
10517 * transmitted which is 1519 to 1522 bytes in length inclusive
10518 * (excluding framing bits but including FCS bytes).
10520 uint64_t tx_1519b_2047_frames;
10521 /* Total Number of 1519-2047 Bytes frames transmitted */
10522 uint64_t tx_2048b_4095b_frames;
10523 /* Total Number of 2048-4095 Bytes frames transmitted */
10524 uint64_t tx_4096b_9216b_frames;
10525 /* Total Number of 4096-9216 Bytes frames transmitted */
10526 uint64_t tx_9217b_16383b_frames;
10527 /* Total Number of 9217-16383 Bytes frames transmitted */
10528 uint64_t tx_good_frames;
10529 /* Total Number of good frames transmitted */
10530 uint64_t tx_total_frames;
10531 /* Total Number of frames transmitted */
10532 uint64_t tx_ucast_frames;
10533 /* Total number of unicast frames transmitted */
10534 uint64_t tx_mcast_frames;
10535 /* Total number of multicast frames transmitted */
10536 uint64_t tx_bcast_frames;
10537 /* Total number of broadcast frames transmitted */
10538 uint64_t tx_pause_frames;
10539 /* Total number of PAUSE control frames transmitted */
10540 uint64_t tx_pfc_frames;
10541 /* Total number of PFC/per-priority PAUSE control frames transmitted */
10542 uint64_t tx_jabber_frames;
10543 /* Total number of jabber frames transmitted */
10544 uint64_t tx_fcs_err_frames;
10545 /* Total number of frames transmitted with FCS error */
10546 uint64_t tx_control_frames;
10547 /* Total number of control frames transmitted */
10548 uint64_t tx_oversz_frames;
10549 /* Total number of over-sized frames transmitted */
10550 uint64_t tx_single_dfrl_frames;
10551 /* Total number of frames with single deferral */
10552 uint64_t tx_multi_dfrl_frames;
10553 /* Total number of frames with multiple deferrals */
10554 uint64_t tx_single_coll_frames;
10555 /* Total number of frames with single collision */
10556 uint64_t tx_multi_coll_frames;
10557 /* Total number of frames with multiple collisions */
10558 uint64_t tx_late_coll_frames;
10559 /* Total number of frames with late collisions */
10560 uint64_t tx_excessive_coll_frames;
10561 /* Total number of frames with excessive collisions */
10562 uint64_t tx_frag_frames;
10563 /* Total number of fragmented frames transmitted */
10565 /* Total number of transmit errors */
10566 uint64_t tx_tagged_frames;
10567 /* Total number of single VLAN tagged frames transmitted */
10568 uint64_t tx_dbl_tagged_frames;
10569 /* Total number of double VLAN tagged frames transmitted */
10570 uint64_t tx_runt_frames;
10571 /* Total number of runt frames transmitted */
10572 uint64_t tx_fifo_underruns;
10573 /* Total number of TX FIFO under runs */
10574 uint64_t tx_pfc_ena_frames_pri0;
10576 * Total number of PFC frames with PFC enabled bit for Pri 0
10579 uint64_t tx_pfc_ena_frames_pri1;
10581 * Total number of PFC frames with PFC enabled bit for Pri 1
10584 uint64_t tx_pfc_ena_frames_pri2;
10586 * Total number of PFC frames with PFC enabled bit for Pri 2
10589 uint64_t tx_pfc_ena_frames_pri3;
10591 * Total number of PFC frames with PFC enabled bit for Pri 3
10594 uint64_t tx_pfc_ena_frames_pri4;
10596 * Total number of PFC frames with PFC enabled bit for Pri 4
10599 uint64_t tx_pfc_ena_frames_pri5;
10601 * Total number of PFC frames with PFC enabled bit for Pri 5
10604 uint64_t tx_pfc_ena_frames_pri6;
10606 * Total number of PFC frames with PFC enabled bit for Pri 6
10609 uint64_t tx_pfc_ena_frames_pri7;
10611 * Total number of PFC frames with PFC enabled bit for Pri 7
10614 uint64_t tx_eee_lpi_events;
10615 /* Total number of EEE LPI Events on TX */
10616 uint64_t tx_eee_lpi_duration;
10617 /* EEE LPI Duration Counter on TX */
10618 uint64_t tx_llfc_logical_msgs;
10620 * Total number of Link Level Flow Control (LLFC) messages
10623 uint64_t tx_hcfc_msgs;
10624 /* Total number of HCFC messages transmitted */
10625 uint64_t tx_total_collisions;
10626 /* Total number of TX collisions */
10628 /* Total number of transmitted bytes */
10629 uint64_t tx_xthol_frames;
10630 /* Total number of end-to-end HOL frames */
10631 uint64_t tx_stat_discard;
10632 /* Total Tx Drops per Port reported by STATS block */
10633 uint64_t tx_stat_error;
10634 /* Total Tx Error Drops per Port reported by STATS block */
10635 } __attribute__((packed));
10637 /* Port Rx Statistics Formats (528 bytes) */
10638 struct rx_port_stats {
10639 uint64_t rx_64b_frames;
10640 /* Total Number of 64 Bytes frames received */
10641 uint64_t rx_65b_127b_frames;
10642 /* Total Number of 65-127 Bytes frames received */
10643 uint64_t rx_128b_255b_frames;
10644 /* Total Number of 128-255 Bytes frames received */
10645 uint64_t rx_256b_511b_frames;
10646 /* Total Number of 256-511 Bytes frames received */
10647 uint64_t rx_512b_1023b_frames;
10648 /* Total Number of 512-1023 Bytes frames received */
10649 uint64_t rx_1024b_1518_frames;
10650 /* Total Number of 1024-1518 Bytes frames received */
10651 uint64_t rx_good_vlan_frames;
10653 * Total Number of each good VLAN (exludes FCS errors) frame
10654 * received which is 1519 to 1522 bytes in length inclusive
10655 * (excluding framing bits but including FCS bytes).
10657 uint64_t rx_1519b_2047b_frames;
10658 /* Total Number of 1519-2047 Bytes frames received */
10659 uint64_t rx_2048b_4095b_frames;
10660 /* Total Number of 2048-4095 Bytes frames received */
10661 uint64_t rx_4096b_9216b_frames;
10662 /* Total Number of 4096-9216 Bytes frames received */
10663 uint64_t rx_9217b_16383b_frames;
10664 /* Total Number of 9217-16383 Bytes frames received */
10665 uint64_t rx_total_frames;
10666 /* Total number of frames received */
10667 uint64_t rx_ucast_frames;
10668 /* Total number of unicast frames received */
10669 uint64_t rx_mcast_frames;
10670 /* Total number of multicast frames received */
10671 uint64_t rx_bcast_frames;
10672 /* Total number of broadcast frames received */
10673 uint64_t rx_fcs_err_frames;
10674 /* Total number of received frames with FCS error */
10675 uint64_t rx_ctrl_frames;
10676 /* Total number of control frames received */
10677 uint64_t rx_pause_frames;
10678 /* Total number of PAUSE frames received */
10679 uint64_t rx_pfc_frames;
10680 /* Total number of PFC frames received */
10681 uint64_t rx_unsupported_opcode_frames;
10682 /* Total number of frames received with an unsupported opcode */
10683 uint64_t rx_unsupported_da_pausepfc_frames;
10685 * Total number of frames received with an unsupported DA for
10688 uint64_t rx_wrong_sa_frames;
10689 /* Total number of frames received with an unsupported SA */
10690 uint64_t rx_align_err_frames;
10691 /* Total number of received packets with alignment error */
10692 uint64_t rx_oor_len_frames;
10693 /* Total number of received frames with out-of-range length */
10694 uint64_t rx_code_err_frames;
10695 /* Total number of received frames with error termination */
10696 uint64_t rx_false_carrier_frames;
10698 * Total number of received frames with a false carrier is
10699 * detected during idle, as defined by RX_ER samples active and
10700 * RXD is 0xE. The event is reported along with the statistics
10701 * generated on the next received frame. Only one false carrier
10702 * condition can be detected and logged between frames. Carrier
10703 * event, valid for 10M/100M speed modes only.
10705 uint64_t rx_ovrsz_frames;
10706 /* Total number of over-sized frames received */
10707 uint64_t rx_jbr_frames;
10708 /* Total number of jabber packets received */
10709 uint64_t rx_mtu_err_frames;
10710 /* Total number of received frames with MTU error */
10711 uint64_t rx_match_crc_frames;
10712 /* Total number of received frames with CRC match */
10713 uint64_t rx_promiscuous_frames;
10714 /* Total number of frames received promiscuously */
10715 uint64_t rx_tagged_frames;
10716 /* Total number of received frames with one or two VLAN tags */
10717 uint64_t rx_double_tagged_frames;
10718 /* Total number of received frames with two VLAN tags */
10719 uint64_t rx_trunc_frames;
10720 /* Total number of truncated frames received */
10721 uint64_t rx_good_frames;
10722 /* Total number of good frames (without errors) received */
10723 uint64_t rx_pfc_xon2xoff_frames_pri0;
10725 * Total number of received PFC frames with transition from XON
10728 uint64_t rx_pfc_xon2xoff_frames_pri1;
10730 * Total number of received PFC frames with transition from XON
10733 uint64_t rx_pfc_xon2xoff_frames_pri2;
10735 * Total number of received PFC frames with transition from XON
10738 uint64_t rx_pfc_xon2xoff_frames_pri3;
10740 * Total number of received PFC frames with transition from XON
10743 uint64_t rx_pfc_xon2xoff_frames_pri4;
10745 * Total number of received PFC frames with transition from XON
10748 uint64_t rx_pfc_xon2xoff_frames_pri5;
10750 * Total number of received PFC frames with transition from XON
10753 uint64_t rx_pfc_xon2xoff_frames_pri6;
10755 * Total number of received PFC frames with transition from XON
10758 uint64_t rx_pfc_xon2xoff_frames_pri7;
10760 * Total number of received PFC frames with transition from XON
10763 uint64_t rx_pfc_ena_frames_pri0;
10765 * Total number of received PFC frames with PFC enabled bit for
10768 uint64_t rx_pfc_ena_frames_pri1;
10770 * Total number of received PFC frames with PFC enabled bit for
10773 uint64_t rx_pfc_ena_frames_pri2;
10775 * Total number of received PFC frames with PFC enabled bit for
10778 uint64_t rx_pfc_ena_frames_pri3;
10780 * Total number of received PFC frames with PFC enabled bit for
10783 uint64_t rx_pfc_ena_frames_pri4;
10785 * Total number of received PFC frames with PFC enabled bit for
10788 uint64_t rx_pfc_ena_frames_pri5;
10790 * Total number of received PFC frames with PFC enabled bit for
10793 uint64_t rx_pfc_ena_frames_pri6;
10795 * Total number of received PFC frames with PFC enabled bit for
10798 uint64_t rx_pfc_ena_frames_pri7;
10800 * Total number of received PFC frames with PFC enabled bit for
10803 uint64_t rx_sch_crc_err_frames;
10804 /* Total Number of frames received with SCH CRC error */
10805 uint64_t rx_undrsz_frames;
10806 /* Total Number of under-sized frames received */
10807 uint64_t rx_frag_frames;
10808 /* Total Number of fragmented frames received */
10809 uint64_t rx_eee_lpi_events;
10810 /* Total number of RX EEE LPI Events */
10811 uint64_t rx_eee_lpi_duration;
10812 /* EEE LPI Duration Counter on RX */
10813 uint64_t rx_llfc_physical_msgs;
10815 * Total number of physical type Link Level Flow Control (LLFC)
10816 * messages received
10818 uint64_t rx_llfc_logical_msgs;
10820 * Total number of logical type Link Level Flow Control (LLFC)
10821 * messages received
10823 uint64_t rx_llfc_msgs_with_crc_err;
10825 * Total number of logical type Link Level Flow Control (LLFC)
10826 * messages received with CRC error
10828 uint64_t rx_hcfc_msgs;
10829 /* Total number of HCFC messages received */
10830 uint64_t rx_hcfc_msgs_with_crc_err;
10831 /* Total number of HCFC messages received with CRC error */
10833 /* Total number of received bytes */
10834 uint64_t rx_runt_bytes;
10835 /* Total number of bytes received in runt frames */
10836 uint64_t rx_runt_frames;
10837 /* Total number of runt frames received */
10838 uint64_t rx_stat_discard;
10839 /* Total Rx Discards per Port reported by STATS block */
10840 uint64_t rx_stat_err;
10841 /* Total Rx Error Drops per Port reported by STATS block */
10842 } __attribute__((packed));
10844 /* Periodic Statistics Context DMA to host (160 bytes) */
10846 * per-context HW statistics -- chip view
10849 struct ctx_hw_stats64 {
10850 uint64_t rx_ucast_pkts;
10851 uint64_t rx_mcast_pkts;
10852 uint64_t rx_bcast_pkts;
10853 uint64_t rx_drop_pkts;
10854 uint64_t rx_discard_pkts;
10855 uint64_t rx_ucast_bytes;
10856 uint64_t rx_mcast_bytes;
10857 uint64_t rx_bcast_bytes;
10859 uint64_t tx_ucast_pkts;
10860 uint64_t tx_mcast_pkts;
10861 uint64_t tx_bcast_pkts;
10862 uint64_t tx_drop_pkts;
10863 uint64_t tx_discard_pkts;
10864 uint64_t tx_ucast_bytes;
10865 uint64_t tx_mcast_bytes;
10866 uint64_t tx_bcast_bytes;
10869 uint64_t tpa_bytes;
10870 uint64_t tpa_events;
10871 uint64_t tpa_aborts;
10872 } __attribute__((packed));
10874 #endif /* _HSI_STRUCT_DEF_DPDK_ */