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_exec_fwd_resp */
258 * Description: This command is used to send an encapsulated request to the
259 * HWRM. This command instructs the HWRM to execute the request and forward the
260 * response of the encapsulated request to the location specified in the
261 * original request that is encapsulated. The target id of this command shall be
262 * set to 0xFFFF (HWRM). The response location in this command shall be used to
263 * acknowledge the receipt of the encapsulated request and forwarding of the
267 /* Input (128 bytes) */
268 struct hwrm_exec_fwd_resp_input {
270 * This value indicates what type of request this is. The format for the
271 * rest of the command is determined by this field.
276 * This value indicates the what completion ring the request will be
277 * optionally completed on. If the value is -1, then no CR completion
278 * will be generated. Any other value must be a valid CR ring_id value
283 /* This value indicates the command sequence number. */
287 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
288 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
293 * This is the host address where the response will be written when the
294 * request is complete. This area must be 16B aligned and must be
295 * cleared to zero before the request is made.
300 * This is an encapsulated request. This request should be executed by
301 * the HWRM and the response should be provided in the response buffer
302 * inside the encapsulated request.
304 uint32_t encap_request[26];
307 * This value indicates the target id of the response to the
308 * encapsulated request. 0x0 - 0xFFF8 - Used for function ids 0xFFF8 -
309 * 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
311 uint16_t encap_resp_target_id;
313 uint16_t unused_0[3];
314 } __attribute__((packed));
316 /* Output (16 bytes) */
317 struct hwrm_exec_fwd_resp_output {
319 * Pass/Fail or error type Note: receiver to verify the in parameters,
320 * and fail the call with an error when appropriate
324 /* This field returns the type of original request. */
327 /* This field provides original sequence number of the command. */
331 * This field is the length of the response in bytes. The last byte of
332 * the response is a valid flag that will read as '1' when the command
333 * has been completely written to memory.
343 * This field is used in Output records to indicate that the output is
344 * completely written to RAM. This field should be read as '1' to
345 * indicate that the output has been completely written. When writing a
346 * command completion or response to an internal processor, the order of
347 * writes has to be such that this field is written last.
350 } __attribute__((packed));
352 /* hwrm_func_qcaps */
354 * Description: This command returns capabilities of a function. The input FID
355 * value is used to indicate what function is being queried. This allows a
356 * physical function driver to query virtual functions that are children of the
357 * physical function. The output FID value is needed to configure Rings and
358 * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
361 /* Input (24 bytes) */
362 struct hwrm_func_qcaps_input {
364 * This value indicates what type of request this is. The format for the
365 * rest of the command is determined by this field.
370 * This value indicates the what completion ring the request will be
371 * optionally completed on. If the value is -1, then no CR completion
372 * will be generated. Any other value must be a valid CR ring_id value
377 /* This value indicates the command sequence number. */
381 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
382 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
387 * This is the host address where the response will be written when the
388 * request is complete. This area must be 16B aligned and must be
389 * cleared to zero before the request is made.
394 * Function ID of the function that is being queried. 0xFF... (All Fs)
395 * if the query is for the requesting function.
399 uint16_t unused_0[3];
400 } __attribute__((packed));
402 /* Output (80 bytes) */
403 struct hwrm_func_qcaps_output {
405 * Pass/Fail or error type Note: receiver to verify the in parameters,
406 * and fail the call with an error when appropriate
410 /* This field returns the type of original request. */
413 /* This field provides original sequence number of the command. */
417 * This field is the length of the response in bytes. The last byte of
418 * the response is a valid flag that will read as '1' when the command
419 * has been completely written to memory.
424 * FID value. This value is used to identify operations on the PCI bus
425 * as belonging to a particular PCI function.
430 * Port ID of port that this function is associated with. Valid only for
431 * the PF. 0xFF... (All Fs) if this function is not associated with any
432 * port. 0xFF... (All Fs) if this function is called from a VF.
436 /* If 1, then Push mode is supported on this function. */
437 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
439 * If 1, then the global MSI-X auto-masking is enabled for the device.
441 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
444 * If 1, then the Precision Time Protocol (PTP) processing is supported
445 * on this function. The HWRM should enable PTP on only a single
446 * Physical Function (PF) per port.
448 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
452 * This value is current MAC address configured for this function. A
453 * value of 00-00-00-00-00-00 indicates no MAC address is currently
456 uint8_t perm_mac_address[6];
459 * The maximum number of RSS/COS contexts that can be allocated to the
462 uint16_t max_rsscos_ctx;
465 * The maximum number of completion rings that can be allocated to the
468 uint16_t max_cmpl_rings;
471 * The maximum number of transmit rings that can be allocated to the
474 uint16_t max_tx_rings;
477 * The maximum number of receive rings that can be allocated to the
480 uint16_t max_rx_rings;
483 * The maximum number of L2 contexts that can be allocated to the
486 uint16_t max_l2_ctxs;
488 /* The maximum number of VNICs that can be allocated to the function. */
492 * The identifier for the first VF enabled on a PF. This is valid only
493 * on the PF with SR-IOV enabled. 0xFF... (All Fs) if this command is
494 * called on a PF with SR-IOV disabled or on a VF.
496 uint16_t first_vf_id;
499 * The maximum number of VFs that can be allocated to the function. This
500 * is valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if this
501 * command is called on a PF with SR-IOV disabled or on a VF.
506 * The maximum number of statistic contexts that can be allocated to the
509 uint16_t max_stat_ctx;
512 * The maximum number of Encapsulation records that can be offloaded by
515 uint32_t max_encap_records;
518 * The maximum number of decapsulation records that can be offloaded by
521 uint32_t max_decap_records;
524 * The maximum number of Exact Match (EM) flows that can be offloaded by
525 * this function on the TX side.
527 uint32_t max_tx_em_flows;
530 * The maximum number of Wildcard Match (WM) flows that can be offloaded
531 * by this function on the TX side.
533 uint32_t max_tx_wm_flows;
536 * The maximum number of Exact Match (EM) flows that can be offloaded by
537 * this function on the RX side.
539 uint32_t max_rx_em_flows;
542 * The maximum number of Wildcard Match (WM) flows that can be offloaded
543 * by this function on the RX side.
545 uint32_t max_rx_wm_flows;
548 * The maximum number of multicast filters that can be supported by this
549 * function on the RX side.
551 uint32_t max_mcast_filters;
554 * The maximum value of flow_id that can be supported in completion
557 uint32_t max_flow_id;
560 * The maximum number of HW ring groups that can be supported on this
563 uint32_t max_hw_ring_grps;
570 * This field is used in Output records to indicate that the output is
571 * completely written to RAM. This field should be read as '1' to
572 * indicate that the output has been completely written. When writing a
573 * command completion or response to an internal processor, the order of
574 * writes has to be such that this field is written last.
577 } __attribute__((packed));
579 /* hwrm_port_phy_cfg */
581 * Description: This command configures the PHY device for the port. It allows
582 * setting of the most generic settings for the PHY. The HWRM shall complete
583 * this command as soon as PHY settings are configured. They may not be applied
584 * when the command response is provided. A VF driver shall not be allowed to
585 * configure PHY using this command. In a network partition mode, a PF driver
586 * shall not be allowed to configure PHY using this command.
589 /* Input (56 bytes) */
590 struct hwrm_port_phy_cfg_input {
592 * This value indicates what type of request this is. The format for the
593 * rest of the command is determined by this field.
598 * This value indicates the what completion ring the request will be
599 * optionally completed on. If the value is -1, then no CR completion
600 * will be generated. Any other value must be a valid CR ring_id value
605 /* This value indicates the command sequence number. */
609 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
610 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
615 * This is the host address where the response will be written when the
616 * request is complete. This area must be 16B aligned and must be
617 * cleared to zero before the request is made.
622 * When this bit is set to '1', the PHY for the port shall be reset. #
623 * If this bit is set to 1, then the HWRM shall reset the PHY after
624 * applying PHY configuration changes specified in this command. # In
625 * order to guarantee that PHY configuration changes specified in this
626 * command take effect, the HWRM client should set this flag to 1. # If
627 * this bit is not set to 1, then the HWRM may reset the PHY depending
628 * on the current PHY configuration and settings specified in this
631 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY UINT32_C(0x1)
633 * When this bit is set to '1', the link shall be forced to be taken
634 * down. # When this bit is set to '1", all other command input settings
635 * related to the link speed shall be ignored. Once the link state is
636 * forced down, it can be explicitly cleared from that state by setting
637 * this flag to '0'. # If this flag is set to '0', then the link shall
638 * be cleared from forced down state if the link is in forced down
639 * state. There may be conditions (e.g. out-of-band or sideband
640 * configuration changes for the link) outside the scope of the HWRM
641 * implementation that may clear forced down link state.
643 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DOWN UINT32_C(0x2)
645 * When this bit is set to '1', the link shall be forced to the
646 * force_link_speed value. When this bit is set to '1', the HWRM client
647 * should not enable any of the auto negotiation related fields
648 * represented by auto_XXX fields in this command. When this bit is set
649 * to '1' and the HWRM client has enabled a auto_XXX field in this
650 * command, then the HWRM shall ignore the enabled auto_XXX field. When
651 * this bit is set to zero, the link shall be allowed to autoneg.
653 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE UINT32_C(0x4)
655 * When this bit is set to '1', the auto-negotiation process shall be
656 * restarted on the link.
658 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG UINT32_C(0x8)
660 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
661 * requested to be enabled on this link. If EEE is not supported on this
662 * port, then this flag shall be ignored by the HWRM.
664 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE UINT32_C(0x10)
666 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
667 * requested to be disabled on this link. If EEE is not supported on
668 * this port, then this flag shall be ignored by the HWRM.
670 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE UINT32_C(0x20)
672 * When this bit is set to '1' and EEE is enabled on this link, then TX
673 * LPI is requested to be enabled on the link. If EEE is not supported
674 * on this port, then this flag shall be ignored by the HWRM. If EEE is
675 * disabled on this port, then this flag shall be ignored by the HWRM.
677 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI UINT32_C(0x40)
680 /* This bit must be '1' for the auto_mode field to be configured. */
681 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE UINT32_C(0x1)
682 /* This bit must be '1' for the auto_duplex field to be configured. */
683 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX UINT32_C(0x2)
684 /* This bit must be '1' for the auto_pause field to be configured. */
685 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE UINT32_C(0x4)
687 * This bit must be '1' for the auto_link_speed field to be configured.
689 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED UINT32_C(0x8)
691 * This bit must be '1' for the auto_link_speed_mask field to be
694 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
696 /* This bit must be '1' for the wirespeed field to be configured. */
697 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED UINT32_C(0x20)
698 /* This bit must be '1' for the lpbk field to be configured. */
699 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK UINT32_C(0x40)
700 /* This bit must be '1' for the preemphasis field to be configured. */
701 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS UINT32_C(0x80)
702 /* This bit must be '1' for the force_pause field to be configured. */
703 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE UINT32_C(0x100)
705 * This bit must be '1' for the eee_link_speed_mask field to be
708 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
710 /* This bit must be '1' for the tx_lpi_timer field to be configured. */
711 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER UINT32_C(0x400)
714 /* Port ID of port that is to be configured. */
718 * This is the speed that will be used if the force bit is '1'. If
719 * unsupported speed is selected, an error will be generated.
721 /* 100Mb link speed */
722 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB \
725 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB \
728 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB \
729 (UINT32_C(0x14) << 0)
730 /* 2.5Gb link speed */
731 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB \
732 (UINT32_C(0x19) << 0)
733 /* 10Gb link speed */
734 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB \
735 (UINT32_C(0x64) << 0)
736 /* 20Mb link speed */
737 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB \
738 (UINT32_C(0xc8) << 0)
739 /* 25Gb link speed */
740 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB \
741 (UINT32_C(0xfa) << 0)
742 /* 40Gb link speed */
743 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB \
744 (UINT32_C(0x190) << 0)
745 /* 50Gb link speed */
746 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB \
747 (UINT32_C(0x1f4) << 0)
748 /* 100Gb link speed */
749 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB \
750 (UINT32_C(0x3e8) << 0)
751 /* 10Mb link speed */
752 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB \
753 (UINT32_C(0xffff) << 0)
754 uint16_t force_link_speed;
757 * This value is used to identify what autoneg mode is used when the
758 * link speed is not being forced.
761 * Disable autoneg or autoneg disabled. No speeds are selected.
763 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE (UINT32_C(0x0) << 0)
764 /* Select all possible speeds for autoneg mode. */
765 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS \
768 * Select only the auto_link_speed speed for autoneg mode. This
769 * mode has been DEPRECATED. An HWRM client should not use this
772 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED \
775 * Select the auto_link_speed or any speed below that speed for
776 * autoneg. This mode has been DEPRECATED. An HWRM client should
779 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW \
782 * Select the speeds based on the corresponding link speed mask
783 * value that is provided.
785 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK \
790 * This is the duplex setting that will be used if the autoneg_mode is
791 * "one_speed" or "one_or_below".
793 /* Half Duplex will be requested. */
794 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF \
796 /* Full duplex will be requested. */
797 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL \
799 /* Both Half and Full dupex will be requested. */
800 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH \
805 * This value is used to configure the pause that will be used for
806 * autonegotiation. Add text on the usage of auto_pause and force_pause.
809 * When this bit is '1', Generation of tx pause messages has been
810 * requested. Disabled otherwise.
812 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX UINT32_C(0x1)
814 * When this bit is '1', Reception of rx pause messages has been
815 * requested. Disabled otherwise.
817 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX UINT32_C(0x2)
819 * When set to 1, the advertisement of pause is enabled. # When the
820 * auto_mode is not set to none and this flag is set to 1, then the
821 * auto_pause bits on this port are being advertised and autoneg pause
822 * results are being interpreted. # When the auto_mode is not set to
823 * none and this flag is set to 0, the pause is forced as indicated in
824 * force_pause, and also advertised as auto_pause bits, but the autoneg
825 * results are not interpreted since the pause configuration is being
826 * forced. # When the auto_mode is set to none and this flag is set to
827 * 1, auto_pause bits should be ignored and should be set to 0.
829 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
835 * This is the speed that will be used if the autoneg_mode is
836 * "one_speed" or "one_or_below". If an unsupported speed is selected,
837 * an error will be generated.
839 /* 100Mb link speed */
840 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB \
843 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB \
846 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB \
847 (UINT32_C(0x14) << 0)
848 /* 2.5Gb link speed */
849 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB \
850 (UINT32_C(0x19) << 0)
851 /* 10Gb link speed */
852 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB \
853 (UINT32_C(0x64) << 0)
854 /* 20Mb link speed */
855 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB \
856 (UINT32_C(0xc8) << 0)
857 /* 25Gb link speed */
858 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB \
859 (UINT32_C(0xfa) << 0)
860 /* 40Gb link speed */
861 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB \
862 (UINT32_C(0x190) << 0)
863 /* 50Gb link speed */
864 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB \
865 (UINT32_C(0x1f4) << 0)
866 /* 100Gb link speed */
867 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB \
868 (UINT32_C(0x3e8) << 0)
869 /* 10Mb link speed */
870 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB \
871 (UINT32_C(0xffff) << 0)
872 uint16_t auto_link_speed;
875 * This is a mask of link speeds that will be used if autoneg_mode is
876 * "mask". If unsupported speed is enabled an error will be generated.
878 /* 100Mb link speed (Half-duplex) */
879 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
881 /* 100Mb link speed (Full-duplex) */
882 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
884 /* 1Gb link speed (Half-duplex) */
885 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
887 /* 1Gb link speed (Full-duplex) */
888 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
891 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
893 /* 2.5Gb link speed */
894 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
896 /* 10Gb link speed */
897 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
899 /* 20Gb link speed */
900 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
902 /* 25Gb link speed */
903 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
905 /* 40Gb link speed */
906 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
908 /* 50Gb link speed */
909 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
911 /* 100Gb link speed */
912 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
914 /* 10Mb link speed (Half-duplex) */
915 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
917 /* 10Mb link speed (Full-duplex) */
918 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
920 uint16_t auto_link_speed_mask;
922 /* This value controls the wirespeed feature. */
923 /* Wirespeed feature is disabled. */
924 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF (UINT32_C(0x0) << 0)
925 /* Wirespeed feature is enabled. */
926 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON (UINT32_C(0x1) << 0)
929 /* This value controls the loopback setting for the PHY. */
930 /* No loopback is selected. Normal operation. */
931 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE (UINT32_C(0x0) << 0)
933 * The HW will be configured with local loopback such that host
934 * data is sent back to the host without modification.
936 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL (UINT32_C(0x1) << 0)
938 * The HW will be configured with remote loopback such that port
939 * logic will send packets back out the transmitter that are
942 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE (UINT32_C(0x2) << 0)
946 * This value is used to configure the pause that will be used for force
950 * When this bit is '1', Generation of tx pause messages is supported.
951 * Disabled otherwise.
953 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1)
955 * When this bit is '1', Reception of rx pause messages is supported.
956 * Disabled otherwise.
958 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2)
964 * This value controls the pre-emphasis to be used for the link. Driver
965 * should not set this value (use enable.preemphasis = 0) unless driver
966 * is sure of setting. Normally HWRM FW will determine proper pre-
969 uint32_t preemphasis;
972 * Setting for link speed mask that is used to advertise speeds during
973 * autonegotiation when EEE is enabled. This field is valid only when
974 * EEE is enabled. The speeds specified in this field shall be a subset
975 * of speeds specified in auto_link_speed_mask. If EEE is enabled,then
976 * at least one speed shall be provided in this mask.
979 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
980 /* 100Mb link speed (Full-duplex) */
981 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
983 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
984 /* 1Gb link speed (Full-duplex) */
985 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
987 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
990 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
992 /* 10Gb link speed */
993 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
995 uint16_t eee_link_speed_mask;
1001 * Reuested setting of TX LPI timer in microseconds. This field is valid
1002 * only when EEE is enabled and TX LPI is enabled.
1004 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK \
1006 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
1007 uint32_t tx_lpi_timer;
1010 } __attribute__((packed));
1012 /* Output (16 bytes) */
1013 struct hwrm_port_phy_cfg_output {
1015 * Pass/Fail or error type Note: receiver to verify the in parameters,
1016 * and fail the call with an error when appropriate
1018 uint16_t error_code;
1020 /* This field returns the type of original request. */
1023 /* This field provides original sequence number of the command. */
1027 * This field is the length of the response in bytes. The last byte of
1028 * the response is a valid flag that will read as '1' when the command
1029 * has been completely written to memory.
1039 * This field is used in Output records to indicate that the output is
1040 * completely written to RAM. This field should be read as '1' to
1041 * indicate that the output has been completely written. When writing a
1042 * command completion or response to an internal processor, the order of
1043 * writes has to be such that this field is written last.
1046 } __attribute__((packed));
1050 * Description: This function is called by a driver to determine the HWRM
1051 * interface version supported by the HWRM firmware, the version of HWRM
1052 * firmware implementation, the name of HWRM firmware, the versions of other
1053 * embedded firmwares, and the names of other embedded firmwares, etc. Any
1054 * interface or firmware version with major = 0, minor = 0, and update = 0 shall
1055 * be considered an invalid version.
1058 /* Input (24 bytes) */
1059 struct hwrm_ver_get_input {
1061 * This value indicates what type of request this is. The format for the
1062 * rest of the command is determined by this field.
1067 * This value indicates the what completion ring the request will be
1068 * optionally completed on. If the value is -1, then no CR completion
1069 * will be generated. Any other value must be a valid CR ring_id value
1070 * for this function.
1074 /* This value indicates the command sequence number. */
1078 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1079 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1084 * This is the host address where the response will be written when the
1085 * request is complete. This area must be 16B aligned and must be
1086 * cleared to zero before the request is made.
1091 * This field represents the major version of HWRM interface
1092 * specification supported by the driver HWRM implementation. The
1093 * interface major version is intended to change only when non backward
1094 * compatible changes are made to the HWRM interface specification.
1096 uint8_t hwrm_intf_maj;
1099 * This field represents the minor version of HWRM interface
1100 * specification supported by the driver HWRM implementation. A change
1101 * in interface minor version is used to reflect significant backward
1102 * compatible modification to HWRM interface specification. This can be
1103 * due to addition or removal of functionality. HWRM interface
1104 * specifications with the same major version but different minor
1105 * versions are compatible.
1107 uint8_t hwrm_intf_min;
1110 * This field represents the update version of HWRM interface
1111 * specification supported by the driver HWRM implementation. The
1112 * interface update version is used to reflect minor changes or bug
1113 * fixes to a released HWRM interface specification.
1115 uint8_t hwrm_intf_upd;
1117 uint8_t unused_0[5];
1118 } __attribute__((packed));
1120 /* Output (128 bytes) */
1121 struct hwrm_ver_get_output {
1123 * Pass/Fail or error type Note: receiver to verify the in parameters,
1124 * and fail the call with an error when appropriate
1126 uint16_t error_code;
1128 /* This field returns the type of original request. */
1131 /* This field provides original sequence number of the command. */
1135 * This field is the length of the response in bytes. The last byte of
1136 * the response is a valid flag that will read as '1' when the command
1137 * has been completely written to memory.
1142 * This field represents the major version of HWRM interface
1143 * specification supported by the HWRM implementation. The interface
1144 * major version is intended to change only when non backward compatible
1145 * changes are made to the HWRM interface specification. A HWRM
1146 * implementation that is compliant with this specification shall
1147 * provide value of 1 in this field.
1149 uint8_t hwrm_intf_maj;
1152 * This field represents the minor version of HWRM interface
1153 * specification supported by the HWRM implementation. A change in
1154 * interface minor version is used to reflect significant backward
1155 * compatible modification to HWRM interface specification. This can be
1156 * due to addition or removal of functionality. HWRM interface
1157 * specifications with the same major version but different minor
1158 * versions are compatible. A HWRM implementation that is compliant with
1159 * this specification shall provide value of 0 in this field.
1161 uint8_t hwrm_intf_min;
1164 * This field represents the update version of HWRM interface
1165 * specification supported by the HWRM implementation. The interface
1166 * update version is used to reflect minor changes or bug fixes to a
1167 * released HWRM interface specification. A HWRM implementation that is
1168 * compliant with this specification shall provide value of 1 in this
1171 uint8_t hwrm_intf_upd;
1173 uint8_t hwrm_intf_rsvd;
1176 * This field represents the major version of HWRM firmware. A change in
1177 * firmware major version represents a major firmware release.
1179 uint8_t hwrm_fw_maj;
1182 * This field represents the minor version of HWRM firmware. A change in
1183 * firmware minor version represents significant firmware functionality
1186 uint8_t hwrm_fw_min;
1189 * This field represents the build version of HWRM firmware. A change in
1190 * firmware build version represents bug fixes to a released firmware.
1192 uint8_t hwrm_fw_bld;
1195 * This field is a reserved field. This field can be used to represent
1196 * firmware branches or customer specific releases tied to a specific
1197 * (major,minor,update) version of the HWRM firmware.
1199 uint8_t hwrm_fw_rsvd;
1202 * This field represents the major version of mgmt firmware. A change in
1203 * major version represents a major release.
1205 uint8_t mgmt_fw_maj;
1208 * This field represents the minor version of mgmt firmware. A change in
1209 * minor version represents significant functionality changes.
1211 uint8_t mgmt_fw_min;
1214 * This field represents the build version of mgmt firmware. A change in
1215 * update version represents bug fixes.
1217 uint8_t mgmt_fw_bld;
1220 * This field is a reserved field. This field can be used to represent
1221 * firmware branches or customer specific releases tied to a specific
1222 * (major,minor,update) version
1224 uint8_t mgmt_fw_rsvd;
1227 * This field represents the major version of network control firmware.
1228 * A change in major version represents a major release.
1230 uint8_t netctrl_fw_maj;
1233 * This field represents the minor version of network control firmware.
1234 * A change in minor version represents significant functionality
1237 uint8_t netctrl_fw_min;
1240 * This field represents the build version of network control firmware.
1241 * A change in update version represents bug fixes.
1243 uint8_t netctrl_fw_bld;
1246 * This field is a reserved field. This field can be used to represent
1247 * firmware branches or customer specific releases tied to a specific
1248 * (major,minor,update) version
1250 uint8_t netctrl_fw_rsvd;
1253 * This field is reserved for future use. The responder should set it to
1254 * 0. The requester should ignore this field.
1259 * This field represents the major version of RoCE firmware. A change in
1260 * major version represents a major release.
1262 uint8_t roce_fw_maj;
1265 * This field represents the minor version of RoCE firmware. A change in
1266 * minor version represents significant functionality changes.
1268 uint8_t roce_fw_min;
1271 * This field represents the build version of RoCE firmware. A change in
1272 * update version represents bug fixes.
1274 uint8_t roce_fw_bld;
1277 * This field is a reserved field. This field can be used to represent
1278 * firmware branches or customer specific releases tied to a specific
1279 * (major,minor,update) version
1281 uint8_t roce_fw_rsvd;
1284 * This field represents the name of HWRM FW (ASCII chars without NULL
1287 char hwrm_fw_name[16];
1290 * This field represents the name of mgmt FW (ASCII chars without NULL
1293 char mgmt_fw_name[16];
1296 * This field represents the name of network control firmware (ASCII
1297 * chars without NULL at the end).
1299 char netctrl_fw_name[16];
1302 * This field is reserved for future use. The responder should set it to
1303 * 0. The requester should ignore this field.
1305 uint32_t reserved2[4];
1308 * This field represents the name of RoCE FW (ASCII chars without NULL
1311 char roce_fw_name[16];
1313 /* This field returns the chip number. */
1316 /* This field returns the revision of chip. */
1319 /* This field returns the chip metal number. */
1322 /* This field returns the bond id of the chip. */
1323 uint8_t chip_bond_id;
1326 * This value indicates the type of platform used for chip
1330 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC \
1331 (UINT32_C(0x0) << 0)
1332 /* FPGA platform of the chip. */
1333 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA \
1334 (UINT32_C(0x1) << 0)
1335 /* Palladium platform of the chip. */
1336 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM \
1337 (UINT32_C(0x2) << 0)
1338 uint8_t chip_platform_type;
1341 * This field returns the maximum value of request window that is
1342 * supported by the HWRM. The request window is mapped into device
1343 * address space using MMIO.
1345 uint16_t max_req_win_len;
1348 * This field returns the maximum value of response buffer in bytes. If
1349 * a request specifies the response buffer length that is greater than
1350 * this value, then the HWRM should fail it. The value of this field
1351 * shall be 4KB or more.
1353 uint16_t max_resp_len;
1356 * This field returns the default request timeout value in milliseconds.
1358 uint16_t def_req_timeout;
1365 * This field is used in Output records to indicate that the output is
1366 * completely written to RAM. This field should be read as '1' to
1367 * indicate that the output has been completely written. When writing a
1368 * command completion or response to an internal processor, the order of
1369 * writes has to be such that this field is written last.
1372 } __attribute__((packed));
1374 /* hwrm_queue_qportcfg */
1376 * Description: This function is called by a driver to query queue configuration
1377 * of a port. # The HWRM shall at least advertise one queue with lossy service
1378 * profile. # The driver shall use this command to query queue ids before
1379 * configuring or using any queues. # If a service profile is not set for a
1380 * queue, then the driver shall not use that queue without configuring a service
1381 * profile for it. # If the driver is not allowed to configure service profiles,
1382 * then the driver shall only use queues for which service profiles are pre-
1386 /* Input (24 bytes) */
1387 struct hwrm_queue_qportcfg_input {
1389 * This value indicates what type of request this is. The format for the
1390 * rest of the command is determined by this field.
1395 * This value indicates the what completion ring the request will be
1396 * optionally completed on. If the value is -1, then no CR completion
1397 * will be generated. Any other value must be a valid CR ring_id value
1398 * for this function.
1402 /* This value indicates the command sequence number. */
1406 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1407 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1412 * This is the host address where the response will be written when the
1413 * request is complete. This area must be 16B aligned and must be
1414 * cleared to zero before the request is made.
1419 * Enumeration denoting the RX, TX type of the resource. This
1420 * enumeration is used for resources that are similar for both TX and RX
1421 * paths of the chip.
1423 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH \
1426 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX \
1427 (UINT32_C(0x0) << 0)
1429 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX \
1430 (UINT32_C(0x1) << 0)
1431 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
1432 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
1436 * Port ID of port for which the queue configuration is being queried.
1437 * This field is only required when sent by IPC.
1442 } __attribute__((packed));
1444 /* Output (32 bytes) */
1445 struct hwrm_queue_qportcfg_output {
1447 * Pass/Fail or error type Note: receiver to verify the in parameters,
1448 * and fail the call with an error when appropriate
1450 uint16_t error_code;
1452 /* This field returns the type of original request. */
1455 /* This field provides original sequence number of the command. */
1459 * This field is the length of the response in bytes. The last byte of
1460 * the response is a valid flag that will read as '1' when the command
1461 * has been completely written to memory.
1465 /* The maximum number of queues that can be configured. */
1466 uint8_t max_configurable_queues;
1468 /* The maximum number of lossless queues that can be configured. */
1469 uint8_t max_configurable_lossless_queues;
1472 * 0 - Not allowed. Non-zero - Allowed. If this value is non-zero, then
1473 * the HWRM shall allow the host SW driver to configure queues using
1476 uint8_t queue_cfg_allowed;
1479 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1480 * the HWRM shall allow the host SW driver to configure queue buffers
1481 * using hwrm_queue_buffers_cfg.
1483 uint8_t queue_buffers_cfg_allowed;
1486 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1487 * the HWRM shall allow the host SW driver to configure PFC using
1488 * hwrm_queue_pfcenable_cfg.
1490 uint8_t queue_pfcenable_cfg_allowed;
1493 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1494 * the HWRM shall allow the host SW driver to configure Priority to CoS
1495 * mapping using hwrm_queue_pri2cos_cfg.
1497 uint8_t queue_pri2cos_cfg_allowed;
1500 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1501 * the HWRM shall allow the host SW driver to configure CoS Bandwidth
1502 * configuration using hwrm_queue_cos2bw_cfg.
1504 uint8_t queue_cos2bw_cfg_allowed;
1506 /* ID of CoS Queue 0. FF - Invalid id */
1509 /* This value is applicable to CoS queues only. */
1510 /* Lossy (best-effort) */
1511 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
1512 (UINT32_C(0x0) << 0)
1514 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
1515 (UINT32_C(0x1) << 0)
1517 * Set to 0xFF... (All Fs) if there is no service profile
1520 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
1521 (UINT32_C(0xff) << 0)
1522 uint8_t queue_id0_service_profile;
1524 /* ID of CoS Queue 1. FF - Invalid id */
1526 /* This value is applicable to CoS queues only. */
1527 /* Lossy (best-effort) */
1528 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
1529 (UINT32_C(0x0) << 0)
1531 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
1532 (UINT32_C(0x1) << 0)
1534 * Set to 0xFF... (All Fs) if there is no service profile
1537 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
1538 (UINT32_C(0xff) << 0)
1539 uint8_t queue_id1_service_profile;
1541 /* ID of CoS Queue 2. FF - Invalid id */
1543 /* This value is applicable to CoS queues only. */
1544 /* Lossy (best-effort) */
1545 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
1546 (UINT32_C(0x0) << 0)
1548 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
1549 (UINT32_C(0x1) << 0)
1551 * Set to 0xFF... (All Fs) if there is no service profile
1554 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
1555 (UINT32_C(0xff) << 0)
1556 uint8_t queue_id2_service_profile;
1558 /* ID of CoS Queue 3. FF - Invalid id */
1561 /* This value is applicable to CoS queues only. */
1562 /* Lossy (best-effort) */
1563 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
1564 (UINT32_C(0x0) << 0)
1566 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
1567 (UINT32_C(0x1) << 0)
1569 * Set to 0xFF... (All Fs) if there is no service profile
1572 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
1573 (UINT32_C(0xff) << 0)
1574 uint8_t queue_id3_service_profile;
1576 /* ID of CoS Queue 4. FF - Invalid id */
1578 /* This value is applicable to CoS queues only. */
1579 /* Lossy (best-effort) */
1580 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
1581 (UINT32_C(0x0) << 0)
1583 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
1584 (UINT32_C(0x1) << 0)
1586 * Set to 0xFF... (All Fs) if there is no service profile
1589 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
1590 (UINT32_C(0xff) << 0)
1591 uint8_t queue_id4_service_profile;
1593 /* ID of CoS Queue 5. FF - Invalid id */
1596 /* This value is applicable to CoS queues only. */
1597 /* Lossy (best-effort) */
1598 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
1599 (UINT32_C(0x0) << 0)
1601 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
1602 (UINT32_C(0x1) << 0)
1604 * Set to 0xFF... (All Fs) if there is no service profile
1607 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
1608 (UINT32_C(0xff) << 0)
1609 uint8_t queue_id5_service_profile;
1611 /* ID of CoS Queue 6. FF - Invalid id */
1612 uint8_t queue_id6_service_profile;
1613 /* This value is applicable to CoS queues only. */
1614 /* Lossy (best-effort) */
1615 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
1616 (UINT32_C(0x0) << 0)
1618 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
1619 (UINT32_C(0x1) << 0)
1621 * Set to 0xFF... (All Fs) if there is no service profile
1624 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
1625 (UINT32_C(0xff) << 0)
1628 /* ID of CoS Queue 7. FF - Invalid id */
1631 /* This value is applicable to CoS queues only. */
1632 /* Lossy (best-effort) */
1633 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
1634 (UINT32_C(0x0) << 0)
1636 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
1637 (UINT32_C(0x1) << 0)
1639 * Set to 0xFF... (All Fs) if there is no service profile
1642 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
1643 (UINT32_C(0xff) << 0)
1644 uint8_t queue_id7_service_profile;
1647 * This field is used in Output records to indicate that the output is
1648 * completely written to RAM. This field should be read as '1' to
1649 * indicate that the output has been completely written. When writing a
1650 * command completion or response to an internal processor, the order of
1651 * writes has to be such that this field is written last.
1654 } __attribute__((packed));
1656 /* hwrm_func_drv_rgtr */
1658 * Description: This command is used by the function driver to register its
1659 * information with the HWRM. A function driver shall implement this command. A
1660 * function driver shall use this command during the driver initialization right
1661 * after the HWRM version discovery and default ring resources allocation.
1664 /* Input (80 bytes) */
1665 struct hwrm_func_drv_rgtr_input {
1667 * This value indicates what type of request this is. The format for the
1668 * rest of the command is determined by this field.
1673 * This value indicates the what completion ring the request will be
1674 * optionally completed on. If the value is -1, then no CR completion
1675 * will be generated. Any other value must be a valid CR ring_id value
1676 * for this function.
1680 /* This value indicates the command sequence number. */
1684 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1685 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1690 * This is the host address where the response will be written when the
1691 * request is complete. This area must be 16B aligned and must be
1692 * cleared to zero before the request is made.
1697 * When this bit is '1', the function driver is requesting all requests
1698 * from its children VF drivers to be forwarded to itself. This flag can
1699 * only be set by the PF driver. If a VF driver sets this flag, it
1700 * should be ignored by the HWRM.
1702 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
1704 * When this bit is '1', the function is requesting none of the requests
1705 * from its children VF drivers to be forwarded to itself. This flag can
1706 * only be set by the PF driver. If a VF driver sets this flag, it
1707 * should be ignored by the HWRM.
1709 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
1712 /* This bit must be '1' for the os_type field to be configured. */
1713 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
1714 /* This bit must be '1' for the ver field to be configured. */
1715 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
1716 /* This bit must be '1' for the timestamp field to be configured. */
1717 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
1718 /* This bit must be '1' for the vf_req_fwd field to be configured. */
1719 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD UINT32_C(0x8)
1721 * This bit must be '1' for the async_event_fwd field to be configured.
1723 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
1727 /* This value indicates the type of OS. */
1729 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN \
1730 (UINT32_C(0x0) << 0)
1731 /* Other OS not listed below. */
1732 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER \
1733 (UINT32_C(0x1) << 0)
1735 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS \
1736 (UINT32_C(0xe) << 0)
1738 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS \
1739 (UINT32_C(0x12) << 0)
1741 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS \
1742 (UINT32_C(0x1d) << 0)
1744 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX \
1745 (UINT32_C(0x24) << 0)
1747 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD \
1748 (UINT32_C(0x2a) << 0)
1749 /* VMware ESXi OS. */
1750 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI \
1751 (UINT32_C(0x68) << 0)
1752 /* Microsoft Windows 8 64-bit OS. */
1753 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 \
1754 (UINT32_C(0x73) << 0)
1755 /* Microsoft Windows Server 2012 R2 OS. */
1756 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 \
1757 (UINT32_C(0x74) << 0)
1760 /* This is the major version of the driver. */
1763 /* This is the minor version of the driver. */
1766 /* This is the update version of the driver. */
1773 * This is a 32-bit timestamp provided by the driver for keep alive. The
1774 * timestamp is in multiples of 1ms.
1781 * This is a 256-bit bit mask provided by the PF driver for letting the
1782 * HWRM know what commands issued by the VF driver to the HWRM should be
1783 * forwarded to the PF driver. Nth bit refers to the Nth req_type.
1784 * Setting Nth bit to 1 indicates that requests from the VF driver with
1785 * req_type equal to N shall be forwarded to the parent PF driver. This
1786 * field is not valid for the VF driver.
1788 uint32_t vf_req_fwd[8];
1791 * This is a 256-bit bit mask provided by the function driver (PF or VF
1792 * driver) to indicate the list of asynchronous event completions to be
1793 * forwarded. Nth bit refers to the Nth event_id. Setting Nth bit to 1
1794 * by the function driver shall result in the HWRM forwarding
1795 * asynchronous event completion with event_id equal to N. If all bits
1796 * are set to 0 (value of 0), then the HWRM shall not forward any
1797 * asynchronous event completion to this function driver.
1799 uint32_t async_event_fwd[8];
1800 } __attribute__((packed));
1802 /* Output (16 bytes) */
1804 struct hwrm_func_drv_rgtr_output {
1806 * Pass/Fail or error type Note: receiver to verify the in parameters,
1807 * and fail the call with an error when appropriate
1809 uint16_t error_code;
1811 /* This field returns the type of original request. */
1814 /* This field provides original sequence number of the command. */
1818 * This field is the length of the response in bytes. The last byte of
1819 * the response is a valid flag that will read as '1' when the command
1820 * has been completely written to memory.
1830 * This field is used in Output records to indicate that the output is
1831 * completely written to RAM. This field should be read as '1' to
1832 * indicate that the output has been completely written. When writing a
1833 * command completion or response to an internal processor, the order of
1834 * writes has to be such that this field is written last.
1837 } __attribute__((packed));
1839 /* hwrm_func_drv_unrgtr */
1841 * Description: This command is used by the function driver to un register with
1842 * the HWRM. A function driver shall implement this command. A function driver
1843 * shall use this command during the driver unloading.
1845 /* Input (24 bytes) */
1847 struct hwrm_func_drv_unrgtr_input {
1849 * This value indicates what type of request this is. The format for the
1850 * rest of the command is determined by this field.
1855 * This value indicates the what completion ring the request will be
1856 * optionally completed on. If the value is -1, then no CR completion
1857 * will be generated. Any other value must be a valid CR ring_id value
1858 * for this function.
1862 /* This value indicates the command sequence number. */
1866 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1867 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1872 * This is the host address where the response will be written when the
1873 * request is complete. This area must be 16B aligned and must be
1874 * cleared to zero before the request is made.
1879 * When this bit is '1', the function driver is notifying the HWRM to
1880 * prepare for the shutdown.
1882 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
1887 } __attribute__((packed));
1889 /* Output (16 bytes) */
1890 struct hwrm_func_drv_unrgtr_output {
1892 * Pass/Fail or error type Note: receiver to verify the in parameters,
1893 * and fail the call with an error when appropriate
1895 uint16_t error_code;
1897 /* This field returns the type of original request. */
1900 /* This field provides original sequence number of the command. */
1904 * This field is the length of the response in bytes. The last byte of
1905 * the response is a valid flag that will read as '1' when the command
1906 * has been completely written to memory.
1916 * This field is used in Output records to indicate that the output is
1917 * completely written to RAM. This field should be read as '1' to
1918 * indicate that the output has been completely written. When writing a
1919 * command completion or response to an internal processor, the order of
1920 * writes has to be such that this field is written last.
1923 } __attribute__((packed));