4 * Copyright(c) 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_EXTERNAL_H_
35 #define _HSI_STRUCT_DEF_EXTERNAL_H_
38 * per-context HW statistics -- chip view
41 struct ctx_hw_stats64 {
42 uint64_t rx_ucast_pkts;
43 uint64_t rx_mcast_pkts;
44 uint64_t rx_bcast_pkts;
45 uint64_t rx_drop_pkts;
46 uint64_t rx_discard_pkts;
47 uint64_t rx_ucast_bytes;
48 uint64_t rx_mcast_bytes;
49 uint64_t rx_bcast_bytes;
51 uint64_t tx_ucast_pkts;
52 uint64_t tx_mcast_pkts;
53 uint64_t tx_bcast_pkts;
54 uint64_t tx_drop_pkts;
55 uint64_t tx_discard_pkts;
56 uint64_t tx_ucast_bytes;
57 uint64_t tx_mcast_bytes;
58 uint64_t tx_bcast_bytes;
64 } __attribute__((packed));
66 /* HW Resource Manager Specification 1.5.1 */
67 #define HWRM_VERSION_MAJOR 1
68 #define HWRM_VERSION_MINOR 5
69 #define HWRM_VERSION_UPDATE 1
71 #define HWRM_VERSION_STR "1.5.1"
74 * Following is the signature for HWRM message field that indicates not
75 * applicable (All F's). Need to cast it the size of the field if needed.
77 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
78 #define HWRM_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */
79 #define HWRM_MAX_RESP_LEN (176) /* hwrm_func_qstats */
80 #define HW_HASH_INDEX_SIZE 0x80 /* 7 bit indirection table index. */
81 #define HW_HASH_KEY_SIZE 40
82 #define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */
87 #define HWRM_VER_GET (UINT32_C(0x0))
88 #define HWRM_FUNC_RESET (UINT32_C(0x11))
89 #define HWRM_FUNC_QCAPS (UINT32_C(0x15))
90 #define HWRM_FUNC_QCFG (UINT32_C(0x16))
91 #define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))
92 #define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))
93 #define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
94 #define HWRM_PORT_PHY_QCFG (UINT32_C(0x27))
95 #define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30))
96 #define HWRM_VNIC_ALLOC (UINT32_C(0x40))
97 #define HWRM_VNIC_FREE (UINT32_C(0x41))
98 #define HWRM_VNIC_CFG (UINT32_C(0x42))
99 #define HWRM_VNIC_RSS_CFG (UINT32_C(0x46))
100 #define HWRM_RING_ALLOC (UINT32_C(0x50))
101 #define HWRM_RING_FREE (UINT32_C(0x51))
102 #define HWRM_RING_GRP_ALLOC (UINT32_C(0x60))
103 #define HWRM_RING_GRP_FREE (UINT32_C(0x61))
104 #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC (UINT32_C(0x70))
105 #define HWRM_VNIC_RSS_COS_LB_CTX_FREE (UINT32_C(0x71))
106 #define HWRM_CFA_L2_FILTER_ALLOC (UINT32_C(0x90))
107 #define HWRM_CFA_L2_FILTER_FREE (UINT32_C(0x91))
108 #define HWRM_CFA_L2_FILTER_CFG (UINT32_C(0x92))
109 #define HWRM_CFA_L2_SET_RX_MASK (UINT32_C(0x93))
110 #define HWRM_STAT_CTX_ALLOC (UINT32_C(0xb0))
111 #define HWRM_STAT_CTX_FREE (UINT32_C(0xb1))
112 #define HWRM_STAT_CTX_CLR_STATS (UINT32_C(0xb3))
113 #define HWRM_EXEC_FWD_RESP (UINT32_C(0xd0))
116 #define HWRM_ERR_CODE_INVALID_PARAMS (UINT32_C(0x2))
117 #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED (UINT32_C(0x3))
119 /* Short TX BD (16 bytes) */
123 * All bits in this field must be valid on the first BD of a
124 * packet. Only the packet_end bit must be valid for the
125 * remaining BDs of a packet.
127 /* This value identifies the type of buffer descriptor. */
128 #define TX_BD_SHORT_TYPE_MASK UINT32_C(0x3f)
129 #define TX_BD_SHORT_TYPE_SFT 0
131 * Indicates that this BD is 16B long and is
132 * used for normal L2 packet transmission.
134 #define TX_BD_SHORT_TYPE_TX_BD_SHORT UINT32_C(0x0)
136 * If set to 1, the packet ends with the data in the buffer
137 * pointed to by this descriptor. This flag must be valid on
140 #define TX_BD_SHORT_FLAGS_PACKET_END UINT32_C(0x40)
142 * If set to 1, the device will not generate a completion for
143 * this transmit packet unless there is an error in it's
144 * processing. If this bit is set to 0, then the packet will be
145 * completed normally. This bit must be valid only on the first
148 #define TX_BD_SHORT_FLAGS_NO_CMPL UINT32_C(0x80)
150 * This value indicates how many 16B BD locations are consumed
151 * in the ring by this packet. A value of 1 indicates that this
152 * BD is the only BD (and that the it is a short BD). A value of
153 * 3 indicates either 3 short BDs or 1 long BD and one short BD
154 * in the packet. A value of 0 indicates that there are 32 BD
155 * locations in the packet (the maximum). This field is valid
156 * only on the first BD of a packet.
158 #define TX_BD_SHORT_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
159 #define TX_BD_SHORT_FLAGS_BD_CNT_SFT 8
161 * This value is a hint for the length of the entire packet. It
162 * is used by the chip to optimize internal processing. The
163 * packet will be dropped if the hint is too short. This field
164 * is valid only on the first BD of a packet.
166 #define TX_BD_SHORT_FLAGS_LHINT_MASK UINT32_C(0x6000)
167 #define TX_BD_SHORT_FLAGS_LHINT_SFT 13
168 /* indicates packet length < 512B */
169 #define TX_BD_SHORT_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
170 /* indicates 512 <= packet length < 1KB */
171 #define TX_BD_SHORT_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
172 /* indicates 1KB <= packet length < 2KB */
173 #define TX_BD_SHORT_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
174 /* indicates packet length >= 2KB */
175 #define TX_BD_SHORT_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
176 #define TX_BD_SHORT_FLAGS_LHINT_LAST TX_BD_SHORT_FLAGS_LHINT_GTE2K
178 * If set to 1, the device immediately updates the Send Consumer
179 * Index after the buffer associated with this descriptor has
180 * been transferred via DMA to NIC memory from host memory. An
181 * interrupt may or may not be generated according to the state
182 * of the interrupt avoidance mechanisms. If this bit is set to
183 * 0, then the Consumer Index is only updated as soon as one of
184 * the host interrupt coalescing conditions has been met. This
185 * bit must be valid on the first BD of a packet.
187 #define TX_BD_SHORT_FLAGS_COAL_NOW UINT32_C(0x8000)
189 * All bits in this field must be valid on the first BD of a
190 * packet. Only the packet_end bit must be valid for the
191 * remaining BDs of a packet.
193 #define TX_BD_SHORT_FLAGS_MASK UINT32_C(0xffc0)
194 #define TX_BD_SHORT_FLAGS_SFT 6
197 * This is the length of the host physical buffer this BD
198 * describes in bytes. This field must be valid on all BDs of a
203 * The opaque data field is pass through to the completion and
204 * can be used for any data that the driver wants to associate
205 * with the transmit BD. This field must be valid on the first
210 * This is the host physical address for the portion of the
211 * packet described by this TX BD. This value must be valid on
212 * all BDs of a packet.
214 } __attribute__((packed));
216 /* Long TX BD (32 bytes split to 2 16-byte struct) */
220 * All bits in this field must be valid on the first BD of a
221 * packet. Only the packet_end bit must be valid for the
222 * remaining BDs of a packet.
224 /* This value identifies the type of buffer descriptor. */
225 #define TX_BD_LONG_TYPE_MASK UINT32_C(0x3f)
226 #define TX_BD_LONG_TYPE_SFT 0
228 * Indicates that this BD is 32B long and is
229 * used for normal L2 packet transmission.
231 #define TX_BD_LONG_TYPE_TX_BD_LONG UINT32_C(0x10)
233 * If set to 1, the packet ends with the data in the buffer
234 * pointed to by this descriptor. This flag must be valid on
237 #define TX_BD_LONG_FLAGS_PACKET_END UINT32_C(0x40)
239 * If set to 1, the device will not generate a completion for
240 * this transmit packet unless there is an error in it's
241 * processing. If this bit is set to 0, then the packet will be
242 * completed normally. This bit must be valid only on the first
245 #define TX_BD_LONG_FLAGS_NO_CMPL UINT32_C(0x80)
247 * This value indicates how many 16B BD locations are consumed
248 * in the ring by this packet. A value of 1 indicates that this
249 * BD is the only BD (and that the it is a short BD). A value of
250 * 3 indicates either 3 short BDs or 1 long BD and one short BD
251 * in the packet. A value of 0 indicates that there are 32 BD
252 * locations in the packet (the maximum). This field is valid
253 * only on the first BD of a packet.
255 #define TX_BD_LONG_FLAGS_BD_CNT_MASK UINT32_C(0x1f00)
256 #define TX_BD_LONG_FLAGS_BD_CNT_SFT 8
258 * This value is a hint for the length of the entire packet. It
259 * is used by the chip to optimize internal processing. The
260 * packet will be dropped if the hint is too short. This field
261 * is valid only on the first BD of a packet.
263 #define TX_BD_LONG_FLAGS_LHINT_MASK UINT32_C(0x6000)
264 #define TX_BD_LONG_FLAGS_LHINT_SFT 13
265 /* indicates packet length < 512B */
266 #define TX_BD_LONG_FLAGS_LHINT_LT512 (UINT32_C(0x0) << 13)
267 /* indicates 512 <= packet length < 1KB */
268 #define TX_BD_LONG_FLAGS_LHINT_LT1K (UINT32_C(0x1) << 13)
269 /* indicates 1KB <= packet length < 2KB */
270 #define TX_BD_LONG_FLAGS_LHINT_LT2K (UINT32_C(0x2) << 13)
271 /* indicates packet length >= 2KB */
272 #define TX_BD_LONG_FLAGS_LHINT_GTE2K (UINT32_C(0x3) << 13)
273 #define TX_BD_LONG_FLAGS_LHINT_LAST TX_BD_LONG_FLAGS_LHINT_GTE2K
275 * If set to 1, the device immediately updates the Send Consumer
276 * Index after the buffer associated with this descriptor has
277 * been transferred via DMA to NIC memory from host memory. An
278 * interrupt may or may not be generated according to the state
279 * of the interrupt avoidance mechanisms. If this bit is set to
280 * 0, then the Consumer Index is only updated as soon as one of
281 * the host interrupt coalescing conditions has been met. This
282 * bit must be valid on the first BD of a packet.
284 #define TX_BD_LONG_FLAGS_COAL_NOW UINT32_C(0x8000)
286 * All bits in this field must be valid on the first BD of a
287 * packet. Only the packet_end bit must be valid for the
288 * remaining BDs of a packet.
290 #define TX_BD_LONG_FLAGS_MASK UINT32_C(0xffc0)
291 #define TX_BD_LONG_FLAGS_SFT 6
294 * This is the length of the host physical buffer this BD
295 * describes in bytes. This field must be valid on all BDs of a
300 * The opaque data field is pass through to the completion and
301 * can be used for any data that the driver wants to associate
302 * with the transmit BD. This field must be valid on the first
307 * This is the host physical address for the portion of the
308 * packet described by this TX BD. This value must be valid on
309 * all BDs of a packet.
311 } __attribute__((packed));
313 /* last 16 bytes of Long TX BD */
314 struct tx_bd_long_hi {
317 * All bits in this field must be valid on the first BD of a
318 * packet. Their value on other BDs of the packet will be
322 * If set to 1, the controller replaces the TCP/UPD checksum
323 * fields of normal TCP/UPD checksum, or the inner TCP/UDP
324 * checksum field of the encapsulated TCP/UDP packets with the
325 * hardware calculated TCP/UDP checksum for the packet
326 * associated with this descriptor. The flag is ignored if the
327 * LSO flag is set. This bit must be valid on the first BD of a
330 #define TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM UINT32_C(0x1)
332 * If set to 1, the controller replaces the IP checksum of the
333 * normal packets, or the inner IP checksum of the encapsulated
334 * packets with the hardware calculated IP checksum for the
335 * packet associated with this descriptor. This bit must be
336 * valid on the first BD of a packet.
338 #define TX_BD_LONG_LFLAGS_IP_CHKSUM UINT32_C(0x2)
340 * If set to 1, the controller will not append an Ethernet CRC
341 * to the end of the frame. This bit must be valid on the first
342 * BD of a packet. Packet must be 64B or longer when this flag
343 * is set. It is not useful to use this bit with any form of TX
344 * offload such as CSO or LSO. The intent is that the packet
345 * from the host already has a valid Ethernet CRC on the packet.
347 #define TX_BD_LONG_LFLAGS_NOCRC UINT32_C(0x4)
349 * If set to 1, the device will record the time at which the
350 * packet was actually transmitted at the TX MAC. This bit must
351 * be valid on the first BD of a packet.
353 #define TX_BD_LONG_LFLAGS_STAMP UINT32_C(0x8)
355 * If set to 1, The controller replaces the tunnel IP checksum
356 * field with hardware calculated IP checksum for the IP header
357 * of the packet associated with this descriptor. For outer UDP
358 * checksum, global outer UDP checksum TE_NIC register needs to
359 * be enabled. If the global outer UDP checksum TE_NIC register
360 * bit is set, outer UDP checksum will be calculated for the
361 * following cases: 1. Packets with tcp_udp_chksum flag set to
362 * offload checksum for inner packet AND the inner packet is
363 * TCP/UDP. If the inner packet is ICMP for example (non-
364 * TCP/UDP), even if the tcp_udp_chksum is set, the outer UDP
365 * checksum will not be calculated. 2. Packets with lso flag set
366 * which implies inner TCP checksum calculation as part of LSO
369 #define TX_BD_LONG_LFLAGS_T_IP_CHKSUM UINT32_C(0x10)
371 * If set to 1, the device will treat this packet with LSO(Large
372 * Send Offload) processing for both normal or encapsulated
373 * packets, which is a form of TCP segmentation. When this bit
374 * is 1, the hdr_size and mss fields must be valid. The driver
375 * doesn't need to set t_ip_chksum, ip_chksum, and
376 * tcp_udp_chksum flags since the controller will replace the
377 * appropriate checksum fields for segmented packets. When this
378 * bit is 1, the hdr_size and mss fields must be valid.
380 #define TX_BD_LONG_LFLAGS_LSO UINT32_C(0x20)
382 * If set to zero when LSO is '1', then the IPID will be treated
383 * as a 16b number and will be wrapped if it exceeds a value of
384 * 0xffff. If set to one when LSO is '1', then the IPID will be
385 * treated as a 15b number and will be wrapped if it exceeds a
388 #define TX_BD_LONG_LFLAGS_IPID_FMT UINT32_C(0x40)
390 * If set to zero when LSO is '1', then the IPID of the tunnel
391 * IP header will not be modified during LSO operations. If set
392 * to one when LSO is '1', then the IPID of the tunnel IP header
393 * will be incremented for each subsequent segment of an LSO
394 * operation. The flag is ignored if the LSO packet is a normal
395 * (non-tunneled) TCP packet.
397 #define TX_BD_LONG_LFLAGS_T_IPID UINT32_C(0x80)
399 * If set to '1', then the RoCE ICRC will be appended to the
400 * packet. Packet must be a valid RoCE format packet.
402 #define TX_BD_LONG_LFLAGS_ROCE_CRC UINT32_C(0x100)
404 * If set to '1', then the FCoE CRC will be appended to the
405 * packet. Packet must be a valid FCoE format packet.
407 #define TX_BD_LONG_LFLAGS_FCOE_CRC UINT32_C(0x200)
410 * When LSO is '1', this field must contain the offset of the
411 * TCP payload from the beginning of the packet in as 16b words.
412 * In case of encapsulated/tunneling packet, this field contains
413 * the offset of the inner TCP payload from beginning of the
414 * packet as 16-bit words. This value must be valid on the first
417 #define TX_BD_LONG_HDR_SIZE_MASK UINT32_C(0x1ff)
418 #define TX_BD_LONG_HDR_SIZE_SFT 0
421 * This is the MSS value that will be used to do the LSO
422 * processing. The value is the length in bytes of the TCP
423 * payload for each segment generated by the LSO operation. This
424 * value must be valid on the first BD of a packet.
426 #define TX_BD_LONG_MSS_MASK UINT32_C(0x7fff)
427 #define TX_BD_LONG_MSS_SFT 0
431 * This value selects a CFA action to perform on the packet. Set
432 * this value to zero if no CFA action is desired. This value
433 * must be valid on the first BD of a packet.
437 * This value is action meta-data that defines CFA edit
438 * operations that are done in addition to any action editing.
440 /* When key=1, This is the VLAN tag VID value. */
441 #define TX_BD_LONG_CFA_META_VLAN_VID_MASK UINT32_C(0xfff)
442 #define TX_BD_LONG_CFA_META_VLAN_VID_SFT 0
443 /* When key=1, This is the VLAN tag DE value. */
444 #define TX_BD_LONG_CFA_META_VLAN_DE UINT32_C(0x1000)
445 /* When key=1, This is the VLAN tag PRI value. */
446 #define TX_BD_LONG_CFA_META_VLAN_PRI_MASK UINT32_C(0xe000)
447 #define TX_BD_LONG_CFA_META_VLAN_PRI_SFT 13
448 /* When key=1, This is the VLAN tag TPID select value. */
449 #define TX_BD_LONG_CFA_META_VLAN_TPID_MASK UINT32_C(0x70000)
450 #define TX_BD_LONG_CFA_META_VLAN_TPID_SFT 16
452 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID88A8 (UINT32_C(0x0) << 16)
454 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100 (UINT32_C(0x1) << 16)
456 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9100 (UINT32_C(0x2) << 16)
458 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9200 (UINT32_C(0x3) << 16)
460 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPID9300 (UINT32_C(0x4) << 16)
461 /* Value programmed in CFA VLANTPID register. */
462 #define TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG (UINT32_C(0x5) << 16)
463 #define TX_BD_LONG_CFA_META_VLAN_TPID_LAST \
464 TX_BD_LONG_CFA_META_VLAN_TPID_TPIDCFG
465 /* When key=1, This is the VLAN tag TPID select value. */
466 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_MASK UINT32_C(0xff80000)
467 #define TX_BD_LONG_CFA_META_VLAN_RESERVED_SFT 19
469 * This field identifies the type of edit to be performed on the
470 * packet. This value must be valid on the first BD of a packet.
472 #define TX_BD_LONG_CFA_META_KEY_MASK UINT32_C(0xf0000000)
473 #define TX_BD_LONG_CFA_META_KEY_SFT 28
475 #define TX_BD_LONG_CFA_META_KEY_NONE (UINT32_C(0x0) << 28)
477 * - meta[17:16] - TPID select value (0 =
478 * 0x8100). - meta[15:12] - PRI/DE value. -
479 * meta[11:0] - VID value.
481 #define TX_BD_LONG_CFA_META_KEY_VLAN_TAG (UINT32_C(0x1) << 28)
482 #define TX_BD_LONG_CFA_META_KEY_LAST TX_BD_LONG_CFA_META_KEY_VLAN_TAG
483 } __attribute__((packed));
485 /* RX Producer Packet BD (16 bytes) */
486 struct rx_prod_pkt_bd {
488 /* This value identifies the type of buffer descriptor. */
489 #define RX_PROD_PKT_BD_TYPE_MASK UINT32_C(0x3f)
490 #define RX_PROD_PKT_BD_TYPE_SFT 0
492 * Indicates that this BD is 16B long and is an
493 * RX Producer (ie. empty) buffer descriptor.
495 #define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT UINT32_C(0x4)
497 * If set to 1, the packet will be placed at the address plus
498 * 2B. The 2 Bytes of padding will be written as zero.
501 * This is intended to be used when the host buffer is cache-
502 * line aligned to produce packets that are easy to parse in
503 * host memory while still allowing writes to be cache line
506 #define RX_PROD_PKT_BD_FLAGS_SOP_PAD UINT32_C(0x40)
508 * If set to 1, the packet write will be padded out to the
509 * nearest cache-line with zero value padding.
512 * If receive buffers start/end on cache-line boundaries, this
513 * feature will ensure that all data writes on the PCI bus
514 * start/end on cache line boundaries.
516 #define RX_PROD_PKT_BD_FLAGS_EOP_PAD UINT32_C(0x80)
518 * This value is the number of additional buffers in the ring
519 * that describe the buffer space to be consumed for the this
520 * packet. If the value is zero, then the packet must fit within
521 * the space described by this BD. If this value is 1 or more,
522 * it indicates how many additional "buffer" BDs are in the ring
523 * immediately following this BD to be used for the same network
524 * packet. Even if the packet to be placed does not need all the
525 * additional buffers, they will be consumed anyway.
527 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_MASK UINT32_C(0x300)
528 #define RX_PROD_PKT_BD_FLAGS_BUFFERS_SFT 8
529 #define RX_PROD_PKT_BD_FLAGS_MASK UINT32_C(0xffc0)
530 #define RX_PROD_PKT_BD_FLAGS_SFT 6
533 * This is the length in Bytes of the host physical buffer where
534 * data for the packet may be placed in host memory.
537 * While this is a Byte resolution value, it is often
538 * advantageous to ensure that the buffers provided end on a
543 * The opaque data field is pass through to the completion and
544 * can be used for any data that the driver wants to associate
545 * with this receive buffer set.
549 * This is the host physical address where data for the packet
550 * may by placed in host memory.
553 * While this is a Byte resolution value, it is often
554 * advantageous to ensure that the buffers provide start on a
557 } __attribute__((packed));
559 /* Completion Ring Structures */
560 /* Note: This structure is used by the HWRM to communicate HWRM Error. */
561 /* Base Completion Record (16 bytes) */
565 * This field indicates the exact type of the completion. By convention,
566 * the LSB identifies the length of the record in 16B units. Even values
567 * indicate 16B records. Odd values indicate 32B records.
569 #define CMPL_BASE_TYPE_MASK UINT32_C(0x3f)
570 #define CMPL_BASE_TYPE_SFT 0
571 /* TX L2 completion: Completion of TX packet. Length = 16B */
572 #define CMPL_BASE_TYPE_TX_L2 (UINT32_C(0x0) << 0)
574 * RX L2 completion: Completion of and L2 RX packet.
577 #define CMPL_BASE_TYPE_RX_L2 (UINT32_C(0x11) << 0)
579 * RX Aggregation Buffer completion : Completion of an L2
580 * aggregation buffer in support of TPA, HDS, or Jumbo packet
581 * completion. Length = 16B
583 #define CMPL_BASE_TYPE_RX_AGG (UINT32_C(0x12) << 0)
585 * RX L2 TPA Start Completion: Completion at the beginning of a
586 * TPA operation. Length = 32B
588 #define CMPL_BASE_TYPE_RX_TPA_START (UINT32_C(0x13) << 0)
590 * RX L2 TPA End Completion: Completion at the end of a TPA
591 * operation. Length = 32B
593 #define CMPL_BASE_TYPE_RX_TPA_END (UINT32_C(0x15) << 0)
595 * Statistics Ejection Completion: Completion of statistics data
596 * ejection buffer. Length = 16B
598 #define CMPL_BASE_TYPE_STAT_EJECT (UINT32_C(0x1a) << 0)
599 /* HWRM Command Completion: Completion of an HWRM command. */
600 #define CMPL_BASE_TYPE_HWRM_DONE (UINT32_C(0x20) << 0)
601 /* Forwarded HWRM Request */
602 #define CMPL_BASE_TYPE_HWRM_FWD_REQ (UINT32_C(0x22) << 0)
603 /* Forwarded HWRM Response */
604 #define CMPL_BASE_TYPE_HWRM_FWD_RESP (UINT32_C(0x24) << 0)
605 /* HWRM Asynchronous Event Information */
606 #define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT (UINT32_C(0x2e) << 0)
607 /* CQ Notification */
608 #define CMPL_BASE_TYPE_CQ_NOTIFICATION (UINT32_C(0x30) << 0)
609 /* SRQ Threshold Event */
610 #define CMPL_BASE_TYPE_SRQ_EVENT (UINT32_C(0x32) << 0)
611 /* DBQ Threshold Event */
612 #define CMPL_BASE_TYPE_DBQ_EVENT (UINT32_C(0x34) << 0)
613 /* QP Async Notification */
614 #define CMPL_BASE_TYPE_QP_EVENT (UINT32_C(0x38) << 0)
615 /* Function Async Notification */
616 #define CMPL_BASE_TYPE_FUNC_EVENT (UINT32_C(0x3a) << 0)
623 * This value is written by the NIC such that it will be different for
624 * each pass through the completion queue. The even passes will write 1.
625 * The odd passes will write 0.
627 #define CMPL_BASE_V UINT32_C(0x1)
629 #define CMPL_BASE_INFO3_MASK UINT32_C(0xfffffffe)
630 #define CMPL_BASE_INFO3_SFT 1
634 } __attribute__((packed));
636 /* TX Completion Record (16 bytes) */
639 * This field indicates the exact type of the completion. By convention,
640 * the LSB identifies the length of the record in 16B units. Even values
641 * indicate 16B records. Odd values indicate 32B records.
643 #define TX_CMPL_TYPE_MASK UINT32_C(0x3f)
644 #define TX_CMPL_TYPE_SFT 0
645 /* TX L2 completion: Completion of TX packet. Length = 16B */
646 #define TX_CMPL_TYPE_TX_L2 (UINT32_C(0x0) << 0)
648 * When this bit is '1', it indicates a packet that has an error of some
649 * type. Type of error is indicated in error_flags.
651 #define TX_CMPL_FLAGS_ERROR UINT32_C(0x40)
653 * When this bit is '1', it indicates that the packet completed was
654 * transmitted using the push acceleration data provided by the driver.
655 * When this bit is '0', it indicates that the packet had not push
656 * acceleration data written or was executed as a normal packet even
657 * though push data was provided.
659 #define TX_CMPL_FLAGS_PUSH UINT32_C(0x80)
660 #define TX_CMPL_FLAGS_MASK UINT32_C(0xffc0)
661 #define TX_CMPL_FLAGS_SFT 6
667 * This is a copy of the opaque field from the first TX BD of this
668 * transmitted packet.
673 * This value is written by the NIC such that it will be different for
674 * each pass through the completion queue. The even passes will write 1.
675 * The odd passes will write 0.
677 #define TX_CMPL_V UINT32_C(0x1)
679 * This error indicates that there was some sort of problem with the BDs
682 #define TX_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
683 #define TX_CMPL_ERRORS_BUFFER_ERROR_SFT 1
685 #define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR (UINT32_C(0x0) << 1)
686 /* Bad Format: BDs were not formatted correctly. */
687 #define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT (UINT32_C(0x2) << 1)
688 #define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \
689 TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT
691 * When this bit is '1', it indicates that the length of the packet was
692 * zero. No packet was transmitted.
694 #define TX_CMPL_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10)
696 * When this bit is '1', it indicates that the packet was longer than
697 * the programmed limit in TDI. No packet was transmitted.
699 #define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20)
701 * When this bit is '1', it indicates that one or more of the BDs
702 * associated with this packet generated a PCI error. This probably
703 * means the address was not valid.
705 #define TX_CMPL_ERRORS_DMA_ERROR UINT32_C(0x40)
707 * When this bit is '1', it indicates that the packet was longer than
708 * indicated by the hint. No packet was transmitted.
710 #define TX_CMPL_ERRORS_HINT_TOO_SHORT UINT32_C(0x80)
712 * When this bit is '1', it indicates that the packet was dropped due to
713 * Poison TLP error on one or more of the TLPs in the PXP completion.
715 #define TX_CMPL_ERRORS_POISON_TLP_ERROR UINT32_C(0x100)
716 #define TX_CMPL_ERRORS_MASK UINT32_C(0xfffe)
717 #define TX_CMPL_ERRORS_SFT 1
722 } __attribute__((packed)) tx_cmpl_t, *ptx_cmpl_t;
724 /* RX Packet Completion Record (32 bytes split to 2 16-byte struct) */
727 * This field indicates the exact type of the completion. By convention,
728 * the LSB identifies the length of the record in 16B units. Even values
729 * indicate 16B records. Odd values indicate 32B records.
731 #define RX_PKT_CMPL_TYPE_MASK UINT32_C(0x3f)
732 #define RX_PKT_CMPL_TYPE_SFT 0
734 * RX L2 completion: Completion of and L2 RX packet.
737 #define RX_PKT_CMPL_TYPE_RX_L2 (UINT32_C(0x11) << 0)
739 * When this bit is '1', it indicates a packet that has an error of some
740 * type. Type of error is indicated in error_flags.
742 #define RX_PKT_CMPL_FLAGS_ERROR UINT32_C(0x40)
743 /* This field indicates how the packet was placed in the buffer. */
744 #define RX_PKT_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380)
745 #define RX_PKT_CMPL_FLAGS_PLACEMENT_SFT 7
746 /* Normal: Packet was placed using normal algorithm. */
747 #define RX_PKT_CMPL_FLAGS_PLACEMENT_NORMAL (UINT32_C(0x0) << 7)
748 /* Jumbo: Packet was placed using jumbo algorithm. */
749 #define RX_PKT_CMPL_FLAGS_PLACEMENT_JUMBO (UINT32_C(0x1) << 7)
751 * Header/Data Separation: Packet was placed using Header/Data
752 * separation algorithm. The separation location is indicated by
755 #define RX_PKT_CMPL_FLAGS_PLACEMENT_HDS (UINT32_C(0x2) << 7)
756 #define RX_PKT_CMPL_FLAGS_PLACEMENT_LAST \
757 RX_PKT_CMPL_FLAGS_PLACEMENT_HDS
758 /* This bit is '1' if the RSS field in this completion is valid. */
759 #define RX_PKT_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)
761 * This value indicates what the inner packet determined for the packet
764 #define RX_PKT_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000)
765 #define RX_PKT_CMPL_FLAGS_ITYPE_SFT 12
766 /* Not Known: Indicates that the packet type was not known. */
767 #define RX_PKT_CMPL_FLAGS_ITYPE_NOT_KNOWN (UINT32_C(0x0) << 12)
769 * IP Packet: Indicates that the packet was an IP packet, but
770 * further classification was not possible.
772 #define RX_PKT_CMPL_FLAGS_ITYPE_IP (UINT32_C(0x1) << 12)
774 * TCP Packet: Indicates that the packet was IP and TCP. This
775 * indicates that the payload_offset field is valid.
777 #define RX_PKT_CMPL_FLAGS_ITYPE_TCP (UINT32_C(0x2) << 12)
779 * UDP Packet: Indicates that the packet was IP and UDP. This
780 * indicates that the payload_offset field is valid.
782 #define RX_PKT_CMPL_FLAGS_ITYPE_UDP (UINT32_C(0x3) << 12)
784 * FCoE Packet: Indicates that the packet was recognized as a
785 * FCoE. This also indicates that the payload_offset field is
788 #define RX_PKT_CMPL_FLAGS_ITYPE_FCOE (UINT32_C(0x4) << 12)
790 * RoCE Packet: Indicates that the packet was recognized as a
791 * RoCE. This also indicates that the payload_offset field is
794 #define RX_PKT_CMPL_FLAGS_ITYPE_ROCE (UINT32_C(0x5) << 12)
796 * ICMP Packet: Indicates that the packet was recognized as
797 * ICMP. This indicates that the payload_offset field is valid.
799 #define RX_PKT_CMPL_FLAGS_ITYPE_ICMP (UINT32_C(0x7) << 12)
801 * PtP packet wo/timestamp: Indicates that the packet was
802 * recognized as a PtP packet.
804 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \
805 (UINT32_C(0x8) << 12)
807 * PtP packet w/timestamp: Indicates that the packet was
808 * recognized as a PtP packet and that a timestamp was taken for
811 #define RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP (UINT32_C(0x9) << 12)
812 #define RX_PKT_CMPL_FLAGS_ITYPE_LAST \
813 RX_PKT_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP
814 #define RX_PKT_CMPL_FLAGS_MASK UINT32_C(0xffc0)
815 #define RX_PKT_CMPL_FLAGS_SFT 6
819 * This is the length of the data for the packet stored in the buffer(s)
820 * identified by the opaque value. This includes the packet BD and any
821 * associated buffer BDs. This does not include the the length of any
822 * data places in aggregation BDs.
827 * This is a copy of the opaque field from the RX BD this completion
833 * This value is written by the NIC such that it will be different for
834 * each pass through the completion queue. The even passes will write 1.
835 * The odd passes will write 0.
837 #define RX_PKT_CMPL_V1 UINT32_C(0x1)
839 * This value is the number of aggregation buffers that follow this
840 * entry in the completion ring that are a part of this packet. If the
841 * value is zero, then the packet is completely contained in the buffer
842 * space provided for the packet in the RX ring.
844 #define RX_PKT_CMPL_AGG_BUFS_MASK UINT32_C(0x3e)
845 #define RX_PKT_CMPL_AGG_BUFS_SFT 1
849 * This is the RSS hash type for the packet. The value is packed
850 * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
852 uint8_t rss_hash_type;
855 * This value indicates the offset from the beginning of the packet
856 * where the inner payload starts. This value is valid for TCP, UDP,
857 * FCoE, and RoCE packets.
859 uint8_t payload_offset;
864 * This value is the RSS hash value calculated for the packet based on
865 * the mode bits and key value in the VNIC.
868 } __attribute__((packed));
870 /* last 16 bytes of RX Packet Completion Record */
871 struct rx_pkt_cmpl_hi {
873 * This indicates that the ip checksum was calculated for the inner
874 * packet and that the ip_cs_error field indicates if there was an
877 #define RX_PKT_CMPL_FLAGS2_IP_CS_CALC UINT32_C(0x1)
879 * This indicates that the TCP, UDP or ICMP checksum was calculated for
880 * the inner packet and that the l4_cs_error field indicates if there
883 #define RX_PKT_CMPL_FLAGS2_L4_CS_CALC UINT32_C(0x2)
885 * This indicates that the ip checksum was calculated for the tunnel
886 * header and that the t_ip_cs_error field indicates if there was an
889 #define RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC UINT32_C(0x4)
891 * This indicates that the UDP checksum was calculated for the tunnel
892 * packet and that the t_l4_cs_error field indicates if there was an
895 #define RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC UINT32_C(0x8)
896 /* This value indicates what format the metadata field is. */
897 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_MASK UINT32_C(0xf0)
898 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT 4
899 /* No metadata informtaion. Value is zero. */
900 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_NONE (UINT32_C(0x0) << 4)
902 * The metadata field contains the VLAN tag and TPID value. -
903 * metadata[11:0] contains the vlan VID value. - metadata[12]
904 * contains the vlan DE value. - metadata[15:13] contains the
905 * vlan PRI value. - metadata[31:16] contains the vlan TPID
908 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN (UINT32_C(0x1) << 4)
909 #define RX_PKT_CMPL_FLAGS2_META_FORMAT_LAST \
910 RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
912 * This field indicates the IP type for the inner-most IP header. A
913 * value of '0' indicates IPv4. A value of '1' indicates IPv6. This
914 * value is only valid if itype indicates a packet with an IP header.
916 #define RX_PKT_CMPL_FLAGS2_IP_TYPE UINT32_C(0x100)
920 * This is data from the CFA block as indicated by the meta_format
923 /* When meta_format=1, this value is the VLAN VID. */
924 #define RX_PKT_CMPL_METADATA_VID_MASK UINT32_C(0xfff)
925 #define RX_PKT_CMPL_METADATA_VID_SFT 0
926 /* When meta_format=1, this value is the VLAN DE. */
927 #define RX_PKT_CMPL_METADATA_DE UINT32_C(0x1000)
928 /* When meta_format=1, this value is the VLAN PRI. */
929 #define RX_PKT_CMPL_METADATA_PRI_MASK UINT32_C(0xe000)
930 #define RX_PKT_CMPL_METADATA_PRI_SFT 13
931 /* When meta_format=1, this value is the VLAN TPID. */
932 #define RX_PKT_CMPL_METADATA_TPID_MASK UINT32_C(0xffff0000)
933 #define RX_PKT_CMPL_METADATA_TPID_SFT 16
937 * This value is written by the NIC such that it will be different for
938 * each pass through the completion queue. The even passes will write 1.
939 * The odd passes will write 0.
941 #define RX_PKT_CMPL_V2 UINT32_C(0x1)
943 * This error indicates that there was some sort of problem with the BDs
944 * for the packet that was found after part of the packet was already
945 * placed. The packet should be treated as invalid.
947 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe)
948 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT 1
949 /* No buffer error */
950 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \
953 * Did Not Fit: Packet did not fit into packet buffer provided.
954 * For regular placement, this means the packet did not fit in
955 * the buffer provided. For HDS and jumbo placement, this means
956 * that the packet could not be placed into 7 physical buffers
959 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \
962 * Not On Chip: All BDs needed for the packet were not on-chip
963 * when the packet arrived.
965 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \
967 /* Bad Format: BDs were not formatted correctly. */
968 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \
970 #define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_LAST \
971 RX_PKT_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT
972 /* This indicates that there was an error in the IP header checksum. */
973 #define RX_PKT_CMPL_ERRORS_IP_CS_ERROR UINT32_C(0x10)
975 * This indicates that there was an error in the TCP, UDP or ICMP
978 #define RX_PKT_CMPL_ERRORS_L4_CS_ERROR UINT32_C(0x20)
980 * This indicates that there was an error in the tunnel IP header
983 #define RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR UINT32_C(0x40)
984 /* This indicates that there was an error in the tunnel UDP checksum. */
985 #define RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR UINT32_C(0x80)
987 * This indicates that there was a CRC error on either an FCoE or RoCE
988 * packet. The itype indicates the packet type.
990 #define RX_PKT_CMPL_ERRORS_CRC_ERROR UINT32_C(0x100)
992 * This indicates that there was an error in the tunnel portion of the
993 * packet when this field is non-zero.
995 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_MASK UINT32_C(0xe00)
996 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_SFT 9
998 * No additional error occurred on the tunnel portion of the
999 * packet of the packet does not have a tunnel.
1001 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 9)
1003 * Indicates that IP header version does not match expectation
1004 * from L2 Ethertype for IPv4 and IPv6 in the tunnel header.
1006 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \
1007 (UINT32_C(0x1) << 9)
1009 * Indicates that header length is out of range in the tunnel
1010 * header. Valid for IPv4.
1012 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \
1013 (UINT32_C(0x2) << 9)
1015 * Indicates that the physical packet is shorter than that
1016 * claimed by the PPPoE header length for a tunnel PPPoE packet.
1018 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_TUNNEL_TOTAL_ERROR \
1019 (UINT32_C(0x3) << 9)
1021 * Indicates that physical packet is shorter than that claimed
1022 * by the tunnel l3 header length. Valid for IPv4, or IPv6
1023 * tunnel packet packets.
1025 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \
1026 (UINT32_C(0x4) << 9)
1028 * Indicates that the physical packet is shorter than that
1029 * claimed by the tunnel UDP header length for a tunnel UDP
1030 * packet that is not fragmented.
1032 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \
1033 (UINT32_C(0x5) << 9)
1035 * indicates that the IPv4 TTL or IPv6 hop limit check have
1036 * failed (e.g. TTL = 0) in the tunnel header. Valid for IPv4,
1039 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \
1040 (UINT32_C(0x6) << 9)
1041 #define RX_PKT_CMPL_ERRORS_T_PKT_ERROR_LAST \
1042 RX_PKT_CMPL_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL
1044 * This indicates that there was an error in the inner portion of the
1045 * packet when this field is non-zero.
1047 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_MASK UINT32_C(0xf000)
1048 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_SFT 12
1050 * No additional error occurred on the tunnel portion of the
1051 * packet of the packet does not have a tunnel.
1053 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_NO_ERROR (UINT32_C(0x0) << 12)
1055 * Indicates that IP header version does not match expectation
1056 * from L2 Ethertype for IPv4 and IPv6 or that option other than
1057 * VFT was parsed on FCoE packet.
1059 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_VERSION \
1060 (UINT32_C(0x1) << 12)
1062 * indicates that header length is out of range. Valid for IPv4
1065 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \
1066 (UINT32_C(0x2) << 12)
1068 * indicates that the IPv4 TTL or IPv6 hop limit check have
1069 * failed (e.g. TTL = 0). Valid for IPv4, and IPv6
1071 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L3_BAD_TTL (UINT32_C(0x3) << 12)
1073 * Indicates that physical packet is shorter than that claimed
1074 * by the l3 header length. Valid for IPv4, IPv6 packet or RoCE
1077 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \
1078 (UINT32_C(0x4) << 12)
1080 * Indicates that the physical packet is shorter than that
1081 * claimed by the UDP header length for a UDP packet that is not
1084 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \
1085 (UINT32_C(0x5) << 12)
1087 * Indicates that TCP header length > IP payload. Valid for TCP
1090 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \
1091 (UINT32_C(0x6) << 12)
1092 /* Indicates that TCP header length < 5. Valid for TCP. */
1093 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \
1094 (UINT32_C(0x7) << 12)
1096 * Indicates that TCP option headers result in a TCP header size
1097 * that does not match data offset in TCP header. Valid for TCP.
1099 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \
1100 (UINT32_C(0x8) << 12)
1101 #define RX_PKT_CMPL_ERRORS_PKT_ERROR_LAST \
1102 RX_PKT_CMPL_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN
1103 #define RX_PKT_CMPL_ERRORS_MASK UINT32_C(0xfffe)
1104 #define RX_PKT_CMPL_ERRORS_SFT 1
1108 * This field identifies the CFA action rule that was used for this
1114 * This value holds the reordering sequence number for the packet. If
1115 * the reordering sequence is not valid, then this value is zero. The
1116 * reordering domain for the packet is in the bottom 8 to 10b of the
1117 * rss_hash value. The bottom 20b of this value contain the ordering
1118 * domain value for the packet.
1120 #define RX_PKT_CMPL_REORDER_MASK UINT32_C(0xffffff)
1121 #define RX_PKT_CMPL_REORDER_SFT 0
1123 } __attribute__((packed));
1125 /* HWRM Forwarded Request (16 bytes) */
1126 struct hwrm_fwd_req_cmpl {
1127 /* Length of forwarded request in bytes. */
1129 * This field indicates the exact type of the completion. By convention,
1130 * the LSB identifies the length of the record in 16B units. Even values
1131 * indicate 16B records. Odd values indicate 32B records.
1133 #define HWRM_FWD_REQ_CMPL_TYPE_MASK UINT32_C(0x3f)
1134 #define HWRM_FWD_REQ_CMPL_TYPE_SFT 0
1135 /* Forwarded HWRM Request */
1136 #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ (UINT32_C(0x22) << 0)
1137 /* Length of forwarded request in bytes. */
1138 #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK UINT32_C(0xffc0)
1139 #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT 6
1140 uint16_t req_len_type;
1143 * Source ID of this request. Typically used in forwarding requests and
1144 * responses. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 - 0xFFFE -
1145 * Reserved for internal processors 0xFFFF - HWRM
1151 /* Address of forwarded request. */
1153 * This value is written by the NIC such that it will be different for
1154 * each pass through the completion queue. The even passes will write 1.
1155 * The odd passes will write 0.
1157 #define HWRM_FWD_REQ_CMPL_V UINT32_C(0x1)
1158 /* Address of forwarded request. */
1159 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
1160 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
1161 uint64_t req_buf_addr_v;
1162 } __attribute__((packed));
1164 /* HWRM Asynchronous Event Completion Record (16 bytes) */
1165 struct hwrm_async_event_cmpl {
1167 * This field indicates the exact type of the completion. By convention,
1168 * the LSB identifies the length of the record in 16B units. Even values
1169 * indicate 16B records. Odd values indicate 32B records.
1171 #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK UINT32_C(0x3f)
1172 #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT 0
1173 /* HWRM Asynchronous Event Information */
1174 #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT \
1175 (UINT32_C(0x2e) << 0)
1178 /* Identifiers of events. */
1179 /* Link status changed */
1180 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \
1181 (UINT32_C(0x0) << 0)
1182 /* Link MTU changed */
1183 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \
1184 (UINT32_C(0x1) << 0)
1185 /* Link speed changed */
1186 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \
1187 (UINT32_C(0x2) << 0)
1188 /* DCB Configuration changed */
1189 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \
1190 (UINT32_C(0x3) << 0)
1191 /* Port connection not allowed */
1192 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \
1193 (UINT32_C(0x4) << 0)
1194 /* Link speed configuration was not allowed */
1195 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
1196 (UINT32_C(0x5) << 0)
1197 /* Function driver unloaded */
1198 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \
1199 (UINT32_C(0x10) << 0)
1200 /* Function driver loaded */
1201 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \
1202 (UINT32_C(0x11) << 0)
1203 /* PF driver unloaded */
1204 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \
1205 (UINT32_C(0x20) << 0)
1206 /* PF driver loaded */
1207 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \
1208 (UINT32_C(0x21) << 0)
1209 /* VF Function Level Reset (FLR) */
1210 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR (UINT32_C(0x30) << 0)
1211 /* VF MAC Address Change */
1212 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \
1213 (UINT32_C(0x31) << 0)
1214 /* PF-VF communication channel status change. */
1215 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
1216 (UINT32_C(0x32) << 0)
1218 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \
1219 (UINT32_C(0xff) << 0)
1222 /* Event specific data */
1223 uint32_t event_data2;
1227 * This value is written by the NIC such that it will be different for
1228 * each pass through the completion queue. The even passes will write 1.
1229 * The odd passes will write 0.
1231 #define HWRM_ASYNC_EVENT_CMPL_V UINT32_C(0x1)
1233 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
1234 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
1237 /* 8-lsb timestamp from POR (100-msec resolution) */
1238 uint8_t timestamp_lo;
1240 /* 16-lsb timestamp from POR (100-msec resolution) */
1241 uint16_t timestamp_hi;
1243 /* Event specific data */
1244 uint32_t event_data1;
1245 } __attribute__((packed));
1248 * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
1249 * inside the chip. The HWRM is implemented in firmware, and runs on embedded
1250 * processors inside the chip. This firmware is vital part of the chip's
1251 * hardware. The chip can not be used by driver without it.
1254 /* Input (16 bytes) */
1257 * This value indicates what type of request this is. The format for the
1258 * rest of the command is determined by this field.
1263 * This value indicates the what completion ring the request will be
1264 * optionally completed on. If the value is -1, then no CR completion
1265 * will be generated. Any other value must be a valid CR ring_id value
1266 * for this function.
1270 /* This value indicates the command sequence number. */
1274 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1275 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1280 * This is the host address where the response will be written when the
1281 * request is complete. This area must be 16B aligned and must be
1282 * cleared to zero before the request is made.
1285 } __attribute__((packed));
1287 /* Output (8 bytes) */
1290 * Pass/Fail or error type Note: receiver to verify the in parameters,
1291 * and fail the call with an error when appropriate
1293 uint16_t error_code;
1295 /* This field returns the type of original request. */
1298 /* This field provides original sequence number of the command. */
1302 * This field is the length of the response in bytes. The last byte of
1303 * the response is a valid flag that will read as '1' when the command
1304 * has been completely written to memory.
1307 } __attribute__((packed));
1309 /* hwrm_cfa_l2_filter_alloc */
1311 * A filter is used to identify traffic that contains a matching set of
1312 * parameters like unicast or broadcast MAC address or a VLAN tag amongst
1313 * other things which then allows the ASIC to direct the incoming traffic
1314 * to an appropriate VNIC or Rx ring.
1317 /* Input (96 bytes) */
1318 struct hwrm_cfa_l2_filter_alloc_input {
1320 * This value indicates what type of request this is. The format for the
1321 * rest of the command is determined by this field.
1326 * This value indicates the what completion ring the request will be
1327 * optionally completed on. If the value is -1, then no CR completion
1328 * will be generated. Any other value must be a valid CR ring_id value
1329 * for this function.
1333 /* This value indicates the command sequence number. */
1337 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1338 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1343 * This is the host address where the response will be written when the
1344 * request is complete. This area must be 16B aligned and must be
1345 * cleared to zero before the request is made.
1350 * Enumeration denoting the RX, TX type of the resource. This
1351 * enumeration is used for resources that are similar for both TX and RX
1352 * paths of the chip.
1354 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
1357 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
1358 (UINT32_C(0x0) << 0)
1360 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
1361 (UINT32_C(0x1) << 0)
1362 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
1363 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
1365 * Setting of this flag indicates the applicability to the loopback
1368 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
1371 * Setting of this flag indicates drop action. If this flag is not set,
1372 * then it should be considered accept action.
1374 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
1377 * If this flag is set, all t_l2_* fields are invalid and they should
1378 * not be specified. If this flag is set, then l2_* fields refer to
1379 * fields of outermost L2 header.
1381 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
1385 /* This bit must be '1' for the l2_addr field to be configured. */
1386 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
1388 /* This bit must be '1' for the l2_addr_mask field to be configured. */
1389 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
1391 /* This bit must be '1' for the l2_ovlan field to be configured. */
1392 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
1394 /* This bit must be '1' for the l2_ovlan_mask field to be configured. */
1395 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
1397 /* This bit must be '1' for the l2_ivlan field to be configured. */
1398 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
1400 /* This bit must be '1' for the l2_ivlan_mask field to be configured. */
1401 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
1403 /* This bit must be '1' for the t_l2_addr field to be configured. */
1404 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
1407 * This bit must be '1' for the t_l2_addr_mask field to be configured.
1409 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
1411 /* This bit must be '1' for the t_l2_ovlan field to be configured. */
1412 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
1415 * This bit must be '1' for the t_l2_ovlan_mask field to be configured.
1417 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
1419 /* This bit must be '1' for the t_l2_ivlan field to be configured. */
1420 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
1423 * This bit must be '1' for the t_l2_ivlan_mask field to be configured.
1425 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
1427 /* This bit must be '1' for the src_type field to be configured. */
1428 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
1430 /* This bit must be '1' for the src_id field to be configured. */
1431 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
1433 /* This bit must be '1' for the tunnel_type field to be configured. */
1434 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
1436 /* This bit must be '1' for the dst_id field to be configured. */
1437 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
1440 * This bit must be '1' for the mirror_vnic_id field to be configured.
1442 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
1447 * This value sets the match value for the L2 MAC address. Destination
1448 * MAC address for RX path. Source MAC address for TX path.
1456 * This value sets the mask value for the L2 address. A value of 0 will
1457 * mask the corresponding bit from compare.
1459 uint8_t l2_addr_mask[6];
1461 /* This value sets VLAN ID value for outer VLAN. */
1465 * This value sets the mask value for the ovlan id. A value of 0 will
1466 * mask the corresponding bit from compare.
1468 uint16_t l2_ovlan_mask;
1470 /* This value sets VLAN ID value for inner VLAN. */
1474 * This value sets the mask value for the ivlan id. A value of 0 will
1475 * mask the corresponding bit from compare.
1477 uint16_t l2_ivlan_mask;
1483 * This value sets the match value for the tunnel L2 MAC address.
1484 * Destination MAC address for RX path. Source MAC address for TX path.
1486 uint8_t t_l2_addr[6];
1492 * This value sets the mask value for the tunnel L2 address. A value of
1493 * 0 will mask the corresponding bit from compare.
1495 uint8_t t_l2_addr_mask[6];
1497 /* This value sets VLAN ID value for tunnel outer VLAN. */
1498 uint16_t t_l2_ovlan;
1501 * This value sets the mask value for the tunnel ovlan id. A value of 0
1502 * will mask the corresponding bit from compare.
1504 uint16_t t_l2_ovlan_mask;
1506 /* This value sets VLAN ID value for tunnel inner VLAN. */
1507 uint16_t t_l2_ivlan;
1510 * This value sets the mask value for the tunnel ivlan id. A value of 0
1511 * will mask the corresponding bit from compare.
1513 uint16_t t_l2_ivlan_mask;
1515 /* This value identifies the type of source of the packet. */
1517 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT \
1518 (UINT32_C(0x0) << 0)
1519 /* Physical function */
1520 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF \
1521 (UINT32_C(0x1) << 0)
1522 /* Virtual function */
1523 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF \
1524 (UINT32_C(0x2) << 0)
1525 /* Virtual NIC of a function */
1526 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC \
1527 (UINT32_C(0x3) << 0)
1528 /* Embedded processor for CFA management */
1529 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG \
1530 (UINT32_C(0x4) << 0)
1531 /* Embedded processor for OOB management */
1532 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE \
1533 (UINT32_C(0x5) << 0)
1534 /* Embedded processor for RoCE */
1535 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO \
1536 (UINT32_C(0x6) << 0)
1537 /* Embedded processor for network proxy functions */
1538 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG \
1539 (UINT32_C(0x7) << 0)
1544 * This value is the id of the source. For a network port, it represents
1545 * port_id. For a physical function, it represents fid. For a virtual
1546 * function, it represents vf_id. For a vnic, it represents vnic_id. For
1547 * embedded processors, this id is not valid. Notes: 1. The function ID
1548 * is implied if it src_id is not provided for a src_type that is either
1554 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
1555 (UINT32_C(0x0) << 0)
1556 /* Virtual eXtensible Local Area Network (VXLAN) */
1557 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
1558 (UINT32_C(0x1) << 0)
1560 * Network Virtualization Generic Routing Encapsulation (NVGRE)
1562 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
1563 (UINT32_C(0x2) << 0)
1565 * Generic Routing Encapsulation (GRE) inside Ethernet payload
1567 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
1568 (UINT32_C(0x3) << 0)
1570 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
1571 (UINT32_C(0x4) << 0)
1572 /* Generic Network Virtualization Encapsulation (Geneve) */
1573 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
1574 (UINT32_C(0x5) << 0)
1575 /* Multi-Protocol Lable Switching (MPLS) */
1576 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
1577 (UINT32_C(0x6) << 0)
1578 /* Stateless Transport Tunnel (STT) */
1579 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
1580 (UINT32_C(0x7) << 0)
1582 * Generic Routing Encapsulation (GRE) inside IP datagram
1585 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
1586 (UINT32_C(0x8) << 0)
1587 /* Any tunneled traffic */
1588 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
1589 (UINT32_C(0xff) << 0)
1590 uint8_t tunnel_type;
1595 * If set, this value shall represent the Logical VNIC ID of the
1596 * destination VNIC for the RX path and network port id of the
1597 * destination port for the TX path.
1601 /* Logical VNIC ID of the VNIC where traffic is mirrored. */
1602 uint16_t mirror_vnic_id;
1605 * This hint is provided to help in placing the filter in the filter
1609 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
1610 (UINT32_C(0x0) << 0)
1611 /* Above the given filter */
1612 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
1613 (UINT32_C(0x1) << 0)
1614 /* Below the given filter */
1615 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
1616 (UINT32_C(0x2) << 0)
1617 /* As high as possible */
1618 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
1619 (UINT32_C(0x3) << 0)
1620 /* As low as possible */
1621 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
1622 (UINT32_C(0x4) << 0)
1629 * This is the ID of the filter that goes along with the pri_hint. This
1630 * field is valid only for the following values. 1 - Above the given
1631 * filter 2 - Below the given filter
1633 uint64_t l2_filter_id_hint;
1634 } __attribute__((packed));
1636 /* Output (24 bytes) */
1637 struct hwrm_cfa_l2_filter_alloc_output {
1639 * Pass/Fail or error type Note: receiver to verify the in parameters,
1640 * and fail the call with an error when appropriate
1642 uint16_t error_code;
1644 /* This field returns the type of original request. */
1647 /* This field provides original sequence number of the command. */
1651 * This field is the length of the response in bytes. The last byte of
1652 * the response is a valid flag that will read as '1' when the command
1653 * has been completely written to memory.
1658 * This value identifies a set of CFA data structures used for an L2
1661 uint64_t l2_filter_id;
1664 * This is the ID of the flow associated with this filter. This value
1665 * shall be used to match and associate the flow identifier returned in
1666 * completion records. A value of 0xFFFFFFFF shall indicate no flow id.
1675 * This field is used in Output records to indicate that the output is
1676 * completely written to RAM. This field should be read as '1' to
1677 * indicate that the output has been completely written. When writing a
1678 * command completion or response to an internal processor, the order of
1679 * writes has to be such that this field is written last.
1682 } __attribute__((packed));
1684 /* hwrm_cfa_l2_filter_free */
1686 * Description: Free a L2 filter. The HWRM shall free all associated filter
1687 * resources with the L2 filter.
1690 /* Input (24 bytes) */
1691 struct hwrm_cfa_l2_filter_free_input {
1693 * This value indicates what type of request this is. The format for the
1694 * rest of the command is determined by this field.
1699 * This value indicates the what completion ring the request will be
1700 * optionally completed on. If the value is -1, then no CR completion
1701 * will be generated. Any other value must be a valid CR ring_id value
1702 * for this function.
1706 /* This value indicates the command sequence number. */
1710 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1711 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1716 * This is the host address where the response will be written when the
1717 * request is complete. This area must be 16B aligned and must be
1718 * cleared to zero before the request is made.
1723 * This value identifies a set of CFA data structures used for an L2
1726 uint64_t l2_filter_id;
1727 } __attribute__((packed));
1729 /* Output (16 bytes) */
1730 struct hwrm_cfa_l2_filter_free_output {
1732 * Pass/Fail or error type Note: receiver to verify the in parameters,
1733 * and fail the call with an error when appropriate
1735 uint16_t error_code;
1737 /* This field returns the type of original request. */
1740 /* This field provides original sequence number of the command. */
1744 * This field is the length of the response in bytes. The last byte of
1745 * the response is a valid flag that will read as '1' when the command
1746 * has been completely written to memory.
1756 * This field is used in Output records to indicate that the output is
1757 * completely written to RAM. This field should be read as '1' to
1758 * indicate that the output has been completely written. When writing a
1759 * command completion or response to an internal processor, the order of
1760 * writes has to be such that this field is written last.
1763 } __attribute__((packed));
1765 /* hwrm_cfa_l2_set_rx_mask */
1766 /* Description: This command will set rx mask of the function. */
1768 /* Input (40 bytes) */
1769 struct hwrm_cfa_l2_set_rx_mask_input {
1771 * This value indicates what type of request this is. The format for the
1772 * rest of the command is determined by this field.
1777 * This value indicates the what completion ring the request will be
1778 * optionally completed on. If the value is -1, then no CR completion
1779 * will be generated. Any other value must be a valid CR ring_id value
1780 * for this function.
1784 /* This value indicates the command sequence number. */
1788 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1789 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1794 * This is the host address where the response will be written when the
1795 * request is complete. This area must be 16B aligned and must be
1796 * cleared to zero before the request is made.
1803 /* Reserved for future use. */
1804 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_RESERVED UINT32_C(0x1)
1806 * When this bit is '1', the function is requested to accept multi-cast
1807 * packets specified by the multicast addr table.
1809 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST UINT32_C(0x2)
1811 * When this bit is '1', the function is requested to accept all multi-
1814 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST UINT32_C(0x4)
1816 * When this bit is '1', the function is requested to accept broadcast
1819 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST UINT32_C(0x8)
1821 * When this bit is '1', the function is requested to be put in the
1822 * promiscuous mode. The HWRM should accept any function to set up
1823 * promiscuous mode. The HWRM shall follow the semantics below for the
1824 * promiscuous mode support. # When partitioning is not enabled on a
1825 * port (i.e. single PF on the port), then the PF shall be allowed to be
1826 * in the promiscuous mode. When the PF is in the promiscuous mode, then
1827 * it shall receive all host bound traffic on that port. # When
1828 * partitioning is enabled on a port (i.e. multiple PFs per port) and a
1829 * PF on that port is in the promiscuous mode, then the PF receives all
1830 * traffic within that partition as identified by a unique identifier
1831 * for the PF (e.g. S-Tag). If a unique outer VLAN for the PF is
1832 * specified, then the setting of promiscuous mode on that PF shall
1833 * result in the PF receiving all host bound traffic with matching outer
1834 * VLAN. # A VF shall can be set in the promiscuous mode. In the
1835 * promiscuous mode, the VF does not receive any traffic unless a unique
1836 * outer VLAN for the VF is specified. If a unique outer VLAN for the VF
1837 * is specified, then the setting of promiscuous mode on that VF shall
1838 * result in the VF receiving all host bound traffic with the matching
1839 * outer VLAN. # The HWRM shall allow the setting of promiscuous mode on
1840 * a function independently from the promiscuous mode settings on other
1843 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS UINT32_C(0x10)
1845 * If this flag is set, the corresponding RX filters shall be set up to
1846 * cover multicast/broadcast filters for the outermost Layer 2
1847 * destination MAC address field.
1849 #define HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_OUTERMOST UINT32_C(0x20)
1852 /* This is the address for mcast address tbl. */
1853 uint64_t mc_tbl_addr;
1856 * This value indicates how many entries in mc_tbl are valid. Each entry
1859 uint32_t num_mc_entries;
1862 } __attribute__((packed));
1864 /* Output (16 bytes) */
1865 struct hwrm_cfa_l2_set_rx_mask_output {
1867 * Pass/Fail or error type Note: receiver to verify the in parameters,
1868 * and fail the call with an error when appropriate
1870 uint16_t error_code;
1872 /* This field returns the type of original request. */
1875 /* This field provides original sequence number of the command. */
1879 * This field is the length of the response in bytes. The last byte of
1880 * the response is a valid flag that will read as '1' when the command
1881 * has been completely written to memory.
1891 * This field is used in Output records to indicate that the output is
1892 * completely written to RAM. This field should be read as '1' to
1893 * indicate that the output has been completely written. When writing a
1894 * command completion or response to an internal processor, the order of
1895 * writes has to be such that this field is written last.
1898 } __attribute__((packed));
1900 /* hwrm_exec_fwd_resp */
1902 * Description: This command is used to send an encapsulated request to the
1903 * HWRM. This command instructs the HWRM to execute the request and forward the
1904 * response of the encapsulated request to the location specified in the
1905 * original request that is encapsulated. The target id of this command shall be
1906 * set to 0xFFFF (HWRM). The response location in this command shall be used to
1907 * acknowledge the receipt of the encapsulated request and forwarding of the
1911 /* Input (128 bytes) */
1912 struct hwrm_exec_fwd_resp_input {
1914 * This value indicates what type of request this is. The format for the
1915 * rest of the command is determined by this field.
1920 * This value indicates the what completion ring the request will be
1921 * optionally completed on. If the value is -1, then no CR completion
1922 * will be generated. Any other value must be a valid CR ring_id value
1923 * for this function.
1927 /* This value indicates the command sequence number. */
1931 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1932 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1937 * This is the host address where the response will be written when the
1938 * request is complete. This area must be 16B aligned and must be
1939 * cleared to zero before the request is made.
1944 * This is an encapsulated request. This request should be executed by
1945 * the HWRM and the response should be provided in the response buffer
1946 * inside the encapsulated request.
1948 uint32_t encap_request[26];
1951 * This value indicates the target id of the response to the
1952 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 -
1953 * 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1955 uint16_t encap_resp_target_id;
1957 uint16_t unused_0[3];
1958 } __attribute__((packed));
1960 /* Output (16 bytes) */
1961 struct hwrm_exec_fwd_resp_output {
1963 * Pass/Fail or error type Note: receiver to verify the in parameters,
1964 * and fail the call with an error when appropriate
1966 uint16_t error_code;
1968 /* This field returns the type of original request. */
1971 /* This field provides original sequence number of the command. */
1975 * This field is the length of the response in bytes. The last byte of
1976 * the response is a valid flag that will read as '1' when the command
1977 * has been completely written to memory.
1987 * This field is used in Output records to indicate that the output is
1988 * completely written to RAM. This field should be read as '1' to
1989 * indicate that the output has been completely written. When writing a
1990 * command completion or response to an internal processor, the order of
1991 * writes has to be such that this field is written last.
1994 } __attribute__((packed));
1996 /* hwrm_func_qcaps */
1998 * Description: This command returns capabilities of a function. The input FID
1999 * value is used to indicate what function is being queried. This allows a
2000 * physical function driver to query virtual functions that are children of the
2001 * physical function. The output FID value is needed to configure Rings and
2002 * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
2005 /* Input (24 bytes) */
2006 struct hwrm_func_qcaps_input {
2008 * This value indicates what type of request this is. The format for the
2009 * rest of the command is determined by this field.
2014 * This value indicates the what completion ring the request will be
2015 * optionally completed on. If the value is -1, then no CR completion
2016 * will be generated. Any other value must be a valid CR ring_id value
2017 * for this function.
2021 /* This value indicates the command sequence number. */
2025 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
2026 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
2031 * This is the host address where the response will be written when the
2032 * request is complete. This area must be 16B aligned and must be
2033 * cleared to zero before the request is made.
2038 * Function ID of the function that is being queried. 0xFF... (All Fs)
2039 * if the query is for the requesting function.
2043 uint16_t unused_0[3];
2044 } __attribute__((packed));
2046 /* Output (80 bytes) */
2047 struct hwrm_func_qcaps_output {
2048 uint16_t error_code;
2050 * Pass/Fail or error type Note: receiver to verify the in
2051 * parameters, and fail the call with an error when appropriate
2054 /* This field returns the type of original request. */
2056 /* This field provides original sequence number of the command. */
2059 * This field is the length of the response in bytes. The last
2060 * byte of the response is a valid flag that will read as '1'
2061 * when the command has been completely written to memory.
2065 * FID value. This value is used to identify operations on the
2066 * PCI bus as belonging to a particular PCI function.
2070 * Port ID of port that this function is associated with. Valid
2071 * only for the PF. 0xFF... (All Fs) if this function is not
2072 * associated with any port. 0xFF... (All Fs) if this function
2073 * is called from a VF.
2076 /* If 1, then Push mode is supported on this function. */
2077 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
2079 * If 1, then the global MSI-X auto-masking is enabled for the
2082 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING UINT32_C(0x2)
2084 * If 1, then the Precision Time Protocol (PTP) processing is
2085 * supported on this function. The HWRM should enable PTP on
2086 * only a single Physical Function (PF) per port.
2088 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
2090 * If 1, then RDMA over Converged Ethernet (RoCE) v1 is
2091 * supported on this function.
2093 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V1_SUPPORTED UINT32_C(0x8)
2095 * If 1, then RDMA over Converged Ethernet (RoCE) v2 is
2096 * supported on this function.
2098 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ROCE_V2_SUPPORTED UINT32_C(0x10)
2100 * If 1, then control and configuration of WoL magic packet are
2101 * supported on this function.
2103 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED UINT32_C(0x20)
2105 * If 1, then control and configuration of bitmap pattern packet
2106 * are supported on this function.
2108 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_BMP_SUPPORTED UINT32_C(0x40)
2110 * If set to 1, then the control and configuration of rate limit
2111 * of an allocated TX ring on the queried function is supported.
2113 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_RING_RL_SUPPORTED UINT32_C(0x80)
2115 * If 1, then control and configuration of minimum and maximum
2116 * bandwidths are supported on the queried function.
2118 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_TX_BW_CFG_SUPPORTED UINT32_C(0x100)
2120 * If the query is for a VF, then this flag shall be ignored. If
2121 * this query is for a PF and this flag is set to 1, then the PF
2122 * has the capability to set the rate limits on the TX rings of
2123 * its children VFs. If this query is for a PF and this flag is
2124 * set to 0, then the PF does not have the capability to set the
2125 * rate limits on the TX rings of its children VFs.
2127 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_TX_RING_RL_SUPPORTED UINT32_C(0x200)
2129 * If the query is for a VF, then this flag shall be ignored. If
2130 * this query is for a PF and this flag is set to 1, then the PF
2131 * has the capability to set the minimum and/or maximum
2132 * bandwidths for its children VFs. If this query is for a PF
2133 * and this flag is set to 0, then the PF does not have the
2134 * capability to set the minimum or maximum bandwidths for its
2137 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VF_BW_CFG_SUPPORTED UINT32_C(0x400)
2138 uint8_t mac_address[6];
2140 * This value is current MAC address configured for this
2141 * function. A value of 00-00-00-00-00-00 indicates no MAC
2142 * address is currently configured.
2144 uint16_t max_rsscos_ctx;
2146 * The maximum number of RSS/COS contexts that can be allocated
2149 uint16_t max_cmpl_rings;
2151 * The maximum number of completion rings that can be allocated
2154 uint16_t max_tx_rings;
2156 * The maximum number of transmit rings that can be allocated to
2159 uint16_t max_rx_rings;
2161 * The maximum number of receive rings that can be allocated to
2164 uint16_t max_l2_ctxs;
2166 * The maximum number of L2 contexts that can be allocated to
2171 * The maximum number of VNICs that can be allocated to the
2174 uint16_t first_vf_id;
2176 * The identifier for the first VF enabled on a PF. This is
2177 * valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if
2178 * this command is called on a PF with SR-IOV disabled or on a
2183 * The maximum number of VFs that can be allocated to the
2184 * function. This is valid only on the PF with SR-IOV enabled.
2185 * 0xFF... (All Fs) if this command is called on a PF with SR-
2186 * IOV disabled or on a VF.
2188 uint16_t max_stat_ctx;
2190 * The maximum number of statistic contexts that can be
2191 * allocated to the function.
2193 uint32_t max_encap_records;
2195 * The maximum number of Encapsulation records that can be
2196 * offloaded by this function.
2198 uint32_t max_decap_records;
2200 * The maximum number of decapsulation records that can be
2201 * offloaded by this function.
2203 uint32_t max_tx_em_flows;
2205 * The maximum number of Exact Match (EM) flows that can be
2206 * offloaded by this function on the TX side.
2208 uint32_t max_tx_wm_flows;
2210 * The maximum number of Wildcard Match (WM) flows that can be
2211 * offloaded by this function on the TX side.
2213 uint32_t max_rx_em_flows;
2215 * The maximum number of Exact Match (EM) flows that can be
2216 * offloaded by this function on the RX side.
2218 uint32_t max_rx_wm_flows;
2220 * The maximum number of Wildcard Match (WM) flows that can be
2221 * offloaded by this function on the RX side.
2223 uint32_t max_mcast_filters;
2225 * The maximum number of multicast filters that can be supported
2226 * by this function on the RX side.
2228 uint32_t max_flow_id;
2230 * The maximum value of flow_id that can be supported in
2231 * completion records.
2233 uint32_t max_hw_ring_grps;
2235 * The maximum number of HW ring groups that can be supported on
2238 uint16_t max_sp_tx_rings;
2240 * The maximum number of strict priority transmit rings that can
2241 * be allocated to the function. This number indicates the
2242 * maximum number of TX rings that can be assigned strict
2243 * priorities out of the maximum number of TX rings that can be
2244 * allocated (max_tx_rings) to the function.
2249 * This field is used in Output records to indicate that the
2250 * output is completely written to RAM. This field should be
2251 * read as '1' to indicate that the output has been completely
2252 * written. When writing a command completion or response to an
2253 * internal processor, the order of writes has to be such that
2254 * this field is written last.
2256 } __attribute__((packed));
2258 /* hwrm_func_reset */
2260 * Description: This command resets a hardware function (PCIe function) and
2261 * frees any resources used by the function. This command shall be initiated by
2262 * the driver after an FLR has occurred to prepare the function for re-use. This
2263 * command may also be initiated by a driver prior to doing it's own
2264 * configuration. This command puts the function into the reset state. In the
2265 * reset state, global and port related features of the chip are not available.
2268 * Note: This command will reset a function that has already been disabled or
2269 * idled. The command returns all the resources owned by the function so a new
2270 * driver may allocate and configure resources normally.
2273 /* Input (24 bytes) */
2274 struct hwrm_func_reset_input {
2276 * This value indicates what type of request this is. The format for the
2277 * rest of the command is determined by this field.
2282 * This value indicates the what completion ring the request will be
2283 * optionally completed on. If the value is -1, then no CR completion
2284 * will be generated. Any other value must be a valid CR ring_id value
2285 * for this function.
2289 /* This value indicates the command sequence number. */
2293 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
2294 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
2299 * This is the host address where the response will be written when the
2300 * request is complete. This area must be 16B aligned and must be
2301 * cleared to zero before the request is made.
2305 /* This bit must be '1' for the vf_id_valid field to be configured. */
2306 #define HWRM_FUNC_RESET_INPUT_ENABLES_VF_ID_VALID \
2311 * The ID of the VF that this PF is trying to reset. Only the parent PF
2312 * shall be allowed to reset a child VF. A parent PF driver shall use
2313 * this field only when a specific child VF is requested to be reset.
2317 /* This value indicates the level of a function reset. */
2319 * Reset the caller function and its children VFs (if any). If
2320 * no children functions exist, then reset the caller function
2323 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETALL \
2324 (UINT32_C(0x0) << 0)
2325 /* Reset the caller function only */
2326 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETME \
2327 (UINT32_C(0x1) << 0)
2329 * Reset all children VFs of the caller function driver if the
2330 * caller is a PF driver. It is an error to specify this level
2331 * by a VF driver. It is an error to specify this level by a PF
2332 * driver with no children VFs.
2334 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETCHILDREN \
2335 (UINT32_C(0x2) << 0)
2337 * Reset a specific VF of the caller function driver if the
2338 * caller is the parent PF driver. It is an error to specify
2339 * this level by a VF driver. It is an error to specify this
2340 * level by a PF driver that is not the parent of the VF that is
2341 * being requested to reset.
2343 #define HWRM_FUNC_RESET_INPUT_FUNC_RESET_LEVEL_RESETVF \
2344 (UINT32_C(0x3) << 0)
2345 uint8_t func_reset_level;
2348 } __attribute__((packed));
2350 /* Output (16 bytes) */
2351 struct hwrm_func_reset_output {
2353 * Pass/Fail or error type Note: receiver to verify the in parameters,
2354 * and fail the call with an error when appropriate
2356 uint16_t error_code;
2358 /* This field returns the type of original request. */
2361 /* This field provides original sequence number of the command. */
2365 * This field is the length of the response in bytes. The last byte of
2366 * the response is a valid flag that will read as '1' when the command
2367 * has been completely written to memory.
2377 * This field is used in Output records to indicate that the output is
2378 * completely written to RAM. This field should be read as '1' to
2379 * indicate that the output has been completely written. When writing a
2380 * command completion or response to an internal processor, the order of
2381 * writes has to be such that this field is written last.
2384 } __attribute__((packed));
2386 /* hwrm_port_phy_cfg */
2388 * Description: This command configures the PHY device for the port. It allows
2389 * setting of the most generic settings for the PHY. The HWRM shall complete
2390 * this command as soon as PHY settings are configured. They may not be applied
2391 * when the command response is provided. A VF driver shall not be allowed to
2392 * configure PHY using this command. In a network partition mode, a PF driver
2393 * shall not be allowed to configure PHY using this command.
2396 /* Input (56 bytes) */
2397 struct hwrm_port_phy_cfg_input {
2399 * This value indicates what type of request this is. The format for the
2400 * rest of the command is determined by this field.
2405 * This value indicates the what completion ring the request will be
2406 * optionally completed on. If the value is -1, then no CR completion
2407 * will be generated. Any other value must be a valid CR ring_id value
2408 * for this function.
2412 /* This value indicates the command sequence number. */
2416 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
2417 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
2422 * This is the host address where the response will be written when the
2423 * request is complete. This area must be 16B aligned and must be
2424 * cleared to zero before the request is made.
2429 * When this bit is set to '1', the PHY for the port shall be reset. #
2430 * If this bit is set to 1, then the HWRM shall reset the PHY after
2431 * applying PHY configuration changes specified in this command. # In
2432 * order to guarantee that PHY configuration changes specified in this
2433 * command take effect, the HWRM client should set this flag to 1. # If
2434 * this bit is not set to 1, then the HWRM may reset the PHY depending
2435 * on the current PHY configuration and settings specified in this
2438 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY UINT32_C(0x1)
2440 * When this bit is set to '1', the link shall be forced to be taken
2441 * down. # When this bit is set to '1", all other command input settings
2442 * related to the link speed shall be ignored. Once the link state is
2443 * forced down, it can be explicitly cleared from that state by setting
2444 * this flag to '0'. # If this flag is set to '0', then the link shall
2445 * be cleared from forced down state if the link is in forced down
2446 * state. There may be conditions (e.g. out-of-band or sideband
2447 * configuration changes for the link) outside the scope of the HWRM
2448 * implementation that may clear forced down link state.
2450 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DOWN UINT32_C(0x2)
2452 * When this bit is set to '1', the link shall be forced to the
2453 * force_link_speed value. When this bit is set to '1', the HWRM client
2454 * should not enable any of the auto negotiation related fields
2455 * represented by auto_XXX fields in this command. When this bit is set
2456 * to '1' and the HWRM client has enabled a auto_XXX field in this
2457 * command, then the HWRM shall ignore the enabled auto_XXX field. When
2458 * this bit is set to zero, the link shall be allowed to autoneg.
2460 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE UINT32_C(0x4)
2462 * When this bit is set to '1', the auto-negotiation process shall be
2463 * restarted on the link.
2465 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG UINT32_C(0x8)
2467 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
2468 * requested to be enabled on this link. If EEE is not supported on this
2469 * port, then this flag shall be ignored by the HWRM.
2471 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE UINT32_C(0x10)
2473 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
2474 * requested to be disabled on this link. If EEE is not supported on
2475 * this port, then this flag shall be ignored by the HWRM.
2477 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE UINT32_C(0x20)
2479 * When this bit is set to '1' and EEE is enabled on this link, then TX
2480 * LPI is requested to be enabled on the link. If EEE is not supported
2481 * on this port, then this flag shall be ignored by the HWRM. If EEE is
2482 * disabled on this port, then this flag shall be ignored by the HWRM.
2484 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI UINT32_C(0x40)
2487 /* This bit must be '1' for the auto_mode field to be configured. */
2488 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE UINT32_C(0x1)
2489 /* This bit must be '1' for the auto_duplex field to be configured. */
2490 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX UINT32_C(0x2)
2491 /* This bit must be '1' for the auto_pause field to be configured. */
2492 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE UINT32_C(0x4)
2494 * This bit must be '1' for the auto_link_speed field to be configured.
2496 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED UINT32_C(0x8)
2498 * This bit must be '1' for the auto_link_speed_mask field to be
2501 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
2503 /* This bit must be '1' for the wirespeed field to be configured. */
2504 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED UINT32_C(0x20)
2505 /* This bit must be '1' for the lpbk field to be configured. */
2506 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK UINT32_C(0x40)
2507 /* This bit must be '1' for the preemphasis field to be configured. */
2508 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS UINT32_C(0x80)
2509 /* This bit must be '1' for the force_pause field to be configured. */
2510 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE UINT32_C(0x100)
2512 * This bit must be '1' for the eee_link_speed_mask field to be
2515 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
2517 /* This bit must be '1' for the tx_lpi_timer field to be configured. */
2518 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER UINT32_C(0x400)
2521 /* Port ID of port that is to be configured. */
2525 * This is the speed that will be used if the force bit is '1'. If
2526 * unsupported speed is selected, an error will be generated.
2528 /* 100Mb link speed */
2529 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB \
2530 (UINT32_C(0x1) << 0)
2531 /* 1Gb link speed */
2532 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB \
2533 (UINT32_C(0xa) << 0)
2534 /* 2Gb link speed */
2535 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB \
2536 (UINT32_C(0x14) << 0)
2537 /* 2.5Gb link speed */
2538 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB \
2539 (UINT32_C(0x19) << 0)
2540 /* 10Gb link speed */
2541 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB \
2542 (UINT32_C(0x64) << 0)
2543 /* 20Mb link speed */
2544 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB \
2545 (UINT32_C(0xc8) << 0)
2546 /* 25Gb link speed */
2547 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB \
2548 (UINT32_C(0xfa) << 0)
2549 /* 40Gb link speed */
2550 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB \
2551 (UINT32_C(0x190) << 0)
2552 /* 50Gb link speed */
2553 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB \
2554 (UINT32_C(0x1f4) << 0)
2555 /* 100Gb link speed */
2556 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB \
2557 (UINT32_C(0x3e8) << 0)
2558 /* 10Mb link speed */
2559 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB \
2560 (UINT32_C(0xffff) << 0)
2561 uint16_t force_link_speed;
2564 * This value is used to identify what autoneg mode is used when the
2565 * link speed is not being forced.
2568 * Disable autoneg or autoneg disabled. No speeds are selected.
2570 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE (UINT32_C(0x0) << 0)
2571 /* Select all possible speeds for autoneg mode. */
2572 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS \
2573 (UINT32_C(0x1) << 0)
2575 * Select only the auto_link_speed speed for autoneg mode. This
2576 * mode has been DEPRECATED. An HWRM client should not use this
2579 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED \
2580 (UINT32_C(0x2) << 0)
2582 * Select the auto_link_speed or any speed below that speed for
2583 * autoneg. This mode has been DEPRECATED. An HWRM client should
2584 * not use this mode.
2586 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW \
2587 (UINT32_C(0x3) << 0)
2589 * Select the speeds based on the corresponding link speed mask
2590 * value that is provided.
2592 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK \
2593 (UINT32_C(0x4) << 0)
2597 * This is the duplex setting that will be used if the autoneg_mode is
2598 * "one_speed" or "one_or_below".
2600 /* Half Duplex will be requested. */
2601 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF \
2602 (UINT32_C(0x0) << 0)
2603 /* Full duplex will be requested. */
2604 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL \
2605 (UINT32_C(0x1) << 0)
2606 /* Both Half and Full dupex will be requested. */
2607 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH \
2608 (UINT32_C(0x2) << 0)
2609 uint8_t auto_duplex;
2612 * This value is used to configure the pause that will be used for
2613 * autonegotiation. Add text on the usage of auto_pause and force_pause.
2616 * When this bit is '1', Generation of tx pause messages has been
2617 * requested. Disabled otherwise.
2619 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX UINT32_C(0x1)
2621 * When this bit is '1', Reception of rx pause messages has been
2622 * requested. Disabled otherwise.
2624 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX UINT32_C(0x2)
2626 * When set to 1, the advertisement of pause is enabled. # When the
2627 * auto_mode is not set to none and this flag is set to 1, then the
2628 * auto_pause bits on this port are being advertised and autoneg pause
2629 * results are being interpreted. # When the auto_mode is not set to
2630 * none and this flag is set to 0, the pause is forced as indicated in
2631 * force_pause, and also advertised as auto_pause bits, but the autoneg
2632 * results are not interpreted since the pause configuration is being
2633 * forced. # When the auto_mode is set to none and this flag is set to
2634 * 1, auto_pause bits should be ignored and should be set to 0.
2636 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
2642 * This is the speed that will be used if the autoneg_mode is
2643 * "one_speed" or "one_or_below". If an unsupported speed is selected,
2644 * an error will be generated.
2646 /* 100Mb link speed */
2647 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB \
2648 (UINT32_C(0x1) << 0)
2649 /* 1Gb link speed */
2650 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB \
2651 (UINT32_C(0xa) << 0)
2652 /* 2Gb link speed */
2653 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB \
2654 (UINT32_C(0x14) << 0)
2655 /* 2.5Gb link speed */
2656 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB \
2657 (UINT32_C(0x19) << 0)
2658 /* 10Gb link speed */
2659 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB \
2660 (UINT32_C(0x64) << 0)
2661 /* 20Mb link speed */
2662 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB \
2663 (UINT32_C(0xc8) << 0)
2664 /* 25Gb link speed */
2665 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB \
2666 (UINT32_C(0xfa) << 0)
2667 /* 40Gb link speed */
2668 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB \
2669 (UINT32_C(0x190) << 0)
2670 /* 50Gb link speed */
2671 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB \
2672 (UINT32_C(0x1f4) << 0)
2673 /* 100Gb link speed */
2674 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB \
2675 (UINT32_C(0x3e8) << 0)
2676 /* 10Mb link speed */
2677 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB \
2678 (UINT32_C(0xffff) << 0)
2679 uint16_t auto_link_speed;
2682 * This is a mask of link speeds that will be used if autoneg_mode is
2683 * "mask". If unsupported speed is enabled an error will be generated.
2685 /* 100Mb link speed (Half-duplex) */
2686 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
2688 /* 100Mb link speed (Full-duplex) */
2689 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
2691 /* 1Gb link speed (Half-duplex) */
2692 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
2694 /* 1Gb link speed (Full-duplex) */
2695 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
2697 /* 2Gb link speed */
2698 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
2700 /* 2.5Gb link speed */
2701 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
2703 /* 10Gb link speed */
2704 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
2706 /* 20Gb link speed */
2707 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
2709 /* 25Gb link speed */
2710 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
2712 /* 40Gb link speed */
2713 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
2715 /* 50Gb link speed */
2716 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
2718 /* 100Gb link speed */
2719 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
2721 /* 10Mb link speed (Half-duplex) */
2722 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
2724 /* 10Mb link speed (Full-duplex) */
2725 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
2727 uint16_t auto_link_speed_mask;
2729 /* This value controls the wirespeed feature. */
2730 /* Wirespeed feature is disabled. */
2731 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF (UINT32_C(0x0) << 0)
2732 /* Wirespeed feature is enabled. */
2733 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON (UINT32_C(0x1) << 0)
2736 /* This value controls the loopback setting for the PHY. */
2737 /* No loopback is selected. Normal operation. */
2738 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE (UINT32_C(0x0) << 0)
2740 * The HW will be configured with local loopback such that host
2741 * data is sent back to the host without modification.
2743 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL (UINT32_C(0x1) << 0)
2745 * The HW will be configured with remote loopback such that port
2746 * logic will send packets back out the transmitter that are
2749 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE (UINT32_C(0x2) << 0)
2753 * This value is used to configure the pause that will be used for force
2757 * When this bit is '1', Generation of tx pause messages is supported.
2758 * Disabled otherwise.
2760 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1)
2762 * When this bit is '1', Reception of rx pause messages is supported.
2763 * Disabled otherwise.
2765 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2)
2766 uint8_t force_pause;
2771 * This value controls the pre-emphasis to be used for the link. Driver
2772 * should not set this value (use enable.preemphasis = 0) unless driver
2773 * is sure of setting. Normally HWRM FW will determine proper pre-
2776 uint32_t preemphasis;
2779 * Setting for link speed mask that is used to advertise speeds during
2780 * autonegotiation when EEE is enabled. This field is valid only when
2781 * EEE is enabled. The speeds specified in this field shall be a subset
2782 * of speeds specified in auto_link_speed_mask. If EEE is enabled,then
2783 * at least one speed shall be provided in this mask.
2786 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
2787 /* 100Mb link speed (Full-duplex) */
2788 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
2790 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
2791 /* 1Gb link speed (Full-duplex) */
2792 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
2794 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
2797 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
2799 /* 10Gb link speed */
2800 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
2802 uint16_t eee_link_speed_mask;
2808 * Reuested setting of TX LPI timer in microseconds. This field is valid
2809 * only when EEE is enabled and TX LPI is enabled.
2811 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK \
2813 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
2814 uint32_t tx_lpi_timer;
2817 } __attribute__((packed));
2819 /* Output (16 bytes) */
2820 struct hwrm_port_phy_cfg_output {
2822 * Pass/Fail or error type Note: receiver to verify the in parameters,
2823 * and fail the call with an error when appropriate
2825 uint16_t error_code;
2827 /* This field returns the type of original request. */
2830 /* This field provides original sequence number of the command. */
2834 * This field is the length of the response in bytes. The last byte of
2835 * the response is a valid flag that will read as '1' when the command
2836 * has been completely written to memory.
2846 * This field is used in Output records to indicate that the output is
2847 * completely written to RAM. This field should be read as '1' to
2848 * indicate that the output has been completely written. When writing a
2849 * command completion or response to an internal processor, the order of
2850 * writes has to be such that this field is written last.
2853 } __attribute__((packed));
2855 /* hwrm_port_phy_qcfg */
2856 /* Description: This command queries the PHY configuration for the port. */
2857 /* Input (24 bytes) */
2859 struct hwrm_port_phy_qcfg_input {
2861 * This value indicates what type of request this is. The format for the
2862 * rest of the command is determined by this field.
2867 * This value indicates the what completion ring the request will be
2868 * optionally completed on. If the value is -1, then no CR completion
2869 * will be generated. Any other value must be a valid CR ring_id value
2870 * for this function.
2874 /* This value indicates the command sequence number. */
2878 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
2879 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
2884 * This is the host address where the response will be written when the
2885 * request is complete. This area must be 16B aligned and must be
2886 * cleared to zero before the request is made.
2890 /* Port ID of port that is to be queried. */
2893 uint16_t unused_0[3];
2894 } __attribute__((packed));
2896 /* Output (96 bytes) */
2897 struct hwrm_port_phy_qcfg_output {
2899 * Pass/Fail or error type Note: receiver to verify the in parameters,
2900 * and fail the call with an error when appropriate
2902 uint16_t error_code;
2904 /* This field returns the type of original request. */
2907 /* This field provides original sequence number of the command. */
2911 * This field is the length of the response in bytes. The last byte of
2912 * the response is a valid flag that will read as '1' when the command
2913 * has been completely written to memory.
2917 /* This value indicates the current link status. */
2918 /* There is no link or cable detected. */
2919 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_NO_LINK (UINT32_C(0x0) << 0)
2920 /* There is no link, but a cable has been detected. */
2921 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SIGNAL (UINT32_C(0x1) << 0)
2922 /* There is a link. */
2923 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK (UINT32_C(0x2) << 0)
2928 /* This value indicates the current link speed of the connection. */
2929 /* 100Mb link speed */
2930 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB \
2931 (UINT32_C(0x1) << 0)
2932 /* 1Gb link speed */
2933 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB \
2934 (UINT32_C(0xa) << 0)
2935 /* 2Gb link speed */
2936 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB \
2937 (UINT32_C(0x14) << 0)
2938 /* 2.5Gb link speed */
2939 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB \
2940 (UINT32_C(0x19) << 0)
2941 /* 10Gb link speed */
2942 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB \
2943 (UINT32_C(0x64) << 0)
2944 /* 20Mb link speed */
2945 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB \
2946 (UINT32_C(0xc8) << 0)
2947 /* 25Gb link speed */
2948 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB \
2949 (UINT32_C(0xfa) << 0)
2950 /* 40Gb link speed */
2951 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB \
2952 (UINT32_C(0x190) << 0)
2953 /* 50Gb link speed */
2954 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB \
2955 (UINT32_C(0x1f4) << 0)
2956 /* 100Gb link speed */
2957 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB \
2958 (UINT32_C(0x3e8) << 0)
2959 /* 10Mb link speed */
2960 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10MB \
2961 (UINT32_C(0xffff) << 0)
2962 uint16_t link_speed;
2964 /* This value is indicates the duplex of the current connection. */
2965 /* Half Duplex connection. */
2966 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_HALF (UINT32_C(0x0) << 0)
2967 /* Full duplex connection. */
2968 #define HWRM_PORT_PHY_QCFG_OUTPUT_DUPLEX_FULL (UINT32_C(0x1) << 0)
2972 * This value is used to indicate the current pause configuration. When
2973 * autoneg is enabled, this value represents the autoneg results of
2974 * pause configuration.
2977 * When this bit is '1', Generation of tx pause messages is supported.
2978 * Disabled otherwise.
2980 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX UINT32_C(0x1)
2982 * When this bit is '1', Reception of rx pause messages is supported.
2983 * Disabled otherwise.
2985 #define HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX UINT32_C(0x2)
2989 * The supported speeds for the port. This is a bit mask. For each speed
2990 * that is supported, the corrresponding bit will be set to '1'.
2992 /* 100Mb link speed (Half-duplex) */
2993 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD \
2995 /* 100Mb link speed (Full-duplex) */
2996 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MB \
2998 /* 1Gb link speed (Half-duplex) */
2999 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GBHD \
3001 /* 1Gb link speed (Full-duplex) */
3002 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB \
3004 /* 2Gb link speed */
3005 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2GB \
3007 /* 2.5Gb link speed */
3008 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_2_5GB \
3010 /* 10Gb link speed */
3011 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB \
3013 /* 20Gb link speed */
3014 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_20GB \
3016 /* 25Gb link speed */
3017 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_25GB \
3019 /* 40Gb link speed */
3020 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_40GB \
3022 /* 50Gb link speed */
3023 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB \
3025 /* 100Gb link speed */
3026 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB \
3028 /* 10Mb link speed (Half-duplex) */
3029 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MBHD \
3031 /* 10Mb link speed (Full-duplex) */
3032 #define HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10MB \
3034 uint16_t support_speeds;
3037 * Current setting of forced link speed. When the link speed is not
3038 * being forced, this value shall be set to 0.
3040 /* 100Mb link speed */
3041 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100MB \
3042 (UINT32_C(0x1) << 0)
3043 /* 1Gb link speed */
3044 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_1GB \
3045 (UINT32_C(0xa) << 0)
3046 /* 2Gb link speed */
3047 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2GB \
3048 (UINT32_C(0x14) << 0)
3049 /* 2.5Gb link speed */
3050 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_2_5GB \
3051 (UINT32_C(0x19) << 0)
3052 /* 10Gb link speed */
3053 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10GB \
3054 (UINT32_C(0x64) << 0)
3055 /* 20Mb link speed */
3056 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_20GB \
3057 (UINT32_C(0xc8) << 0)
3058 /* 25Gb link speed */
3059 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_25GB \
3060 (UINT32_C(0xfa) << 0)
3061 /* 40Gb link speed */
3062 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_40GB \
3063 (UINT32_C(0x190) << 0)
3064 /* 50Gb link speed */
3065 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_50GB \
3066 (UINT32_C(0x1f4) << 0)
3067 /* 100Gb link speed */
3068 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_100GB \
3069 (UINT32_C(0x3e8) << 0)
3070 /* 10Mb link speed */
3071 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_LINK_SPEED_10MB \
3072 (UINT32_C(0xffff) << 0)
3073 uint16_t force_link_speed;
3075 /* Current setting of auto negotiation mode. */
3077 * Disable autoneg or autoneg disabled. No speeds are selected.
3079 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE \
3080 (UINT32_C(0x0) << 0)
3081 /* Select all possible speeds for autoneg mode. */
3082 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ALL_SPEEDS \
3083 (UINT32_C(0x1) << 0)
3085 * Select only the auto_link_speed speed for autoneg mode. This
3086 * mode has been DEPRECATED. An HWRM client should not use this
3089 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_SPEED \
3090 (UINT32_C(0x2) << 0)
3092 * Select the auto_link_speed or any speed below that speed for
3093 * autoneg. This mode has been DEPRECATED. An HWRM client should
3094 * not use this mode.
3096 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_ONE_OR_BELOW \
3097 (UINT32_C(0x3) << 0)
3099 * Select the speeds based on the corresponding link speed mask
3100 * value that is provided.
3102 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_SPEED_MASK \
3103 (UINT32_C(0x4) << 0)
3107 * Current setting of pause autonegotiation. Move autoneg_pause flag
3111 * When this bit is '1', Generation of tx pause messages has been
3112 * requested. Disabled otherwise.
3114 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_TX UINT32_C(0x1)
3116 * When this bit is '1', Reception of rx pause messages has been
3117 * requested. Disabled otherwise.
3119 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_RX UINT32_C(0x2)
3121 * When set to 1, the advertisement of pause is enabled. # When the
3122 * auto_mode is not set to none and this flag is set to 1, then the
3123 * auto_pause bits on this port are being advertised and autoneg pause
3124 * results are being interpreted. # When the auto_mode is not set to
3125 * none and this flag is set to 0, the pause is forced as indicated in
3126 * force_pause, and also advertised as auto_pause bits, but the autoneg
3127 * results are not interpreted since the pause configuration is being
3128 * forced. # When the auto_mode is set to none and this flag is set to
3129 * 1, auto_pause bits should be ignored and should be set to 0.
3131 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE \
3136 * Current setting for auto_link_speed. This field is only valid when
3137 * auto_mode is set to "one_speed" or "one_or_below".
3139 /* 100Mb link speed */
3140 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100MB \
3141 (UINT32_C(0x1) << 0)
3142 /* 1Gb link speed */
3143 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_1GB \
3144 (UINT32_C(0xa) << 0)
3145 /* 2Gb link speed */
3146 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2GB \
3147 (UINT32_C(0x14) << 0)
3148 /* 2.5Gb link speed */
3149 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_2_5GB \
3150 (UINT32_C(0x19) << 0)
3151 /* 10Gb link speed */
3152 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10GB \
3153 (UINT32_C(0x64) << 0)
3154 /* 20Mb link speed */
3155 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_20GB \
3156 (UINT32_C(0xc8) << 0)
3157 /* 25Gb link speed */
3158 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_25GB \
3159 (UINT32_C(0xfa) << 0)
3160 /* 40Gb link speed */
3161 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_40GB \
3162 (UINT32_C(0x190) << 0)
3163 /* 50Gb link speed */
3164 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_50GB \
3165 (UINT32_C(0x1f4) << 0)
3166 /* 100Gb link speed */
3167 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_100GB \
3168 (UINT32_C(0x3e8) << 0)
3169 /* 10Mb link speed */
3170 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_10MB \
3171 (UINT32_C(0xffff) << 0)
3172 uint16_t auto_link_speed;
3175 * Current setting for auto_link_speed_mask that is used to advertise
3176 * speeds during autonegotiation. This field is only valid when
3177 * auto_mode is set to "mask". The speeds specified in this field shall
3178 * be a subset of supported speeds on this port.
3180 /* 100Mb link speed (Half-duplex) */
3181 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MBHD \
3183 /* 100Mb link speed (Full-duplex) */
3184 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100MB \
3186 /* 1Gb link speed (Half-duplex) */
3187 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GBHD \
3189 /* 1Gb link speed (Full-duplex) */
3190 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_1GB \
3192 /* 2Gb link speed */
3193 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2GB \
3195 /* 2.5Gb link speed */
3196 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_2_5GB \
3198 /* 10Gb link speed */
3199 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10GB \
3201 /* 20Gb link speed */
3202 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_20GB \
3204 /* 25Gb link speed */
3205 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_25GB \
3207 /* 40Gb link speed */
3208 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_40GB \
3210 /* 50Gb link speed */
3211 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_50GB \
3213 /* 100Gb link speed */
3214 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_100GB \
3216 /* 10Mb link speed (Half-duplex) */
3217 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MBHD \
3219 /* 10Mb link speed (Full-duplex) */
3220 #define HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_LINK_SPEED_MASK_10MB \
3222 uint16_t auto_link_speed_mask;
3224 /* Current setting for wirespeed. */
3225 /* Wirespeed feature is disabled. */
3226 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_OFF (UINT32_C(0x0) << 0)
3227 /* Wirespeed feature is enabled. */
3228 #define HWRM_PORT_PHY_QCFG_OUTPUT_WIRESPEED_ON (UINT32_C(0x1) << 0)
3231 /* Current setting for loopback. */
3232 /* No loopback is selected. Normal operation. */
3233 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_NONE (UINT32_C(0x0) << 0)
3235 * The HW will be configured with local loopback such that host
3236 * data is sent back to the host without modification.
3238 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_LOCAL (UINT32_C(0x1) << 0)
3240 * The HW will be configured with remote loopback such that port
3241 * logic will send packets back out the transmitter that are
3244 #define HWRM_PORT_PHY_QCFG_OUTPUT_LPBK_REMOTE (UINT32_C(0x2) << 0)
3248 * Current setting of forced pause. When the pause configuration is not
3249 * being forced, then this value shall be set to 0.
3252 * When this bit is '1', Generation of tx pause messages is supported.
3253 * Disabled otherwise.
3255 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_TX \
3258 * When this bit is '1', Reception of rx pause messages is supported.
3259 * Disabled otherwise.
3261 #define HWRM_PORT_PHY_QCFG_OUTPUT_FORCE_PAUSE_RX \
3263 uint8_t force_pause;
3266 * This value indicates the current status of the optics module on this
3269 /* Module is inserted and accepted */
3270 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NONE \
3271 (UINT32_C(0x0) << 0)
3272 /* Module is rejected and transmit side Laser is disabled. */
3273 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_DISABLETX \
3274 (UINT32_C(0x1) << 0)
3275 /* Module mismatch warning. */
3276 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_WARNINGMSG \
3277 (UINT32_C(0x2) << 0)
3278 /* Module is rejected and powered down. */
3279 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_PWRDOWN \
3280 (UINT32_C(0x3) << 0)
3281 /* Module is not inserted. */
3282 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTINSERTED \
3283 (UINT32_C(0x4) << 0)
3284 /* Module status is not applicable. */
3285 #define HWRM_PORT_PHY_QCFG_OUTPUT_MODULE_STATUS_NOTAPPLICABLE \
3286 (UINT32_C(0xff) << 0)
3287 uint8_t module_status;
3289 /* Current setting for preemphasis. */
3290 uint32_t preemphasis;
3292 /* This field represents the major version of the PHY. */
3295 /* This field represents the minor version of the PHY. */
3298 /* This field represents the build version of the PHY. */
3301 /* This value represents a PHY type. */
3303 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN \
3304 (UINT32_C(0x0) << 0)
3306 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR \
3307 (UINT32_C(0x1) << 0)
3308 /* BASE-KR4 (Deprecated) */
3309 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4 \
3310 (UINT32_C(0x2) << 0)
3312 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR \
3313 (UINT32_C(0x3) << 0)
3315 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR \
3316 (UINT32_C(0x4) << 0)
3317 /* BASE-KR2 (Deprecated) */
3318 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2 \
3319 (UINT32_C(0x5) << 0)
3321 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX \
3322 (UINT32_C(0x6) << 0)
3324 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR \
3325 (UINT32_C(0x7) << 0)
3327 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET \
3328 (UINT32_C(0x8) << 0)
3329 /* EEE capable BASE-T */
3330 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE \
3331 (UINT32_C(0x9) << 0)
3332 /* SGMII connected external PHY */
3333 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY \
3334 (UINT32_C(0xa) << 0)
3337 /* This value represents a media type. */
3339 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_UNKNOWN \
3340 (UINT32_C(0x0) << 0)
3342 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_TP (UINT32_C(0x1) << 0)
3343 /* Direct Attached Copper */
3344 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_DAC \
3345 (UINT32_C(0x2) << 0)
3347 #define HWRM_PORT_PHY_QCFG_OUTPUT_MEDIA_TYPE_FIBRE \
3348 (UINT32_C(0x3) << 0)
3351 /* This value represents a transceiver type. */
3352 /* PHY and MAC are in the same package */
3353 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_INTERNAL \
3354 (UINT32_C(0x1) << 0)
3355 /* PHY and MAC are in different packages */
3356 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_PKG_TYPE_XCVR_EXTERNAL \
3357 (UINT32_C(0x2) << 0)
3358 uint8_t xcvr_pkg_type;
3361 * This field represents flags related to EEE configuration. These EEE
3362 * configuration flags are valid only when the auto_mode is not set to
3363 * none (in other words autonegotiation is enabled).
3365 /* This field represents PHY address. */
3366 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_MASK UINT32_C(0x1f)
3367 #define HWRM_PORT_PHY_QCFG_OUTPUT_PHY_ADDR_SFT 0
3369 * When set to 1, Energy Efficient Ethernet (EEE) mode is enabled.
3370 * Speeds for autoneg with EEE mode enabled are based on
3371 * eee_link_speed_mask.
3373 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ENABLED \
3376 * This flag is valid only when eee_enabled is set to 1. # If
3377 * eee_enabled is set to 0, then EEE mode is disabled and this flag
3378 * shall be ignored. # If eee_enabled is set to 1 and this flag is set
3379 * to 1, then Energy Efficient Ethernet (EEE) mode is enabled and in
3380 * use. # If eee_enabled is set to 1 and this flag is set to 0, then
3381 * Energy Efficient Ethernet (EEE) mode is enabled but is currently not
3384 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_ACTIVE \
3387 * This flag is valid only when eee_enabled is set to 1. # If
3388 * eee_enabled is set to 0, then EEE mode is disabled and this flag
3389 * shall be ignored. # If eee_enabled is set to 1 and this flag is set
3390 * to 1, then Energy Efficient Ethernet (EEE) mode is enabled and TX LPI
3391 * is enabled. # If eee_enabled is set to 1 and this flag is set to 0,
3392 * then Energy Efficient Ethernet (EEE) mode is enabled but TX LPI is
3395 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_EEE_TX_LPI \
3398 * This field represents flags related to EEE configuration. These EEE
3399 * configuration flags are valid only when the auto_mode is not set to
3400 * none (in other words autonegotiation is enabled).
3402 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_MASK \
3404 #define HWRM_PORT_PHY_QCFG_OUTPUT_EEE_CONFIG_SFT 5
3405 uint8_t eee_config_phy_addr;
3407 /* Reserved field, set to 0 */
3409 * When set to 1, the parallel detection is used to determine the speed
3410 * of the link partner. Parallel detection is used when a
3411 * autonegotiation capable device is connected to a link parter that is
3412 * not capable of autonegotiation.
3414 #define HWRM_PORT_PHY_QCFG_OUTPUT_PARALLEL_DETECT \
3416 /* Reserved field, set to 0 */
3417 #define HWRM_PORT_PHY_QCFG_OUTPUT_RESERVED_MASK UINT32_C(0xfe)
3418 #define HWRM_PORT_PHY_QCFG_OUTPUT_RESERVED_SFT 1
3419 uint8_t parallel_detect;
3422 * The advertised speeds for the port by the link partner. Each
3423 * advertised speed will be set to '1'.
3425 /* 100Mb link speed (Half-duplex) */
3426 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MBHD \
3428 /* 100Mb link speed (Full-duplex) */
3429 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100MB \
3431 /* 1Gb link speed (Half-duplex) */
3432 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GBHD \
3434 /* 1Gb link speed (Full-duplex) */
3435 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_1GB \
3437 /* 2Gb link speed */
3438 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2GB \
3440 /* 2.5Gb link speed */
3441 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_2_5GB \
3443 /* 10Gb link speed */
3444 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10GB \
3446 /* 20Gb link speed */
3447 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_20GB \
3449 /* 25Gb link speed */
3450 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_25GB \
3452 /* 40Gb link speed */
3453 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_40GB \
3455 /* 50Gb link speed */
3456 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_50GB \
3458 /* 100Gb link speed */
3459 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_100GB \
3461 /* 10Mb link speed (Half-duplex) */
3462 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MBHD \
3464 /* 10Mb link speed (Full-duplex) */
3465 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_SPEEDS_10MB \
3467 uint16_t link_partner_adv_speeds;
3470 * The advertised autoneg for the port by the link partner. This field
3471 * is deprecated and should be set to 0.
3474 * Disable autoneg or autoneg disabled. No speeds are selected.
3476 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_NONE \
3477 (UINT32_C(0x0) << 0)
3478 /* Select all possible speeds for autoneg mode. */
3479 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS\
3480 (UINT32_C(0x1) << 0)
3482 * Select only the auto_link_speed speed for autoneg mode. This
3483 * mode has been DEPRECATED. An HWRM client should not use this
3486 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED \
3487 (UINT32_C(0x2) << 0)
3489 * Select the auto_link_speed or any speed below that speed for
3490 * autoneg. This mode has been DEPRECATED. An HWRM client should
3491 * not use this mode.
3494 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW \
3495 (UINT32_C(0x3) << 0)
3497 * Select the speeds based on the corresponding link speed mask
3498 * value that is provided.
3500 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK\
3501 (UINT32_C(0x4) << 0)
3502 uint8_t link_partner_adv_auto_mode;
3504 /* The advertised pause settings on the port by the link partner. */
3506 * When this bit is '1', Generation of tx pause messages is supported.
3507 * Disabled otherwise.
3509 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_TX \
3512 * When this bit is '1', Reception of rx pause messages is supported.
3513 * Disabled otherwise.
3515 #define HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_PAUSE_RX \
3517 uint8_t link_partner_adv_pause;
3520 * Current setting for link speed mask that is used to advertise speeds
3521 * during autonegotiation when EEE is enabled. This field is valid only
3522 * when eee_enabled flags is set to 1. The speeds specified in this
3523 * field shall be a subset of speeds specified in auto_link_speed_mask.
3526 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
3528 /* 100Mb link speed (Full-duplex) */
3529 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_100MB \
3532 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
3534 /* 1Gb link speed (Full-duplex) */
3535 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_1GB \
3538 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
3541 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
3543 /* 10Gb link speed */
3544 #define HWRM_PORT_PHY_QCFG_OUTPUT_ADV_EEE_LINK_SPEED_MASK_10GB \
3546 uint16_t adv_eee_link_speed_mask;
3549 * Current setting for link speed mask that is advertised by the link
3550 * partner when EEE is enabled. This field is valid only when
3551 * eee_enabled flags is set to 1.
3555 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 \
3557 /* 100Mb link speed (Full-duplex) */
3559 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB \
3563 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 \
3565 /* 1Gb link speed (Full-duplex) */
3567 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB \
3571 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 \
3575 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 \
3577 /* 10Gb link speed */
3579 HWRM_PORT_PHY_QCFG_OUTPUT_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB \
3581 uint16_t link_partner_adv_eee_link_speed_mask;
3583 /* This value represents transceiver identifier type. */
3585 * Current setting of TX LPI timer in microseconds. This field is valid
3586 * only when_eee_enabled flag is set to 1 and tx_lpi_enabled is set to
3589 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_MASK \
3591 #define HWRM_PORT_PHY_QCFG_OUTPUT_TX_LPI_TIMER_SFT 0
3592 /* This value represents transceiver identifier type. */
3593 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_MASK \
3594 UINT32_C(0xff000000)
3595 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFT \
3598 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_UNKNOWN \
3599 (UINT32_C(0x0) << 24)
3600 /* SFP/SFP+/SFP28 */
3601 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_SFP \
3602 (UINT32_C(0x3) << 24)
3604 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP \
3605 (UINT32_C(0xc) << 24)
3607 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFPPLUS \
3608 (UINT32_C(0xd) << 24)
3610 #define HWRM_PORT_PHY_QCFG_OUTPUT_XCVR_IDENTIFIER_TYPE_QSFP28 \
3611 (UINT32_C(0x11) << 24)
3612 uint32_t xcvr_identifier_type_tx_lpi_timer;
3617 * Up to 16 bytes of null padded ASCII string representing PHY vendor.
3618 * If the string is set to null, then the vendor name is not available.
3620 char phy_vendor_name[16];
3623 * Up to 16 bytes of null padded ASCII string that identifies vendor
3624 * specific part number of the PHY. If the string is set to null, then
3625 * the vendor specific part number is not available.
3627 char phy_vendor_partnumber[16];
3635 * This field is used in Output records to indicate that the output is
3636 * completely written to RAM. This field should be read as '1' to
3637 * indicate that the output has been completely written. When writing a
3638 * command completion or response to an internal processor, the order of
3639 * writes has to be such that this field is written last.
3642 } __attribute__((packed));
3646 * Description: This function is called by a driver to determine the HWRM
3647 * interface version supported by the HWRM firmware, the version of HWRM
3648 * firmware implementation, the name of HWRM firmware, the versions of other
3649 * embedded firmwares, and the names of other embedded firmwares, etc. Any
3650 * interface or firmware version with major = 0, minor = 0, and update = 0 shall
3651 * be considered an invalid version.
3654 /* Input (24 bytes) */
3655 struct hwrm_ver_get_input {
3657 * This value indicates what type of request this is. The format for the
3658 * rest of the command is determined by this field.
3663 * This value indicates the what completion ring the request will be
3664 * optionally completed on. If the value is -1, then no CR completion
3665 * will be generated. Any other value must be a valid CR ring_id value
3666 * for this function.
3670 /* This value indicates the command sequence number. */
3674 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
3675 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
3680 * This is the host address where the response will be written when the
3681 * request is complete. This area must be 16B aligned and must be
3682 * cleared to zero before the request is made.
3687 * This field represents the major version of HWRM interface
3688 * specification supported by the driver HWRM implementation. The
3689 * interface major version is intended to change only when non backward
3690 * compatible changes are made to the HWRM interface specification.
3692 uint8_t hwrm_intf_maj;
3695 * This field represents the minor version of HWRM interface
3696 * specification supported by the driver HWRM implementation. A change
3697 * in interface minor version is used to reflect significant backward
3698 * compatible modification to HWRM interface specification. This can be
3699 * due to addition or removal of functionality. HWRM interface
3700 * specifications with the same major version but different minor
3701 * versions are compatible.
3703 uint8_t hwrm_intf_min;
3706 * This field represents the update version of HWRM interface
3707 * specification supported by the driver HWRM implementation. The
3708 * interface update version is used to reflect minor changes or bug
3709 * fixes to a released HWRM interface specification.
3711 uint8_t hwrm_intf_upd;
3713 uint8_t unused_0[5];
3714 } __attribute__((packed));
3716 /* Output (128 bytes) */
3717 struct hwrm_ver_get_output {
3719 * Pass/Fail or error type Note: receiver to verify the in parameters,
3720 * and fail the call with an error when appropriate
3722 uint16_t error_code;
3724 /* This field returns the type of original request. */
3727 /* This field provides original sequence number of the command. */
3731 * This field is the length of the response in bytes. The last byte of
3732 * the response is a valid flag that will read as '1' when the command
3733 * has been completely written to memory.
3738 * This field represents the major version of HWRM interface
3739 * specification supported by the HWRM implementation. The interface
3740 * major version is intended to change only when non backward compatible
3741 * changes are made to the HWRM interface specification. A HWRM
3742 * implementation that is compliant with this specification shall
3743 * provide value of 1 in this field.
3745 uint8_t hwrm_intf_maj;
3748 * This field represents the minor version of HWRM interface
3749 * specification supported by the HWRM implementation. A change in
3750 * interface minor version is used to reflect significant backward
3751 * compatible modification to HWRM interface specification. This can be
3752 * due to addition or removal of functionality. HWRM interface
3753 * specifications with the same major version but different minor
3754 * versions are compatible. A HWRM implementation that is compliant with
3755 * this specification shall provide value of 0 in this field.
3757 uint8_t hwrm_intf_min;
3760 * This field represents the update version of HWRM interface
3761 * specification supported by the HWRM implementation. The interface
3762 * update version is used to reflect minor changes or bug fixes to a
3763 * released HWRM interface specification. A HWRM implementation that is
3764 * compliant with this specification shall provide value of 1 in this
3767 uint8_t hwrm_intf_upd;
3769 uint8_t hwrm_intf_rsvd;
3772 * This field represents the major version of HWRM firmware. A change in
3773 * firmware major version represents a major firmware release.
3775 uint8_t hwrm_fw_maj;
3778 * This field represents the minor version of HWRM firmware. A change in
3779 * firmware minor version represents significant firmware functionality
3782 uint8_t hwrm_fw_min;
3785 * This field represents the build version of HWRM firmware. A change in
3786 * firmware build version represents bug fixes to a released firmware.
3788 uint8_t hwrm_fw_bld;
3791 * This field is a reserved field. This field can be used to represent
3792 * firmware branches or customer specific releases tied to a specific
3793 * (major,minor,update) version of the HWRM firmware.
3795 uint8_t hwrm_fw_rsvd;
3798 * This field represents the major version of mgmt firmware. A change in
3799 * major version represents a major release.
3801 uint8_t mgmt_fw_maj;
3804 * This field represents the minor version of mgmt firmware. A change in
3805 * minor version represents significant functionality changes.
3807 uint8_t mgmt_fw_min;
3810 * This field represents the build version of mgmt firmware. A change in
3811 * update version represents bug fixes.
3813 uint8_t mgmt_fw_bld;
3816 * This field is a reserved field. This field can be used to represent
3817 * firmware branches or customer specific releases tied to a specific
3818 * (major,minor,update) version
3820 uint8_t mgmt_fw_rsvd;
3823 * This field represents the major version of network control firmware.
3824 * A change in major version represents a major release.
3826 uint8_t netctrl_fw_maj;
3829 * This field represents the minor version of network control firmware.
3830 * A change in minor version represents significant functionality
3833 uint8_t netctrl_fw_min;
3836 * This field represents the build version of network control firmware.
3837 * A change in update version represents bug fixes.
3839 uint8_t netctrl_fw_bld;
3842 * This field is a reserved field. This field can be used to represent
3843 * firmware branches or customer specific releases tied to a specific
3844 * (major,minor,update) version
3846 uint8_t netctrl_fw_rsvd;
3849 * This field is reserved for future use. The responder should set it to
3850 * 0. The requester should ignore this field.
3855 * This field represents the major version of RoCE firmware. A change in
3856 * major version represents a major release.
3858 uint8_t roce_fw_maj;
3861 * This field represents the minor version of RoCE firmware. A change in
3862 * minor version represents significant functionality changes.
3864 uint8_t roce_fw_min;
3867 * This field represents the build version of RoCE firmware. A change in
3868 * update version represents bug fixes.
3870 uint8_t roce_fw_bld;
3873 * This field is a reserved field. This field can be used to represent
3874 * firmware branches or customer specific releases tied to a specific
3875 * (major,minor,update) version
3877 uint8_t roce_fw_rsvd;
3880 * This field represents the name of HWRM FW (ASCII chars without NULL
3883 char hwrm_fw_name[16];
3886 * This field represents the name of mgmt FW (ASCII chars without NULL
3889 char mgmt_fw_name[16];
3892 * This field represents the name of network control firmware (ASCII
3893 * chars without NULL at the end).
3895 char netctrl_fw_name[16];
3898 * This field is reserved for future use. The responder should set it to
3899 * 0. The requester should ignore this field.
3901 uint32_t reserved2[4];
3904 * This field represents the name of RoCE FW (ASCII chars without NULL
3907 char roce_fw_name[16];
3909 /* This field returns the chip number. */
3912 /* This field returns the revision of chip. */
3915 /* This field returns the chip metal number. */
3918 /* This field returns the bond id of the chip. */
3919 uint8_t chip_bond_id;
3922 * This value indicates the type of platform used for chip
3926 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC \
3927 (UINT32_C(0x0) << 0)
3928 /* FPGA platform of the chip. */
3929 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA \
3930 (UINT32_C(0x1) << 0)
3931 /* Palladium platform of the chip. */
3932 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM \
3933 (UINT32_C(0x2) << 0)
3934 uint8_t chip_platform_type;
3937 * This field returns the maximum value of request window that is
3938 * supported by the HWRM. The request window is mapped into device
3939 * address space using MMIO.
3941 uint16_t max_req_win_len;
3944 * This field returns the maximum value of response buffer in bytes. If
3945 * a request specifies the response buffer length that is greater than
3946 * this value, then the HWRM should fail it. The value of this field
3947 * shall be 4KB or more.
3949 uint16_t max_resp_len;
3952 * This field returns the default request timeout value in milliseconds.
3954 uint16_t def_req_timeout;
3961 * This field is used in Output records to indicate that the output is
3962 * completely written to RAM. This field should be read as '1' to
3963 * indicate that the output has been completely written. When writing a
3964 * command completion or response to an internal processor, the order of
3965 * writes has to be such that this field is written last.
3968 } __attribute__((packed));
3970 /* hwrm_queue_qportcfg */
3972 * Description: This function is called by a driver to query queue configuration
3973 * of a port. # The HWRM shall at least advertise one queue with lossy service
3974 * profile. # The driver shall use this command to query queue ids before
3975 * configuring or using any queues. # If a service profile is not set for a
3976 * queue, then the driver shall not use that queue without configuring a service
3977 * profile for it. # If the driver is not allowed to configure service profiles,
3978 * then the driver shall only use queues for which service profiles are pre-
3982 /* Input (24 bytes) */
3983 struct hwrm_queue_qportcfg_input {
3985 * This value indicates what type of request this is. The format for the
3986 * rest of the command is determined by this field.
3991 * This value indicates the what completion ring the request will be
3992 * optionally completed on. If the value is -1, then no CR completion
3993 * will be generated. Any other value must be a valid CR ring_id value
3994 * for this function.
3998 /* This value indicates the command sequence number. */
4002 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4003 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4008 * This is the host address where the response will be written when the
4009 * request is complete. This area must be 16B aligned and must be
4010 * cleared to zero before the request is made.
4015 * Enumeration denoting the RX, TX type of the resource. This
4016 * enumeration is used for resources that are similar for both TX and RX
4017 * paths of the chip.
4019 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH \
4022 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX \
4023 (UINT32_C(0x0) << 0)
4025 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX \
4026 (UINT32_C(0x1) << 0)
4027 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
4028 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
4032 * Port ID of port for which the queue configuration is being queried.
4033 * This field is only required when sent by IPC.
4038 } __attribute__((packed));
4040 /* hwrm_ring_alloc */
4042 * Description: This command allocates and does basic preparation for a ring.
4045 /* Input (80 bytes) */
4046 struct hwrm_ring_alloc_input {
4048 * This value indicates what type of request this is. The format for the
4049 * rest of the command is determined by this field.
4054 * This value indicates the what completion ring the request will be
4055 * optionally completed on. If the value is -1, then no CR completion
4056 * will be generated. Any other value must be a valid CR ring_id value
4057 * for this function.
4061 /* This value indicates the command sequence number. */
4065 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4066 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4071 * This is the host address where the response will be written when the
4072 * request is complete. This area must be 16B aligned and must be
4073 * cleared to zero before the request is made.
4077 /* This bit must be '1' for the Reserved1 field to be configured. */
4078 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED1 UINT32_C(0x1)
4079 /* This bit must be '1' for the Reserved2 field to be configured. */
4080 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED2 UINT32_C(0x2)
4081 /* This bit must be '1' for the Reserved3 field to be configured. */
4082 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED3 UINT32_C(0x4)
4084 * This bit must be '1' for the stat_ctx_id_valid field to be
4087 #define HWRM_RING_ALLOC_INPUT_ENABLES_STAT_CTX_ID_VALID UINT32_C(0x8)
4088 /* This bit must be '1' for the Reserved4 field to be configured. */
4089 #define HWRM_RING_ALLOC_INPUT_ENABLES_RESERVED4 UINT32_C(0x10)
4090 /* This bit must be '1' for the max_bw_valid field to be configured. */
4091 #define HWRM_RING_ALLOC_INPUT_ENABLES_MAX_BW_VALID UINT32_C(0x20)
4095 /* Completion Ring (CR) */
4096 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_CMPL (UINT32_C(0x0) << 0)
4098 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_TX (UINT32_C(0x1) << 0)
4100 #define HWRM_RING_ALLOC_INPUT_RING_TYPE_RX (UINT32_C(0x2) << 0)
4106 /* This value is a pointer to the page table for the Ring. */
4107 uint64_t page_tbl_addr;
4109 /* First Byte Offset of the first entry in the first page. */
4113 * Actual page size in 2^page_size. The supported range is increments in
4114 * powers of 2 from 16 bytes to 1GB. - 4 = 16 B Page size is 16 B. - 12
4115 * = 4 KB Page size is 4 KB. - 13 = 8 KB Page size is 8 KB. - 16 = 64 KB
4116 * Page size is 64 KB. - 22 = 2 MB Page size is 2 MB. - 23 = 4 MB Page
4117 * size is 4 MB. - 31 = 1 GB Page size is 1 GB.
4122 * This value indicates the depth of page table. For this version of the
4123 * specification, value other than 0 or 1 shall be considered as an
4124 * invalid value. When the page_tbl_depth = 0, then it is treated as a
4125 * special case with the following. 1. FBO and page size fields are not
4126 * valid. 2. page_tbl_addr is the physical address of the first element
4129 uint8_t page_tbl_depth;
4135 * Number of 16B units in the ring. Minimum size for a ring is 16 16B
4141 * Logical ring number for the ring to be allocated. This value
4142 * determines the position in the doorbell area where the update to the
4143 * ring will be made. For completion rings, this value is also the MSI-X
4144 * vector number for the function the completion ring is associated
4147 uint16_t logical_id;
4150 * This field is used only when ring_type is a TX ring. This value
4151 * indicates what completion ring the TX ring is associated with.
4153 uint16_t cmpl_ring_id;
4156 * This field is used only when ring_type is a TX ring. This value
4157 * indicates what CoS queue the TX ring is associated with.
4164 /* This field is reserved for the future use. It shall be set to 0. */
4166 /* This field is reserved for the future use. It shall be set to 0. */
4171 /* This field is reserved for the future use. It shall be set to 0. */
4175 * This field is used only when ring_type is a TX ring. This input
4176 * indicates what statistics context this ring should be associated
4179 uint32_t stat_ctx_id;
4181 /* This field is reserved for the future use. It shall be set to 0. */
4185 * This field is used only when ring_type is a TX ring. Maximum BW
4186 * allocated to this TX ring in Mbps. The HWRM will translate this value
4187 * into byte counter and time interval used for this ring inside the
4193 * This field is used only when ring_type is a Completion ring. This
4194 * value indicates what interrupt mode should be used on this completion
4195 * ring. Note: In the legacy interrupt mode, no more than 16 completion
4196 * rings are allowed.
4199 #define HWRM_RING_ALLOC_INPUT_INT_MODE_LEGACY (UINT32_C(0x0) << 0)
4201 #define HWRM_RING_ALLOC_INPUT_INT_MODE_RSVD (UINT32_C(0x1) << 0)
4203 #define HWRM_RING_ALLOC_INPUT_INT_MODE_MSIX (UINT32_C(0x2) << 0)
4204 /* No Interrupt - Polled mode */
4205 #define HWRM_RING_ALLOC_INPUT_INT_MODE_POLL (UINT32_C(0x3) << 0)
4208 uint8_t unused_8[3];
4209 } __attribute__((packed));
4211 /* Output (16 bytes) */
4213 struct hwrm_ring_alloc_output {
4215 * Pass/Fail or error type Note: receiver to verify the in parameters,
4216 * and fail the call with an error when appropriate
4218 uint16_t error_code;
4220 /* This field returns the type of original request. */
4223 /* This field provides original sequence number of the command. */
4227 * This field is the length of the response in bytes. The last byte of
4228 * the response is a valid flag that will read as '1' when the command
4229 * has been completely written to memory.
4233 /* Physical number of ring allocated. */
4236 /* Logical number of ring allocated. */
4237 uint16_t logical_ring_id;
4244 * This field is used in Output records to indicate that the output is
4245 * completely written to RAM. This field should be read as '1' to
4246 * indicate that the output has been completely written. When writing a
4247 * command completion or response to an internal processor, the order of
4248 * writes has to be such that this field is written last.
4251 } __attribute__((packed));
4253 /* hwrm_ring_free */
4255 * Description: This command is used to free a ring and associated resources.
4257 /* Input (24 bytes) */
4259 struct hwrm_ring_free_input {
4261 * This value indicates what type of request this is. The format for the
4262 * rest of the command is determined by this field.
4267 * This value indicates the what completion ring the request will be
4268 * optionally completed on. If the value is -1, then no CR completion
4269 * will be generated. Any other value must be a valid CR ring_id value
4270 * for this function.
4274 /* This value indicates the command sequence number. */
4278 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4279 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4284 * This is the host address where the response will be written when the
4285 * request is complete. This area must be 16B aligned and must be
4286 * cleared to zero before the request is made.
4291 /* Completion Ring (CR) */
4292 #define HWRM_RING_FREE_INPUT_RING_TYPE_CMPL (UINT32_C(0x0) << 0)
4294 #define HWRM_RING_FREE_INPUT_RING_TYPE_TX (UINT32_C(0x1) << 0)
4296 #define HWRM_RING_FREE_INPUT_RING_TYPE_RX (UINT32_C(0x2) << 0)
4301 /* Physical number of ring allocated. */
4305 } __attribute__((packed));
4307 /* Output (16 bytes) */
4308 struct hwrm_ring_free_output {
4310 * Pass/Fail or error type Note: receiver to verify the in parameters,
4311 * and fail the call with an error when appropriate
4313 uint16_t error_code;
4315 /* This field returns the type of original request. */
4318 /* This field provides original sequence number of the command. */
4322 * This field is the length of the response in bytes. The last byte of
4323 * the response is a valid flag that will read as '1' when the command
4324 * has been completely written to memory.
4334 * This field is used in Output records to indicate that the output is
4335 * completely written to RAM. This field should be read as '1' to
4336 * indicate that the output has been completely written. When writing a
4337 * command completion or response to an internal processor, the order of
4338 * writes has to be such that this field is written last.
4341 } __attribute__((packed));
4343 /* hwrm_ring_grp_alloc */
4345 * Description: This API allocates and does basic preparation for a ring group.
4348 /* Input (24 bytes) */
4349 struct hwrm_ring_grp_alloc_input {
4351 * This value indicates what type of request this is. The format for the
4352 * rest of the command is determined by this field.
4357 * This value indicates the what completion ring the request will be
4358 * optionally completed on. If the value is -1, then no CR completion
4359 * will be generated. Any other value must be a valid CR ring_id value
4360 * for this function.
4364 /* This value indicates the command sequence number. */
4368 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4369 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4374 * This is the host address where the response will be written when the
4375 * request is complete. This area must be 16B aligned and must be
4376 * cleared to zero before the request is made.
4380 /* This value identifies the CR associated with the ring group. */
4383 /* This value identifies the main RR associated with the ring group. */
4387 * This value identifies the aggregation RR associated with the ring
4388 * group. If this value is 0xFF... (All Fs), then no Aggregation ring
4394 * This value identifies the statistics context associated with the ring
4398 } __attribute__((packed));
4400 /* Output (16 bytes) */
4401 struct hwrm_ring_grp_alloc_output {
4403 * Pass/Fail or error type Note: receiver to verify the in parameters,
4404 * and fail the call with an error when appropriate
4406 uint16_t error_code;
4408 /* This field returns the type of original request. */
4411 /* This field provides original sequence number of the command. */
4415 * This field is the length of the response in bytes. The last byte of
4416 * the response is a valid flag that will read as '1' when the command
4417 * has been completely written to memory.
4422 * This is the ring group ID value. Use this value to program the
4423 * default ring group for the VNIC or as table entries in an RSS/COS
4426 uint32_t ring_group_id;
4433 * This field is used in Output records to indicate that the output is
4434 * completely written to RAM. This field should be read as '1' to
4435 * indicate that the output has been completely written. When writing a
4436 * command completion or response to an internal processor, the order of
4437 * writes has to be such that this field is written last.
4440 } __attribute__((packed));
4442 /* hwrm_ring_grp_free */
4444 * Description: This API frees a ring group and associated resources. # If a
4445 * ring in the ring group is reset or free, then the associated rings in the
4446 * ring group shall also be reset/free using hwrm_ring_free. # A function driver
4447 * shall always use hwrm_ring_grp_free after freeing all rings in a group. # As
4448 * a part of executing this command, the HWRM shall reset all associated ring
4452 /* Input (24 bytes) */
4453 struct hwrm_ring_grp_free_input {
4455 * This value indicates what type of request this is. The format for the
4456 * rest of the command is determined by this field.
4461 * This value indicates the what completion ring the request will be
4462 * optionally completed on. If the value is -1, then no CR completion
4463 * will be generated. Any other value must be a valid CR ring_id value
4464 * for this function.
4468 /* This value indicates the command sequence number. */
4472 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4473 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4478 * This is the host address where the response will be written when the
4479 * request is complete. This area must be 16B aligned and must be
4480 * cleared to zero before the request is made.
4484 /* This is the ring group ID value. */
4485 uint32_t ring_group_id;
4488 } __attribute__((packed));
4490 /* Output (16 bytes) */
4491 struct hwrm_ring_grp_free_output {
4493 * Pass/Fail or error type Note: receiver to verify the in parameters,
4494 * and fail the call with an error when appropriate
4496 uint16_t error_code;
4498 /* This field returns the type of original request. */
4501 /* This field provides original sequence number of the command. */
4505 * This field is the length of the response in bytes. The last byte of
4506 * the response is a valid flag that will read as '1' when the command
4507 * has been completely written to memory.
4517 * This field is used in Output records to indicate that the output is
4518 * completely written to RAM. This field should be read as '1' to
4519 * indicate that the output has been completely written. When writing a
4520 * command completion or response to an internal processor, the order of
4521 * writes has to be such that this field is written last.
4524 } __attribute__((packed));
4526 /* hwrm_stat_ctx_alloc */
4528 * Description: This command allocates and does basic preparation for a stat
4532 /* Input (32 bytes) */
4533 struct hwrm_stat_ctx_alloc_input {
4535 * This value indicates what type of request this is. The format for the
4536 * rest of the command is determined by this field.
4541 * This value indicates the what completion ring the request will be
4542 * optionally completed on. If the value is -1, then no CR completion
4543 * will be generated. Any other value must be a valid CR ring_id value
4544 * for this function.
4548 /* This value indicates the command sequence number. */
4552 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4553 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4558 * This is the host address where the response will be written when the
4559 * request is complete. This area must be 16B aligned and must be
4560 * cleared to zero before the request is made.
4564 /* This is the address for statistic block. */
4565 uint64_t stats_dma_addr;
4568 * The statistic block update period in ms. e.g. 250ms, 500ms, 750ms,
4571 uint32_t update_period_ms;
4574 } __attribute__((packed));
4576 /* Output (16 bytes) */
4577 struct hwrm_stat_ctx_alloc_output {
4579 * Pass/Fail or error type Note: receiver to verify the in parameters,
4580 * and fail the call with an error when appropriate
4582 uint16_t error_code;
4584 /* This field returns the type of original request. */
4587 /* This field provides original sequence number of the command. */
4591 * This field is the length of the response in bytes. The last byte of
4592 * the response is a valid flag that will read as '1' when the command
4593 * has been completely written to memory.
4597 /* This is the statistics context ID value. */
4598 uint32_t stat_ctx_id;
4605 * This field is used in Output records to indicate that the output is
4606 * completely written to RAM. This field should be read as '1' to
4607 * indicate that the output has been completely written. When writing a
4608 * command completion or response to an internal processor, the order of
4609 * writes has to be such that this field is written last.
4612 } __attribute__((packed));
4614 /* hwrm_stat_ctx_clr_stats */
4615 /* Description: This command clears statistics of a context. */
4617 /* Input (24 bytes) */
4618 struct hwrm_stat_ctx_clr_stats_input {
4620 * This value indicates what type of request this is. The format for the
4621 * rest of the command is determined by this field.
4626 * This value indicates the what completion ring the request will be
4627 * optionally completed on. If the value is -1, then no CR completion
4628 * will be generated. Any other value must be a valid CR ring_id value
4629 * for this function.
4633 /* This value indicates the command sequence number. */
4637 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4638 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4643 * This is the host address where the response will be written when the
4644 * request is complete. This area must be 16B aligned and must be
4645 * cleared to zero before the request is made.
4649 /* ID of the statistics context that is being queried. */
4650 uint32_t stat_ctx_id;
4653 } __attribute__((packed));
4655 /* Output (16 bytes) */
4656 struct hwrm_stat_ctx_clr_stats_output {
4658 * Pass/Fail or error type Note: receiver to verify the in parameters,
4659 * and fail the call with an error when appropriate
4661 uint16_t error_code;
4663 /* This field returns the type of original request. */
4666 /* This field provides original sequence number of the command. */
4670 * This field is the length of the response in bytes. The last byte of
4671 * the response is a valid flag that will read as '1' when the command
4672 * has been completely written to memory.
4682 * This field is used in Output records to indicate that the output is
4683 * completely written to RAM. This field should be read as '1' to
4684 * indicate that the output has been completely written. When writing a
4685 * command completion or response to an internal processor, the order of
4686 * writes has to be such that this field is written last.
4689 } __attribute__((packed));
4691 /* hwrm_stat_ctx_free */
4692 /* Description: This command is used to free a stat context. */
4693 /* Input (24 bytes) */
4695 struct hwrm_stat_ctx_free_input {
4697 * This value indicates what type of request this is. The format for the
4698 * rest of the command is determined by this field.
4703 * This value indicates the what completion ring the request will be
4704 * optionally completed on. If the value is -1, then no CR completion
4705 * will be generated. Any other value must be a valid CR ring_id value
4706 * for this function.
4710 /* This value indicates the command sequence number. */
4714 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4715 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4720 * This is the host address where the response will be written when the
4721 * request is complete. This area must be 16B aligned and must be
4722 * cleared to zero before the request is made.
4726 /* ID of the statistics context that is being queried. */
4727 uint32_t stat_ctx_id;
4730 } __attribute__((packed));
4732 /* Output (16 bytes) */
4734 struct hwrm_stat_ctx_free_output {
4736 * Pass/Fail or error type Note: receiver to verify the in parameters,
4737 * and fail the call with an error when appropriate
4739 uint16_t error_code;
4741 /* This field returns the type of original request. */
4744 /* This field provides original sequence number of the command. */
4748 * This field is the length of the response in bytes. The last byte of
4749 * the response is a valid flag that will read as '1' when the command
4750 * has been completely written to memory.
4754 /* This is the statistics context ID value. */
4755 uint32_t stat_ctx_id;
4762 * This field is used in Output records to indicate that the output is
4763 * completely written to RAM. This field should be read as '1' to
4764 * indicate that the output has been completely written. When writing a
4765 * command completion or response to an internal processor, the order of
4766 * writes has to be such that this field is written last.
4769 } __attribute__((packed));
4771 /* hwrm_vnic_alloc */
4773 * Description: This VNIC is a resource in the RX side of the chip that is used
4774 * to represent a virtual host "interface". # At the time of VNIC allocation or
4775 * configuration, the function can specify whether it wants the requested VNIC
4776 * to be the default VNIC for the function or not. # If a function requests
4777 * allocation of a VNIC for the first time and a VNIC is successfully allocated
4778 * by the HWRM, then the HWRM shall make the allocated VNIC as the default VNIC
4779 * for that function. # The default VNIC shall be used for the default action
4780 * for a partition or function. # For each VNIC allocated on a function, a
4781 * mapping on the RX side to map the allocated VNIC to source virtual interface
4782 * shall be performed by the HWRM. This should be hidden to the function driver
4783 * requesting the VNIC allocation. This enables broadcast/multicast replication
4784 * with source knockout. # If multicast replication with source knockout is
4785 * enabled, then the internal VNIC to SVIF mapping data structures shall be
4786 * programmed at the time of VNIC allocation.
4789 /* Input (24 bytes) */
4790 struct hwrm_vnic_alloc_input {
4792 * This value indicates what type of request this is. The format for the
4793 * rest of the command is determined by this field.
4798 * This value indicates the what completion ring the request will be
4799 * optionally completed on. If the value is -1, then no CR completion
4800 * will be generated. Any other value must be a valid CR ring_id value
4801 * for this function.
4805 /* This value indicates the command sequence number. */
4809 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4810 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4815 * This is the host address where the response will be written when the
4816 * request is complete. This area must be 16B aligned and must be
4817 * cleared to zero before the request is made.
4822 * When this bit is '1', this VNIC is requested to be the default VNIC
4823 * for this function.
4825 #define HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT UINT32_C(0x1)
4829 } __attribute__((packed));
4831 /* Output (16 bytes) */
4832 struct hwrm_vnic_alloc_output {
4834 * Pass/Fail or error type Note: receiver to verify the in parameters,
4835 * and fail the call with an error when appropriate
4837 uint16_t error_code;
4839 /* This field returns the type of original request. */
4842 /* This field provides original sequence number of the command. */
4846 * This field is the length of the response in bytes. The last byte of
4847 * the response is a valid flag that will read as '1' when the command
4848 * has been completely written to memory.
4852 /* Logical vnic ID */
4860 * This field is used in Output records to indicate that the output is
4861 * completely written to RAM. This field should be read as '1' to
4862 * indicate that the output has been completely written. When writing a
4863 * command completion or response to an internal processor, the order of
4864 * writes has to be such that this field is written last.
4867 } __attribute__((packed));
4870 /* Description: Configure the RX VNIC structure. */
4872 /* Input (40 bytes) */
4873 struct hwrm_vnic_cfg_input {
4875 * This value indicates what type of request this is. The format for the
4876 * rest of the command is determined by this field.
4881 * This value indicates the what completion ring the request will be
4882 * optionally completed on. If the value is -1, then no CR completion
4883 * will be generated. Any other value must be a valid CR ring_id value
4884 * for this function.
4888 /* This value indicates the command sequence number. */
4892 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
4893 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
4898 * This is the host address where the response will be written when the
4899 * request is complete. This area must be 16B aligned and must be
4900 * cleared to zero before the request is made.
4905 * When this bit is '1', the VNIC is requested to be the default VNIC
4908 #define HWRM_VNIC_CFG_INPUT_FLAGS_DEFAULT UINT32_C(0x1)
4910 * When this bit is '1', the VNIC is being configured to strip VLAN in
4911 * the RX path. If set to '0', then VLAN stripping is disabled on this
4914 #define HWRM_VNIC_CFG_INPUT_FLAGS_VLAN_STRIP_MODE UINT32_C(0x2)
4916 * When this bit is '1', the VNIC is being configured to buffer receive
4917 * packets in the hardware until the host posts new receive buffers. If
4918 * set to '0', then bd_stall is being configured to be disabled on this
4921 #define HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE UINT32_C(0x4)
4923 * When this bit is '1', the VNIC is being configured to receive both
4924 * RoCE and non-RoCE traffic. If set to '0', then this VNIC is not
4925 * configured to be operating in dual VNIC mode.
4927 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_DUAL_VNIC_MODE UINT32_C(0x8)
4929 * When this flag is set to '1', the VNIC is requested to be configured
4930 * to receive only RoCE traffic. If this flag is set to '0', then this
4931 * flag shall be ignored by the HWRM. If roce_dual_vnic_mode flag is set
4932 * to '1', then the HWRM client shall not set this flag to '1'.
4934 #define HWRM_VNIC_CFG_INPUT_FLAGS_ROCE_ONLY_VNIC_MODE UINT32_C(0x10)
4937 /* This bit must be '1' for the dflt_ring_grp field to be configured. */
4938 #define HWRM_VNIC_CFG_INPUT_ENABLES_DFLT_RING_GRP UINT32_C(0x1)
4939 /* This bit must be '1' for the rss_rule field to be configured. */
4940 #define HWRM_VNIC_CFG_INPUT_ENABLES_RSS_RULE UINT32_C(0x2)
4941 /* This bit must be '1' for the cos_rule field to be configured. */
4942 #define HWRM_VNIC_CFG_INPUT_ENABLES_COS_RULE UINT32_C(0x4)
4943 /* This bit must be '1' for the lb_rule field to be configured. */
4944 #define HWRM_VNIC_CFG_INPUT_ENABLES_LB_RULE UINT32_C(0x8)
4945 /* This bit must be '1' for the mru field to be configured. */
4946 #define HWRM_VNIC_CFG_INPUT_ENABLES_MRU UINT32_C(0x10)
4949 /* Logical vnic ID */
4953 * Default Completion ring for the VNIC. This ring will be chosen if
4954 * packet does not match any RSS rules and if there is no COS rule.
4956 uint16_t dflt_ring_grp;
4959 * RSS ID for RSS rule/table structure. 0xFF... (All Fs) if there is no
4965 * RSS ID for COS rule/table structure. 0xFF... (All Fs) if there is no
4971 * RSS ID for load balancing rule/table structure. 0xFF... (All Fs) if
4972 * there is no LB rule.
4977 * The maximum receive unit of the vnic. Each vnic is associated with a
4978 * function. The vnic mru value overwrites the mru setting of the
4979 * associated function. The HWRM shall make sure that vnic mru does not
4980 * exceed the mru of the port the function is associated with.
4985 } __attribute__((packed));
4987 /* Output (16 bytes) */
4988 struct hwrm_vnic_cfg_output {
4990 * Pass/Fail or error type Note: receiver to verify the in parameters,
4991 * and fail the call with an error when appropriate
4993 uint16_t error_code;
4995 /* This field returns the type of original request. */
4998 /* This field provides original sequence number of the command. */
5002 * This field is the length of the response in bytes. The last byte of
5003 * the response is a valid flag that will read as '1' when the command
5004 * has been completely written to memory.
5014 * This field is used in Output records to indicate that the output is
5015 * completely written to RAM. This field should be read as '1' to
5016 * indicate that the output has been completely written. When writing a
5017 * command completion or response to an internal processor, the order of
5018 * writes has to be such that this field is written last.
5021 } __attribute__((packed));
5023 /* hwrm_vnic_free */
5025 * Description: Free a VNIC resource. Idle any resources associated with the
5026 * VNIC as well as the VNIC. Reset and release all resources associated with the
5030 /* Input (24 bytes) */
5031 struct hwrm_vnic_free_input {
5033 * This value indicates what type of request this is. The format for the
5034 * rest of the command is determined by this field.
5039 * This value indicates the what completion ring the request will be
5040 * optionally completed on. If the value is -1, then no CR completion
5041 * will be generated. Any other value must be a valid CR ring_id value
5042 * for this function.
5046 /* This value indicates the command sequence number. */
5050 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5051 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5056 * This is the host address where the response will be written when the
5057 * request is complete. This area must be 16B aligned and must be
5058 * cleared to zero before the request is made.
5062 /* Logical vnic ID */
5066 } __attribute__((packed));
5068 /* Output (16 bytes) */
5069 struct hwrm_vnic_free_output {
5071 * Pass/Fail or error type Note: receiver to verify the in parameters,
5072 * and fail the call with an error when appropriate
5074 uint16_t error_code;
5076 /* This field returns the type of original request. */
5079 /* This field provides original sequence number of the command. */
5083 * This field is the length of the response in bytes. The last byte of
5084 * the response is a valid flag that will read as '1' when the command
5085 * has been completely written to memory.
5095 * This field is used in Output records to indicate that the output is
5096 * completely written to RAM. This field should be read as '1' to
5097 * indicate that the output has been completely written. When writing a
5098 * command completion or response to an internal processor, the order of
5099 * writes has to be such that this field is written last.
5102 } __attribute__((packed));
5104 /* hwrm_vnic_rss_cfg */
5105 /* Description: This function is used to enable RSS configuration. */
5107 /* Input (48 bytes) */
5108 struct hwrm_vnic_rss_cfg_input {
5110 * This value indicates what type of request this is. The format for the
5111 * rest of the command is determined by this field.
5116 * This value indicates the what completion ring the request will be
5117 * optionally completed on. If the value is -1, then no CR completion
5118 * will be generated. Any other value must be a valid CR ring_id value
5119 * for this function.
5123 /* This value indicates the command sequence number. */
5127 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5128 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5133 * This is the host address where the response will be written when the
5134 * request is complete. This area must be 16B aligned and must be
5135 * cleared to zero before the request is made.
5140 * When this bit is '1', the RSS hash shall be computed over source and
5141 * destination IPv4 addresses of IPv4 packets.
5143 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4 UINT32_C(0x1)
5145 * When this bit is '1', the RSS hash shall be computed over
5146 * source/destination IPv4 addresses and source/destination ports of
5149 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2)
5151 * When this bit is '1', the RSS hash shall be computed over
5152 * source/destination IPv4 addresses and source/destination ports of
5155 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4)
5157 * When this bit is '1', the RSS hash shall be computed over source and
5158 * destination IPv4 addresses of IPv6 packets.
5160 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6 UINT32_C(0x8)
5162 * When this bit is '1', the RSS hash shall be computed over
5163 * source/destination IPv6 addresses and source/destination ports of
5166 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10)
5168 * When this bit is '1', the RSS hash shall be computed over
5169 * source/destination IPv6 addresses and source/destination ports of
5172 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20)
5177 /* This is the address for rss ring group table */
5178 uint64_t ring_grp_tbl_addr;
5180 /* This is the address for rss hash key table */
5181 uint64_t hash_key_tbl_addr;
5183 /* Index to the rss indirection table. */
5184 uint16_t rss_ctx_idx;
5186 uint16_t unused_1[3];
5187 } __attribute__((packed));
5189 /* Output (16 bytes) */
5190 struct hwrm_vnic_rss_cfg_output {
5192 * Pass/Fail or error type Note: receiver to verify the in parameters,
5193 * and fail the call with an error when appropriate
5195 uint16_t error_code;
5197 /* This field returns the type of original request. */
5200 /* This field provides original sequence number of the command. */
5204 * This field is the length of the response in bytes. The last byte of
5205 * the response is a valid flag that will read as '1' when the command
5206 * has been completely written to memory.
5216 * This field is used in Output records to indicate that the output is
5217 * completely written to RAM. This field should be read as '1' to
5218 * indicate that the output has been completely written. When writing a
5219 * command completion or response to an internal processor, the order of
5220 * writes has to be such that this field is written last.
5223 } __attribute__((packed));
5225 /* Input (16 bytes) */
5226 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
5228 * This value indicates what type of request this is. The format for the
5229 * rest of the command is determined by this field.
5234 * This value indicates the what completion ring the request will be
5235 * optionally completed on. If the value is -1, then no CR completion
5236 * will be generated. Any other value must be a valid CR ring_id value
5237 * for this function.
5241 /* This value indicates the command sequence number. */
5245 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5246 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5251 * This is the host address where the response will be written when the
5252 * request is complete. This area must be 16B aligned and must be
5253 * cleared to zero before the request is made.
5256 } __attribute__((packed));
5258 /* Output (16 bytes) */
5260 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
5262 * Pass/Fail or error type Note: receiver to verify the in parameters,
5263 * and fail the call with an error when appropriate
5265 uint16_t error_code;
5267 /* This field returns the type of original request. */
5270 /* This field provides original sequence number of the command. */
5274 * This field is the length of the response in bytes. The last byte of
5275 * the response is a valid flag that will read as '1' when the command
5276 * has been completely written to memory.
5280 /* rss_cos_lb_ctx_id is 16 b */
5281 uint16_t rss_cos_lb_ctx_id;
5290 * This field is used in Output records to indicate that the output is
5291 * completely written to RAM. This field should be read as '1' to
5292 * indicate that the output has been completely written. When writing a
5293 * command completion or response to an internal processor, the order of
5294 * writes has to be such that this field is written last.
5297 } __attribute__((packed));
5299 /* hwrm_vnic_rss_cos_lb_ctx_free */
5300 /* Description: This function can be used to free COS/Load Balance context. */
5301 /* Input (24 bytes) */
5303 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
5305 * This value indicates what type of request this is. The format for the
5306 * rest of the command is determined by this field.
5311 * This value indicates the what completion ring the request will be
5312 * optionally completed on. If the value is -1, then no CR completion
5313 * will be generated. Any other value must be a valid CR ring_id value
5314 * for this function.
5318 /* This value indicates the command sequence number. */
5322 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5323 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5328 * This is the host address where the response will be written when the
5329 * request is complete. This area must be 16B aligned and must be
5330 * cleared to zero before the request is made.
5334 /* rss_cos_lb_ctx_id is 16 b */
5335 uint16_t rss_cos_lb_ctx_id;
5337 uint16_t unused_0[3];
5338 } __attribute__((packed));
5340 /* Output (16 bytes) */
5341 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
5343 * Pass/Fail or error type Note: receiver to verify the in parameters,
5344 * and fail the call with an error when appropriate
5346 uint16_t error_code;
5348 /* This field returns the type of original request. */
5351 /* This field provides original sequence number of the command. */
5355 * This field is the length of the response in bytes. The last byte of
5356 * the response is a valid flag that will read as '1' when the command
5357 * has been completely written to memory.
5367 * This field is used in Output records to indicate that the output is
5368 * completely written to RAM. This field should be read as '1' to
5369 * indicate that the output has been completely written. When writing a
5370 * command completion or response to an internal processor, the order of
5371 * writes has to be such that this field is written last.
5374 } __attribute__((packed));
5376 /* Output (32 bytes) */
5377 struct hwrm_queue_qportcfg_output {
5379 * Pass/Fail or error type Note: receiver to verify the in parameters,
5380 * and fail the call with an error when appropriate
5382 uint16_t error_code;
5384 /* This field returns the type of original request. */
5387 /* This field provides original sequence number of the command. */
5391 * This field is the length of the response in bytes. The last byte of
5392 * the response is a valid flag that will read as '1' when the command
5393 * has been completely written to memory.
5397 /* The maximum number of queues that can be configured. */
5398 uint8_t max_configurable_queues;
5400 /* The maximum number of lossless queues that can be configured. */
5401 uint8_t max_configurable_lossless_queues;
5404 * 0 - Not allowed. Non-zero - Allowed. If this value is non-zero, then
5405 * the HWRM shall allow the host SW driver to configure queues using
5408 uint8_t queue_cfg_allowed;
5411 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
5412 * the HWRM shall allow the host SW driver to configure queue buffers
5413 * using hwrm_queue_buffers_cfg.
5415 uint8_t queue_buffers_cfg_allowed;
5418 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
5419 * the HWRM shall allow the host SW driver to configure PFC using
5420 * hwrm_queue_pfcenable_cfg.
5422 uint8_t queue_pfcenable_cfg_allowed;
5425 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
5426 * the HWRM shall allow the host SW driver to configure Priority to CoS
5427 * mapping using hwrm_queue_pri2cos_cfg.
5429 uint8_t queue_pri2cos_cfg_allowed;
5432 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
5433 * the HWRM shall allow the host SW driver to configure CoS Bandwidth
5434 * configuration using hwrm_queue_cos2bw_cfg.
5436 uint8_t queue_cos2bw_cfg_allowed;
5438 /* ID of CoS Queue 0. FF - Invalid id */
5441 /* This value is applicable to CoS queues only. */
5442 /* Lossy (best-effort) */
5443 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
5444 (UINT32_C(0x0) << 0)
5446 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
5447 (UINT32_C(0x1) << 0)
5449 * Set to 0xFF... (All Fs) if there is no service profile
5452 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
5453 (UINT32_C(0xff) << 0)
5454 uint8_t queue_id0_service_profile;
5456 /* ID of CoS Queue 1. FF - Invalid id */
5458 /* This value is applicable to CoS queues only. */
5459 /* Lossy (best-effort) */
5460 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
5461 (UINT32_C(0x0) << 0)
5463 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
5464 (UINT32_C(0x1) << 0)
5466 * Set to 0xFF... (All Fs) if there is no service profile
5469 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
5470 (UINT32_C(0xff) << 0)
5471 uint8_t queue_id1_service_profile;
5473 /* ID of CoS Queue 2. FF - Invalid id */
5475 /* This value is applicable to CoS queues only. */
5476 /* Lossy (best-effort) */
5477 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
5478 (UINT32_C(0x0) << 0)
5480 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
5481 (UINT32_C(0x1) << 0)
5483 * Set to 0xFF... (All Fs) if there is no service profile
5486 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
5487 (UINT32_C(0xff) << 0)
5488 uint8_t queue_id2_service_profile;
5490 /* ID of CoS Queue 3. FF - Invalid id */
5493 /* This value is applicable to CoS queues only. */
5494 /* Lossy (best-effort) */
5495 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
5496 (UINT32_C(0x0) << 0)
5498 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
5499 (UINT32_C(0x1) << 0)
5501 * Set to 0xFF... (All Fs) if there is no service profile
5504 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
5505 (UINT32_C(0xff) << 0)
5506 uint8_t queue_id3_service_profile;
5508 /* ID of CoS Queue 4. FF - Invalid id */
5510 /* This value is applicable to CoS queues only. */
5511 /* Lossy (best-effort) */
5512 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
5513 (UINT32_C(0x0) << 0)
5515 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
5516 (UINT32_C(0x1) << 0)
5518 * Set to 0xFF... (All Fs) if there is no service profile
5521 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
5522 (UINT32_C(0xff) << 0)
5523 uint8_t queue_id4_service_profile;
5525 /* ID of CoS Queue 5. FF - Invalid id */
5528 /* This value is applicable to CoS queues only. */
5529 /* Lossy (best-effort) */
5530 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
5531 (UINT32_C(0x0) << 0)
5533 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
5534 (UINT32_C(0x1) << 0)
5536 * Set to 0xFF... (All Fs) if there is no service profile
5539 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
5540 (UINT32_C(0xff) << 0)
5541 uint8_t queue_id5_service_profile;
5543 /* ID of CoS Queue 6. FF - Invalid id */
5544 uint8_t queue_id6_service_profile;
5545 /* This value is applicable to CoS queues only. */
5546 /* Lossy (best-effort) */
5547 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
5548 (UINT32_C(0x0) << 0)
5550 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
5551 (UINT32_C(0x1) << 0)
5553 * Set to 0xFF... (All Fs) if there is no service profile
5556 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
5557 (UINT32_C(0xff) << 0)
5560 /* ID of CoS Queue 7. FF - Invalid id */
5563 /* This value is applicable to CoS queues only. */
5564 /* Lossy (best-effort) */
5565 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
5566 (UINT32_C(0x0) << 0)
5568 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
5569 (UINT32_C(0x1) << 0)
5571 * Set to 0xFF... (All Fs) if there is no service profile
5574 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
5575 (UINT32_C(0xff) << 0)
5576 uint8_t queue_id7_service_profile;
5579 * This field is used in Output records to indicate that the output is
5580 * completely written to RAM. This field should be read as '1' to
5581 * indicate that the output has been completely written. When writing a
5582 * command completion or response to an internal processor, the order of
5583 * writes has to be such that this field is written last.
5586 } __attribute__((packed));
5588 /* hwrm_func_drv_rgtr */
5590 * Description: This command is used by the function driver to register its
5591 * information with the HWRM. A function driver shall implement this command. A
5592 * function driver shall use this command during the driver initialization right
5593 * after the HWRM version discovery and default ring resources allocation.
5596 /* Input (80 bytes) */
5597 struct hwrm_func_drv_rgtr_input {
5599 * This value indicates what type of request this is. The format for the
5600 * rest of the command is determined by this field.
5605 * This value indicates the what completion ring the request will be
5606 * optionally completed on. If the value is -1, then no CR completion
5607 * will be generated. Any other value must be a valid CR ring_id value
5608 * for this function.
5612 /* This value indicates the command sequence number. */
5616 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5617 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5622 * This is the host address where the response will be written when the
5623 * request is complete. This area must be 16B aligned and must be
5624 * cleared to zero before the request is made.
5629 * When this bit is '1', the function driver is requesting all requests
5630 * from its children VF drivers to be forwarded to itself. This flag can
5631 * only be set by the PF driver. If a VF driver sets this flag, it
5632 * should be ignored by the HWRM.
5634 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
5636 * When this bit is '1', the function is requesting none of the requests
5637 * from its children VF drivers to be forwarded to itself. This flag can
5638 * only be set by the PF driver. If a VF driver sets this flag, it
5639 * should be ignored by the HWRM.
5641 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
5644 /* This bit must be '1' for the os_type field to be configured. */
5645 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
5646 /* This bit must be '1' for the ver field to be configured. */
5647 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
5648 /* This bit must be '1' for the timestamp field to be configured. */
5649 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
5650 /* This bit must be '1' for the vf_req_fwd field to be configured. */
5651 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD UINT32_C(0x8)
5653 * This bit must be '1' for the async_event_fwd field to be configured.
5655 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
5659 /* This value indicates the type of OS. */
5661 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN \
5662 (UINT32_C(0x0) << 0)
5663 /* Other OS not listed below. */
5664 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER \
5665 (UINT32_C(0x1) << 0)
5667 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS \
5668 (UINT32_C(0xe) << 0)
5670 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS \
5671 (UINT32_C(0x12) << 0)
5673 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS \
5674 (UINT32_C(0x1d) << 0)
5676 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX \
5677 (UINT32_C(0x24) << 0)
5679 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD \
5680 (UINT32_C(0x2a) << 0)
5681 /* VMware ESXi OS. */
5682 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI \
5683 (UINT32_C(0x68) << 0)
5684 /* Microsoft Windows 8 64-bit OS. */
5685 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 \
5686 (UINT32_C(0x73) << 0)
5687 /* Microsoft Windows Server 2012 R2 OS. */
5688 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 \
5689 (UINT32_C(0x74) << 0)
5692 /* This is the major version of the driver. */
5695 /* This is the minor version of the driver. */
5698 /* This is the update version of the driver. */
5705 * This is a 32-bit timestamp provided by the driver for keep alive. The
5706 * timestamp is in multiples of 1ms.
5713 * This is a 256-bit bit mask provided by the PF driver for letting the
5714 * HWRM know what commands issued by the VF driver to the HWRM should be
5715 * forwarded to the PF driver. Nth bit refers to the Nth req_type.
5716 * Setting Nth bit to 1 indicates that requests from the VF driver with
5717 * req_type equal to N shall be forwarded to the parent PF driver. This
5718 * field is not valid for the VF driver.
5720 uint32_t vf_req_fwd[8];
5723 * This is a 256-bit bit mask provided by the function driver (PF or VF
5724 * driver) to indicate the list of asynchronous event completions to be
5725 * forwarded. Nth bit refers to the Nth event_id. Setting Nth bit to 1
5726 * by the function driver shall result in the HWRM forwarding
5727 * asynchronous event completion with event_id equal to N. If all bits
5728 * are set to 0 (value of 0), then the HWRM shall not forward any
5729 * asynchronous event completion to this function driver.
5731 uint32_t async_event_fwd[8];
5732 } __attribute__((packed));
5734 /* Output (16 bytes) */
5736 struct hwrm_func_drv_rgtr_output {
5738 * Pass/Fail or error type Note: receiver to verify the in parameters,
5739 * and fail the call with an error when appropriate
5741 uint16_t error_code;
5743 /* This field returns the type of original request. */
5746 /* This field provides original sequence number of the command. */
5750 * This field is the length of the response in bytes. The last byte of
5751 * the response is a valid flag that will read as '1' when the command
5752 * has been completely written to memory.
5762 * This field is used in Output records to indicate that the output is
5763 * completely written to RAM. This field should be read as '1' to
5764 * indicate that the output has been completely written. When writing a
5765 * command completion or response to an internal processor, the order of
5766 * writes has to be such that this field is written last.
5769 } __attribute__((packed));
5771 /* hwrm_func_drv_unrgtr */
5773 * Description: This command is used by the function driver to un register with
5774 * the HWRM. A function driver shall implement this command. A function driver
5775 * shall use this command during the driver unloading.
5777 /* Input (24 bytes) */
5779 struct hwrm_func_drv_unrgtr_input {
5781 * This value indicates what type of request this is. The format for the
5782 * rest of the command is determined by this field.
5787 * This value indicates the what completion ring the request will be
5788 * optionally completed on. If the value is -1, then no CR completion
5789 * will be generated. Any other value must be a valid CR ring_id value
5790 * for this function.
5794 /* This value indicates the command sequence number. */
5798 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5799 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5804 * This is the host address where the response will be written when the
5805 * request is complete. This area must be 16B aligned and must be
5806 * cleared to zero before the request is made.
5811 * When this bit is '1', the function driver is notifying the HWRM to
5812 * prepare for the shutdown.
5814 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
5819 } __attribute__((packed));
5821 /* Output (16 bytes) */
5822 struct hwrm_func_drv_unrgtr_output {
5824 * Pass/Fail or error type Note: receiver to verify the in parameters,
5825 * and fail the call with an error when appropriate
5827 uint16_t error_code;
5829 /* This field returns the type of original request. */
5832 /* This field provides original sequence number of the command. */
5836 * This field is the length of the response in bytes. The last byte of
5837 * the response is a valid flag that will read as '1' when the command
5838 * has been completely written to memory.
5848 * This field is used in Output records to indicate that the output is
5849 * completely written to RAM. This field should be read as '1' to
5850 * indicate that the output has been completely written. When writing a
5851 * command completion or response to an internal processor, the order of
5852 * writes has to be such that this field is written last.
5855 } __attribute__((packed));
5857 /* hwrm_func_qcfg */
5859 * Description: This command returns the current configuration of a function.
5860 * The input FID value is used to indicate what function is being queried. This
5861 * allows a physical function driver to query virtual functions that are
5862 * children of the physical function. The output FID value is needed to
5863 * configure Rings and MSI-X vectors so their DMA operations appear correctly on
5866 /* Input (24 bytes) */
5867 struct hwrm_func_qcfg_input {
5869 * This value indicates what type of request this is. The format for the
5870 * rest of the command is determined by this field.
5874 * This value indicates the what completion ring the request will be
5875 * optionally completed on. If the value is -1, then no CR completion
5876 * will be generated. Any other value must be a valid CR ring_id value
5877 * for this function.
5880 /* This value indicates the command sequence number. */
5883 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
5884 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
5888 * This is the host address where the response will be written when the
5889 * request is complete. This area must be 16B aligned and must be
5890 * cleared to zero before the request is made.
5894 * Function ID of the function that is being queried. 0xFF... (All Fs)
5895 * if the query is for the requesting function.
5899 uint16_t unused_0[3];
5900 } __attribute__((packed));
5902 /* Output (72 bytes) */
5903 struct hwrm_func_qcfg_output {
5905 * Pass/Fail or error type Note: receiver to verify the in parameters,
5906 * and fail the call with an error when appropriate
5908 uint16_t error_code;
5909 /* This field returns the type of original request. */
5911 /* This field provides original sequence number of the command. */
5914 * This field is the length of the response in bytes. The last byte of
5915 * the response is a valid flag that will read as '1' when the command
5916 * has been completely written to memory.
5920 * FID value. This value is used to identify operations on the PCI bus
5921 * as belonging to a particular PCI function.
5925 * Port ID of port that this function is associated with. 0xFF... (All
5926 * Fs) if this function is not associated with any port.
5930 * This value is the current VLAN setting for this function. The value
5931 * of 0 for this field indicates no priority tagging or VLAN is used.
5932 * This VLAN is in 802.1Q tag format.
5940 * This value is current MAC address configured for this function. A
5941 * value of 00-00-00-00-00-00 indicates no MAC address is currently
5944 uint8_t mac_address[6];
5947 * This value is current PCI ID of this function. If ARI is enabled,
5948 * then it is Bus Number (8b):Function Number(8b). Otherwise, it is Bus
5949 * Number (8b):Device Number (4b):Function Number(4b).
5952 /* The number of RSS/COS contexts currently allocated to the function. */
5953 uint16_t alloc_rsscos_ctx;
5955 * The number of completion rings currently allocated to the function.
5956 * This does not include the rings allocated to any children functions
5959 uint16_t alloc_cmpl_rings;
5961 * The number of transmit rings currently allocated to the function.
5962 * This does not include the rings allocated to any children functions
5965 uint16_t alloc_tx_rings;
5967 * The number of receive rings currently allocated to the function. This
5968 * does not include the rings allocated to any children functions if
5971 uint16_t alloc_rx_rings;
5972 /* The allocated number of L2 contexts to the function. */
5973 uint16_t alloc_l2_ctx;
5974 /* The allocated number of vnics to the function. */
5975 uint16_t alloc_vnics;
5977 * The maximum transmission unit of the function. For rings allocated on
5978 * this function, this default value is used if ring MTU is not
5983 * The maximum receive unit of the function. For vnics allocated on this
5984 * function, this default value is used if vnic MRU is not specified.
5987 /* The statistics context assigned to a function. */
5988 uint16_t stat_ctx_id;
5990 * The HWRM shall return Unknown value for this field when this command
5991 * is used to query VF's configuration.
5993 /* Single physical function */
5994 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_SPF \
5995 (UINT32_C(0x0) << 0)
5996 /* Multiple physical functions */
5997 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_MPFS \
5998 (UINT32_C(0x1) << 0)
5999 /* Network Partitioning 1.0 */
6000 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_0 \
6001 (UINT32_C(0x2) << 0)
6002 /* Network Partitioning 1.5 */
6003 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5 \
6004 (UINT32_C(0x3) << 0)
6005 /* Network Partitioning 2.0 */
6006 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0 \
6007 (UINT32_C(0x4) << 0)
6009 #define HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_UNKNOWN \
6010 (UINT32_C(0xff) << 0)
6011 uint8_t port_partition_type;
6014 /* The default VNIC ID assigned to a function that is being queried. */
6015 uint16_t dflt_vnic_id;
6020 * Minimum BW allocated for this function in Mbps. The HWRM will
6021 * translate this value into byte counter and time interval used for the
6022 * scheduler inside the device. A value of 0 indicates the minimum
6023 * bandwidth is not configured.
6027 * Maximum BW allocated for this function in Mbps. The HWRM will
6028 * translate this value into byte counter and time interval used for the
6029 * scheduler inside the device. A value of 0 indicates that the maximum
6030 * bandwidth is not configured.
6034 * This value indicates the Edge virtual bridge mode for the domain that
6035 * this function belongs to.
6037 /* No Edge Virtual Bridging (EVB) */
6038 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_NO_EVB (UINT32_C(0x0) << 0)
6039 /* Virtual Ethernet Bridge (VEB) */
6040 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEB (UINT32_C(0x1) << 0)
6041 /* Virtual Ethernet Port Aggregator (VEPA) */
6042 #define HWRM_FUNC_QCFG_OUTPUT_EVB_MODE_VEPA (UINT32_C(0x2) << 0)
6048 * The number of allocated multicast filters for this function on the RX
6051 uint32_t alloc_mcast_filters;
6052 /* The number of allocated HW ring groups for this function. */
6053 uint32_t alloc_hw_ring_grps;
6059 * This field is used in Output records to indicate that the output is
6060 * completely written to RAM. This field should be read as '1' to
6061 * indicate that the output has been completely written. When writing a
6062 * command completion or response to an internal processor, the order of
6063 * writes has to be such that this field is written last.
6066 } __attribute__((packed));