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_
37 /* HW Resource Manager Specification 1.2.0 */
38 #define HWRM_VERSION_MAJOR 1
39 #define HWRM_VERSION_MINOR 2
40 #define HWRM_VERSION_UPDATE 0
43 * Following is the signature for HWRM message field that indicates not
44 * applicable (All F's). Need to cast it the size of the field if needed.
46 #define HWRM_NA_SIGNATURE ((uint32_t)(-1))
47 #define HWRM_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */
48 #define HWRM_MAX_RESP_LEN (176) /* hwrm_func_qstats */
49 #define HW_HASH_INDEX_SIZE 0x80 /* 7 bit indirection table index. */
50 #define HW_HASH_KEY_SIZE 40
51 #define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */
56 #define HWRM_VER_GET (UINT32_C(0x0))
57 #define HWRM_FUNC_QCAPS (UINT32_C(0x15))
58 #define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))
59 #define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))
60 #define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
61 #define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30))
62 #define HWRM_CFA_L2_FILTER_ALLOC (UINT32_C(0x90))
63 #define HWRM_CFA_L2_FILTER_FREE (UINT32_C(0x91))
64 #define HWRM_CFA_L2_FILTER_CFG (UINT32_C(0x92))
65 #define HWRM_CFA_L2_SET_RX_MASK (UINT32_C(0x93))
66 #define HWRM_EXEC_FWD_RESP (UINT32_C(0xd0))
69 #define HWRM_ERR_CODE_INVALID_PARAMS (UINT32_C(0x2))
70 #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED (UINT32_C(0x3))
72 /* HWRM Forwarded Request (16 bytes) */
73 struct hwrm_fwd_req_cmpl {
74 /* Length of forwarded request in bytes. */
76 * This field indicates the exact type of the completion. By convention,
77 * the LSB identifies the length of the record in 16B units. Even values
78 * indicate 16B records. Odd values indicate 32B records.
80 #define HWRM_FWD_REQ_CMPL_TYPE_MASK UINT32_C(0x3f)
81 #define HWRM_FWD_REQ_CMPL_TYPE_SFT 0
82 /* Forwarded HWRM Request */
83 #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ (UINT32_C(0x22) << 0)
84 /* Length of forwarded request in bytes. */
85 #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK UINT32_C(0xffc0)
86 #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT 6
87 uint16_t req_len_type;
90 * Source ID of this request. Typically used in forwarding requests and
91 * responses. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 - 0xFFFE -
92 * Reserved for internal processors 0xFFFF - HWRM
98 /* Address of forwarded request. */
100 * This value is written by the NIC such that it will be different for
101 * each pass through the completion queue. The even passes will write 1.
102 * The odd passes will write 0.
104 #define HWRM_FWD_REQ_CMPL_V UINT32_C(0x1)
105 /* Address of forwarded request. */
106 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK UINT32_C(0xfffffffe)
107 #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT 1
108 uint64_t req_buf_addr_v;
109 } __attribute__((packed));
111 /* HWRM Asynchronous Event Completion Record (16 bytes) */
112 struct hwrm_async_event_cmpl {
114 * This field indicates the exact type of the completion. By convention,
115 * the LSB identifies the length of the record in 16B units. Even values
116 * indicate 16B records. Odd values indicate 32B records.
118 #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK UINT32_C(0x3f)
119 #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT 0
120 /* HWRM Asynchronous Event Information */
121 #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT \
122 (UINT32_C(0x2e) << 0)
125 /* Identifiers of events. */
126 /* Link status changed */
127 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE \
129 /* Link MTU changed */
130 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE \
132 /* Link speed changed */
133 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE \
135 /* DCB Configuration changed */
136 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE \
138 /* Port connection not allowed */
139 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \
141 /* Link speed configuration was not allowed */
142 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED \
144 /* Function driver unloaded */
145 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD \
146 (UINT32_C(0x10) << 0)
147 /* Function driver loaded */
148 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD \
149 (UINT32_C(0x11) << 0)
150 /* PF driver unloaded */
151 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD \
152 (UINT32_C(0x20) << 0)
153 /* PF driver loaded */
154 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD \
155 (UINT32_C(0x21) << 0)
156 /* VF Function Level Reset (FLR) */
157 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR (UINT32_C(0x30) << 0)
158 /* VF MAC Address Change */
159 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE \
160 (UINT32_C(0x31) << 0)
161 /* PF-VF communication channel status change. */
162 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE \
163 (UINT32_C(0x32) << 0)
165 #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR \
166 (UINT32_C(0xff) << 0)
169 /* Event specific data */
170 uint32_t event_data2;
174 * This value is written by the NIC such that it will be different for
175 * each pass through the completion queue. The even passes will write 1.
176 * The odd passes will write 0.
178 #define HWRM_ASYNC_EVENT_CMPL_V UINT32_C(0x1)
180 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK UINT32_C(0xfe)
181 #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT 1
184 /* 8-lsb timestamp from POR (100-msec resolution) */
185 uint8_t timestamp_lo;
187 /* 16-lsb timestamp from POR (100-msec resolution) */
188 uint16_t timestamp_hi;
190 /* Event specific data */
191 uint32_t event_data1;
192 } __attribute__((packed));
195 * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
196 * inside the chip. The HWRM is implemented in firmware, and runs on embedded
197 * processors inside the chip. This firmware is vital part of the chip's
198 * hardware. The chip can not be used by driver without it.
201 /* Input (16 bytes) */
204 * This value indicates what type of request this is. The format for the
205 * rest of the command is determined by this field.
210 * This value indicates the what completion ring the request will be
211 * optionally completed on. If the value is -1, then no CR completion
212 * will be generated. Any other value must be a valid CR ring_id value
217 /* This value indicates the command sequence number. */
221 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
222 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
227 * This is the host address where the response will be written when the
228 * request is complete. This area must be 16B aligned and must be
229 * cleared to zero before the request is made.
232 } __attribute__((packed));
234 /* Output (8 bytes) */
237 * Pass/Fail or error type Note: receiver to verify the in parameters,
238 * and fail the call with an error when appropriate
242 /* This field returns the type of original request. */
245 /* This field provides original sequence number of the command. */
249 * This field is the length of the response in bytes. The last byte of
250 * the response is a valid flag that will read as '1' when the command
251 * has been completely written to memory.
254 } __attribute__((packed));
256 /* hwrm_cfa_l2_filter_alloc */
258 * A filter is used to identify traffic that contains a matching set of
259 * parameters like unicast or broadcast MAC address or a VLAN tag amongst
260 * other things which then allows the ASIC to direct the incoming traffic
261 * to an appropriate VNIC or Rx ring.
264 /* Input (96 bytes) */
265 struct hwrm_cfa_l2_filter_alloc_input {
267 * This value indicates what type of request this is. The format for the
268 * rest of the command is determined by this field.
273 * This value indicates the what completion ring the request will be
274 * optionally completed on. If the value is -1, then no CR completion
275 * will be generated. Any other value must be a valid CR ring_id value
280 /* This value indicates the command sequence number. */
284 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
285 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
290 * This is the host address where the response will be written when the
291 * request is complete. This area must be 16B aligned and must be
292 * cleared to zero before the request is made.
297 * Enumeration denoting the RX, TX type of the resource. This
298 * enumeration is used for resources that are similar for both TX and RX
301 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH \
304 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_TX \
307 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX \
309 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_LAST \
310 HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX
312 * Setting of this flag indicates the applicability to the loopback
315 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_LOOPBACK \
318 * Setting of this flag indicates drop action. If this flag is not set,
319 * then it should be considered accept action.
321 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_DROP \
324 * If this flag is set, all t_l2_* fields are invalid and they should
325 * not be specified. If this flag is set, then l2_* fields refer to
326 * fields of outermost L2 header.
328 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST \
332 /* This bit must be '1' for the l2_addr field to be configured. */
333 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR \
335 /* This bit must be '1' for the l2_addr_mask field to be configured. */
336 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK \
338 /* This bit must be '1' for the l2_ovlan field to be configured. */
339 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN \
341 /* This bit must be '1' for the l2_ovlan_mask field to be configured. */
342 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN_MASK \
344 /* This bit must be '1' for the l2_ivlan field to be configured. */
345 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN \
347 /* This bit must be '1' for the l2_ivlan_mask field to be configured. */
348 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK \
350 /* This bit must be '1' for the t_l2_addr field to be configured. */
351 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR \
354 * This bit must be '1' for the t_l2_addr_mask field to be configured.
356 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_ADDR_MASK \
358 /* This bit must be '1' for the t_l2_ovlan field to be configured. */
359 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN \
362 * This bit must be '1' for the t_l2_ovlan_mask field to be configured.
364 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_OVLAN_MASK \
366 /* This bit must be '1' for the t_l2_ivlan field to be configured. */
367 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN \
370 * This bit must be '1' for the t_l2_ivlan_mask field to be configured.
372 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_T_L2_IVLAN_MASK \
374 /* This bit must be '1' for the src_type field to be configured. */
375 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_TYPE \
377 /* This bit must be '1' for the src_id field to be configured. */
378 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_SRC_ID \
380 /* This bit must be '1' for the tunnel_type field to be configured. */
381 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE \
383 /* This bit must be '1' for the dst_id field to be configured. */
384 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_DST_ID \
387 * This bit must be '1' for the mirror_vnic_id field to be configured.
389 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_MIRROR_VNIC_ID \
394 * This value sets the match value for the L2 MAC address. Destination
395 * MAC address for RX path. Source MAC address for TX path.
403 * This value sets the mask value for the L2 address. A value of 0 will
404 * mask the corresponding bit from compare.
406 uint8_t l2_addr_mask[6];
408 /* This value sets VLAN ID value for outer VLAN. */
412 * This value sets the mask value for the ovlan id. A value of 0 will
413 * mask the corresponding bit from compare.
415 uint16_t l2_ovlan_mask;
417 /* This value sets VLAN ID value for inner VLAN. */
421 * This value sets the mask value for the ivlan id. A value of 0 will
422 * mask the corresponding bit from compare.
424 uint16_t l2_ivlan_mask;
430 * This value sets the match value for the tunnel L2 MAC address.
431 * Destination MAC address for RX path. Source MAC address for TX path.
433 uint8_t t_l2_addr[6];
439 * This value sets the mask value for the tunnel L2 address. A value of
440 * 0 will mask the corresponding bit from compare.
442 uint8_t t_l2_addr_mask[6];
444 /* This value sets VLAN ID value for tunnel outer VLAN. */
448 * This value sets the mask value for the tunnel ovlan id. A value of 0
449 * will mask the corresponding bit from compare.
451 uint16_t t_l2_ovlan_mask;
453 /* This value sets VLAN ID value for tunnel inner VLAN. */
457 * This value sets the mask value for the tunnel ivlan id. A value of 0
458 * will mask the corresponding bit from compare.
460 uint16_t t_l2_ivlan_mask;
462 /* This value identifies the type of source of the packet. */
464 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_NPORT \
466 /* Physical function */
467 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_PF \
469 /* Virtual function */
470 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VF \
472 /* Virtual NIC of a function */
473 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_VNIC \
475 /* Embedded processor for CFA management */
476 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_KONG \
478 /* Embedded processor for OOB management */
479 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_APE \
481 /* Embedded processor for RoCE */
482 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_BONO \
484 /* Embedded processor for network proxy functions */
485 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_SRC_TYPE_TANG \
491 * This value is the id of the source. For a network port, it represents
492 * port_id. For a physical function, it represents fid. For a virtual
493 * function, it represents vf_id. For a vnic, it represents vnic_id. For
494 * embedded processors, this id is not valid. Notes: 1. The function ID
495 * is implied if it src_id is not provided for a src_type that is either
501 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NONTUNNEL \
503 /* Virtual eXtensible Local Area Network (VXLAN) */
504 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_VXLAN \
507 * Network Virtualization Generic Routing Encapsulation (NVGRE)
509 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_NVGRE \
512 * Generic Routing Encapsulation (GRE) inside Ethernet payload
514 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_L2GRE \
517 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPIP \
519 /* Generic Network Virtualization Encapsulation (Geneve) */
520 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_GENEVE \
522 /* Multi-Protocol Lable Switching (MPLS) */
523 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_MPLS \
525 /* Stateless Transport Tunnel (STT) */
526 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_STT \
529 * Generic Routing Encapsulation (GRE) inside IP datagram
532 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_IPGRE \
534 /* Any tunneled traffic */
535 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_TUNNEL_TYPE_ANYTUNNEL \
536 (UINT32_C(0xff) << 0)
542 * If set, this value shall represent the Logical VNIC ID of the
543 * destination VNIC for the RX path and network port id of the
544 * destination port for the TX path.
548 /* Logical VNIC ID of the VNIC where traffic is mirrored. */
549 uint16_t mirror_vnic_id;
552 * This hint is provided to help in placing the filter in the filter
556 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_NO_PREFER \
558 /* Above the given filter */
559 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_ABOVE_FILTER \
561 /* Below the given filter */
562 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_BELOW_FILTER \
564 /* As high as possible */
565 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MAX \
567 /* As low as possible */
568 #define HWRM_CFA_L2_FILTER_ALLOC_INPUT_PRI_HINT_MIN \
576 * This is the ID of the filter that goes along with the pri_hint. This
577 * field is valid only for the following values. 1 - Above the given
578 * filter 2 - Below the given filter
580 uint64_t l2_filter_id_hint;
581 } __attribute__((packed));
583 /* Output (24 bytes) */
584 struct hwrm_cfa_l2_filter_alloc_output {
586 * Pass/Fail or error type Note: receiver to verify the in parameters,
587 * and fail the call with an error when appropriate
591 /* This field returns the type of original request. */
594 /* This field provides original sequence number of the command. */
598 * This field is the length of the response in bytes. The last byte of
599 * the response is a valid flag that will read as '1' when the command
600 * has been completely written to memory.
605 * This value identifies a set of CFA data structures used for an L2
608 uint64_t l2_filter_id;
611 * This is the ID of the flow associated with this filter. This value
612 * shall be used to match and associate the flow identifier returned in
613 * completion records. A value of 0xFFFFFFFF shall indicate no flow id.
622 * This field is used in Output records to indicate that the output is
623 * completely written to RAM. This field should be read as '1' to
624 * indicate that the output has been completely written. When writing a
625 * command completion or response to an internal processor, the order of
626 * writes has to be such that this field is written last.
629 } __attribute__((packed));
631 /* hwrm_cfa_l2_filter_free */
633 * Description: Free a L2 filter. The HWRM shall free all associated filter
634 * resources with the L2 filter.
637 /* Input (24 bytes) */
638 struct hwrm_cfa_l2_filter_free_input {
640 * This value indicates what type of request this is. The format for the
641 * rest of the command is determined by this field.
646 * This value indicates the what completion ring the request will be
647 * optionally completed on. If the value is -1, then no CR completion
648 * will be generated. Any other value must be a valid CR ring_id value
653 /* This value indicates the command sequence number. */
657 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
658 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
663 * This is the host address where the response will be written when the
664 * request is complete. This area must be 16B aligned and must be
665 * cleared to zero before the request is made.
670 * This value identifies a set of CFA data structures used for an L2
673 uint64_t l2_filter_id;
674 } __attribute__((packed));
676 /* Output (16 bytes) */
677 struct hwrm_cfa_l2_filter_free_output {
679 * Pass/Fail or error type Note: receiver to verify the in parameters,
680 * and fail the call with an error when appropriate
684 /* This field returns the type of original request. */
687 /* This field provides original sequence number of the command. */
691 * This field is the length of the response in bytes. The last byte of
692 * the response is a valid flag that will read as '1' when the command
693 * has been completely written to memory.
703 * This field is used in Output records to indicate that the output is
704 * completely written to RAM. This field should be read as '1' to
705 * indicate that the output has been completely written. When writing a
706 * command completion or response to an internal processor, the order of
707 * writes has to be such that this field is written last.
710 } __attribute__((packed));
712 /* hwrm_exec_fwd_resp */
714 * Description: This command is used to send an encapsulated request to the
715 * HWRM. This command instructs the HWRM to execute the request and forward the
716 * response of the encapsulated request to the location specified in the
717 * original request that is encapsulated. The target id of this command shall be
718 * set to 0xFFFF (HWRM). The response location in this command shall be used to
719 * acknowledge the receipt of the encapsulated request and forwarding of the
723 /* Input (128 bytes) */
724 struct hwrm_exec_fwd_resp_input {
726 * This value indicates what type of request this is. The format for the
727 * rest of the command is determined by this field.
732 * This value indicates the what completion ring the request will be
733 * optionally completed on. If the value is -1, then no CR completion
734 * will be generated. Any other value must be a valid CR ring_id value
739 /* This value indicates the command sequence number. */
743 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
744 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
749 * This is the host address where the response will be written when the
750 * request is complete. This area must be 16B aligned and must be
751 * cleared to zero before the request is made.
756 * This is an encapsulated request. This request should be executed by
757 * the HWRM and the response should be provided in the response buffer
758 * inside the encapsulated request.
760 uint32_t encap_request[26];
763 * This value indicates the target id of the response to the
764 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 -
765 * 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
767 uint16_t encap_resp_target_id;
769 uint16_t unused_0[3];
770 } __attribute__((packed));
772 /* Output (16 bytes) */
773 struct hwrm_exec_fwd_resp_output {
775 * Pass/Fail or error type Note: receiver to verify the in parameters,
776 * and fail the call with an error when appropriate
780 /* This field returns the type of original request. */
783 /* This field provides original sequence number of the command. */
787 * This field is the length of the response in bytes. The last byte of
788 * the response is a valid flag that will read as '1' when the command
789 * has been completely written to memory.
799 * This field is used in Output records to indicate that the output is
800 * completely written to RAM. This field should be read as '1' to
801 * indicate that the output has been completely written. When writing a
802 * command completion or response to an internal processor, the order of
803 * writes has to be such that this field is written last.
806 } __attribute__((packed));
808 /* hwrm_func_qcaps */
810 * Description: This command returns capabilities of a function. The input FID
811 * value is used to indicate what function is being queried. This allows a
812 * physical function driver to query virtual functions that are children of the
813 * physical function. The output FID value is needed to configure Rings and
814 * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
817 /* Input (24 bytes) */
818 struct hwrm_func_qcaps_input {
820 * This value indicates what type of request this is. The format for the
821 * rest of the command is determined by this field.
826 * This value indicates the what completion ring the request will be
827 * optionally completed on. If the value is -1, then no CR completion
828 * will be generated. Any other value must be a valid CR ring_id value
833 /* This value indicates the command sequence number. */
837 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
838 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
843 * This is the host address where the response will be written when the
844 * request is complete. This area must be 16B aligned and must be
845 * cleared to zero before the request is made.
850 * Function ID of the function that is being queried. 0xFF... (All Fs)
851 * if the query is for the requesting function.
855 uint16_t unused_0[3];
856 } __attribute__((packed));
858 /* Output (80 bytes) */
859 struct hwrm_func_qcaps_output {
861 * Pass/Fail or error type Note: receiver to verify the in parameters,
862 * and fail the call with an error when appropriate
866 /* This field returns the type of original request. */
869 /* This field provides original sequence number of the command. */
873 * This field is the length of the response in bytes. The last byte of
874 * the response is a valid flag that will read as '1' when the command
875 * has been completely written to memory.
880 * FID value. This value is used to identify operations on the PCI bus
881 * as belonging to a particular PCI function.
886 * Port ID of port that this function is associated with. Valid only for
887 * the PF. 0xFF... (All Fs) if this function is not associated with any
888 * port. 0xFF... (All Fs) if this function is called from a VF.
892 /* If 1, then Push mode is supported on this function. */
893 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
895 * If 1, then the global MSI-X auto-masking is enabled for the device.
897 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
900 * If 1, then the Precision Time Protocol (PTP) processing is supported
901 * on this function. The HWRM should enable PTP on only a single
902 * Physical Function (PF) per port.
904 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
908 * This value is current MAC address configured for this function. A
909 * value of 00-00-00-00-00-00 indicates no MAC address is currently
912 uint8_t perm_mac_address[6];
915 * The maximum number of RSS/COS contexts that can be allocated to the
918 uint16_t max_rsscos_ctx;
921 * The maximum number of completion rings that can be allocated to the
924 uint16_t max_cmpl_rings;
927 * The maximum number of transmit rings that can be allocated to the
930 uint16_t max_tx_rings;
933 * The maximum number of receive rings that can be allocated to the
936 uint16_t max_rx_rings;
939 * The maximum number of L2 contexts that can be allocated to the
942 uint16_t max_l2_ctxs;
944 /* The maximum number of VNICs that can be allocated to the function. */
948 * The identifier for the first VF enabled on a PF. This is valid only
949 * on the PF with SR-IOV enabled. 0xFF... (All Fs) if this command is
950 * called on a PF with SR-IOV disabled or on a VF.
952 uint16_t first_vf_id;
955 * The maximum number of VFs that can be allocated to the function. This
956 * is valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if this
957 * command is called on a PF with SR-IOV disabled or on a VF.
962 * The maximum number of statistic contexts that can be allocated to the
965 uint16_t max_stat_ctx;
968 * The maximum number of Encapsulation records that can be offloaded by
971 uint32_t max_encap_records;
974 * The maximum number of decapsulation records that can be offloaded by
977 uint32_t max_decap_records;
980 * The maximum number of Exact Match (EM) flows that can be offloaded by
981 * this function on the TX side.
983 uint32_t max_tx_em_flows;
986 * The maximum number of Wildcard Match (WM) flows that can be offloaded
987 * by this function on the TX side.
989 uint32_t max_tx_wm_flows;
992 * The maximum number of Exact Match (EM) flows that can be offloaded by
993 * this function on the RX side.
995 uint32_t max_rx_em_flows;
998 * The maximum number of Wildcard Match (WM) flows that can be offloaded
999 * by this function on the RX side.
1001 uint32_t max_rx_wm_flows;
1004 * The maximum number of multicast filters that can be supported by this
1005 * function on the RX side.
1007 uint32_t max_mcast_filters;
1010 * The maximum value of flow_id that can be supported in completion
1013 uint32_t max_flow_id;
1016 * The maximum number of HW ring groups that can be supported on this
1019 uint32_t max_hw_ring_grps;
1026 * This field is used in Output records to indicate that the output is
1027 * completely written to RAM. This field should be read as '1' to
1028 * indicate that the output has been completely written. When writing a
1029 * command completion or response to an internal processor, the order of
1030 * writes has to be such that this field is written last.
1033 } __attribute__((packed));
1035 /* hwrm_port_phy_cfg */
1037 * Description: This command configures the PHY device for the port. It allows
1038 * setting of the most generic settings for the PHY. The HWRM shall complete
1039 * this command as soon as PHY settings are configured. They may not be applied
1040 * when the command response is provided. A VF driver shall not be allowed to
1041 * configure PHY using this command. In a network partition mode, a PF driver
1042 * shall not be allowed to configure PHY using this command.
1045 /* Input (56 bytes) */
1046 struct hwrm_port_phy_cfg_input {
1048 * This value indicates what type of request this is. The format for the
1049 * rest of the command is determined by this field.
1054 * This value indicates the what completion ring the request will be
1055 * optionally completed on. If the value is -1, then no CR completion
1056 * will be generated. Any other value must be a valid CR ring_id value
1057 * for this function.
1061 /* This value indicates the command sequence number. */
1065 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1066 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1071 * This is the host address where the response will be written when the
1072 * request is complete. This area must be 16B aligned and must be
1073 * cleared to zero before the request is made.
1078 * When this bit is set to '1', the PHY for the port shall be reset. #
1079 * If this bit is set to 1, then the HWRM shall reset the PHY after
1080 * applying PHY configuration changes specified in this command. # In
1081 * order to guarantee that PHY configuration changes specified in this
1082 * command take effect, the HWRM client should set this flag to 1. # If
1083 * this bit is not set to 1, then the HWRM may reset the PHY depending
1084 * on the current PHY configuration and settings specified in this
1087 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY UINT32_C(0x1)
1089 * When this bit is set to '1', the link shall be forced to be taken
1090 * down. # When this bit is set to '1", all other command input settings
1091 * related to the link speed shall be ignored. Once the link state is
1092 * forced down, it can be explicitly cleared from that state by setting
1093 * this flag to '0'. # If this flag is set to '0', then the link shall
1094 * be cleared from forced down state if the link is in forced down
1095 * state. There may be conditions (e.g. out-of-band or sideband
1096 * configuration changes for the link) outside the scope of the HWRM
1097 * implementation that may clear forced down link state.
1099 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DOWN UINT32_C(0x2)
1101 * When this bit is set to '1', the link shall be forced to the
1102 * force_link_speed value. When this bit is set to '1', the HWRM client
1103 * should not enable any of the auto negotiation related fields
1104 * represented by auto_XXX fields in this command. When this bit is set
1105 * to '1' and the HWRM client has enabled a auto_XXX field in this
1106 * command, then the HWRM shall ignore the enabled auto_XXX field. When
1107 * this bit is set to zero, the link shall be allowed to autoneg.
1109 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE UINT32_C(0x4)
1111 * When this bit is set to '1', the auto-negotiation process shall be
1112 * restarted on the link.
1114 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG UINT32_C(0x8)
1116 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
1117 * requested to be enabled on this link. If EEE is not supported on this
1118 * port, then this flag shall be ignored by the HWRM.
1120 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE UINT32_C(0x10)
1122 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
1123 * requested to be disabled on this link. If EEE is not supported on
1124 * this port, then this flag shall be ignored by the HWRM.
1126 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE UINT32_C(0x20)
1128 * When this bit is set to '1' and EEE is enabled on this link, then TX
1129 * LPI is requested to be enabled on the link. If EEE is not supported
1130 * on this port, then this flag shall be ignored by the HWRM. If EEE is
1131 * disabled on this port, then this flag shall be ignored by the HWRM.
1133 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI UINT32_C(0x40)
1136 /* This bit must be '1' for the auto_mode field to be configured. */
1137 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE UINT32_C(0x1)
1138 /* This bit must be '1' for the auto_duplex field to be configured. */
1139 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX UINT32_C(0x2)
1140 /* This bit must be '1' for the auto_pause field to be configured. */
1141 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE UINT32_C(0x4)
1143 * This bit must be '1' for the auto_link_speed field to be configured.
1145 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED UINT32_C(0x8)
1147 * This bit must be '1' for the auto_link_speed_mask field to be
1150 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
1152 /* This bit must be '1' for the wirespeed field to be configured. */
1153 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED UINT32_C(0x20)
1154 /* This bit must be '1' for the lpbk field to be configured. */
1155 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK UINT32_C(0x40)
1156 /* This bit must be '1' for the preemphasis field to be configured. */
1157 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS UINT32_C(0x80)
1158 /* This bit must be '1' for the force_pause field to be configured. */
1159 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE UINT32_C(0x100)
1161 * This bit must be '1' for the eee_link_speed_mask field to be
1164 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
1166 /* This bit must be '1' for the tx_lpi_timer field to be configured. */
1167 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER UINT32_C(0x400)
1170 /* Port ID of port that is to be configured. */
1174 * This is the speed that will be used if the force bit is '1'. If
1175 * unsupported speed is selected, an error will be generated.
1177 /* 100Mb link speed */
1178 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB \
1179 (UINT32_C(0x1) << 0)
1180 /* 1Gb link speed */
1181 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB \
1182 (UINT32_C(0xa) << 0)
1183 /* 2Gb link speed */
1184 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB \
1185 (UINT32_C(0x14) << 0)
1186 /* 2.5Gb link speed */
1187 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB \
1188 (UINT32_C(0x19) << 0)
1189 /* 10Gb link speed */
1190 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB \
1191 (UINT32_C(0x64) << 0)
1192 /* 20Mb link speed */
1193 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB \
1194 (UINT32_C(0xc8) << 0)
1195 /* 25Gb link speed */
1196 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB \
1197 (UINT32_C(0xfa) << 0)
1198 /* 40Gb link speed */
1199 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB \
1200 (UINT32_C(0x190) << 0)
1201 /* 50Gb link speed */
1202 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB \
1203 (UINT32_C(0x1f4) << 0)
1204 /* 100Gb link speed */
1205 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB \
1206 (UINT32_C(0x3e8) << 0)
1207 /* 10Mb link speed */
1208 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB \
1209 (UINT32_C(0xffff) << 0)
1210 uint16_t force_link_speed;
1213 * This value is used to identify what autoneg mode is used when the
1214 * link speed is not being forced.
1217 * Disable autoneg or autoneg disabled. No speeds are selected.
1219 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE (UINT32_C(0x0) << 0)
1220 /* Select all possible speeds for autoneg mode. */
1221 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS \
1222 (UINT32_C(0x1) << 0)
1224 * Select only the auto_link_speed speed for autoneg mode. This
1225 * mode has been DEPRECATED. An HWRM client should not use this
1228 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED \
1229 (UINT32_C(0x2) << 0)
1231 * Select the auto_link_speed or any speed below that speed for
1232 * autoneg. This mode has been DEPRECATED. An HWRM client should
1233 * not use this mode.
1235 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW \
1236 (UINT32_C(0x3) << 0)
1238 * Select the speeds based on the corresponding link speed mask
1239 * value that is provided.
1241 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK \
1242 (UINT32_C(0x4) << 0)
1246 * This is the duplex setting that will be used if the autoneg_mode is
1247 * "one_speed" or "one_or_below".
1249 /* Half Duplex will be requested. */
1250 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF \
1251 (UINT32_C(0x0) << 0)
1252 /* Full duplex will be requested. */
1253 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL \
1254 (UINT32_C(0x1) << 0)
1255 /* Both Half and Full dupex will be requested. */
1256 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH \
1257 (UINT32_C(0x2) << 0)
1258 uint8_t auto_duplex;
1261 * This value is used to configure the pause that will be used for
1262 * autonegotiation. Add text on the usage of auto_pause and force_pause.
1265 * When this bit is '1', Generation of tx pause messages has been
1266 * requested. Disabled otherwise.
1268 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX UINT32_C(0x1)
1270 * When this bit is '1', Reception of rx pause messages has been
1271 * requested. Disabled otherwise.
1273 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX UINT32_C(0x2)
1275 * When set to 1, the advertisement of pause is enabled. # When the
1276 * auto_mode is not set to none and this flag is set to 1, then the
1277 * auto_pause bits on this port are being advertised and autoneg pause
1278 * results are being interpreted. # When the auto_mode is not set to
1279 * none and this flag is set to 0, the pause is forced as indicated in
1280 * force_pause, and also advertised as auto_pause bits, but the autoneg
1281 * results are not interpreted since the pause configuration is being
1282 * forced. # When the auto_mode is set to none and this flag is set to
1283 * 1, auto_pause bits should be ignored and should be set to 0.
1285 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
1291 * This is the speed that will be used if the autoneg_mode is
1292 * "one_speed" or "one_or_below". If an unsupported speed is selected,
1293 * an error will be generated.
1295 /* 100Mb link speed */
1296 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB \
1297 (UINT32_C(0x1) << 0)
1298 /* 1Gb link speed */
1299 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB \
1300 (UINT32_C(0xa) << 0)
1301 /* 2Gb link speed */
1302 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB \
1303 (UINT32_C(0x14) << 0)
1304 /* 2.5Gb link speed */
1305 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB \
1306 (UINT32_C(0x19) << 0)
1307 /* 10Gb link speed */
1308 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB \
1309 (UINT32_C(0x64) << 0)
1310 /* 20Mb link speed */
1311 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB \
1312 (UINT32_C(0xc8) << 0)
1313 /* 25Gb link speed */
1314 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB \
1315 (UINT32_C(0xfa) << 0)
1316 /* 40Gb link speed */
1317 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB \
1318 (UINT32_C(0x190) << 0)
1319 /* 50Gb link speed */
1320 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB \
1321 (UINT32_C(0x1f4) << 0)
1322 /* 100Gb link speed */
1323 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB \
1324 (UINT32_C(0x3e8) << 0)
1325 /* 10Mb link speed */
1326 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB \
1327 (UINT32_C(0xffff) << 0)
1328 uint16_t auto_link_speed;
1331 * This is a mask of link speeds that will be used if autoneg_mode is
1332 * "mask". If unsupported speed is enabled an error will be generated.
1334 /* 100Mb link speed (Half-duplex) */
1335 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
1337 /* 100Mb link speed (Full-duplex) */
1338 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
1340 /* 1Gb link speed (Half-duplex) */
1341 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
1343 /* 1Gb link speed (Full-duplex) */
1344 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
1346 /* 2Gb link speed */
1347 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
1349 /* 2.5Gb link speed */
1350 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
1352 /* 10Gb link speed */
1353 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
1355 /* 20Gb link speed */
1356 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
1358 /* 25Gb link speed */
1359 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
1361 /* 40Gb link speed */
1362 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
1364 /* 50Gb link speed */
1365 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
1367 /* 100Gb link speed */
1368 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
1370 /* 10Mb link speed (Half-duplex) */
1371 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
1373 /* 10Mb link speed (Full-duplex) */
1374 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
1376 uint16_t auto_link_speed_mask;
1378 /* This value controls the wirespeed feature. */
1379 /* Wirespeed feature is disabled. */
1380 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF (UINT32_C(0x0) << 0)
1381 /* Wirespeed feature is enabled. */
1382 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON (UINT32_C(0x1) << 0)
1385 /* This value controls the loopback setting for the PHY. */
1386 /* No loopback is selected. Normal operation. */
1387 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE (UINT32_C(0x0) << 0)
1389 * The HW will be configured with local loopback such that host
1390 * data is sent back to the host without modification.
1392 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL (UINT32_C(0x1) << 0)
1394 * The HW will be configured with remote loopback such that port
1395 * logic will send packets back out the transmitter that are
1398 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE (UINT32_C(0x2) << 0)
1402 * This value is used to configure the pause that will be used for force
1406 * When this bit is '1', Generation of tx pause messages is supported.
1407 * Disabled otherwise.
1409 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1)
1411 * When this bit is '1', Reception of rx pause messages is supported.
1412 * Disabled otherwise.
1414 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2)
1415 uint8_t force_pause;
1420 * This value controls the pre-emphasis to be used for the link. Driver
1421 * should not set this value (use enable.preemphasis = 0) unless driver
1422 * is sure of setting. Normally HWRM FW will determine proper pre-
1425 uint32_t preemphasis;
1428 * Setting for link speed mask that is used to advertise speeds during
1429 * autonegotiation when EEE is enabled. This field is valid only when
1430 * EEE is enabled. The speeds specified in this field shall be a subset
1431 * of speeds specified in auto_link_speed_mask. If EEE is enabled,then
1432 * at least one speed shall be provided in this mask.
1435 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
1436 /* 100Mb link speed (Full-duplex) */
1437 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
1439 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
1440 /* 1Gb link speed (Full-duplex) */
1441 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
1443 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
1446 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
1448 /* 10Gb link speed */
1449 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
1451 uint16_t eee_link_speed_mask;
1457 * Reuested setting of TX LPI timer in microseconds. This field is valid
1458 * only when EEE is enabled and TX LPI is enabled.
1460 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK \
1462 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
1463 uint32_t tx_lpi_timer;
1466 } __attribute__((packed));
1468 /* Output (16 bytes) */
1469 struct hwrm_port_phy_cfg_output {
1471 * Pass/Fail or error type Note: receiver to verify the in parameters,
1472 * and fail the call with an error when appropriate
1474 uint16_t error_code;
1476 /* This field returns the type of original request. */
1479 /* This field provides original sequence number of the command. */
1483 * This field is the length of the response in bytes. The last byte of
1484 * the response is a valid flag that will read as '1' when the command
1485 * has been completely written to memory.
1495 * This field is used in Output records to indicate that the output is
1496 * completely written to RAM. This field should be read as '1' to
1497 * indicate that the output has been completely written. When writing a
1498 * command completion or response to an internal processor, the order of
1499 * writes has to be such that this field is written last.
1502 } __attribute__((packed));
1506 * Description: This function is called by a driver to determine the HWRM
1507 * interface version supported by the HWRM firmware, the version of HWRM
1508 * firmware implementation, the name of HWRM firmware, the versions of other
1509 * embedded firmwares, and the names of other embedded firmwares, etc. Any
1510 * interface or firmware version with major = 0, minor = 0, and update = 0 shall
1511 * be considered an invalid version.
1514 /* Input (24 bytes) */
1515 struct hwrm_ver_get_input {
1517 * This value indicates what type of request this is. The format for the
1518 * rest of the command is determined by this field.
1523 * This value indicates the what completion ring the request will be
1524 * optionally completed on. If the value is -1, then no CR completion
1525 * will be generated. Any other value must be a valid CR ring_id value
1526 * for this function.
1530 /* This value indicates the command sequence number. */
1534 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1535 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1540 * This is the host address where the response will be written when the
1541 * request is complete. This area must be 16B aligned and must be
1542 * cleared to zero before the request is made.
1547 * This field represents the major version of HWRM interface
1548 * specification supported by the driver HWRM implementation. The
1549 * interface major version is intended to change only when non backward
1550 * compatible changes are made to the HWRM interface specification.
1552 uint8_t hwrm_intf_maj;
1555 * This field represents the minor version of HWRM interface
1556 * specification supported by the driver HWRM implementation. A change
1557 * in interface minor version is used to reflect significant backward
1558 * compatible modification to HWRM interface specification. This can be
1559 * due to addition or removal of functionality. HWRM interface
1560 * specifications with the same major version but different minor
1561 * versions are compatible.
1563 uint8_t hwrm_intf_min;
1566 * This field represents the update version of HWRM interface
1567 * specification supported by the driver HWRM implementation. The
1568 * interface update version is used to reflect minor changes or bug
1569 * fixes to a released HWRM interface specification.
1571 uint8_t hwrm_intf_upd;
1573 uint8_t unused_0[5];
1574 } __attribute__((packed));
1576 /* Output (128 bytes) */
1577 struct hwrm_ver_get_output {
1579 * Pass/Fail or error type Note: receiver to verify the in parameters,
1580 * and fail the call with an error when appropriate
1582 uint16_t error_code;
1584 /* This field returns the type of original request. */
1587 /* This field provides original sequence number of the command. */
1591 * This field is the length of the response in bytes. The last byte of
1592 * the response is a valid flag that will read as '1' when the command
1593 * has been completely written to memory.
1598 * This field represents the major version of HWRM interface
1599 * specification supported by the HWRM implementation. The interface
1600 * major version is intended to change only when non backward compatible
1601 * changes are made to the HWRM interface specification. A HWRM
1602 * implementation that is compliant with this specification shall
1603 * provide value of 1 in this field.
1605 uint8_t hwrm_intf_maj;
1608 * This field represents the minor version of HWRM interface
1609 * specification supported by the HWRM implementation. A change in
1610 * interface minor version is used to reflect significant backward
1611 * compatible modification to HWRM interface specification. This can be
1612 * due to addition or removal of functionality. HWRM interface
1613 * specifications with the same major version but different minor
1614 * versions are compatible. A HWRM implementation that is compliant with
1615 * this specification shall provide value of 0 in this field.
1617 uint8_t hwrm_intf_min;
1620 * This field represents the update version of HWRM interface
1621 * specification supported by the HWRM implementation. The interface
1622 * update version is used to reflect minor changes or bug fixes to a
1623 * released HWRM interface specification. A HWRM implementation that is
1624 * compliant with this specification shall provide value of 1 in this
1627 uint8_t hwrm_intf_upd;
1629 uint8_t hwrm_intf_rsvd;
1632 * This field represents the major version of HWRM firmware. A change in
1633 * firmware major version represents a major firmware release.
1635 uint8_t hwrm_fw_maj;
1638 * This field represents the minor version of HWRM firmware. A change in
1639 * firmware minor version represents significant firmware functionality
1642 uint8_t hwrm_fw_min;
1645 * This field represents the build version of HWRM firmware. A change in
1646 * firmware build version represents bug fixes to a released firmware.
1648 uint8_t hwrm_fw_bld;
1651 * This field is a reserved field. This field can be used to represent
1652 * firmware branches or customer specific releases tied to a specific
1653 * (major,minor,update) version of the HWRM firmware.
1655 uint8_t hwrm_fw_rsvd;
1658 * This field represents the major version of mgmt firmware. A change in
1659 * major version represents a major release.
1661 uint8_t mgmt_fw_maj;
1664 * This field represents the minor version of mgmt firmware. A change in
1665 * minor version represents significant functionality changes.
1667 uint8_t mgmt_fw_min;
1670 * This field represents the build version of mgmt firmware. A change in
1671 * update version represents bug fixes.
1673 uint8_t mgmt_fw_bld;
1676 * This field is a reserved field. This field can be used to represent
1677 * firmware branches or customer specific releases tied to a specific
1678 * (major,minor,update) version
1680 uint8_t mgmt_fw_rsvd;
1683 * This field represents the major version of network control firmware.
1684 * A change in major version represents a major release.
1686 uint8_t netctrl_fw_maj;
1689 * This field represents the minor version of network control firmware.
1690 * A change in minor version represents significant functionality
1693 uint8_t netctrl_fw_min;
1696 * This field represents the build version of network control firmware.
1697 * A change in update version represents bug fixes.
1699 uint8_t netctrl_fw_bld;
1702 * This field is a reserved field. This field can be used to represent
1703 * firmware branches or customer specific releases tied to a specific
1704 * (major,minor,update) version
1706 uint8_t netctrl_fw_rsvd;
1709 * This field is reserved for future use. The responder should set it to
1710 * 0. The requester should ignore this field.
1715 * This field represents the major version of RoCE firmware. A change in
1716 * major version represents a major release.
1718 uint8_t roce_fw_maj;
1721 * This field represents the minor version of RoCE firmware. A change in
1722 * minor version represents significant functionality changes.
1724 uint8_t roce_fw_min;
1727 * This field represents the build version of RoCE firmware. A change in
1728 * update version represents bug fixes.
1730 uint8_t roce_fw_bld;
1733 * This field is a reserved field. This field can be used to represent
1734 * firmware branches or customer specific releases tied to a specific
1735 * (major,minor,update) version
1737 uint8_t roce_fw_rsvd;
1740 * This field represents the name of HWRM FW (ASCII chars without NULL
1743 char hwrm_fw_name[16];
1746 * This field represents the name of mgmt FW (ASCII chars without NULL
1749 char mgmt_fw_name[16];
1752 * This field represents the name of network control firmware (ASCII
1753 * chars without NULL at the end).
1755 char netctrl_fw_name[16];
1758 * This field is reserved for future use. The responder should set it to
1759 * 0. The requester should ignore this field.
1761 uint32_t reserved2[4];
1764 * This field represents the name of RoCE FW (ASCII chars without NULL
1767 char roce_fw_name[16];
1769 /* This field returns the chip number. */
1772 /* This field returns the revision of chip. */
1775 /* This field returns the chip metal number. */
1778 /* This field returns the bond id of the chip. */
1779 uint8_t chip_bond_id;
1782 * This value indicates the type of platform used for chip
1786 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC \
1787 (UINT32_C(0x0) << 0)
1788 /* FPGA platform of the chip. */
1789 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA \
1790 (UINT32_C(0x1) << 0)
1791 /* Palladium platform of the chip. */
1792 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM \
1793 (UINT32_C(0x2) << 0)
1794 uint8_t chip_platform_type;
1797 * This field returns the maximum value of request window that is
1798 * supported by the HWRM. The request window is mapped into device
1799 * address space using MMIO.
1801 uint16_t max_req_win_len;
1804 * This field returns the maximum value of response buffer in bytes. If
1805 * a request specifies the response buffer length that is greater than
1806 * this value, then the HWRM should fail it. The value of this field
1807 * shall be 4KB or more.
1809 uint16_t max_resp_len;
1812 * This field returns the default request timeout value in milliseconds.
1814 uint16_t def_req_timeout;
1821 * This field is used in Output records to indicate that the output is
1822 * completely written to RAM. This field should be read as '1' to
1823 * indicate that the output has been completely written. When writing a
1824 * command completion or response to an internal processor, the order of
1825 * writes has to be such that this field is written last.
1828 } __attribute__((packed));
1830 /* hwrm_queue_qportcfg */
1832 * Description: This function is called by a driver to query queue configuration
1833 * of a port. # The HWRM shall at least advertise one queue with lossy service
1834 * profile. # The driver shall use this command to query queue ids before
1835 * configuring or using any queues. # If a service profile is not set for a
1836 * queue, then the driver shall not use that queue without configuring a service
1837 * profile for it. # If the driver is not allowed to configure service profiles,
1838 * then the driver shall only use queues for which service profiles are pre-
1842 /* Input (24 bytes) */
1843 struct hwrm_queue_qportcfg_input {
1845 * This value indicates what type of request this is. The format for the
1846 * rest of the command is determined by this field.
1851 * This value indicates the what completion ring the request will be
1852 * optionally completed on. If the value is -1, then no CR completion
1853 * will be generated. Any other value must be a valid CR ring_id value
1854 * for this function.
1858 /* This value indicates the command sequence number. */
1862 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1863 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1868 * This is the host address where the response will be written when the
1869 * request is complete. This area must be 16B aligned and must be
1870 * cleared to zero before the request is made.
1875 * Enumeration denoting the RX, TX type of the resource. This
1876 * enumeration is used for resources that are similar for both TX and RX
1877 * paths of the chip.
1879 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH \
1882 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX \
1883 (UINT32_C(0x0) << 0)
1885 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX \
1886 (UINT32_C(0x1) << 0)
1887 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
1888 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
1892 * Port ID of port for which the queue configuration is being queried.
1893 * This field is only required when sent by IPC.
1898 } __attribute__((packed));
1900 /* Output (32 bytes) */
1901 struct hwrm_queue_qportcfg_output {
1903 * Pass/Fail or error type Note: receiver to verify the in parameters,
1904 * and fail the call with an error when appropriate
1906 uint16_t error_code;
1908 /* This field returns the type of original request. */
1911 /* This field provides original sequence number of the command. */
1915 * This field is the length of the response in bytes. The last byte of
1916 * the response is a valid flag that will read as '1' when the command
1917 * has been completely written to memory.
1921 /* The maximum number of queues that can be configured. */
1922 uint8_t max_configurable_queues;
1924 /* The maximum number of lossless queues that can be configured. */
1925 uint8_t max_configurable_lossless_queues;
1928 * 0 - Not allowed. Non-zero - Allowed. If this value is non-zero, then
1929 * the HWRM shall allow the host SW driver to configure queues using
1932 uint8_t queue_cfg_allowed;
1935 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1936 * the HWRM shall allow the host SW driver to configure queue buffers
1937 * using hwrm_queue_buffers_cfg.
1939 uint8_t queue_buffers_cfg_allowed;
1942 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1943 * the HWRM shall allow the host SW driver to configure PFC using
1944 * hwrm_queue_pfcenable_cfg.
1946 uint8_t queue_pfcenable_cfg_allowed;
1949 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1950 * the HWRM shall allow the host SW driver to configure Priority to CoS
1951 * mapping using hwrm_queue_pri2cos_cfg.
1953 uint8_t queue_pri2cos_cfg_allowed;
1956 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1957 * the HWRM shall allow the host SW driver to configure CoS Bandwidth
1958 * configuration using hwrm_queue_cos2bw_cfg.
1960 uint8_t queue_cos2bw_cfg_allowed;
1962 /* ID of CoS Queue 0. FF - Invalid id */
1965 /* This value is applicable to CoS queues only. */
1966 /* Lossy (best-effort) */
1967 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
1968 (UINT32_C(0x0) << 0)
1970 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
1971 (UINT32_C(0x1) << 0)
1973 * Set to 0xFF... (All Fs) if there is no service profile
1976 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
1977 (UINT32_C(0xff) << 0)
1978 uint8_t queue_id0_service_profile;
1980 /* ID of CoS Queue 1. FF - Invalid id */
1982 /* This value is applicable to CoS queues only. */
1983 /* Lossy (best-effort) */
1984 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
1985 (UINT32_C(0x0) << 0)
1987 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
1988 (UINT32_C(0x1) << 0)
1990 * Set to 0xFF... (All Fs) if there is no service profile
1993 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
1994 (UINT32_C(0xff) << 0)
1995 uint8_t queue_id1_service_profile;
1997 /* ID of CoS Queue 2. FF - Invalid id */
1999 /* This value is applicable to CoS queues only. */
2000 /* Lossy (best-effort) */
2001 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
2002 (UINT32_C(0x0) << 0)
2004 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
2005 (UINT32_C(0x1) << 0)
2007 * Set to 0xFF... (All Fs) if there is no service profile
2010 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
2011 (UINT32_C(0xff) << 0)
2012 uint8_t queue_id2_service_profile;
2014 /* ID of CoS Queue 3. FF - Invalid id */
2017 /* This value is applicable to CoS queues only. */
2018 /* Lossy (best-effort) */
2019 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
2020 (UINT32_C(0x0) << 0)
2022 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
2023 (UINT32_C(0x1) << 0)
2025 * Set to 0xFF... (All Fs) if there is no service profile
2028 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
2029 (UINT32_C(0xff) << 0)
2030 uint8_t queue_id3_service_profile;
2032 /* ID of CoS Queue 4. FF - Invalid id */
2034 /* This value is applicable to CoS queues only. */
2035 /* Lossy (best-effort) */
2036 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
2037 (UINT32_C(0x0) << 0)
2039 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
2040 (UINT32_C(0x1) << 0)
2042 * Set to 0xFF... (All Fs) if there is no service profile
2045 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
2046 (UINT32_C(0xff) << 0)
2047 uint8_t queue_id4_service_profile;
2049 /* ID of CoS Queue 5. FF - Invalid id */
2052 /* This value is applicable to CoS queues only. */
2053 /* Lossy (best-effort) */
2054 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
2055 (UINT32_C(0x0) << 0)
2057 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
2058 (UINT32_C(0x1) << 0)
2060 * Set to 0xFF... (All Fs) if there is no service profile
2063 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
2064 (UINT32_C(0xff) << 0)
2065 uint8_t queue_id5_service_profile;
2067 /* ID of CoS Queue 6. FF - Invalid id */
2068 uint8_t queue_id6_service_profile;
2069 /* This value is applicable to CoS queues only. */
2070 /* Lossy (best-effort) */
2071 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
2072 (UINT32_C(0x0) << 0)
2074 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
2075 (UINT32_C(0x1) << 0)
2077 * Set to 0xFF... (All Fs) if there is no service profile
2080 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
2081 (UINT32_C(0xff) << 0)
2084 /* ID of CoS Queue 7. FF - Invalid id */
2087 /* This value is applicable to CoS queues only. */
2088 /* Lossy (best-effort) */
2089 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
2090 (UINT32_C(0x0) << 0)
2092 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
2093 (UINT32_C(0x1) << 0)
2095 * Set to 0xFF... (All Fs) if there is no service profile
2098 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
2099 (UINT32_C(0xff) << 0)
2100 uint8_t queue_id7_service_profile;
2103 * This field is used in Output records to indicate that the output is
2104 * completely written to RAM. This field should be read as '1' to
2105 * indicate that the output has been completely written. When writing a
2106 * command completion or response to an internal processor, the order of
2107 * writes has to be such that this field is written last.
2110 } __attribute__((packed));
2112 /* hwrm_func_drv_rgtr */
2114 * Description: This command is used by the function driver to register its
2115 * information with the HWRM. A function driver shall implement this command. A
2116 * function driver shall use this command during the driver initialization right
2117 * after the HWRM version discovery and default ring resources allocation.
2120 /* Input (80 bytes) */
2121 struct hwrm_func_drv_rgtr_input {
2123 * This value indicates what type of request this is. The format for the
2124 * rest of the command is determined by this field.
2129 * This value indicates the what completion ring the request will be
2130 * optionally completed on. If the value is -1, then no CR completion
2131 * will be generated. Any other value must be a valid CR ring_id value
2132 * for this function.
2136 /* This value indicates the command sequence number. */
2140 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
2141 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
2146 * This is the host address where the response will be written when the
2147 * request is complete. This area must be 16B aligned and must be
2148 * cleared to zero before the request is made.
2153 * When this bit is '1', the function driver is requesting all requests
2154 * from its children VF drivers to be forwarded to itself. This flag can
2155 * only be set by the PF driver. If a VF driver sets this flag, it
2156 * should be ignored by the HWRM.
2158 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
2160 * When this bit is '1', the function is requesting none of the requests
2161 * from its children VF drivers to be forwarded to itself. This flag can
2162 * only be set by the PF driver. If a VF driver sets this flag, it
2163 * should be ignored by the HWRM.
2165 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
2168 /* This bit must be '1' for the os_type field to be configured. */
2169 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
2170 /* This bit must be '1' for the ver field to be configured. */
2171 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
2172 /* This bit must be '1' for the timestamp field to be configured. */
2173 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
2174 /* This bit must be '1' for the vf_req_fwd field to be configured. */
2175 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD UINT32_C(0x8)
2177 * This bit must be '1' for the async_event_fwd field to be configured.
2179 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
2183 /* This value indicates the type of OS. */
2185 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN \
2186 (UINT32_C(0x0) << 0)
2187 /* Other OS not listed below. */
2188 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER \
2189 (UINT32_C(0x1) << 0)
2191 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS \
2192 (UINT32_C(0xe) << 0)
2194 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS \
2195 (UINT32_C(0x12) << 0)
2197 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS \
2198 (UINT32_C(0x1d) << 0)
2200 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX \
2201 (UINT32_C(0x24) << 0)
2203 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD \
2204 (UINT32_C(0x2a) << 0)
2205 /* VMware ESXi OS. */
2206 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI \
2207 (UINT32_C(0x68) << 0)
2208 /* Microsoft Windows 8 64-bit OS. */
2209 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 \
2210 (UINT32_C(0x73) << 0)
2211 /* Microsoft Windows Server 2012 R2 OS. */
2212 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 \
2213 (UINT32_C(0x74) << 0)
2216 /* This is the major version of the driver. */
2219 /* This is the minor version of the driver. */
2222 /* This is the update version of the driver. */
2229 * This is a 32-bit timestamp provided by the driver for keep alive. The
2230 * timestamp is in multiples of 1ms.
2237 * This is a 256-bit bit mask provided by the PF driver for letting the
2238 * HWRM know what commands issued by the VF driver to the HWRM should be
2239 * forwarded to the PF driver. Nth bit refers to the Nth req_type.
2240 * Setting Nth bit to 1 indicates that requests from the VF driver with
2241 * req_type equal to N shall be forwarded to the parent PF driver. This
2242 * field is not valid for the VF driver.
2244 uint32_t vf_req_fwd[8];
2247 * This is a 256-bit bit mask provided by the function driver (PF or VF
2248 * driver) to indicate the list of asynchronous event completions to be
2249 * forwarded. Nth bit refers to the Nth event_id. Setting Nth bit to 1
2250 * by the function driver shall result in the HWRM forwarding
2251 * asynchronous event completion with event_id equal to N. If all bits
2252 * are set to 0 (value of 0), then the HWRM shall not forward any
2253 * asynchronous event completion to this function driver.
2255 uint32_t async_event_fwd[8];
2256 } __attribute__((packed));
2258 /* Output (16 bytes) */
2260 struct hwrm_func_drv_rgtr_output {
2262 * Pass/Fail or error type Note: receiver to verify the in parameters,
2263 * and fail the call with an error when appropriate
2265 uint16_t error_code;
2267 /* This field returns the type of original request. */
2270 /* This field provides original sequence number of the command. */
2274 * This field is the length of the response in bytes. The last byte of
2275 * the response is a valid flag that will read as '1' when the command
2276 * has been completely written to memory.
2286 * This field is used in Output records to indicate that the output is
2287 * completely written to RAM. This field should be read as '1' to
2288 * indicate that the output has been completely written. When writing a
2289 * command completion or response to an internal processor, the order of
2290 * writes has to be such that this field is written last.
2293 } __attribute__((packed));
2295 /* hwrm_func_drv_unrgtr */
2297 * Description: This command is used by the function driver to un register with
2298 * the HWRM. A function driver shall implement this command. A function driver
2299 * shall use this command during the driver unloading.
2301 /* Input (24 bytes) */
2303 struct hwrm_func_drv_unrgtr_input {
2305 * This value indicates what type of request this is. The format for the
2306 * rest of the command is determined by this field.
2311 * This value indicates the what completion ring the request will be
2312 * optionally completed on. If the value is -1, then no CR completion
2313 * will be generated. Any other value must be a valid CR ring_id value
2314 * for this function.
2318 /* This value indicates the command sequence number. */
2322 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
2323 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
2328 * This is the host address where the response will be written when the
2329 * request is complete. This area must be 16B aligned and must be
2330 * cleared to zero before the request is made.
2335 * When this bit is '1', the function driver is notifying the HWRM to
2336 * prepare for the shutdown.
2338 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
2343 } __attribute__((packed));
2345 /* Output (16 bytes) */
2346 struct hwrm_func_drv_unrgtr_output {
2348 * Pass/Fail or error type Note: receiver to verify the in parameters,
2349 * and fail the call with an error when appropriate
2351 uint16_t error_code;
2353 /* This field returns the type of original request. */
2356 /* This field provides original sequence number of the command. */
2360 * This field is the length of the response in bytes. The last byte of
2361 * the response is a valid flag that will read as '1' when the command
2362 * has been completely written to memory.
2372 * This field is used in Output records to indicate that the output is
2373 * completely written to RAM. This field should be read as '1' to
2374 * indicate that the output has been completely written. When writing a
2375 * command completion or response to an internal processor, the order of
2376 * writes has to be such that this field is written last.
2379 } __attribute__((packed));