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))
64 * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
65 * inside the chip. The HWRM is implemented in firmware, and runs on embedded
66 * processors inside the chip. This firmware is vital part of the chip's
67 * hardware. The chip can not be used by driver without it.
70 /* Input (16 bytes) */
73 * This value indicates what type of request this is. The format for the
74 * rest of the command is determined by this field.
79 * This value indicates the what completion ring the request will be
80 * optionally completed on. If the value is -1, then no CR completion
81 * will be generated. Any other value must be a valid CR ring_id value
86 /* This value indicates the command sequence number. */
90 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
91 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
96 * This is the host address where the response will be written when the
97 * request is complete. This area must be 16B aligned and must be
98 * cleared to zero before the request is made.
101 } __attribute__((packed));
103 /* Output (8 bytes) */
106 * Pass/Fail or error type Note: receiver to verify the in parameters,
107 * and fail the call with an error when appropriate
111 /* This field returns the type of original request. */
114 /* This field provides original sequence number of the command. */
118 * This field is the length of the response in bytes. The last byte of
119 * the response is a valid flag that will read as '1' when the command
120 * has been completely written to memory.
123 } __attribute__((packed));
125 /* hwrm_func_qcaps */
127 * Description: This command returns capabilities of a function. The input FID
128 * value is used to indicate what function is being queried. This allows a
129 * physical function driver to query virtual functions that are children of the
130 * physical function. The output FID value is needed to configure Rings and
131 * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
134 /* Input (24 bytes) */
135 struct hwrm_func_qcaps_input {
137 * This value indicates what type of request this is. The format for the
138 * rest of the command is determined by this field.
143 * This value indicates the what completion ring the request will be
144 * optionally completed on. If the value is -1, then no CR completion
145 * will be generated. Any other value must be a valid CR ring_id value
150 /* This value indicates the command sequence number. */
154 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
155 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
160 * This is the host address where the response will be written when the
161 * request is complete. This area must be 16B aligned and must be
162 * cleared to zero before the request is made.
167 * Function ID of the function that is being queried. 0xFF... (All Fs)
168 * if the query is for the requesting function.
172 uint16_t unused_0[3];
173 } __attribute__((packed));
175 /* Output (80 bytes) */
176 struct hwrm_func_qcaps_output {
178 * Pass/Fail or error type Note: receiver to verify the in parameters,
179 * and fail the call with an error when appropriate
183 /* This field returns the type of original request. */
186 /* This field provides original sequence number of the command. */
190 * This field is the length of the response in bytes. The last byte of
191 * the response is a valid flag that will read as '1' when the command
192 * has been completely written to memory.
197 * FID value. This value is used to identify operations on the PCI bus
198 * as belonging to a particular PCI function.
203 * Port ID of port that this function is associated with. Valid only for
204 * the PF. 0xFF... (All Fs) if this function is not associated with any
205 * port. 0xFF... (All Fs) if this function is called from a VF.
209 /* If 1, then Push mode is supported on this function. */
210 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
212 * If 1, then the global MSI-X auto-masking is enabled for the device.
214 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
217 * If 1, then the Precision Time Protocol (PTP) processing is supported
218 * on this function. The HWRM should enable PTP on only a single
219 * Physical Function (PF) per port.
221 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
225 * This value is current MAC address configured for this function. A
226 * value of 00-00-00-00-00-00 indicates no MAC address is currently
229 uint8_t perm_mac_address[6];
232 * The maximum number of RSS/COS contexts that can be allocated to the
235 uint16_t max_rsscos_ctx;
238 * The maximum number of completion rings that can be allocated to the
241 uint16_t max_cmpl_rings;
244 * The maximum number of transmit rings that can be allocated to the
247 uint16_t max_tx_rings;
250 * The maximum number of receive rings that can be allocated to the
253 uint16_t max_rx_rings;
256 * The maximum number of L2 contexts that can be allocated to the
259 uint16_t max_l2_ctxs;
261 /* The maximum number of VNICs that can be allocated to the function. */
265 * The identifier for the first VF enabled on a PF. This is valid only
266 * on the PF with SR-IOV enabled. 0xFF... (All Fs) if this command is
267 * called on a PF with SR-IOV disabled or on a VF.
269 uint16_t first_vf_id;
272 * The maximum number of VFs that can be allocated to the function. This
273 * is valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if this
274 * command is called on a PF with SR-IOV disabled or on a VF.
279 * The maximum number of statistic contexts that can be allocated to the
282 uint16_t max_stat_ctx;
285 * The maximum number of Encapsulation records that can be offloaded by
288 uint32_t max_encap_records;
291 * The maximum number of decapsulation records that can be offloaded by
294 uint32_t max_decap_records;
297 * The maximum number of Exact Match (EM) flows that can be offloaded by
298 * this function on the TX side.
300 uint32_t max_tx_em_flows;
303 * The maximum number of Wildcard Match (WM) flows that can be offloaded
304 * by this function on the TX side.
306 uint32_t max_tx_wm_flows;
309 * The maximum number of Exact Match (EM) flows that can be offloaded by
310 * this function on the RX side.
312 uint32_t max_rx_em_flows;
315 * The maximum number of Wildcard Match (WM) flows that can be offloaded
316 * by this function on the RX side.
318 uint32_t max_rx_wm_flows;
321 * The maximum number of multicast filters that can be supported by this
322 * function on the RX side.
324 uint32_t max_mcast_filters;
327 * The maximum value of flow_id that can be supported in completion
330 uint32_t max_flow_id;
333 * The maximum number of HW ring groups that can be supported on this
336 uint32_t max_hw_ring_grps;
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_port_phy_cfg */
354 * Description: This command configures the PHY device for the port. It allows
355 * setting of the most generic settings for the PHY. The HWRM shall complete
356 * this command as soon as PHY settings are configured. They may not be applied
357 * when the command response is provided. A VF driver shall not be allowed to
358 * configure PHY using this command. In a network partition mode, a PF driver
359 * shall not be allowed to configure PHY using this command.
362 /* Input (56 bytes) */
363 struct hwrm_port_phy_cfg_input {
365 * This value indicates what type of request this is. The format for the
366 * rest of the command is determined by this field.
371 * This value indicates the what completion ring the request will be
372 * optionally completed on. If the value is -1, then no CR completion
373 * will be generated. Any other value must be a valid CR ring_id value
378 /* This value indicates the command sequence number. */
382 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
383 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
388 * This is the host address where the response will be written when the
389 * request is complete. This area must be 16B aligned and must be
390 * cleared to zero before the request is made.
395 * When this bit is set to '1', the PHY for the port shall be reset. #
396 * If this bit is set to 1, then the HWRM shall reset the PHY after
397 * applying PHY configuration changes specified in this command. # In
398 * order to guarantee that PHY configuration changes specified in this
399 * command take effect, the HWRM client should set this flag to 1. # If
400 * this bit is not set to 1, then the HWRM may reset the PHY depending
401 * on the current PHY configuration and settings specified in this
404 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY UINT32_C(0x1)
406 * When this bit is set to '1', the link shall be forced to be taken
407 * down. # When this bit is set to '1", all other command input settings
408 * related to the link speed shall be ignored. Once the link state is
409 * forced down, it can be explicitly cleared from that state by setting
410 * this flag to '0'. # If this flag is set to '0', then the link shall
411 * be cleared from forced down state if the link is in forced down
412 * state. There may be conditions (e.g. out-of-band or sideband
413 * configuration changes for the link) outside the scope of the HWRM
414 * implementation that may clear forced down link state.
416 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DOWN UINT32_C(0x2)
418 * When this bit is set to '1', the link shall be forced to the
419 * force_link_speed value. When this bit is set to '1', the HWRM client
420 * should not enable any of the auto negotiation related fields
421 * represented by auto_XXX fields in this command. When this bit is set
422 * to '1' and the HWRM client has enabled a auto_XXX field in this
423 * command, then the HWRM shall ignore the enabled auto_XXX field. When
424 * this bit is set to zero, the link shall be allowed to autoneg.
426 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE UINT32_C(0x4)
428 * When this bit is set to '1', the auto-negotiation process shall be
429 * restarted on the link.
431 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG UINT32_C(0x8)
433 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
434 * requested to be enabled on this link. If EEE is not supported on this
435 * port, then this flag shall be ignored by the HWRM.
437 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE UINT32_C(0x10)
439 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
440 * requested to be disabled on this link. If EEE is not supported on
441 * this port, then this flag shall be ignored by the HWRM.
443 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE UINT32_C(0x20)
445 * When this bit is set to '1' and EEE is enabled on this link, then TX
446 * LPI is requested to be enabled on the link. If EEE is not supported
447 * on this port, then this flag shall be ignored by the HWRM. If EEE is
448 * disabled on this port, then this flag shall be ignored by the HWRM.
450 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI UINT32_C(0x40)
453 /* This bit must be '1' for the auto_mode field to be configured. */
454 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE UINT32_C(0x1)
455 /* This bit must be '1' for the auto_duplex field to be configured. */
456 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX UINT32_C(0x2)
457 /* This bit must be '1' for the auto_pause field to be configured. */
458 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE UINT32_C(0x4)
460 * This bit must be '1' for the auto_link_speed field to be configured.
462 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED UINT32_C(0x8)
464 * This bit must be '1' for the auto_link_speed_mask field to be
467 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
469 /* This bit must be '1' for the wirespeed field to be configured. */
470 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED UINT32_C(0x20)
471 /* This bit must be '1' for the lpbk field to be configured. */
472 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK UINT32_C(0x40)
473 /* This bit must be '1' for the preemphasis field to be configured. */
474 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS UINT32_C(0x80)
475 /* This bit must be '1' for the force_pause field to be configured. */
476 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE UINT32_C(0x100)
478 * This bit must be '1' for the eee_link_speed_mask field to be
481 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
483 /* This bit must be '1' for the tx_lpi_timer field to be configured. */
484 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER UINT32_C(0x400)
487 /* Port ID of port that is to be configured. */
491 * This is the speed that will be used if the force bit is '1'. If
492 * unsupported speed is selected, an error will be generated.
494 /* 100Mb link speed */
495 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB \
498 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB \
501 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB \
502 (UINT32_C(0x14) << 0)
503 /* 2.5Gb link speed */
504 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB \
505 (UINT32_C(0x19) << 0)
506 /* 10Gb link speed */
507 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB \
508 (UINT32_C(0x64) << 0)
509 /* 20Mb link speed */
510 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB \
511 (UINT32_C(0xc8) << 0)
512 /* 25Gb link speed */
513 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB \
514 (UINT32_C(0xfa) << 0)
515 /* 40Gb link speed */
516 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB \
517 (UINT32_C(0x190) << 0)
518 /* 50Gb link speed */
519 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB \
520 (UINT32_C(0x1f4) << 0)
521 /* 100Gb link speed */
522 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB \
523 (UINT32_C(0x3e8) << 0)
524 /* 10Mb link speed */
525 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB \
526 (UINT32_C(0xffff) << 0)
527 uint16_t force_link_speed;
530 * This value is used to identify what autoneg mode is used when the
531 * link speed is not being forced.
534 * Disable autoneg or autoneg disabled. No speeds are selected.
536 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE (UINT32_C(0x0) << 0)
537 /* Select all possible speeds for autoneg mode. */
538 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS \
541 * Select only the auto_link_speed speed for autoneg mode. This
542 * mode has been DEPRECATED. An HWRM client should not use this
545 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED \
548 * Select the auto_link_speed or any speed below that speed for
549 * autoneg. This mode has been DEPRECATED. An HWRM client should
552 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW \
555 * Select the speeds based on the corresponding link speed mask
556 * value that is provided.
558 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK \
563 * This is the duplex setting that will be used if the autoneg_mode is
564 * "one_speed" or "one_or_below".
566 /* Half Duplex will be requested. */
567 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF \
569 /* Full duplex will be requested. */
570 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL \
572 /* Both Half and Full dupex will be requested. */
573 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH \
578 * This value is used to configure the pause that will be used for
579 * autonegotiation. Add text on the usage of auto_pause and force_pause.
582 * When this bit is '1', Generation of tx pause messages has been
583 * requested. Disabled otherwise.
585 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX UINT32_C(0x1)
587 * When this bit is '1', Reception of rx pause messages has been
588 * requested. Disabled otherwise.
590 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX UINT32_C(0x2)
592 * When set to 1, the advertisement of pause is enabled. # When the
593 * auto_mode is not set to none and this flag is set to 1, then the
594 * auto_pause bits on this port are being advertised and autoneg pause
595 * results are being interpreted. # When the auto_mode is not set to
596 * none and this flag is set to 0, the pause is forced as indicated in
597 * force_pause, and also advertised as auto_pause bits, but the autoneg
598 * results are not interpreted since the pause configuration is being
599 * forced. # When the auto_mode is set to none and this flag is set to
600 * 1, auto_pause bits should be ignored and should be set to 0.
602 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
608 * This is the speed that will be used if the autoneg_mode is
609 * "one_speed" or "one_or_below". If an unsupported speed is selected,
610 * an error will be generated.
612 /* 100Mb link speed */
613 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB \
616 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB \
619 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB \
620 (UINT32_C(0x14) << 0)
621 /* 2.5Gb link speed */
622 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB \
623 (UINT32_C(0x19) << 0)
624 /* 10Gb link speed */
625 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB \
626 (UINT32_C(0x64) << 0)
627 /* 20Mb link speed */
628 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB \
629 (UINT32_C(0xc8) << 0)
630 /* 25Gb link speed */
631 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB \
632 (UINT32_C(0xfa) << 0)
633 /* 40Gb link speed */
634 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB \
635 (UINT32_C(0x190) << 0)
636 /* 50Gb link speed */
637 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB \
638 (UINT32_C(0x1f4) << 0)
639 /* 100Gb link speed */
640 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB \
641 (UINT32_C(0x3e8) << 0)
642 /* 10Mb link speed */
643 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB \
644 (UINT32_C(0xffff) << 0)
645 uint16_t auto_link_speed;
648 * This is a mask of link speeds that will be used if autoneg_mode is
649 * "mask". If unsupported speed is enabled an error will be generated.
651 /* 100Mb link speed (Half-duplex) */
652 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
654 /* 100Mb link speed (Full-duplex) */
655 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
657 /* 1Gb link speed (Half-duplex) */
658 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
660 /* 1Gb link speed (Full-duplex) */
661 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
664 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
666 /* 2.5Gb link speed */
667 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
669 /* 10Gb link speed */
670 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
672 /* 20Gb link speed */
673 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
675 /* 25Gb link speed */
676 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
678 /* 40Gb link speed */
679 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
681 /* 50Gb link speed */
682 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
684 /* 100Gb link speed */
685 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
687 /* 10Mb link speed (Half-duplex) */
688 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
690 /* 10Mb link speed (Full-duplex) */
691 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
693 uint16_t auto_link_speed_mask;
695 /* This value controls the wirespeed feature. */
696 /* Wirespeed feature is disabled. */
697 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF (UINT32_C(0x0) << 0)
698 /* Wirespeed feature is enabled. */
699 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON (UINT32_C(0x1) << 0)
702 /* This value controls the loopback setting for the PHY. */
703 /* No loopback is selected. Normal operation. */
704 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE (UINT32_C(0x0) << 0)
706 * The HW will be configured with local loopback such that host
707 * data is sent back to the host without modification.
709 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL (UINT32_C(0x1) << 0)
711 * The HW will be configured with remote loopback such that port
712 * logic will send packets back out the transmitter that are
715 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE (UINT32_C(0x2) << 0)
719 * This value is used to configure the pause that will be used for force
723 * When this bit is '1', Generation of tx pause messages is supported.
724 * Disabled otherwise.
726 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1)
728 * When this bit is '1', Reception of rx pause messages is supported.
729 * Disabled otherwise.
731 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2)
737 * This value controls the pre-emphasis to be used for the link. Driver
738 * should not set this value (use enable.preemphasis = 0) unless driver
739 * is sure of setting. Normally HWRM FW will determine proper pre-
742 uint32_t preemphasis;
745 * Setting for link speed mask that is used to advertise speeds during
746 * autonegotiation when EEE is enabled. This field is valid only when
747 * EEE is enabled. The speeds specified in this field shall be a subset
748 * of speeds specified in auto_link_speed_mask. If EEE is enabled,then
749 * at least one speed shall be provided in this mask.
752 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
753 /* 100Mb link speed (Full-duplex) */
754 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
756 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
757 /* 1Gb link speed (Full-duplex) */
758 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
760 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
763 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
765 /* 10Gb link speed */
766 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
768 uint16_t eee_link_speed_mask;
774 * Reuested setting of TX LPI timer in microseconds. This field is valid
775 * only when EEE is enabled and TX LPI is enabled.
777 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK \
779 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
780 uint32_t tx_lpi_timer;
783 } __attribute__((packed));
785 /* Output (16 bytes) */
786 struct hwrm_port_phy_cfg_output {
788 * Pass/Fail or error type Note: receiver to verify the in parameters,
789 * and fail the call with an error when appropriate
793 /* This field returns the type of original request. */
796 /* This field provides original sequence number of the command. */
800 * This field is the length of the response in bytes. The last byte of
801 * the response is a valid flag that will read as '1' when the command
802 * has been completely written to memory.
812 * This field is used in Output records to indicate that the output is
813 * completely written to RAM. This field should be read as '1' to
814 * indicate that the output has been completely written. When writing a
815 * command completion or response to an internal processor, the order of
816 * writes has to be such that this field is written last.
819 } __attribute__((packed));
823 * Description: This function is called by a driver to determine the HWRM
824 * interface version supported by the HWRM firmware, the version of HWRM
825 * firmware implementation, the name of HWRM firmware, the versions of other
826 * embedded firmwares, and the names of other embedded firmwares, etc. Any
827 * interface or firmware version with major = 0, minor = 0, and update = 0 shall
828 * be considered an invalid version.
831 /* Input (24 bytes) */
832 struct hwrm_ver_get_input {
834 * This value indicates what type of request this is. The format for the
835 * rest of the command is determined by this field.
840 * This value indicates the what completion ring the request will be
841 * optionally completed on. If the value is -1, then no CR completion
842 * will be generated. Any other value must be a valid CR ring_id value
847 /* This value indicates the command sequence number. */
851 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
852 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
857 * This is the host address where the response will be written when the
858 * request is complete. This area must be 16B aligned and must be
859 * cleared to zero before the request is made.
864 * This field represents the major version of HWRM interface
865 * specification supported by the driver HWRM implementation. The
866 * interface major version is intended to change only when non backward
867 * compatible changes are made to the HWRM interface specification.
869 uint8_t hwrm_intf_maj;
872 * This field represents the minor version of HWRM interface
873 * specification supported by the driver HWRM implementation. A change
874 * in interface minor version is used to reflect significant backward
875 * compatible modification to HWRM interface specification. This can be
876 * due to addition or removal of functionality. HWRM interface
877 * specifications with the same major version but different minor
878 * versions are compatible.
880 uint8_t hwrm_intf_min;
883 * This field represents the update version of HWRM interface
884 * specification supported by the driver HWRM implementation. The
885 * interface update version is used to reflect minor changes or bug
886 * fixes to a released HWRM interface specification.
888 uint8_t hwrm_intf_upd;
891 } __attribute__((packed));
893 /* Output (128 bytes) */
894 struct hwrm_ver_get_output {
896 * Pass/Fail or error type Note: receiver to verify the in parameters,
897 * and fail the call with an error when appropriate
901 /* This field returns the type of original request. */
904 /* This field provides original sequence number of the command. */
908 * This field is the length of the response in bytes. The last byte of
909 * the response is a valid flag that will read as '1' when the command
910 * has been completely written to memory.
915 * This field represents the major version of HWRM interface
916 * specification supported by the HWRM implementation. The interface
917 * major version is intended to change only when non backward compatible
918 * changes are made to the HWRM interface specification. A HWRM
919 * implementation that is compliant with this specification shall
920 * provide value of 1 in this field.
922 uint8_t hwrm_intf_maj;
925 * This field represents the minor version of HWRM interface
926 * specification supported by the HWRM implementation. A change in
927 * interface minor version is used to reflect significant backward
928 * compatible modification to HWRM interface specification. This can be
929 * due to addition or removal of functionality. HWRM interface
930 * specifications with the same major version but different minor
931 * versions are compatible. A HWRM implementation that is compliant with
932 * this specification shall provide value of 0 in this field.
934 uint8_t hwrm_intf_min;
937 * This field represents the update version of HWRM interface
938 * specification supported by the HWRM implementation. The interface
939 * update version is used to reflect minor changes or bug fixes to a
940 * released HWRM interface specification. A HWRM implementation that is
941 * compliant with this specification shall provide value of 1 in this
944 uint8_t hwrm_intf_upd;
946 uint8_t hwrm_intf_rsvd;
949 * This field represents the major version of HWRM firmware. A change in
950 * firmware major version represents a major firmware release.
955 * This field represents the minor version of HWRM firmware. A change in
956 * firmware minor version represents significant firmware functionality
962 * This field represents the build version of HWRM firmware. A change in
963 * firmware build version represents bug fixes to a released firmware.
968 * This field is a reserved field. This field can be used to represent
969 * firmware branches or customer specific releases tied to a specific
970 * (major,minor,update) version of the HWRM firmware.
972 uint8_t hwrm_fw_rsvd;
975 * This field represents the major version of mgmt firmware. A change in
976 * major version represents a major release.
981 * This field represents the minor version of mgmt firmware. A change in
982 * minor version represents significant functionality changes.
987 * This field represents the build version of mgmt firmware. A change in
988 * update version represents bug fixes.
993 * This field is a reserved field. This field can be used to represent
994 * firmware branches or customer specific releases tied to a specific
995 * (major,minor,update) version
997 uint8_t mgmt_fw_rsvd;
1000 * This field represents the major version of network control firmware.
1001 * A change in major version represents a major release.
1003 uint8_t netctrl_fw_maj;
1006 * This field represents the minor version of network control firmware.
1007 * A change in minor version represents significant functionality
1010 uint8_t netctrl_fw_min;
1013 * This field represents the build version of network control firmware.
1014 * A change in update version represents bug fixes.
1016 uint8_t netctrl_fw_bld;
1019 * This field is a reserved field. This field can be used to represent
1020 * firmware branches or customer specific releases tied to a specific
1021 * (major,minor,update) version
1023 uint8_t netctrl_fw_rsvd;
1026 * This field is reserved for future use. The responder should set it to
1027 * 0. The requester should ignore this field.
1032 * This field represents the major version of RoCE firmware. A change in
1033 * major version represents a major release.
1035 uint8_t roce_fw_maj;
1038 * This field represents the minor version of RoCE firmware. A change in
1039 * minor version represents significant functionality changes.
1041 uint8_t roce_fw_min;
1044 * This field represents the build version of RoCE firmware. A change in
1045 * update version represents bug fixes.
1047 uint8_t roce_fw_bld;
1050 * This field is a reserved field. This field can be used to represent
1051 * firmware branches or customer specific releases tied to a specific
1052 * (major,minor,update) version
1054 uint8_t roce_fw_rsvd;
1057 * This field represents the name of HWRM FW (ASCII chars without NULL
1060 char hwrm_fw_name[16];
1063 * This field represents the name of mgmt FW (ASCII chars without NULL
1066 char mgmt_fw_name[16];
1069 * This field represents the name of network control firmware (ASCII
1070 * chars without NULL at the end).
1072 char netctrl_fw_name[16];
1075 * This field is reserved for future use. The responder should set it to
1076 * 0. The requester should ignore this field.
1078 uint32_t reserved2[4];
1081 * This field represents the name of RoCE FW (ASCII chars without NULL
1084 char roce_fw_name[16];
1086 /* This field returns the chip number. */
1089 /* This field returns the revision of chip. */
1092 /* This field returns the chip metal number. */
1095 /* This field returns the bond id of the chip. */
1096 uint8_t chip_bond_id;
1099 * This value indicates the type of platform used for chip
1103 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC \
1104 (UINT32_C(0x0) << 0)
1105 /* FPGA platform of the chip. */
1106 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA \
1107 (UINT32_C(0x1) << 0)
1108 /* Palladium platform of the chip. */
1109 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM \
1110 (UINT32_C(0x2) << 0)
1111 uint8_t chip_platform_type;
1114 * This field returns the maximum value of request window that is
1115 * supported by the HWRM. The request window is mapped into device
1116 * address space using MMIO.
1118 uint16_t max_req_win_len;
1121 * This field returns the maximum value of response buffer in bytes. If
1122 * a request specifies the response buffer length that is greater than
1123 * this value, then the HWRM should fail it. The value of this field
1124 * shall be 4KB or more.
1126 uint16_t max_resp_len;
1129 * This field returns the default request timeout value in milliseconds.
1131 uint16_t def_req_timeout;
1138 * This field is used in Output records to indicate that the output is
1139 * completely written to RAM. This field should be read as '1' to
1140 * indicate that the output has been completely written. When writing a
1141 * command completion or response to an internal processor, the order of
1142 * writes has to be such that this field is written last.
1145 } __attribute__((packed));
1147 /* hwrm_queue_qportcfg */
1149 * Description: This function is called by a driver to query queue configuration
1150 * of a port. # The HWRM shall at least advertise one queue with lossy service
1151 * profile. # The driver shall use this command to query queue ids before
1152 * configuring or using any queues. # If a service profile is not set for a
1153 * queue, then the driver shall not use that queue without configuring a service
1154 * profile for it. # If the driver is not allowed to configure service profiles,
1155 * then the driver shall only use queues for which service profiles are pre-
1159 /* Input (24 bytes) */
1160 struct hwrm_queue_qportcfg_input {
1162 * This value indicates what type of request this is. The format for the
1163 * rest of the command is determined by this field.
1168 * This value indicates the what completion ring the request will be
1169 * optionally completed on. If the value is -1, then no CR completion
1170 * will be generated. Any other value must be a valid CR ring_id value
1171 * for this function.
1175 /* This value indicates the command sequence number. */
1179 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1180 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1185 * This is the host address where the response will be written when the
1186 * request is complete. This area must be 16B aligned and must be
1187 * cleared to zero before the request is made.
1192 * Enumeration denoting the RX, TX type of the resource. This
1193 * enumeration is used for resources that are similar for both TX and RX
1194 * paths of the chip.
1196 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH \
1199 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX \
1200 (UINT32_C(0x0) << 0)
1202 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX \
1203 (UINT32_C(0x1) << 0)
1204 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
1205 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
1209 * Port ID of port for which the queue configuration is being queried.
1210 * This field is only required when sent by IPC.
1215 } __attribute__((packed));
1217 /* Output (32 bytes) */
1218 struct hwrm_queue_qportcfg_output {
1220 * Pass/Fail or error type Note: receiver to verify the in parameters,
1221 * and fail the call with an error when appropriate
1223 uint16_t error_code;
1225 /* This field returns the type of original request. */
1228 /* This field provides original sequence number of the command. */
1232 * This field is the length of the response in bytes. The last byte of
1233 * the response is a valid flag that will read as '1' when the command
1234 * has been completely written to memory.
1238 /* The maximum number of queues that can be configured. */
1239 uint8_t max_configurable_queues;
1241 /* The maximum number of lossless queues that can be configured. */
1242 uint8_t max_configurable_lossless_queues;
1245 * 0 - Not allowed. Non-zero - Allowed. If this value is non-zero, then
1246 * the HWRM shall allow the host SW driver to configure queues using
1249 uint8_t queue_cfg_allowed;
1252 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1253 * the HWRM shall allow the host SW driver to configure queue buffers
1254 * using hwrm_queue_buffers_cfg.
1256 uint8_t queue_buffers_cfg_allowed;
1259 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1260 * the HWRM shall allow the host SW driver to configure PFC using
1261 * hwrm_queue_pfcenable_cfg.
1263 uint8_t queue_pfcenable_cfg_allowed;
1266 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1267 * the HWRM shall allow the host SW driver to configure Priority to CoS
1268 * mapping using hwrm_queue_pri2cos_cfg.
1270 uint8_t queue_pri2cos_cfg_allowed;
1273 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1274 * the HWRM shall allow the host SW driver to configure CoS Bandwidth
1275 * configuration using hwrm_queue_cos2bw_cfg.
1277 uint8_t queue_cos2bw_cfg_allowed;
1279 /* ID of CoS Queue 0. FF - Invalid id */
1282 /* This value is applicable to CoS queues only. */
1283 /* Lossy (best-effort) */
1284 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
1285 (UINT32_C(0x0) << 0)
1287 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
1288 (UINT32_C(0x1) << 0)
1290 * Set to 0xFF... (All Fs) if there is no service profile
1293 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
1294 (UINT32_C(0xff) << 0)
1295 uint8_t queue_id0_service_profile;
1297 /* ID of CoS Queue 1. FF - Invalid id */
1299 /* This value is applicable to CoS queues only. */
1300 /* Lossy (best-effort) */
1301 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
1302 (UINT32_C(0x0) << 0)
1304 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
1305 (UINT32_C(0x1) << 0)
1307 * Set to 0xFF... (All Fs) if there is no service profile
1310 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
1311 (UINT32_C(0xff) << 0)
1312 uint8_t queue_id1_service_profile;
1314 /* ID of CoS Queue 2. FF - Invalid id */
1316 /* This value is applicable to CoS queues only. */
1317 /* Lossy (best-effort) */
1318 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
1319 (UINT32_C(0x0) << 0)
1321 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
1322 (UINT32_C(0x1) << 0)
1324 * Set to 0xFF... (All Fs) if there is no service profile
1327 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
1328 (UINT32_C(0xff) << 0)
1329 uint8_t queue_id2_service_profile;
1331 /* ID of CoS Queue 3. FF - Invalid id */
1334 /* This value is applicable to CoS queues only. */
1335 /* Lossy (best-effort) */
1336 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
1337 (UINT32_C(0x0) << 0)
1339 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
1340 (UINT32_C(0x1) << 0)
1342 * Set to 0xFF... (All Fs) if there is no service profile
1345 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
1346 (UINT32_C(0xff) << 0)
1347 uint8_t queue_id3_service_profile;
1349 /* ID of CoS Queue 4. FF - Invalid id */
1351 /* This value is applicable to CoS queues only. */
1352 /* Lossy (best-effort) */
1353 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
1354 (UINT32_C(0x0) << 0)
1356 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
1357 (UINT32_C(0x1) << 0)
1359 * Set to 0xFF... (All Fs) if there is no service profile
1362 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
1363 (UINT32_C(0xff) << 0)
1364 uint8_t queue_id4_service_profile;
1366 /* ID of CoS Queue 5. FF - Invalid id */
1369 /* This value is applicable to CoS queues only. */
1370 /* Lossy (best-effort) */
1371 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
1372 (UINT32_C(0x0) << 0)
1374 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
1375 (UINT32_C(0x1) << 0)
1377 * Set to 0xFF... (All Fs) if there is no service profile
1380 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
1381 (UINT32_C(0xff) << 0)
1382 uint8_t queue_id5_service_profile;
1384 /* ID of CoS Queue 6. FF - Invalid id */
1385 uint8_t queue_id6_service_profile;
1386 /* This value is applicable to CoS queues only. */
1387 /* Lossy (best-effort) */
1388 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
1389 (UINT32_C(0x0) << 0)
1391 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
1392 (UINT32_C(0x1) << 0)
1394 * Set to 0xFF... (All Fs) if there is no service profile
1397 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
1398 (UINT32_C(0xff) << 0)
1401 /* ID of CoS Queue 7. FF - Invalid id */
1404 /* This value is applicable to CoS queues only. */
1405 /* Lossy (best-effort) */
1406 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
1407 (UINT32_C(0x0) << 0)
1409 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
1410 (UINT32_C(0x1) << 0)
1412 * Set to 0xFF... (All Fs) if there is no service profile
1415 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
1416 (UINT32_C(0xff) << 0)
1417 uint8_t queue_id7_service_profile;
1420 * This field is used in Output records to indicate that the output is
1421 * completely written to RAM. This field should be read as '1' to
1422 * indicate that the output has been completely written. When writing a
1423 * command completion or response to an internal processor, the order of
1424 * writes has to be such that this field is written last.
1427 } __attribute__((packed));
1429 /* hwrm_func_drv_rgtr */
1431 * Description: This command is used by the function driver to register its
1432 * information with the HWRM. A function driver shall implement this command. A
1433 * function driver shall use this command during the driver initialization right
1434 * after the HWRM version discovery and default ring resources allocation.
1437 /* Input (80 bytes) */
1438 struct hwrm_func_drv_rgtr_input {
1440 * This value indicates what type of request this is. The format for the
1441 * rest of the command is determined by this field.
1446 * This value indicates the what completion ring the request will be
1447 * optionally completed on. If the value is -1, then no CR completion
1448 * will be generated. Any other value must be a valid CR ring_id value
1449 * for this function.
1453 /* This value indicates the command sequence number. */
1457 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1458 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1463 * This is the host address where the response will be written when the
1464 * request is complete. This area must be 16B aligned and must be
1465 * cleared to zero before the request is made.
1470 * When this bit is '1', the function driver is requesting all requests
1471 * from its children VF drivers to be forwarded to itself. This flag can
1472 * only be set by the PF driver. If a VF driver sets this flag, it
1473 * should be ignored by the HWRM.
1475 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
1477 * When this bit is '1', the function is requesting none of the requests
1478 * from its children VF drivers to be forwarded to itself. This flag can
1479 * only be set by the PF driver. If a VF driver sets this flag, it
1480 * should be ignored by the HWRM.
1482 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
1485 /* This bit must be '1' for the os_type field to be configured. */
1486 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
1487 /* This bit must be '1' for the ver field to be configured. */
1488 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
1489 /* This bit must be '1' for the timestamp field to be configured. */
1490 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
1491 /* This bit must be '1' for the vf_req_fwd field to be configured. */
1492 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD UINT32_C(0x8)
1494 * This bit must be '1' for the async_event_fwd field to be configured.
1496 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
1500 /* This value indicates the type of OS. */
1502 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN \
1503 (UINT32_C(0x0) << 0)
1504 /* Other OS not listed below. */
1505 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER \
1506 (UINT32_C(0x1) << 0)
1508 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS \
1509 (UINT32_C(0xe) << 0)
1511 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS \
1512 (UINT32_C(0x12) << 0)
1514 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS \
1515 (UINT32_C(0x1d) << 0)
1517 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX \
1518 (UINT32_C(0x24) << 0)
1520 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD \
1521 (UINT32_C(0x2a) << 0)
1522 /* VMware ESXi OS. */
1523 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI \
1524 (UINT32_C(0x68) << 0)
1525 /* Microsoft Windows 8 64-bit OS. */
1526 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 \
1527 (UINT32_C(0x73) << 0)
1528 /* Microsoft Windows Server 2012 R2 OS. */
1529 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 \
1530 (UINT32_C(0x74) << 0)
1533 /* This is the major version of the driver. */
1536 /* This is the minor version of the driver. */
1539 /* This is the update version of the driver. */
1546 * This is a 32-bit timestamp provided by the driver for keep alive. The
1547 * timestamp is in multiples of 1ms.
1554 * This is a 256-bit bit mask provided by the PF driver for letting the
1555 * HWRM know what commands issued by the VF driver to the HWRM should be
1556 * forwarded to the PF driver. Nth bit refers to the Nth req_type.
1557 * Setting Nth bit to 1 indicates that requests from the VF driver with
1558 * req_type equal to N shall be forwarded to the parent PF driver. This
1559 * field is not valid for the VF driver.
1561 uint32_t vf_req_fwd[8];
1564 * This is a 256-bit bit mask provided by the function driver (PF or VF
1565 * driver) to indicate the list of asynchronous event completions to be
1566 * forwarded. Nth bit refers to the Nth event_id. Setting Nth bit to 1
1567 * by the function driver shall result in the HWRM forwarding
1568 * asynchronous event completion with event_id equal to N. If all bits
1569 * are set to 0 (value of 0), then the HWRM shall not forward any
1570 * asynchronous event completion to this function driver.
1572 uint32_t async_event_fwd[8];
1573 } __attribute__((packed));
1575 /* Output (16 bytes) */
1577 struct hwrm_func_drv_rgtr_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.
1603 * This field is used in Output records to indicate that the output is
1604 * completely written to RAM. This field should be read as '1' to
1605 * indicate that the output has been completely written. When writing a
1606 * command completion or response to an internal processor, the order of
1607 * writes has to be such that this field is written last.
1610 } __attribute__((packed));
1612 /* hwrm_func_drv_unrgtr */
1614 * Description: This command is used by the function driver to un register with
1615 * the HWRM. A function driver shall implement this command. A function driver
1616 * shall use this command during the driver unloading.
1618 /* Input (24 bytes) */
1620 struct hwrm_func_drv_unrgtr_input {
1622 * This value indicates what type of request this is. The format for the
1623 * rest of the command is determined by this field.
1628 * This value indicates the what completion ring the request will be
1629 * optionally completed on. If the value is -1, then no CR completion
1630 * will be generated. Any other value must be a valid CR ring_id value
1631 * for this function.
1635 /* This value indicates the command sequence number. */
1639 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1640 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1645 * This is the host address where the response will be written when the
1646 * request is complete. This area must be 16B aligned and must be
1647 * cleared to zero before the request is made.
1652 * When this bit is '1', the function driver is notifying the HWRM to
1653 * prepare for the shutdown.
1655 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
1660 } __attribute__((packed));
1662 /* Output (16 bytes) */
1663 struct hwrm_func_drv_unrgtr_output {
1665 * Pass/Fail or error type Note: receiver to verify the in parameters,
1666 * and fail the call with an error when appropriate
1668 uint16_t error_code;
1670 /* This field returns the type of original request. */
1673 /* This field provides original sequence number of the command. */
1677 * This field is the length of the response in bytes. The last byte of
1678 * the response is a valid flag that will read as '1' when the command
1679 * has been completely written to memory.
1689 * This field is used in Output records to indicate that the output is
1690 * completely written to RAM. This field should be read as '1' to
1691 * indicate that the output has been completely written. When writing a
1692 * command completion or response to an internal processor, the order of
1693 * writes has to be such that this field is written last.
1696 } __attribute__((packed));