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;
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;
56 uint64_t tx_ucast_bytes;
57 uint64_t tx_mcast_bytes;
58 uint64_t tx_bcast_bytes;
66 /* HW Resource Manager Specification 1.2.0 */
67 #define HWRM_VERSION_MAJOR 1
68 #define HWRM_VERSION_MINOR 2
69 #define HWRM_VERSION_UPDATE 0
72 * Following is the signature for HWRM message field that indicates not
73 * applicable (All F's). Need to cast it the size of the field if needed.
75 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
76 #define HWRM_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */
77 #define HWRM_MAX_RESP_LEN (176) /* hwrm_func_qstats */
78 #define HW_HASH_INDEX_SIZE 0x80 /* 7 bit indirection table index. */
79 #define HW_HASH_KEY_SIZE 40
80 #define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */
85 #define HWRM_VER_GET (UINT32_C(0x0))
86 #define HWRM_FUNC_QCAPS (UINT32_C(0x15))
87 #define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))
88 #define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))
89 #define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
90 #define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30))
91 #define HWRM_CFA_L2_FILTER_ALLOC (UINT32_C(0x90))
92 #define HWRM_CFA_L2_FILTER_FREE (UINT32_C(0x91))
93 #define HWRM_CFA_L2_FILTER_CFG (UINT32_C(0x92))
94 #define HWRM_CFA_L2_SET_RX_MASK (UINT32_C(0x93))
95 #define HWRM_STAT_CTX_CLR_STATS (UINT32_C(0xb3))
96 #define HWRM_EXEC_FWD_RESP (UINT32_C(0xd0))
99 #define HWRM_ERR_CODE_INVALID_PARAMS (UINT32_C(0x2))
100 #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED (UINT32_C(0x3))
102 /* HWRM Forwarded Request (16 bytes) */
103 struct hwrm_fwd_req_cmpl {
104 /* Length of forwarded request in bytes. */
106 * This field indicates the exact type of the completion. By convention,
107 * the LSB identifies the length of the record in 16B units. Even values
108 * indicate 16B records. Odd values indicate 32B records.
110 #define HWRM_FWD_REQ_CMPL_TYPE_MASK UINT32_C(0x3f)
111 #define HWRM_FWD_REQ_CMPL_TYPE_SFT 0
112 /* Forwarded HWRM Request */
113 #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ (UINT32_C(0x22) << 0)
114 /* Length of forwarded request in bytes. */
115 #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK UINT32_C(0xffc0)
116 #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT 6
117 uint16_t req_len_type;
120 * Source ID of this request. Typically used in forwarding requests and
121 * responses. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 - 0xFFFE -
122 * Reserved for internal processors 0xFFFF - HWRM
128 /* Address of forwarded request. */
130 * This value is written by the NIC such that it will be different for
131 * each pass through the completion queue. The even passes will write 1.
132 * The odd passes will write 0.
134 #define HWRM_FWD_REQ_CMPL_V UINT32_C(0x1)
135 /* Address of forwarded request. */
136 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
137 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
138 uint64_t req_buf_addr_v;
139 } __attribute__((packed));
141 /* HWRM Asynchronous Event Completion Record (16 bytes) */
142 struct hwrm_async_event_cmpl {
144 * This field indicates the exact type of the completion. By convention,
145 * the LSB identifies the length of the record in 16B units. Even values
146 * indicate 16B records. Odd values indicate 32B records.
148 #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK UINT32_C(0x3f)
149 #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT 0
150 /* HWRM Asynchronous Event Information */
151 #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT \
152 (UINT32_C(0x2e) << 0)
155 /* Identifiers of events. */
156 /* Link status changed */
157 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \
159 /* Link MTU changed */
160 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \
162 /* Link speed changed */
163 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \
165 /* DCB Configuration changed */
166 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \
168 /* Port connection not allowed */
169 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \
171 /* Link speed configuration was not allowed */
172 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
174 /* Function driver unloaded */
175 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \
176 (UINT32_C(0x10) << 0)
177 /* Function driver loaded */
178 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \
179 (UINT32_C(0x11) << 0)
180 /* PF driver unloaded */
181 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \
182 (UINT32_C(0x20) << 0)
183 /* PF driver loaded */
184 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \
185 (UINT32_C(0x21) << 0)
186 /* VF Function Level Reset (FLR) */
187 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR (UINT32_C(0x30) << 0)
188 /* VF MAC Address Change */
189 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \
190 (UINT32_C(0x31) << 0)
191 /* PF-VF communication channel status change. */
192 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
193 (UINT32_C(0x32) << 0)
195 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \
196 (UINT32_C(0xff) << 0)
199 /* Event specific data */
200 uint32_t event_data2;
204 * This value is written by the NIC such that it will be different for
205 * each pass through the completion queue. The even passes will write 1.
206 * The odd passes will write 0.
208 #define HWRM_ASYNC_EVENT_CMPL_V UINT32_C(0x1)
210 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
211 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
214 /* 8-lsb timestamp from POR (100-msec resolution) */
215 uint8_t timestamp_lo;
217 /* 16-lsb timestamp from POR (100-msec resolution) */
218 uint16_t timestamp_hi;
220 /* Event specific data */
221 uint32_t event_data1;
222 } __attribute__((packed));
225 * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
226 * inside the chip. The HWRM is implemented in firmware, and runs on embedded
227 * processors inside the chip. This firmware is vital part of the chip's
228 * hardware. The chip can not be used by driver without it.
231 /* Input (16 bytes) */
234 * This value indicates what type of request this is. The format for the
235 * rest of the command is determined by this field.
240 * This value indicates the what completion ring the request will be
241 * optionally completed on. If the value is -1, then no CR completion
242 * will be generated. Any other value must be a valid CR ring_id value
247 /* This value indicates the command sequence number. */
251 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
252 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
257 * This is the host address where the response will be written when the
258 * request is complete. This area must be 16B aligned and must be
259 * cleared to zero before the request is made.
262 } __attribute__((packed));
264 /* Output (8 bytes) */
267 * Pass/Fail or error type Note: receiver to verify the in parameters,
268 * and fail the call with an error when appropriate
272 /* This field returns the type of original request. */
275 /* This field provides original sequence number of the command. */
279 * This field is the length of the response in bytes. The last byte of
280 * the response is a valid flag that will read as '1' when the command
281 * has been completely written to memory.
284 } __attribute__((packed));
286 /* hwrm_cfa_l2_filter_alloc */
288 * A filter is used to identify traffic that contains a matching set of
289 * parameters like unicast or broadcast MAC address or a VLAN tag amongst
290 * other things which then allows the ASIC to direct the incoming traffic
291 * to an appropriate VNIC or Rx ring.
294 /* Input (96 bytes) */
295 struct hwrm_cfa_l2_filter_alloc_input {
297 * This value indicates what type of request this is. The format for the
298 * rest of the command is determined by this field.
303 * This value indicates the what completion ring the request will be
304 * optionally completed on. If the value is -1, then no CR completion
305 * will be generated. Any other value must be a valid CR ring_id value
310 /* This value indicates the command sequence number. */
314 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
315 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
320 * This is the host address where the response will be written when the
321 * request is complete. This area must be 16B aligned and must be
322 * cleared to zero before the request is made.
327 * Enumeration denoting the RX, TX type of the resource. This
328 * enumeration is used for resources that are similar for both TX and RX
331 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
334 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
337 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
339 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
340 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
342 * Setting of this flag indicates the applicability to the loopback
345 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
348 * Setting of this flag indicates drop action. If this flag is not set,
349 * then it should be considered accept action.
351 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
354 * If this flag is set, all t_l2_* fields are invalid and they should
355 * not be specified. If this flag is set, then l2_* fields refer to
356 * fields of outermost L2 header.
358 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
362 /* This bit must be '1' for the l2_addr field to be configured. */
363 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
365 /* This bit must be '1' for the l2_addr_mask field to be configured. */
366 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
368 /* This bit must be '1' for the l2_ovlan field to be configured. */
369 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
371 /* This bit must be '1' for the l2_ovlan_mask field to be configured. */
372 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
374 /* This bit must be '1' for the l2_ivlan field to be configured. */
375 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
377 /* This bit must be '1' for the l2_ivlan_mask field to be configured. */
378 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
380 /* This bit must be '1' for the t_l2_addr field to be configured. */
381 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
384 * This bit must be '1' for the t_l2_addr_mask field to be configured.
386 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
388 /* This bit must be '1' for the t_l2_ovlan field to be configured. */
389 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
392 * This bit must be '1' for the t_l2_ovlan_mask field to be configured.
394 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
396 /* This bit must be '1' for the t_l2_ivlan field to be configured. */
397 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
400 * This bit must be '1' for the t_l2_ivlan_mask field to be configured.
402 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
404 /* This bit must be '1' for the src_type field to be configured. */
405 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
407 /* This bit must be '1' for the src_id field to be configured. */
408 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
410 /* This bit must be '1' for the tunnel_type field to be configured. */
411 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
413 /* This bit must be '1' for the dst_id field to be configured. */
414 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
417 * This bit must be '1' for the mirror_vnic_id field to be configured.
419 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
424 * This value sets the match value for the L2 MAC address. Destination
425 * MAC address for RX path. Source MAC address for TX path.
433 * This value sets the mask value for the L2 address. A value of 0 will
434 * mask the corresponding bit from compare.
436 uint8_t l2_addr_mask[6];
438 /* This value sets VLAN ID value for outer VLAN. */
442 * This value sets the mask value for the ovlan id. A value of 0 will
443 * mask the corresponding bit from compare.
445 uint16_t l2_ovlan_mask;
447 /* This value sets VLAN ID value for inner VLAN. */
451 * This value sets the mask value for the ivlan id. A value of 0 will
452 * mask the corresponding bit from compare.
454 uint16_t l2_ivlan_mask;
460 * This value sets the match value for the tunnel L2 MAC address.
461 * Destination MAC address for RX path. Source MAC address for TX path.
463 uint8_t t_l2_addr[6];
469 * This value sets the mask value for the tunnel L2 address. A value of
470 * 0 will mask the corresponding bit from compare.
472 uint8_t t_l2_addr_mask[6];
474 /* This value sets VLAN ID value for tunnel outer VLAN. */
478 * This value sets the mask value for the tunnel ovlan id. A value of 0
479 * will mask the corresponding bit from compare.
481 uint16_t t_l2_ovlan_mask;
483 /* This value sets VLAN ID value for tunnel inner VLAN. */
487 * This value sets the mask value for the tunnel ivlan id. A value of 0
488 * will mask the corresponding bit from compare.
490 uint16_t t_l2_ivlan_mask;
492 /* This value identifies the type of source of the packet. */
494 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT \
496 /* Physical function */
497 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF \
499 /* Virtual function */
500 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF \
502 /* Virtual NIC of a function */
503 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC \
505 /* Embedded processor for CFA management */
506 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG \
508 /* Embedded processor for OOB management */
509 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE \
511 /* Embedded processor for RoCE */
512 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO \
514 /* Embedded processor for network proxy functions */
515 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG \
521 * This value is the id of the source. For a network port, it represents
522 * port_id. For a physical function, it represents fid. For a virtual
523 * function, it represents vf_id. For a vnic, it represents vnic_id. For
524 * embedded processors, this id is not valid. Notes: 1. The function ID
525 * is implied if it src_id is not provided for a src_type that is either
531 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
533 /* Virtual eXtensible Local Area Network (VXLAN) */
534 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
537 * Network Virtualization Generic Routing Encapsulation (NVGRE)
539 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
542 * Generic Routing Encapsulation (GRE) inside Ethernet payload
544 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
547 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
549 /* Generic Network Virtualization Encapsulation (Geneve) */
550 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
552 /* Multi-Protocol Lable Switching (MPLS) */
553 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
555 /* Stateless Transport Tunnel (STT) */
556 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
559 * Generic Routing Encapsulation (GRE) inside IP datagram
562 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
564 /* Any tunneled traffic */
565 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
566 (UINT32_C(0xff) << 0)
572 * If set, this value shall represent the Logical VNIC ID of the
573 * destination VNIC for the RX path and network port id of the
574 * destination port for the TX path.
578 /* Logical VNIC ID of the VNIC where traffic is mirrored. */
579 uint16_t mirror_vnic_id;
582 * This hint is provided to help in placing the filter in the filter
586 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
588 /* Above the given filter */
589 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
591 /* Below the given filter */
592 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
594 /* As high as possible */
595 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
597 /* As low as possible */
598 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
606 * This is the ID of the filter that goes along with the pri_hint. This
607 * field is valid only for the following values. 1 - Above the given
608 * filter 2 - Below the given filter
610 uint64_t l2_filter_id_hint;
611 } __attribute__((packed));
613 /* Output (24 bytes) */
614 struct hwrm_cfa_l2_filter_alloc_output {
616 * Pass/Fail or error type Note: receiver to verify the in parameters,
617 * and fail the call with an error when appropriate
621 /* This field returns the type of original request. */
624 /* This field provides original sequence number of the command. */
628 * This field is the length of the response in bytes. The last byte of
629 * the response is a valid flag that will read as '1' when the command
630 * has been completely written to memory.
635 * This value identifies a set of CFA data structures used for an L2
638 uint64_t l2_filter_id;
641 * This is the ID of the flow associated with this filter. This value
642 * shall be used to match and associate the flow identifier returned in
643 * completion records. A value of 0xFFFFFFFF shall indicate no flow id.
652 * This field is used in Output records to indicate that the output is
653 * completely written to RAM. This field should be read as '1' to
654 * indicate that the output has been completely written. When writing a
655 * command completion or response to an internal processor, the order of
656 * writes has to be such that this field is written last.
659 } __attribute__((packed));
661 /* hwrm_cfa_l2_filter_free */
663 * Description: Free a L2 filter. The HWRM shall free all associated filter
664 * resources with the L2 filter.
667 /* Input (24 bytes) */
668 struct hwrm_cfa_l2_filter_free_input {
670 * This value indicates what type of request this is. The format for the
671 * rest of the command is determined by this field.
676 * This value indicates the what completion ring the request will be
677 * optionally completed on. If the value is -1, then no CR completion
678 * will be generated. Any other value must be a valid CR ring_id value
683 /* This value indicates the command sequence number. */
687 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
688 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
693 * This is the host address where the response will be written when the
694 * request is complete. This area must be 16B aligned and must be
695 * cleared to zero before the request is made.
700 * This value identifies a set of CFA data structures used for an L2
703 uint64_t l2_filter_id;
704 } __attribute__((packed));
706 /* Output (16 bytes) */
707 struct hwrm_cfa_l2_filter_free_output {
709 * Pass/Fail or error type Note: receiver to verify the in parameters,
710 * and fail the call with an error when appropriate
714 /* This field returns the type of original request. */
717 /* This field provides original sequence number of the command. */
721 * This field is the length of the response in bytes. The last byte of
722 * the response is a valid flag that will read as '1' when the command
723 * has been completely written to memory.
733 * This field is used in Output records to indicate that the output is
734 * completely written to RAM. This field should be read as '1' to
735 * indicate that the output has been completely written. When writing a
736 * command completion or response to an internal processor, the order of
737 * writes has to be such that this field is written last.
740 } __attribute__((packed));
742 /* hwrm_exec_fwd_resp */
744 * Description: This command is used to send an encapsulated request to the
745 * HWRM. This command instructs the HWRM to execute the request and forward the
746 * response of the encapsulated request to the location specified in the
747 * original request that is encapsulated. The target id of this command shall be
748 * set to 0xFFFF (HWRM). The response location in this command shall be used to
749 * acknowledge the receipt of the encapsulated request and forwarding of the
753 /* Input (128 bytes) */
754 struct hwrm_exec_fwd_resp_input {
756 * This value indicates what type of request this is. The format for the
757 * rest of the command is determined by this field.
762 * This value indicates the what completion ring the request will be
763 * optionally completed on. If the value is -1, then no CR completion
764 * will be generated. Any other value must be a valid CR ring_id value
769 /* This value indicates the command sequence number. */
773 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
774 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
779 * This is the host address where the response will be written when the
780 * request is complete. This area must be 16B aligned and must be
781 * cleared to zero before the request is made.
786 * This is an encapsulated request. This request should be executed by
787 * the HWRM and the response should be provided in the response buffer
788 * inside the encapsulated request.
790 uint32_t encap_request[26];
793 * This value indicates the target id of the response to the
794 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 -
795 * 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
797 uint16_t encap_resp_target_id;
799 uint16_t unused_0[3];
800 } __attribute__((packed));
802 /* Output (16 bytes) */
803 struct hwrm_exec_fwd_resp_output {
805 * Pass/Fail or error type Note: receiver to verify the in parameters,
806 * and fail the call with an error when appropriate
810 /* This field returns the type of original request. */
813 /* This field provides original sequence number of the command. */
817 * This field is the length of the response in bytes. The last byte of
818 * the response is a valid flag that will read as '1' when the command
819 * has been completely written to memory.
829 * This field is used in Output records to indicate that the output is
830 * completely written to RAM. This field should be read as '1' to
831 * indicate that the output has been completely written. When writing a
832 * command completion or response to an internal processor, the order of
833 * writes has to be such that this field is written last.
836 } __attribute__((packed));
838 /* hwrm_func_qcaps */
840 * Description: This command returns capabilities of a function. The input FID
841 * value is used to indicate what function is being queried. This allows a
842 * physical function driver to query virtual functions that are children of the
843 * physical function. The output FID value is needed to configure Rings and
844 * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
847 /* Input (24 bytes) */
848 struct hwrm_func_qcaps_input {
850 * This value indicates what type of request this is. The format for the
851 * rest of the command is determined by this field.
856 * This value indicates the what completion ring the request will be
857 * optionally completed on. If the value is -1, then no CR completion
858 * will be generated. Any other value must be a valid CR ring_id value
863 /* This value indicates the command sequence number. */
867 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
868 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
873 * This is the host address where the response will be written when the
874 * request is complete. This area must be 16B aligned and must be
875 * cleared to zero before the request is made.
880 * Function ID of the function that is being queried. 0xFF... (All Fs)
881 * if the query is for the requesting function.
885 uint16_t unused_0[3];
886 } __attribute__((packed));
888 /* Output (80 bytes) */
889 struct hwrm_func_qcaps_output {
891 * Pass/Fail or error type Note: receiver to verify the in parameters,
892 * and fail the call with an error when appropriate
896 /* This field returns the type of original request. */
899 /* This field provides original sequence number of the command. */
903 * This field is the length of the response in bytes. The last byte of
904 * the response is a valid flag that will read as '1' when the command
905 * has been completely written to memory.
910 * FID value. This value is used to identify operations on the PCI bus
911 * as belonging to a particular PCI function.
916 * Port ID of port that this function is associated with. Valid only for
917 * the PF. 0xFF... (All Fs) if this function is not associated with any
918 * port. 0xFF... (All Fs) if this function is called from a VF.
922 /* If 1, then Push mode is supported on this function. */
923 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
925 * If 1, then the global MSI-X auto-masking is enabled for the device.
927 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
930 * If 1, then the Precision Time Protocol (PTP) processing is supported
931 * on this function. The HWRM should enable PTP on only a single
932 * Physical Function (PF) per port.
934 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
938 * This value is current MAC address configured for this function. A
939 * value of 00-00-00-00-00-00 indicates no MAC address is currently
942 uint8_t perm_mac_address[6];
945 * The maximum number of RSS/COS contexts that can be allocated to the
948 uint16_t max_rsscos_ctx;
951 * The maximum number of completion rings that can be allocated to the
954 uint16_t max_cmpl_rings;
957 * The maximum number of transmit rings that can be allocated to the
960 uint16_t max_tx_rings;
963 * The maximum number of receive rings that can be allocated to the
966 uint16_t max_rx_rings;
969 * The maximum number of L2 contexts that can be allocated to the
972 uint16_t max_l2_ctxs;
974 /* The maximum number of VNICs that can be allocated to the function. */
978 * The identifier for the first VF enabled on a PF. This is valid only
979 * on the PF with SR-IOV enabled. 0xFF... (All Fs) if this command is
980 * called on a PF with SR-IOV disabled or on a VF.
982 uint16_t first_vf_id;
985 * The maximum number of VFs that can be allocated to the function. This
986 * is valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if this
987 * command is called on a PF with SR-IOV disabled or on a VF.
992 * The maximum number of statistic contexts that can be allocated to the
995 uint16_t max_stat_ctx;
998 * The maximum number of Encapsulation records that can be offloaded by
1001 uint32_t max_encap_records;
1004 * The maximum number of decapsulation records that can be offloaded by
1007 uint32_t max_decap_records;
1010 * The maximum number of Exact Match (EM) flows that can be offloaded by
1011 * this function on the TX side.
1013 uint32_t max_tx_em_flows;
1016 * The maximum number of Wildcard Match (WM) flows that can be offloaded
1017 * by this function on the TX side.
1019 uint32_t max_tx_wm_flows;
1022 * The maximum number of Exact Match (EM) flows that can be offloaded by
1023 * this function on the RX side.
1025 uint32_t max_rx_em_flows;
1028 * The maximum number of Wildcard Match (WM) flows that can be offloaded
1029 * by this function on the RX side.
1031 uint32_t max_rx_wm_flows;
1034 * The maximum number of multicast filters that can be supported by this
1035 * function on the RX side.
1037 uint32_t max_mcast_filters;
1040 * The maximum value of flow_id that can be supported in completion
1043 uint32_t max_flow_id;
1046 * The maximum number of HW ring groups that can be supported on this
1049 uint32_t max_hw_ring_grps;
1056 * This field is used in Output records to indicate that the output is
1057 * completely written to RAM. This field should be read as '1' to
1058 * indicate that the output has been completely written. When writing a
1059 * command completion or response to an internal processor, the order of
1060 * writes has to be such that this field is written last.
1063 } __attribute__((packed));
1065 /* hwrm_port_phy_cfg */
1067 * Description: This command configures the PHY device for the port. It allows
1068 * setting of the most generic settings for the PHY. The HWRM shall complete
1069 * this command as soon as PHY settings are configured. They may not be applied
1070 * when the command response is provided. A VF driver shall not be allowed to
1071 * configure PHY using this command. In a network partition mode, a PF driver
1072 * shall not be allowed to configure PHY using this command.
1075 /* Input (56 bytes) */
1076 struct hwrm_port_phy_cfg_input {
1078 * This value indicates what type of request this is. The format for the
1079 * rest of the command is determined by this field.
1084 * This value indicates the what completion ring the request will be
1085 * optionally completed on. If the value is -1, then no CR completion
1086 * will be generated. Any other value must be a valid CR ring_id value
1087 * for this function.
1091 /* This value indicates the command sequence number. */
1095 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1096 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1101 * This is the host address where the response will be written when the
1102 * request is complete. This area must be 16B aligned and must be
1103 * cleared to zero before the request is made.
1108 * When this bit is set to '1', the PHY for the port shall be reset. #
1109 * If this bit is set to 1, then the HWRM shall reset the PHY after
1110 * applying PHY configuration changes specified in this command. # In
1111 * order to guarantee that PHY configuration changes specified in this
1112 * command take effect, the HWRM client should set this flag to 1. # If
1113 * this bit is not set to 1, then the HWRM may reset the PHY depending
1114 * on the current PHY configuration and settings specified in this
1117 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY UINT32_C(0x1)
1119 * When this bit is set to '1', the link shall be forced to be taken
1120 * down. # When this bit is set to '1", all other command input settings
1121 * related to the link speed shall be ignored. Once the link state is
1122 * forced down, it can be explicitly cleared from that state by setting
1123 * this flag to '0'. # If this flag is set to '0', then the link shall
1124 * be cleared from forced down state if the link is in forced down
1125 * state. There may be conditions (e.g. out-of-band or sideband
1126 * configuration changes for the link) outside the scope of the HWRM
1127 * implementation that may clear forced down link state.
1129 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DOWN UINT32_C(0x2)
1131 * When this bit is set to '1', the link shall be forced to the
1132 * force_link_speed value. When this bit is set to '1', the HWRM client
1133 * should not enable any of the auto negotiation related fields
1134 * represented by auto_XXX fields in this command. When this bit is set
1135 * to '1' and the HWRM client has enabled a auto_XXX field in this
1136 * command, then the HWRM shall ignore the enabled auto_XXX field. When
1137 * this bit is set to zero, the link shall be allowed to autoneg.
1139 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE UINT32_C(0x4)
1141 * When this bit is set to '1', the auto-negotiation process shall be
1142 * restarted on the link.
1144 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG UINT32_C(0x8)
1146 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
1147 * requested to be enabled on this link. If EEE is not supported on this
1148 * port, then this flag shall be ignored by the HWRM.
1150 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE UINT32_C(0x10)
1152 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
1153 * requested to be disabled on this link. If EEE is not supported on
1154 * this port, then this flag shall be ignored by the HWRM.
1156 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE UINT32_C(0x20)
1158 * When this bit is set to '1' and EEE is enabled on this link, then TX
1159 * LPI is requested to be enabled on the link. If EEE is not supported
1160 * on this port, then this flag shall be ignored by the HWRM. If EEE is
1161 * disabled on this port, then this flag shall be ignored by the HWRM.
1163 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI UINT32_C(0x40)
1166 /* This bit must be '1' for the auto_mode field to be configured. */
1167 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE UINT32_C(0x1)
1168 /* This bit must be '1' for the auto_duplex field to be configured. */
1169 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX UINT32_C(0x2)
1170 /* This bit must be '1' for the auto_pause field to be configured. */
1171 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE UINT32_C(0x4)
1173 * This bit must be '1' for the auto_link_speed field to be configured.
1175 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED UINT32_C(0x8)
1177 * This bit must be '1' for the auto_link_speed_mask field to be
1180 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
1182 /* This bit must be '1' for the wirespeed field to be configured. */
1183 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED UINT32_C(0x20)
1184 /* This bit must be '1' for the lpbk field to be configured. */
1185 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK UINT32_C(0x40)
1186 /* This bit must be '1' for the preemphasis field to be configured. */
1187 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS UINT32_C(0x80)
1188 /* This bit must be '1' for the force_pause field to be configured. */
1189 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE UINT32_C(0x100)
1191 * This bit must be '1' for the eee_link_speed_mask field to be
1194 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
1196 /* This bit must be '1' for the tx_lpi_timer field to be configured. */
1197 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER UINT32_C(0x400)
1200 /* Port ID of port that is to be configured. */
1204 * This is the speed that will be used if the force bit is '1'. If
1205 * unsupported speed is selected, an error will be generated.
1207 /* 100Mb link speed */
1208 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB \
1209 (UINT32_C(0x1) << 0)
1210 /* 1Gb link speed */
1211 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB \
1212 (UINT32_C(0xa) << 0)
1213 /* 2Gb link speed */
1214 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB \
1215 (UINT32_C(0x14) << 0)
1216 /* 2.5Gb link speed */
1217 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB \
1218 (UINT32_C(0x19) << 0)
1219 /* 10Gb link speed */
1220 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB \
1221 (UINT32_C(0x64) << 0)
1222 /* 20Mb link speed */
1223 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB \
1224 (UINT32_C(0xc8) << 0)
1225 /* 25Gb link speed */
1226 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB \
1227 (UINT32_C(0xfa) << 0)
1228 /* 40Gb link speed */
1229 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB \
1230 (UINT32_C(0x190) << 0)
1231 /* 50Gb link speed */
1232 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB \
1233 (UINT32_C(0x1f4) << 0)
1234 /* 100Gb link speed */
1235 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB \
1236 (UINT32_C(0x3e8) << 0)
1237 /* 10Mb link speed */
1238 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB \
1239 (UINT32_C(0xffff) << 0)
1240 uint16_t force_link_speed;
1243 * This value is used to identify what autoneg mode is used when the
1244 * link speed is not being forced.
1247 * Disable autoneg or autoneg disabled. No speeds are selected.
1249 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE (UINT32_C(0x0) << 0)
1250 /* Select all possible speeds for autoneg mode. */
1251 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS \
1252 (UINT32_C(0x1) << 0)
1254 * Select only the auto_link_speed speed for autoneg mode. This
1255 * mode has been DEPRECATED. An HWRM client should not use this
1258 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED \
1259 (UINT32_C(0x2) << 0)
1261 * Select the auto_link_speed or any speed below that speed for
1262 * autoneg. This mode has been DEPRECATED. An HWRM client should
1263 * not use this mode.
1265 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW \
1266 (UINT32_C(0x3) << 0)
1268 * Select the speeds based on the corresponding link speed mask
1269 * value that is provided.
1271 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK \
1272 (UINT32_C(0x4) << 0)
1276 * This is the duplex setting that will be used if the autoneg_mode is
1277 * "one_speed" or "one_or_below".
1279 /* Half Duplex will be requested. */
1280 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF \
1281 (UINT32_C(0x0) << 0)
1282 /* Full duplex will be requested. */
1283 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL \
1284 (UINT32_C(0x1) << 0)
1285 /* Both Half and Full dupex will be requested. */
1286 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH \
1287 (UINT32_C(0x2) << 0)
1288 uint8_t auto_duplex;
1291 * This value is used to configure the pause that will be used for
1292 * autonegotiation. Add text on the usage of auto_pause and force_pause.
1295 * When this bit is '1', Generation of tx pause messages has been
1296 * requested. Disabled otherwise.
1298 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX UINT32_C(0x1)
1300 * When this bit is '1', Reception of rx pause messages has been
1301 * requested. Disabled otherwise.
1303 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX UINT32_C(0x2)
1305 * When set to 1, the advertisement of pause is enabled. # When the
1306 * auto_mode is not set to none and this flag is set to 1, then the
1307 * auto_pause bits on this port are being advertised and autoneg pause
1308 * results are being interpreted. # When the auto_mode is not set to
1309 * none and this flag is set to 0, the pause is forced as indicated in
1310 * force_pause, and also advertised as auto_pause bits, but the autoneg
1311 * results are not interpreted since the pause configuration is being
1312 * forced. # When the auto_mode is set to none and this flag is set to
1313 * 1, auto_pause bits should be ignored and should be set to 0.
1315 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
1321 * This is the speed that will be used if the autoneg_mode is
1322 * "one_speed" or "one_or_below". If an unsupported speed is selected,
1323 * an error will be generated.
1325 /* 100Mb link speed */
1326 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB \
1327 (UINT32_C(0x1) << 0)
1328 /* 1Gb link speed */
1329 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB \
1330 (UINT32_C(0xa) << 0)
1331 /* 2Gb link speed */
1332 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB \
1333 (UINT32_C(0x14) << 0)
1334 /* 2.5Gb link speed */
1335 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB \
1336 (UINT32_C(0x19) << 0)
1337 /* 10Gb link speed */
1338 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB \
1339 (UINT32_C(0x64) << 0)
1340 /* 20Mb link speed */
1341 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB \
1342 (UINT32_C(0xc8) << 0)
1343 /* 25Gb link speed */
1344 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB \
1345 (UINT32_C(0xfa) << 0)
1346 /* 40Gb link speed */
1347 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB \
1348 (UINT32_C(0x190) << 0)
1349 /* 50Gb link speed */
1350 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB \
1351 (UINT32_C(0x1f4) << 0)
1352 /* 100Gb link speed */
1353 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB \
1354 (UINT32_C(0x3e8) << 0)
1355 /* 10Mb link speed */
1356 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB \
1357 (UINT32_C(0xffff) << 0)
1358 uint16_t auto_link_speed;
1361 * This is a mask of link speeds that will be used if autoneg_mode is
1362 * "mask". If unsupported speed is enabled an error will be generated.
1364 /* 100Mb link speed (Half-duplex) */
1365 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
1367 /* 100Mb link speed (Full-duplex) */
1368 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
1370 /* 1Gb link speed (Half-duplex) */
1371 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
1373 /* 1Gb link speed (Full-duplex) */
1374 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
1376 /* 2Gb link speed */
1377 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
1379 /* 2.5Gb link speed */
1380 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
1382 /* 10Gb link speed */
1383 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
1385 /* 20Gb link speed */
1386 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
1388 /* 25Gb link speed */
1389 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
1391 /* 40Gb link speed */
1392 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
1394 /* 50Gb link speed */
1395 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
1397 /* 100Gb link speed */
1398 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
1400 /* 10Mb link speed (Half-duplex) */
1401 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
1403 /* 10Mb link speed (Full-duplex) */
1404 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
1406 uint16_t auto_link_speed_mask;
1408 /* This value controls the wirespeed feature. */
1409 /* Wirespeed feature is disabled. */
1410 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF (UINT32_C(0x0) << 0)
1411 /* Wirespeed feature is enabled. */
1412 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON (UINT32_C(0x1) << 0)
1415 /* This value controls the loopback setting for the PHY. */
1416 /* No loopback is selected. Normal operation. */
1417 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE (UINT32_C(0x0) << 0)
1419 * The HW will be configured with local loopback such that host
1420 * data is sent back to the host without modification.
1422 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL (UINT32_C(0x1) << 0)
1424 * The HW will be configured with remote loopback such that port
1425 * logic will send packets back out the transmitter that are
1428 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE (UINT32_C(0x2) << 0)
1432 * This value is used to configure the pause that will be used for force
1436 * When this bit is '1', Generation of tx pause messages is supported.
1437 * Disabled otherwise.
1439 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1)
1441 * When this bit is '1', Reception of rx pause messages is supported.
1442 * Disabled otherwise.
1444 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2)
1445 uint8_t force_pause;
1450 * This value controls the pre-emphasis to be used for the link. Driver
1451 * should not set this value (use enable.preemphasis = 0) unless driver
1452 * is sure of setting. Normally HWRM FW will determine proper pre-
1455 uint32_t preemphasis;
1458 * Setting for link speed mask that is used to advertise speeds during
1459 * autonegotiation when EEE is enabled. This field is valid only when
1460 * EEE is enabled. The speeds specified in this field shall be a subset
1461 * of speeds specified in auto_link_speed_mask. If EEE is enabled,then
1462 * at least one speed shall be provided in this mask.
1465 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
1466 /* 100Mb link speed (Full-duplex) */
1467 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
1469 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
1470 /* 1Gb link speed (Full-duplex) */
1471 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
1473 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
1476 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
1478 /* 10Gb link speed */
1479 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
1481 uint16_t eee_link_speed_mask;
1487 * Reuested setting of TX LPI timer in microseconds. This field is valid
1488 * only when EEE is enabled and TX LPI is enabled.
1490 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK \
1492 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
1493 uint32_t tx_lpi_timer;
1496 } __attribute__((packed));
1498 /* Output (16 bytes) */
1499 struct hwrm_port_phy_cfg_output {
1501 * Pass/Fail or error type Note: receiver to verify the in parameters,
1502 * and fail the call with an error when appropriate
1504 uint16_t error_code;
1506 /* This field returns the type of original request. */
1509 /* This field provides original sequence number of the command. */
1513 * This field is the length of the response in bytes. The last byte of
1514 * the response is a valid flag that will read as '1' when the command
1515 * has been completely written to memory.
1525 * This field is used in Output records to indicate that the output is
1526 * completely written to RAM. This field should be read as '1' to
1527 * indicate that the output has been completely written. When writing a
1528 * command completion or response to an internal processor, the order of
1529 * writes has to be such that this field is written last.
1532 } __attribute__((packed));
1536 * Description: This function is called by a driver to determine the HWRM
1537 * interface version supported by the HWRM firmware, the version of HWRM
1538 * firmware implementation, the name of HWRM firmware, the versions of other
1539 * embedded firmwares, and the names of other embedded firmwares, etc. Any
1540 * interface or firmware version with major = 0, minor = 0, and update = 0 shall
1541 * be considered an invalid version.
1544 /* Input (24 bytes) */
1545 struct hwrm_ver_get_input {
1547 * This value indicates what type of request this is. The format for the
1548 * rest of the command is determined by this field.
1553 * This value indicates the what completion ring the request will be
1554 * optionally completed on. If the value is -1, then no CR completion
1555 * will be generated. Any other value must be a valid CR ring_id value
1556 * for this function.
1560 /* This value indicates the command sequence number. */
1564 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1565 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1570 * This is the host address where the response will be written when the
1571 * request is complete. This area must be 16B aligned and must be
1572 * cleared to zero before the request is made.
1577 * This field represents the major version of HWRM interface
1578 * specification supported by the driver HWRM implementation. The
1579 * interface major version is intended to change only when non backward
1580 * compatible changes are made to the HWRM interface specification.
1582 uint8_t hwrm_intf_maj;
1585 * This field represents the minor version of HWRM interface
1586 * specification supported by the driver HWRM implementation. A change
1587 * in interface minor version is used to reflect significant backward
1588 * compatible modification to HWRM interface specification. This can be
1589 * due to addition or removal of functionality. HWRM interface
1590 * specifications with the same major version but different minor
1591 * versions are compatible.
1593 uint8_t hwrm_intf_min;
1596 * This field represents the update version of HWRM interface
1597 * specification supported by the driver HWRM implementation. The
1598 * interface update version is used to reflect minor changes or bug
1599 * fixes to a released HWRM interface specification.
1601 uint8_t hwrm_intf_upd;
1603 uint8_t unused_0[5];
1604 } __attribute__((packed));
1606 /* Output (128 bytes) */
1607 struct hwrm_ver_get_output {
1609 * Pass/Fail or error type Note: receiver to verify the in parameters,
1610 * and fail the call with an error when appropriate
1612 uint16_t error_code;
1614 /* This field returns the type of original request. */
1617 /* This field provides original sequence number of the command. */
1621 * This field is the length of the response in bytes. The last byte of
1622 * the response is a valid flag that will read as '1' when the command
1623 * has been completely written to memory.
1628 * This field represents the major version of HWRM interface
1629 * specification supported by the HWRM implementation. The interface
1630 * major version is intended to change only when non backward compatible
1631 * changes are made to the HWRM interface specification. A HWRM
1632 * implementation that is compliant with this specification shall
1633 * provide value of 1 in this field.
1635 uint8_t hwrm_intf_maj;
1638 * This field represents the minor version of HWRM interface
1639 * specification supported by the HWRM implementation. A change in
1640 * interface minor version is used to reflect significant backward
1641 * compatible modification to HWRM interface specification. This can be
1642 * due to addition or removal of functionality. HWRM interface
1643 * specifications with the same major version but different minor
1644 * versions are compatible. A HWRM implementation that is compliant with
1645 * this specification shall provide value of 0 in this field.
1647 uint8_t hwrm_intf_min;
1650 * This field represents the update version of HWRM interface
1651 * specification supported by the HWRM implementation. The interface
1652 * update version is used to reflect minor changes or bug fixes to a
1653 * released HWRM interface specification. A HWRM implementation that is
1654 * compliant with this specification shall provide value of 1 in this
1657 uint8_t hwrm_intf_upd;
1659 uint8_t hwrm_intf_rsvd;
1662 * This field represents the major version of HWRM firmware. A change in
1663 * firmware major version represents a major firmware release.
1665 uint8_t hwrm_fw_maj;
1668 * This field represents the minor version of HWRM firmware. A change in
1669 * firmware minor version represents significant firmware functionality
1672 uint8_t hwrm_fw_min;
1675 * This field represents the build version of HWRM firmware. A change in
1676 * firmware build version represents bug fixes to a released firmware.
1678 uint8_t hwrm_fw_bld;
1681 * This field is a reserved field. This field can be used to represent
1682 * firmware branches or customer specific releases tied to a specific
1683 * (major,minor,update) version of the HWRM firmware.
1685 uint8_t hwrm_fw_rsvd;
1688 * This field represents the major version of mgmt firmware. A change in
1689 * major version represents a major release.
1691 uint8_t mgmt_fw_maj;
1694 * This field represents the minor version of mgmt firmware. A change in
1695 * minor version represents significant functionality changes.
1697 uint8_t mgmt_fw_min;
1700 * This field represents the build version of mgmt firmware. A change in
1701 * update version represents bug fixes.
1703 uint8_t mgmt_fw_bld;
1706 * This field is a reserved field. This field can be used to represent
1707 * firmware branches or customer specific releases tied to a specific
1708 * (major,minor,update) version
1710 uint8_t mgmt_fw_rsvd;
1713 * This field represents the major version of network control firmware.
1714 * A change in major version represents a major release.
1716 uint8_t netctrl_fw_maj;
1719 * This field represents the minor version of network control firmware.
1720 * A change in minor version represents significant functionality
1723 uint8_t netctrl_fw_min;
1726 * This field represents the build version of network control firmware.
1727 * A change in update version represents bug fixes.
1729 uint8_t netctrl_fw_bld;
1732 * This field is a reserved field. This field can be used to represent
1733 * firmware branches or customer specific releases tied to a specific
1734 * (major,minor,update) version
1736 uint8_t netctrl_fw_rsvd;
1739 * This field is reserved for future use. The responder should set it to
1740 * 0. The requester should ignore this field.
1745 * This field represents the major version of RoCE firmware. A change in
1746 * major version represents a major release.
1748 uint8_t roce_fw_maj;
1751 * This field represents the minor version of RoCE firmware. A change in
1752 * minor version represents significant functionality changes.
1754 uint8_t roce_fw_min;
1757 * This field represents the build version of RoCE firmware. A change in
1758 * update version represents bug fixes.
1760 uint8_t roce_fw_bld;
1763 * This field is a reserved field. This field can be used to represent
1764 * firmware branches or customer specific releases tied to a specific
1765 * (major,minor,update) version
1767 uint8_t roce_fw_rsvd;
1770 * This field represents the name of HWRM FW (ASCII chars without NULL
1773 char hwrm_fw_name[16];
1776 * This field represents the name of mgmt FW (ASCII chars without NULL
1779 char mgmt_fw_name[16];
1782 * This field represents the name of network control firmware (ASCII
1783 * chars without NULL at the end).
1785 char netctrl_fw_name[16];
1788 * This field is reserved for future use. The responder should set it to
1789 * 0. The requester should ignore this field.
1791 uint32_t reserved2[4];
1794 * This field represents the name of RoCE FW (ASCII chars without NULL
1797 char roce_fw_name[16];
1799 /* This field returns the chip number. */
1802 /* This field returns the revision of chip. */
1805 /* This field returns the chip metal number. */
1808 /* This field returns the bond id of the chip. */
1809 uint8_t chip_bond_id;
1812 * This value indicates the type of platform used for chip
1816 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC \
1817 (UINT32_C(0x0) << 0)
1818 /* FPGA platform of the chip. */
1819 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA \
1820 (UINT32_C(0x1) << 0)
1821 /* Palladium platform of the chip. */
1822 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM \
1823 (UINT32_C(0x2) << 0)
1824 uint8_t chip_platform_type;
1827 * This field returns the maximum value of request window that is
1828 * supported by the HWRM. The request window is mapped into device
1829 * address space using MMIO.
1831 uint16_t max_req_win_len;
1834 * This field returns the maximum value of response buffer in bytes. If
1835 * a request specifies the response buffer length that is greater than
1836 * this value, then the HWRM should fail it. The value of this field
1837 * shall be 4KB or more.
1839 uint16_t max_resp_len;
1842 * This field returns the default request timeout value in milliseconds.
1844 uint16_t def_req_timeout;
1851 * This field is used in Output records to indicate that the output is
1852 * completely written to RAM. This field should be read as '1' to
1853 * indicate that the output has been completely written. When writing a
1854 * command completion or response to an internal processor, the order of
1855 * writes has to be such that this field is written last.
1858 } __attribute__((packed));
1860 /* hwrm_queue_qportcfg */
1862 * Description: This function is called by a driver to query queue configuration
1863 * of a port. # The HWRM shall at least advertise one queue with lossy service
1864 * profile. # The driver shall use this command to query queue ids before
1865 * configuring or using any queues. # If a service profile is not set for a
1866 * queue, then the driver shall not use that queue without configuring a service
1867 * profile for it. # If the driver is not allowed to configure service profiles,
1868 * then the driver shall only use queues for which service profiles are pre-
1872 /* Input (24 bytes) */
1873 struct hwrm_queue_qportcfg_input {
1875 * This value indicates what type of request this is. The format for the
1876 * rest of the command is determined by this field.
1881 * This value indicates the what completion ring the request will be
1882 * optionally completed on. If the value is -1, then no CR completion
1883 * will be generated. Any other value must be a valid CR ring_id value
1884 * for this function.
1888 /* This value indicates the command sequence number. */
1892 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1893 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1898 * This is the host address where the response will be written when the
1899 * request is complete. This area must be 16B aligned and must be
1900 * cleared to zero before the request is made.
1905 * Enumeration denoting the RX, TX type of the resource. This
1906 * enumeration is used for resources that are similar for both TX and RX
1907 * paths of the chip.
1909 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH \
1912 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX \
1913 (UINT32_C(0x0) << 0)
1915 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX \
1916 (UINT32_C(0x1) << 0)
1917 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
1918 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
1922 * Port ID of port for which the queue configuration is being queried.
1923 * This field is only required when sent by IPC.
1928 } __attribute__((packed));
1930 /* hwrm_stat_ctx_clr_stats */
1931 /* Description: This command clears statistics of a context. */
1933 /* Input (24 bytes) */
1934 struct hwrm_stat_ctx_clr_stats_input {
1936 * This value indicates what type of request this is. The format for the
1937 * rest of the command is determined by this field.
1942 * This value indicates the what completion ring the request will be
1943 * optionally completed on. If the value is -1, then no CR completion
1944 * will be generated. Any other value must be a valid CR ring_id value
1945 * for this function.
1949 /* This value indicates the command sequence number. */
1953 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1954 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1959 * This is the host address where the response will be written when the
1960 * request is complete. This area must be 16B aligned and must be
1961 * cleared to zero before the request is made.
1965 /* ID of the statistics context that is being queried. */
1966 uint32_t stat_ctx_id;
1969 } __attribute__((packed));
1971 /* Output (16 bytes) */
1972 struct hwrm_stat_ctx_clr_stats_output {
1974 * Pass/Fail or error type Note: receiver to verify the in parameters,
1975 * and fail the call with an error when appropriate
1977 uint16_t error_code;
1979 /* This field returns the type of original request. */
1982 /* This field provides original sequence number of the command. */
1986 * This field is the length of the response in bytes. The last byte of
1987 * the response is a valid flag that will read as '1' when the command
1988 * has been completely written to memory.
1998 * This field is used in Output records to indicate that the output is
1999 * completely written to RAM. This field should be read as '1' to
2000 * indicate that the output has been completely written. When writing a
2001 * command completion or response to an internal processor, the order of
2002 * writes has to be such that this field is written last.
2005 } __attribute__((packed));
2007 /* hwrm_vnic_rss_cfg */
2008 /* Description: This function is used to enable RSS configuration. */
2010 /* Input (48 bytes) */
2011 struct hwrm_vnic_rss_cfg_input {
2013 * This value indicates what type of request this is. The format for the
2014 * rest of the command is determined by this field.
2019 * This value indicates the what completion ring the request will be
2020 * optionally completed on. If the value is -1, then no CR completion
2021 * will be generated. Any other value must be a valid CR ring_id value
2022 * for this function.
2026 /* This value indicates the command sequence number. */
2030 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
2031 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
2036 * This is the host address where the response will be written when the
2037 * request is complete. This area must be 16B aligned and must be
2038 * cleared to zero before the request is made.
2043 * When this bit is '1', the RSS hash shall be computed over source and
2044 * destination IPv4 addresses of IPv4 packets.
2046 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4 UINT32_C(0x1)
2048 * When this bit is '1', the RSS hash shall be computed over
2049 * source/destination IPv4 addresses and source/destination ports of
2052 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV4 UINT32_C(0x2)
2054 * When this bit is '1', the RSS hash shall be computed over
2055 * source/destination IPv4 addresses and source/destination ports of
2058 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV4 UINT32_C(0x4)
2060 * When this bit is '1', the RSS hash shall be computed over source and
2061 * destination IPv4 addresses of IPv6 packets.
2063 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6 UINT32_C(0x8)
2065 * When this bit is '1', the RSS hash shall be computed over
2066 * source/destination IPv6 addresses and source/destination ports of
2069 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6 UINT32_C(0x10)
2071 * When this bit is '1', the RSS hash shall be computed over
2072 * source/destination IPv6 addresses and source/destination ports of
2075 #define HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6 UINT32_C(0x20)
2080 /* This is the address for rss ring group table */
2081 uint64_t ring_grp_tbl_addr;
2083 /* This is the address for rss hash key table */
2084 uint64_t hash_key_tbl_addr;
2086 /* Index to the rss indirection table. */
2087 uint16_t rss_ctx_idx;
2089 uint16_t unused_1[3];
2090 } __attribute__((packed));
2092 /* Output (16 bytes) */
2093 struct hwrm_vnic_rss_cfg_output {
2095 * Pass/Fail or error type Note: receiver to verify the in parameters,
2096 * and fail the call with an error when appropriate
2098 uint16_t error_code;
2100 /* This field returns the type of original request. */
2103 /* This field provides original sequence number of the command. */
2107 * This field is the length of the response in bytes. The last byte of
2108 * the response is a valid flag that will read as '1' when the command
2109 * has been completely written to memory.
2119 * This field is used in Output records to indicate that the output is
2120 * completely written to RAM. This field should be read as '1' to
2121 * indicate that the output has been completely written. When writing a
2122 * command completion or response to an internal processor, the order of
2123 * writes has to be such that this field is written last.
2126 } __attribute__((packed));
2128 /* Output (32 bytes) */
2129 struct hwrm_queue_qportcfg_output {
2131 * Pass/Fail or error type Note: receiver to verify the in parameters,
2132 * and fail the call with an error when appropriate
2134 uint16_t error_code;
2136 /* This field returns the type of original request. */
2139 /* This field provides original sequence number of the command. */
2143 * This field is the length of the response in bytes. The last byte of
2144 * the response is a valid flag that will read as '1' when the command
2145 * has been completely written to memory.
2149 /* The maximum number of queues that can be configured. */
2150 uint8_t max_configurable_queues;
2152 /* The maximum number of lossless queues that can be configured. */
2153 uint8_t max_configurable_lossless_queues;
2156 * 0 - Not allowed. Non-zero - Allowed. If this value is non-zero, then
2157 * the HWRM shall allow the host SW driver to configure queues using
2160 uint8_t queue_cfg_allowed;
2163 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
2164 * the HWRM shall allow the host SW driver to configure queue buffers
2165 * using hwrm_queue_buffers_cfg.
2167 uint8_t queue_buffers_cfg_allowed;
2170 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
2171 * the HWRM shall allow the host SW driver to configure PFC using
2172 * hwrm_queue_pfcenable_cfg.
2174 uint8_t queue_pfcenable_cfg_allowed;
2177 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
2178 * the HWRM shall allow the host SW driver to configure Priority to CoS
2179 * mapping using hwrm_queue_pri2cos_cfg.
2181 uint8_t queue_pri2cos_cfg_allowed;
2184 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
2185 * the HWRM shall allow the host SW driver to configure CoS Bandwidth
2186 * configuration using hwrm_queue_cos2bw_cfg.
2188 uint8_t queue_cos2bw_cfg_allowed;
2190 /* ID of CoS Queue 0. FF - Invalid id */
2193 /* This value is applicable to CoS queues only. */
2194 /* Lossy (best-effort) */
2195 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
2196 (UINT32_C(0x0) << 0)
2198 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
2199 (UINT32_C(0x1) << 0)
2201 * Set to 0xFF... (All Fs) if there is no service profile
2204 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
2205 (UINT32_C(0xff) << 0)
2206 uint8_t queue_id0_service_profile;
2208 /* ID of CoS Queue 1. FF - Invalid id */
2210 /* This value is applicable to CoS queues only. */
2211 /* Lossy (best-effort) */
2212 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
2213 (UINT32_C(0x0) << 0)
2215 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
2216 (UINT32_C(0x1) << 0)
2218 * Set to 0xFF... (All Fs) if there is no service profile
2221 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
2222 (UINT32_C(0xff) << 0)
2223 uint8_t queue_id1_service_profile;
2225 /* ID of CoS Queue 2. FF - Invalid id */
2227 /* This value is applicable to CoS queues only. */
2228 /* Lossy (best-effort) */
2229 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
2230 (UINT32_C(0x0) << 0)
2232 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
2233 (UINT32_C(0x1) << 0)
2235 * Set to 0xFF... (All Fs) if there is no service profile
2238 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
2239 (UINT32_C(0xff) << 0)
2240 uint8_t queue_id2_service_profile;
2242 /* ID of CoS Queue 3. FF - Invalid id */
2245 /* This value is applicable to CoS queues only. */
2246 /* Lossy (best-effort) */
2247 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
2248 (UINT32_C(0x0) << 0)
2250 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
2251 (UINT32_C(0x1) << 0)
2253 * Set to 0xFF... (All Fs) if there is no service profile
2256 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
2257 (UINT32_C(0xff) << 0)
2258 uint8_t queue_id3_service_profile;
2260 /* ID of CoS Queue 4. FF - Invalid id */
2262 /* This value is applicable to CoS queues only. */
2263 /* Lossy (best-effort) */
2264 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
2265 (UINT32_C(0x0) << 0)
2267 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
2268 (UINT32_C(0x1) << 0)
2270 * Set to 0xFF... (All Fs) if there is no service profile
2273 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
2274 (UINT32_C(0xff) << 0)
2275 uint8_t queue_id4_service_profile;
2277 /* ID of CoS Queue 5. FF - Invalid id */
2280 /* This value is applicable to CoS queues only. */
2281 /* Lossy (best-effort) */
2282 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
2283 (UINT32_C(0x0) << 0)
2285 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
2286 (UINT32_C(0x1) << 0)
2288 * Set to 0xFF... (All Fs) if there is no service profile
2291 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
2292 (UINT32_C(0xff) << 0)
2293 uint8_t queue_id5_service_profile;
2295 /* ID of CoS Queue 6. FF - Invalid id */
2296 uint8_t queue_id6_service_profile;
2297 /* This value is applicable to CoS queues only. */
2298 /* Lossy (best-effort) */
2299 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
2300 (UINT32_C(0x0) << 0)
2302 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
2303 (UINT32_C(0x1) << 0)
2305 * Set to 0xFF... (All Fs) if there is no service profile
2308 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
2309 (UINT32_C(0xff) << 0)
2312 /* ID of CoS Queue 7. FF - Invalid id */
2315 /* This value is applicable to CoS queues only. */
2316 /* Lossy (best-effort) */
2317 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
2318 (UINT32_C(0x0) << 0)
2320 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
2321 (UINT32_C(0x1) << 0)
2323 * Set to 0xFF... (All Fs) if there is no service profile
2326 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
2327 (UINT32_C(0xff) << 0)
2328 uint8_t queue_id7_service_profile;
2331 * This field is used in Output records to indicate that the output is
2332 * completely written to RAM. This field should be read as '1' to
2333 * indicate that the output has been completely written. When writing a
2334 * command completion or response to an internal processor, the order of
2335 * writes has to be such that this field is written last.
2338 } __attribute__((packed));
2340 /* hwrm_func_drv_rgtr */
2342 * Description: This command is used by the function driver to register its
2343 * information with the HWRM. A function driver shall implement this command. A
2344 * function driver shall use this command during the driver initialization right
2345 * after the HWRM version discovery and default ring resources allocation.
2348 /* Input (80 bytes) */
2349 struct hwrm_func_drv_rgtr_input {
2351 * This value indicates what type of request this is. The format for the
2352 * rest of the command is determined by this field.
2357 * This value indicates the what completion ring the request will be
2358 * optionally completed on. If the value is -1, then no CR completion
2359 * will be generated. Any other value must be a valid CR ring_id value
2360 * for this function.
2364 /* This value indicates the command sequence number. */
2368 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
2369 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
2374 * This is the host address where the response will be written when the
2375 * request is complete. This area must be 16B aligned and must be
2376 * cleared to zero before the request is made.
2381 * When this bit is '1', the function driver is requesting all requests
2382 * from its children VF drivers to be forwarded to itself. This flag can
2383 * only be set by the PF driver. If a VF driver sets this flag, it
2384 * should be ignored by the HWRM.
2386 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
2388 * When this bit is '1', the function is requesting none of the requests
2389 * from its children VF drivers to be forwarded to itself. This flag can
2390 * only be set by the PF driver. If a VF driver sets this flag, it
2391 * should be ignored by the HWRM.
2393 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
2396 /* This bit must be '1' for the os_type field to be configured. */
2397 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
2398 /* This bit must be '1' for the ver field to be configured. */
2399 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
2400 /* This bit must be '1' for the timestamp field to be configured. */
2401 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
2402 /* This bit must be '1' for the vf_req_fwd field to be configured. */
2403 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD UINT32_C(0x8)
2405 * This bit must be '1' for the async_event_fwd field to be configured.
2407 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
2411 /* This value indicates the type of OS. */
2413 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN \
2414 (UINT32_C(0x0) << 0)
2415 /* Other OS not listed below. */
2416 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER \
2417 (UINT32_C(0x1) << 0)
2419 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS \
2420 (UINT32_C(0xe) << 0)
2422 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS \
2423 (UINT32_C(0x12) << 0)
2425 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS \
2426 (UINT32_C(0x1d) << 0)
2428 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX \
2429 (UINT32_C(0x24) << 0)
2431 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD \
2432 (UINT32_C(0x2a) << 0)
2433 /* VMware ESXi OS. */
2434 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI \
2435 (UINT32_C(0x68) << 0)
2436 /* Microsoft Windows 8 64-bit OS. */
2437 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 \
2438 (UINT32_C(0x73) << 0)
2439 /* Microsoft Windows Server 2012 R2 OS. */
2440 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 \
2441 (UINT32_C(0x74) << 0)
2444 /* This is the major version of the driver. */
2447 /* This is the minor version of the driver. */
2450 /* This is the update version of the driver. */
2457 * This is a 32-bit timestamp provided by the driver for keep alive. The
2458 * timestamp is in multiples of 1ms.
2465 * This is a 256-bit bit mask provided by the PF driver for letting the
2466 * HWRM know what commands issued by the VF driver to the HWRM should be
2467 * forwarded to the PF driver. Nth bit refers to the Nth req_type.
2468 * Setting Nth bit to 1 indicates that requests from the VF driver with
2469 * req_type equal to N shall be forwarded to the parent PF driver. This
2470 * field is not valid for the VF driver.
2472 uint32_t vf_req_fwd[8];
2475 * This is a 256-bit bit mask provided by the function driver (PF or VF
2476 * driver) to indicate the list of asynchronous event completions to be
2477 * forwarded. Nth bit refers to the Nth event_id. Setting Nth bit to 1
2478 * by the function driver shall result in the HWRM forwarding
2479 * asynchronous event completion with event_id equal to N. If all bits
2480 * are set to 0 (value of 0), then the HWRM shall not forward any
2481 * asynchronous event completion to this function driver.
2483 uint32_t async_event_fwd[8];
2484 } __attribute__((packed));
2486 /* Output (16 bytes) */
2488 struct hwrm_func_drv_rgtr_output {
2490 * Pass/Fail or error type Note: receiver to verify the in parameters,
2491 * and fail the call with an error when appropriate
2493 uint16_t error_code;
2495 /* This field returns the type of original request. */
2498 /* This field provides original sequence number of the command. */
2502 * This field is the length of the response in bytes. The last byte of
2503 * the response is a valid flag that will read as '1' when the command
2504 * has been completely written to memory.
2514 * This field is used in Output records to indicate that the output is
2515 * completely written to RAM. This field should be read as '1' to
2516 * indicate that the output has been completely written. When writing a
2517 * command completion or response to an internal processor, the order of
2518 * writes has to be such that this field is written last.
2521 } __attribute__((packed));
2523 /* hwrm_func_drv_unrgtr */
2525 * Description: This command is used by the function driver to un register with
2526 * the HWRM. A function driver shall implement this command. A function driver
2527 * shall use this command during the driver unloading.
2529 /* Input (24 bytes) */
2531 struct hwrm_func_drv_unrgtr_input {
2533 * This value indicates what type of request this is. The format for the
2534 * rest of the command is determined by this field.
2539 * This value indicates the what completion ring the request will be
2540 * optionally completed on. If the value is -1, then no CR completion
2541 * will be generated. Any other value must be a valid CR ring_id value
2542 * for this function.
2546 /* This value indicates the command sequence number. */
2550 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
2551 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
2556 * This is the host address where the response will be written when the
2557 * request is complete. This area must be 16B aligned and must be
2558 * cleared to zero before the request is made.
2563 * When this bit is '1', the function driver is notifying the HWRM to
2564 * prepare for the shutdown.
2566 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
2571 } __attribute__((packed));
2573 /* Output (16 bytes) */
2574 struct hwrm_func_drv_unrgtr_output {
2576 * Pass/Fail or error type Note: receiver to verify the in parameters,
2577 * and fail the call with an error when appropriate
2579 uint16_t error_code;
2581 /* This field returns the type of original request. */
2584 /* This field provides original sequence number of the command. */
2588 * This field is the length of the response in bytes. The last byte of
2589 * the response is a valid flag that will read as '1' when the command
2590 * has been completely written to memory.
2600 * This field is used in Output records to indicate that the output is
2601 * completely written to RAM. This field should be read as '1' to
2602 * indicate that the output has been completely written. When writing a
2603 * command completion or response to an internal processor, the order of
2604 * writes has to be such that this field is written last.
2607 } __attribute__((packed));