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_MAX_REQ_LEN (128) /* hwrm_func_buf_rgtr */
47 #define HWRM_MAX_RESP_LEN (176) /* hwrm_func_qstats */
48 #define HWRM_RESP_VALID_KEY 1 /* valid key for HWRM response */
53 #define HWRM_VER_GET (UINT32_C(0x0))
54 #define HWRM_FUNC_QCAPS (UINT32_C(0x15))
55 #define HWRM_FUNC_DRV_UNRGTR (UINT32_C(0x1a))
56 #define HWRM_FUNC_DRV_RGTR (UINT32_C(0x1d))
57 #define HWRM_PORT_PHY_CFG (UINT32_C(0x20))
58 #define HWRM_QUEUE_QPORTCFG (UINT32_C(0x30))
61 * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
62 * inside the chip. The HWRM is implemented in firmware, and runs on embedded
63 * processors inside the chip. This firmware is vital part of the chip's
64 * hardware. The chip can not be used by driver without it.
67 /* Input (16 bytes) */
70 * This value indicates what type of request this is. The format for the
71 * rest of the command is determined by this field.
76 * This value indicates the what completion ring the request will be
77 * optionally completed on. If the value is -1, then no CR completion
78 * will be generated. Any other value must be a valid CR ring_id value
83 /* This value indicates the command sequence number. */
87 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
88 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
93 * This is the host address where the response will be written when the
94 * request is complete. This area must be 16B aligned and must be
95 * cleared to zero before the request is made.
98 } __attribute__((packed));
100 /* Output (8 bytes) */
103 * Pass/Fail or error type Note: receiver to verify the in parameters,
104 * and fail the call with an error when appropriate
108 /* This field returns the type of original request. */
111 /* This field provides original sequence number of the command. */
115 * This field is the length of the response in bytes. The last byte of
116 * the response is a valid flag that will read as '1' when the command
117 * has been completely written to memory.
120 } __attribute__((packed));
122 /* hwrm_func_qcaps */
124 * Description: This command returns capabilities of a function. The input FID
125 * value is used to indicate what function is being queried. This allows a
126 * physical function driver to query virtual functions that are children of the
127 * physical function. The output FID value is needed to configure Rings and
128 * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
131 /* Input (24 bytes) */
132 struct hwrm_func_qcaps_input {
134 * This value indicates what type of request this is. The format for the
135 * rest of the command is determined by this field.
140 * This value indicates the what completion ring the request will be
141 * optionally completed on. If the value is -1, then no CR completion
142 * will be generated. Any other value must be a valid CR ring_id value
147 /* This value indicates the command sequence number. */
151 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
152 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
157 * This is the host address where the response will be written when the
158 * request is complete. This area must be 16B aligned and must be
159 * cleared to zero before the request is made.
164 * Function ID of the function that is being queried. 0xFF... (All Fs)
165 * if the query is for the requesting function.
169 uint16_t unused_0[3];
170 } __attribute__((packed));
172 /* Output (80 bytes) */
173 struct hwrm_func_qcaps_output {
175 * Pass/Fail or error type Note: receiver to verify the in parameters,
176 * and fail the call with an error when appropriate
180 /* This field returns the type of original request. */
183 /* This field provides original sequence number of the command. */
187 * This field is the length of the response in bytes. The last byte of
188 * the response is a valid flag that will read as '1' when the command
189 * has been completely written to memory.
194 * FID value. This value is used to identify operations on the PCI bus
195 * as belonging to a particular PCI function.
200 * Port ID of port that this function is associated with. Valid only for
201 * the PF. 0xFF... (All Fs) if this function is not associated with any
202 * port. 0xFF... (All Fs) if this function is called from a VF.
206 /* If 1, then Push mode is supported on this function. */
207 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
209 * If 1, then the global MSI-X auto-masking is enabled for the device.
211 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
214 * If 1, then the Precision Time Protocol (PTP) processing is supported
215 * on this function. The HWRM should enable PTP on only a single
216 * Physical Function (PF) per port.
218 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
222 * This value is current MAC address configured for this function. A
223 * value of 00-00-00-00-00-00 indicates no MAC address is currently
226 uint8_t perm_mac_address[6];
229 * The maximum number of RSS/COS contexts that can be allocated to the
232 uint16_t max_rsscos_ctx;
235 * The maximum number of completion rings that can be allocated to the
238 uint16_t max_cmpl_rings;
241 * The maximum number of transmit rings that can be allocated to the
244 uint16_t max_tx_rings;
247 * The maximum number of receive rings that can be allocated to the
250 uint16_t max_rx_rings;
253 * The maximum number of L2 contexts that can be allocated to the
256 uint16_t max_l2_ctxs;
258 /* The maximum number of VNICs that can be allocated to the function. */
262 * The identifier for the first VF enabled on a PF. This is valid only
263 * on the PF with SR-IOV enabled. 0xFF... (All Fs) if this command is
264 * called on a PF with SR-IOV disabled or on a VF.
266 uint16_t first_vf_id;
269 * The maximum number of VFs that can be allocated to the function. This
270 * is valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if this
271 * command is called on a PF with SR-IOV disabled or on a VF.
276 * The maximum number of statistic contexts that can be allocated to the
279 uint16_t max_stat_ctx;
282 * The maximum number of Encapsulation records that can be offloaded by
285 uint32_t max_encap_records;
288 * The maximum number of decapsulation records that can be offloaded by
291 uint32_t max_decap_records;
294 * The maximum number of Exact Match (EM) flows that can be offloaded by
295 * this function on the TX side.
297 uint32_t max_tx_em_flows;
300 * The maximum number of Wildcard Match (WM) flows that can be offloaded
301 * by this function on the TX side.
303 uint32_t max_tx_wm_flows;
306 * The maximum number of Exact Match (EM) flows that can be offloaded by
307 * this function on the RX side.
309 uint32_t max_rx_em_flows;
312 * The maximum number of Wildcard Match (WM) flows that can be offloaded
313 * by this function on the RX side.
315 uint32_t max_rx_wm_flows;
318 * The maximum number of multicast filters that can be supported by this
319 * function on the RX side.
321 uint32_t max_mcast_filters;
324 * The maximum value of flow_id that can be supported in completion
327 uint32_t max_flow_id;
330 * The maximum number of HW ring groups that can be supported on this
333 uint32_t max_hw_ring_grps;
340 * This field is used in Output records to indicate that the output is
341 * completely written to RAM. This field should be read as '1' to
342 * indicate that the output has been completely written. When writing a
343 * command completion or response to an internal processor, the order of
344 * writes has to be such that this field is written last.
347 } __attribute__((packed));
349 /* hwrm_port_phy_cfg */
351 * Description: This command configures the PHY device for the port. It allows
352 * setting of the most generic settings for the PHY. The HWRM shall complete
353 * this command as soon as PHY settings are configured. They may not be applied
354 * when the command response is provided. A VF driver shall not be allowed to
355 * configure PHY using this command. In a network partition mode, a PF driver
356 * shall not be allowed to configure PHY using this command.
359 /* Input (56 bytes) */
360 struct hwrm_port_phy_cfg_input {
362 * This value indicates what type of request this is. The format for the
363 * rest of the command is determined by this field.
368 * This value indicates the what completion ring the request will be
369 * optionally completed on. If the value is -1, then no CR completion
370 * will be generated. Any other value must be a valid CR ring_id value
375 /* This value indicates the command sequence number. */
379 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
380 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
385 * This is the host address where the response will be written when the
386 * request is complete. This area must be 16B aligned and must be
387 * cleared to zero before the request is made.
392 * When this bit is set to '1', the PHY for the port shall be reset. #
393 * If this bit is set to 1, then the HWRM shall reset the PHY after
394 * applying PHY configuration changes specified in this command. # In
395 * order to guarantee that PHY configuration changes specified in this
396 * command take effect, the HWRM client should set this flag to 1. # If
397 * this bit is not set to 1, then the HWRM may reset the PHY depending
398 * on the current PHY configuration and settings specified in this
401 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY UINT32_C(0x1)
403 * When this bit is set to '1', the link shall be forced to be taken
404 * down. # When this bit is set to '1", all other command input settings
405 * related to the link speed shall be ignored. Once the link state is
406 * forced down, it can be explicitly cleared from that state by setting
407 * this flag to '0'. # If this flag is set to '0', then the link shall
408 * be cleared from forced down state if the link is in forced down
409 * state. There may be conditions (e.g. out-of-band or sideband
410 * configuration changes for the link) outside the scope of the HWRM
411 * implementation that may clear forced down link state.
413 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE_LINK_DOWN UINT32_C(0x2)
415 * When this bit is set to '1', the link shall be forced to the
416 * force_link_speed value. When this bit is set to '1', the HWRM client
417 * should not enable any of the auto negotiation related fields
418 * represented by auto_XXX fields in this command. When this bit is set
419 * to '1' and the HWRM client has enabled a auto_XXX field in this
420 * command, then the HWRM shall ignore the enabled auto_XXX field. When
421 * this bit is set to zero, the link shall be allowed to autoneg.
423 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE UINT32_C(0x4)
425 * When this bit is set to '1', the auto-negotiation process shall be
426 * restarted on the link.
428 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG UINT32_C(0x8)
430 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
431 * requested to be enabled on this link. If EEE is not supported on this
432 * port, then this flag shall be ignored by the HWRM.
434 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_ENABLE UINT32_C(0x10)
436 * When this bit is set to '1', Energy Efficient Ethernet (EEE) is
437 * requested to be disabled on this link. If EEE is not supported on
438 * this port, then this flag shall be ignored by the HWRM.
440 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_DISABLE UINT32_C(0x20)
442 * When this bit is set to '1' and EEE is enabled on this link, then TX
443 * LPI is requested to be enabled on the link. If EEE is not supported
444 * on this port, then this flag shall be ignored by the HWRM. If EEE is
445 * disabled on this port, then this flag shall be ignored by the HWRM.
447 #define HWRM_PORT_PHY_CFG_INPUT_FLAGS_EEE_TX_LPI UINT32_C(0x40)
450 /* This bit must be '1' for the auto_mode field to be configured. */
451 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_MODE UINT32_C(0x1)
452 /* This bit must be '1' for the auto_duplex field to be configured. */
453 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_DUPLEX UINT32_C(0x2)
454 /* This bit must be '1' for the auto_pause field to be configured. */
455 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE UINT32_C(0x4)
457 * This bit must be '1' for the auto_link_speed field to be configured.
459 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED UINT32_C(0x8)
461 * This bit must be '1' for the auto_link_speed_mask field to be
464 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_LINK_SPEED_MASK \
466 /* This bit must be '1' for the wirespeed field to be configured. */
467 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_WIRESPEED UINT32_C(0x20)
468 /* This bit must be '1' for the lpbk field to be configured. */
469 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_LPBK UINT32_C(0x40)
470 /* This bit must be '1' for the preemphasis field to be configured. */
471 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_PREEMPHASIS UINT32_C(0x80)
472 /* This bit must be '1' for the force_pause field to be configured. */
473 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE UINT32_C(0x100)
475 * This bit must be '1' for the eee_link_speed_mask field to be
478 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_EEE_LINK_SPEED_MASK \
480 /* This bit must be '1' for the tx_lpi_timer field to be configured. */
481 #define HWRM_PORT_PHY_CFG_INPUT_ENABLES_TX_LPI_TIMER UINT32_C(0x400)
484 /* Port ID of port that is to be configured. */
488 * This is the speed that will be used if the force bit is '1'. If
489 * unsupported speed is selected, an error will be generated.
491 /* 100Mb link speed */
492 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100MB \
495 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_1GB \
498 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2GB \
499 (UINT32_C(0x14) << 0)
500 /* 2.5Gb link speed */
501 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_2_5GB \
502 (UINT32_C(0x19) << 0)
503 /* 10Gb link speed */
504 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10GB \
505 (UINT32_C(0x64) << 0)
506 /* 20Mb link speed */
507 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_20GB \
508 (UINT32_C(0xc8) << 0)
509 /* 25Gb link speed */
510 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB \
511 (UINT32_C(0xfa) << 0)
512 /* 40Gb link speed */
513 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB \
514 (UINT32_C(0x190) << 0)
515 /* 50Gb link speed */
516 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB \
517 (UINT32_C(0x1f4) << 0)
518 /* 100Gb link speed */
519 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB \
520 (UINT32_C(0x3e8) << 0)
521 /* 10Mb link speed */
522 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_10MB \
523 (UINT32_C(0xffff) << 0)
524 uint16_t force_link_speed;
527 * This value is used to identify what autoneg mode is used when the
528 * link speed is not being forced.
531 * Disable autoneg or autoneg disabled. No speeds are selected.
533 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_NONE (UINT32_C(0x0) << 0)
534 /* Select all possible speeds for autoneg mode. */
535 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ALL_SPEEDS \
538 * Select only the auto_link_speed speed for autoneg mode. This
539 * mode has been DEPRECATED. An HWRM client should not use this
542 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_SPEED \
545 * Select the auto_link_speed or any speed below that speed for
546 * autoneg. This mode has been DEPRECATED. An HWRM client should
549 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_ONE_OR_BELOW \
552 * Select the speeds based on the corresponding link speed mask
553 * value that is provided.
555 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK \
560 * This is the duplex setting that will be used if the autoneg_mode is
561 * "one_speed" or "one_or_below".
563 /* Half Duplex will be requested. */
564 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_HALF \
566 /* Full duplex will be requested. */
567 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_FULL \
569 /* Both Half and Full dupex will be requested. */
570 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_DUPLEX_BOTH \
575 * This value is used to configure the pause that will be used for
576 * autonegotiation. Add text on the usage of auto_pause and force_pause.
579 * When this bit is '1', Generation of tx pause messages has been
580 * requested. Disabled otherwise.
582 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX UINT32_C(0x1)
584 * When this bit is '1', Reception of rx pause messages has been
585 * requested. Disabled otherwise.
587 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX UINT32_C(0x2)
589 * When set to 1, the advertisement of pause is enabled. # When the
590 * auto_mode is not set to none and this flag is set to 1, then the
591 * auto_pause bits on this port are being advertised and autoneg pause
592 * results are being interpreted. # When the auto_mode is not set to
593 * none and this flag is set to 0, the pause is forced as indicated in
594 * force_pause, and also advertised as auto_pause bits, but the autoneg
595 * results are not interpreted since the pause configuration is being
596 * forced. # When the auto_mode is set to none and this flag is set to
597 * 1, auto_pause bits should be ignored and should be set to 0.
599 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE UINT32_C(0x4)
605 * This is the speed that will be used if the autoneg_mode is
606 * "one_speed" or "one_or_below". If an unsupported speed is selected,
607 * an error will be generated.
609 /* 100Mb link speed */
610 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100MB \
613 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_1GB \
616 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2GB \
617 (UINT32_C(0x14) << 0)
618 /* 2.5Gb link speed */
619 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_2_5GB \
620 (UINT32_C(0x19) << 0)
621 /* 10Gb link speed */
622 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10GB \
623 (UINT32_C(0x64) << 0)
624 /* 20Mb link speed */
625 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_20GB \
626 (UINT32_C(0xc8) << 0)
627 /* 25Gb link speed */
628 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB \
629 (UINT32_C(0xfa) << 0)
630 /* 40Gb link speed */
631 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_40GB \
632 (UINT32_C(0x190) << 0)
633 /* 50Gb link speed */
634 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_50GB \
635 (UINT32_C(0x1f4) << 0)
636 /* 100Gb link speed */
637 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_100GB \
638 (UINT32_C(0x3e8) << 0)
639 /* 10Mb link speed */
640 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_10MB \
641 (UINT32_C(0xffff) << 0)
642 uint16_t auto_link_speed;
645 * This is a mask of link speeds that will be used if autoneg_mode is
646 * "mask". If unsupported speed is enabled an error will be generated.
648 /* 100Mb link speed (Half-duplex) */
649 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MBHD \
651 /* 100Mb link speed (Full-duplex) */
652 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100MB \
654 /* 1Gb link speed (Half-duplex) */
655 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GBHD \
657 /* 1Gb link speed (Full-duplex) */
658 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_1GB \
661 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2GB \
663 /* 2.5Gb link speed */
664 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_2_5GB \
666 /* 10Gb link speed */
667 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10GB \
669 /* 20Gb link speed */
670 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_20GB \
672 /* 25Gb link speed */
673 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_25GB \
675 /* 40Gb link speed */
676 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_40GB \
678 /* 50Gb link speed */
679 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_50GB \
681 /* 100Gb link speed */
682 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_100GB \
684 /* 10Mb link speed (Half-duplex) */
685 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MBHD \
687 /* 10Mb link speed (Full-duplex) */
688 #define HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_MASK_10MB \
690 uint16_t auto_link_speed_mask;
692 /* This value controls the wirespeed feature. */
693 /* Wirespeed feature is disabled. */
694 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_OFF (UINT32_C(0x0) << 0)
695 /* Wirespeed feature is enabled. */
696 #define HWRM_PORT_PHY_CFG_INPUT_WIRESPEED_ON (UINT32_C(0x1) << 0)
699 /* This value controls the loopback setting for the PHY. */
700 /* No loopback is selected. Normal operation. */
701 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_NONE (UINT32_C(0x0) << 0)
703 * The HW will be configured with local loopback such that host
704 * data is sent back to the host without modification.
706 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_LOCAL (UINT32_C(0x1) << 0)
708 * The HW will be configured with remote loopback such that port
709 * logic will send packets back out the transmitter that are
712 #define HWRM_PORT_PHY_CFG_INPUT_LPBK_REMOTE (UINT32_C(0x2) << 0)
716 * This value is used to configure the pause that will be used for force
720 * When this bit is '1', Generation of tx pause messages is supported.
721 * Disabled otherwise.
723 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX UINT32_C(0x1)
725 * When this bit is '1', Reception of rx pause messages is supported.
726 * Disabled otherwise.
728 #define HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX UINT32_C(0x2)
734 * This value controls the pre-emphasis to be used for the link. Driver
735 * should not set this value (use enable.preemphasis = 0) unless driver
736 * is sure of setting. Normally HWRM FW will determine proper pre-
739 uint32_t preemphasis;
742 * Setting for link speed mask that is used to advertise speeds during
743 * autonegotiation when EEE is enabled. This field is valid only when
744 * EEE is enabled. The speeds specified in this field shall be a subset
745 * of speeds specified in auto_link_speed_mask. If EEE is enabled,then
746 * at least one speed shall be provided in this mask.
749 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD1 UINT32_C(0x1)
750 /* 100Mb link speed (Full-duplex) */
751 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_100MB UINT32_C(0x2)
753 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD2 UINT32_C(0x4)
754 /* 1Gb link speed (Full-duplex) */
755 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_1GB UINT32_C(0x8)
757 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD3 \
760 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_RSVD4 \
762 /* 10Gb link speed */
763 #define HWRM_PORT_PHY_CFG_INPUT_EEE_LINK_SPEED_MASK_10GB \
765 uint16_t eee_link_speed_mask;
771 * Reuested setting of TX LPI timer in microseconds. This field is valid
772 * only when EEE is enabled and TX LPI is enabled.
774 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_MASK \
776 #define HWRM_PORT_PHY_CFG_INPUT_TX_LPI_TIMER_SFT 0
777 uint32_t tx_lpi_timer;
780 } __attribute__((packed));
782 /* Output (16 bytes) */
783 struct hwrm_port_phy_cfg_output {
785 * Pass/Fail or error type Note: receiver to verify the in parameters,
786 * and fail the call with an error when appropriate
790 /* This field returns the type of original request. */
793 /* This field provides original sequence number of the command. */
797 * This field is the length of the response in bytes. The last byte of
798 * the response is a valid flag that will read as '1' when the command
799 * has been completely written to memory.
809 * This field is used in Output records to indicate that the output is
810 * completely written to RAM. This field should be read as '1' to
811 * indicate that the output has been completely written. When writing a
812 * command completion or response to an internal processor, the order of
813 * writes has to be such that this field is written last.
816 } __attribute__((packed));
820 * Description: This function is called by a driver to determine the HWRM
821 * interface version supported by the HWRM firmware, the version of HWRM
822 * firmware implementation, the name of HWRM firmware, the versions of other
823 * embedded firmwares, and the names of other embedded firmwares, etc. Any
824 * interface or firmware version with major = 0, minor = 0, and update = 0 shall
825 * be considered an invalid version.
828 /* Input (24 bytes) */
829 struct hwrm_ver_get_input {
831 * This value indicates what type of request this is. The format for the
832 * rest of the command is determined by this field.
837 * This value indicates the what completion ring the request will be
838 * optionally completed on. If the value is -1, then no CR completion
839 * will be generated. Any other value must be a valid CR ring_id value
844 /* This value indicates the command sequence number. */
848 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
849 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
854 * This is the host address where the response will be written when the
855 * request is complete. This area must be 16B aligned and must be
856 * cleared to zero before the request is made.
861 * This field represents the major version of HWRM interface
862 * specification supported by the driver HWRM implementation. The
863 * interface major version is intended to change only when non backward
864 * compatible changes are made to the HWRM interface specification.
866 uint8_t hwrm_intf_maj;
869 * This field represents the minor version of HWRM interface
870 * specification supported by the driver HWRM implementation. A change
871 * in interface minor version is used to reflect significant backward
872 * compatible modification to HWRM interface specification. This can be
873 * due to addition or removal of functionality. HWRM interface
874 * specifications with the same major version but different minor
875 * versions are compatible.
877 uint8_t hwrm_intf_min;
880 * This field represents the update version of HWRM interface
881 * specification supported by the driver HWRM implementation. The
882 * interface update version is used to reflect minor changes or bug
883 * fixes to a released HWRM interface specification.
885 uint8_t hwrm_intf_upd;
888 } __attribute__((packed));
890 /* Output (128 bytes) */
891 struct hwrm_ver_get_output {
893 * Pass/Fail or error type Note: receiver to verify the in parameters,
894 * and fail the call with an error when appropriate
898 /* This field returns the type of original request. */
901 /* This field provides original sequence number of the command. */
905 * This field is the length of the response in bytes. The last byte of
906 * the response is a valid flag that will read as '1' when the command
907 * has been completely written to memory.
912 * This field represents the major version of HWRM interface
913 * specification supported by the HWRM implementation. The interface
914 * major version is intended to change only when non backward compatible
915 * changes are made to the HWRM interface specification. A HWRM
916 * implementation that is compliant with this specification shall
917 * provide value of 1 in this field.
919 uint8_t hwrm_intf_maj;
922 * This field represents the minor version of HWRM interface
923 * specification supported by the HWRM implementation. A change in
924 * interface minor version is used to reflect significant backward
925 * compatible modification to HWRM interface specification. This can be
926 * due to addition or removal of functionality. HWRM interface
927 * specifications with the same major version but different minor
928 * versions are compatible. A HWRM implementation that is compliant with
929 * this specification shall provide value of 0 in this field.
931 uint8_t hwrm_intf_min;
934 * This field represents the update version of HWRM interface
935 * specification supported by the HWRM implementation. The interface
936 * update version is used to reflect minor changes or bug fixes to a
937 * released HWRM interface specification. A HWRM implementation that is
938 * compliant with this specification shall provide value of 1 in this
941 uint8_t hwrm_intf_upd;
943 uint8_t hwrm_intf_rsvd;
946 * This field represents the major version of HWRM firmware. A change in
947 * firmware major version represents a major firmware release.
952 * This field represents the minor version of HWRM firmware. A change in
953 * firmware minor version represents significant firmware functionality
959 * This field represents the build version of HWRM firmware. A change in
960 * firmware build version represents bug fixes to a released firmware.
965 * This field is a reserved field. This field can be used to represent
966 * firmware branches or customer specific releases tied to a specific
967 * (major,minor,update) version of the HWRM firmware.
969 uint8_t hwrm_fw_rsvd;
972 * This field represents the major version of mgmt firmware. A change in
973 * major version represents a major release.
978 * This field represents the minor version of mgmt firmware. A change in
979 * minor version represents significant functionality changes.
984 * This field represents the build version of mgmt firmware. A change in
985 * update version represents bug fixes.
990 * This field is a reserved field. This field can be used to represent
991 * firmware branches or customer specific releases tied to a specific
992 * (major,minor,update) version
994 uint8_t mgmt_fw_rsvd;
997 * This field represents the major version of network control firmware.
998 * A change in major version represents a major release.
1000 uint8_t netctrl_fw_maj;
1003 * This field represents the minor version of network control firmware.
1004 * A change in minor version represents significant functionality
1007 uint8_t netctrl_fw_min;
1010 * This field represents the build version of network control firmware.
1011 * A change in update version represents bug fixes.
1013 uint8_t netctrl_fw_bld;
1016 * This field is a reserved field. This field can be used to represent
1017 * firmware branches or customer specific releases tied to a specific
1018 * (major,minor,update) version
1020 uint8_t netctrl_fw_rsvd;
1023 * This field is reserved for future use. The responder should set it to
1024 * 0. The requester should ignore this field.
1029 * This field represents the major version of RoCE firmware. A change in
1030 * major version represents a major release.
1032 uint8_t roce_fw_maj;
1035 * This field represents the minor version of RoCE firmware. A change in
1036 * minor version represents significant functionality changes.
1038 uint8_t roce_fw_min;
1041 * This field represents the build version of RoCE firmware. A change in
1042 * update version represents bug fixes.
1044 uint8_t roce_fw_bld;
1047 * This field is a reserved field. This field can be used to represent
1048 * firmware branches or customer specific releases tied to a specific
1049 * (major,minor,update) version
1051 uint8_t roce_fw_rsvd;
1054 * This field represents the name of HWRM FW (ASCII chars without NULL
1057 char hwrm_fw_name[16];
1060 * This field represents the name of mgmt FW (ASCII chars without NULL
1063 char mgmt_fw_name[16];
1066 * This field represents the name of network control firmware (ASCII
1067 * chars without NULL at the end).
1069 char netctrl_fw_name[16];
1072 * This field is reserved for future use. The responder should set it to
1073 * 0. The requester should ignore this field.
1075 uint32_t reserved2[4];
1078 * This field represents the name of RoCE FW (ASCII chars without NULL
1081 char roce_fw_name[16];
1083 /* This field returns the chip number. */
1086 /* This field returns the revision of chip. */
1089 /* This field returns the chip metal number. */
1092 /* This field returns the bond id of the chip. */
1093 uint8_t chip_bond_id;
1096 * This value indicates the type of platform used for chip
1100 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC \
1101 (UINT32_C(0x0) << 0)
1102 /* FPGA platform of the chip. */
1103 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA \
1104 (UINT32_C(0x1) << 0)
1105 /* Palladium platform of the chip. */
1106 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM \
1107 (UINT32_C(0x2) << 0)
1108 uint8_t chip_platform_type;
1111 * This field returns the maximum value of request window that is
1112 * supported by the HWRM. The request window is mapped into device
1113 * address space using MMIO.
1115 uint16_t max_req_win_len;
1118 * This field returns the maximum value of response buffer in bytes. If
1119 * a request specifies the response buffer length that is greater than
1120 * this value, then the HWRM should fail it. The value of this field
1121 * shall be 4KB or more.
1123 uint16_t max_resp_len;
1126 * This field returns the default request timeout value in milliseconds.
1128 uint16_t def_req_timeout;
1135 * This field is used in Output records to indicate that the output is
1136 * completely written to RAM. This field should be read as '1' to
1137 * indicate that the output has been completely written. When writing a
1138 * command completion or response to an internal processor, the order of
1139 * writes has to be such that this field is written last.
1142 } __attribute__((packed));
1144 /* hwrm_queue_qportcfg */
1146 * Description: This function is called by a driver to query queue configuration
1147 * of a port. # The HWRM shall at least advertise one queue with lossy service
1148 * profile. # The driver shall use this command to query queue ids before
1149 * configuring or using any queues. # If a service profile is not set for a
1150 * queue, then the driver shall not use that queue without configuring a service
1151 * profile for it. # If the driver is not allowed to configure service profiles,
1152 * then the driver shall only use queues for which service profiles are pre-
1156 /* Input (24 bytes) */
1157 struct hwrm_queue_qportcfg_input {
1159 * This value indicates what type of request this is. The format for the
1160 * rest of the command is determined by this field.
1165 * This value indicates the what completion ring the request will be
1166 * optionally completed on. If the value is -1, then no CR completion
1167 * will be generated. Any other value must be a valid CR ring_id value
1168 * for this function.
1172 /* This value indicates the command sequence number. */
1176 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1177 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1182 * This is the host address where the response will be written when the
1183 * request is complete. This area must be 16B aligned and must be
1184 * cleared to zero before the request is made.
1189 * Enumeration denoting the RX, TX type of the resource. This
1190 * enumeration is used for resources that are similar for both TX and RX
1191 * paths of the chip.
1193 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH \
1196 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX \
1197 (UINT32_C(0x0) << 0)
1199 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX \
1200 (UINT32_C(0x1) << 0)
1201 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
1202 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
1206 * Port ID of port for which the queue configuration is being queried.
1207 * This field is only required when sent by IPC.
1212 } __attribute__((packed));
1214 /* Output (32 bytes) */
1215 struct hwrm_queue_qportcfg_output {
1217 * Pass/Fail or error type Note: receiver to verify the in parameters,
1218 * and fail the call with an error when appropriate
1220 uint16_t error_code;
1222 /* This field returns the type of original request. */
1225 /* This field provides original sequence number of the command. */
1229 * This field is the length of the response in bytes. The last byte of
1230 * the response is a valid flag that will read as '1' when the command
1231 * has been completely written to memory.
1235 /* The maximum number of queues that can be configured. */
1236 uint8_t max_configurable_queues;
1238 /* The maximum number of lossless queues that can be configured. */
1239 uint8_t max_configurable_lossless_queues;
1242 * 0 - Not allowed. Non-zero - Allowed. If this value is non-zero, then
1243 * the HWRM shall allow the host SW driver to configure queues using
1246 uint8_t queue_cfg_allowed;
1249 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1250 * the HWRM shall allow the host SW driver to configure queue buffers
1251 * using hwrm_queue_buffers_cfg.
1253 uint8_t queue_buffers_cfg_allowed;
1256 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1257 * the HWRM shall allow the host SW driver to configure PFC using
1258 * hwrm_queue_pfcenable_cfg.
1260 uint8_t queue_pfcenable_cfg_allowed;
1263 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1264 * the HWRM shall allow the host SW driver to configure Priority to CoS
1265 * mapping using hwrm_queue_pri2cos_cfg.
1267 uint8_t queue_pri2cos_cfg_allowed;
1270 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
1271 * the HWRM shall allow the host SW driver to configure CoS Bandwidth
1272 * configuration using hwrm_queue_cos2bw_cfg.
1274 uint8_t queue_cos2bw_cfg_allowed;
1276 /* ID of CoS Queue 0. FF - Invalid id */
1279 /* This value is applicable to CoS queues only. */
1280 /* Lossy (best-effort) */
1281 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
1282 (UINT32_C(0x0) << 0)
1284 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
1285 (UINT32_C(0x1) << 0)
1287 * Set to 0xFF... (All Fs) if there is no service profile
1290 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
1291 (UINT32_C(0xff) << 0)
1292 uint8_t queue_id0_service_profile;
1294 /* ID of CoS Queue 1. FF - Invalid id */
1296 /* This value is applicable to CoS queues only. */
1297 /* Lossy (best-effort) */
1298 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
1299 (UINT32_C(0x0) << 0)
1301 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
1302 (UINT32_C(0x1) << 0)
1304 * Set to 0xFF... (All Fs) if there is no service profile
1307 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
1308 (UINT32_C(0xff) << 0)
1309 uint8_t queue_id1_service_profile;
1311 /* ID of CoS Queue 2. FF - Invalid id */
1313 /* This value is applicable to CoS queues only. */
1314 /* Lossy (best-effort) */
1315 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
1316 (UINT32_C(0x0) << 0)
1318 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
1319 (UINT32_C(0x1) << 0)
1321 * Set to 0xFF... (All Fs) if there is no service profile
1324 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
1325 (UINT32_C(0xff) << 0)
1326 uint8_t queue_id2_service_profile;
1328 /* ID of CoS Queue 3. FF - Invalid id */
1331 /* This value is applicable to CoS queues only. */
1332 /* Lossy (best-effort) */
1333 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
1334 (UINT32_C(0x0) << 0)
1336 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
1337 (UINT32_C(0x1) << 0)
1339 * Set to 0xFF... (All Fs) if there is no service profile
1342 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
1343 (UINT32_C(0xff) << 0)
1344 uint8_t queue_id3_service_profile;
1346 /* ID of CoS Queue 4. FF - Invalid id */
1348 /* This value is applicable to CoS queues only. */
1349 /* Lossy (best-effort) */
1350 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
1351 (UINT32_C(0x0) << 0)
1353 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
1354 (UINT32_C(0x1) << 0)
1356 * Set to 0xFF... (All Fs) if there is no service profile
1359 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
1360 (UINT32_C(0xff) << 0)
1361 uint8_t queue_id4_service_profile;
1363 /* ID of CoS Queue 5. FF - Invalid id */
1366 /* This value is applicable to CoS queues only. */
1367 /* Lossy (best-effort) */
1368 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
1369 (UINT32_C(0x0) << 0)
1371 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
1372 (UINT32_C(0x1) << 0)
1374 * Set to 0xFF... (All Fs) if there is no service profile
1377 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
1378 (UINT32_C(0xff) << 0)
1379 uint8_t queue_id5_service_profile;
1381 /* ID of CoS Queue 6. FF - Invalid id */
1382 uint8_t queue_id6_service_profile;
1383 /* This value is applicable to CoS queues only. */
1384 /* Lossy (best-effort) */
1385 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
1386 (UINT32_C(0x0) << 0)
1388 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
1389 (UINT32_C(0x1) << 0)
1391 * Set to 0xFF... (All Fs) if there is no service profile
1394 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
1395 (UINT32_C(0xff) << 0)
1398 /* ID of CoS Queue 7. FF - Invalid id */
1401 /* This value is applicable to CoS queues only. */
1402 /* Lossy (best-effort) */
1403 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
1404 (UINT32_C(0x0) << 0)
1406 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
1407 (UINT32_C(0x1) << 0)
1409 * Set to 0xFF... (All Fs) if there is no service profile
1412 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
1413 (UINT32_C(0xff) << 0)
1414 uint8_t queue_id7_service_profile;
1417 * This field is used in Output records to indicate that the output is
1418 * completely written to RAM. This field should be read as '1' to
1419 * indicate that the output has been completely written. When writing a
1420 * command completion or response to an internal processor, the order of
1421 * writes has to be such that this field is written last.
1424 } __attribute__((packed));
1426 /* hwrm_func_drv_rgtr */
1428 * Description: This command is used by the function driver to register its
1429 * information with the HWRM. A function driver shall implement this command. A
1430 * function driver shall use this command during the driver initialization right
1431 * after the HWRM version discovery and default ring resources allocation.
1434 /* Input (80 bytes) */
1435 struct hwrm_func_drv_rgtr_input {
1437 * This value indicates what type of request this is. The format for the
1438 * rest of the command is determined by this field.
1443 * This value indicates the what completion ring the request will be
1444 * optionally completed on. If the value is -1, then no CR completion
1445 * will be generated. Any other value must be a valid CR ring_id value
1446 * for this function.
1450 /* This value indicates the command sequence number. */
1454 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1455 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1460 * This is the host address where the response will be written when the
1461 * request is complete. This area must be 16B aligned and must be
1462 * cleared to zero before the request is made.
1467 * When this bit is '1', the function driver is requesting all requests
1468 * from its children VF drivers to be forwarded to itself. This flag can
1469 * only be set by the PF driver. If a VF driver sets this flag, it
1470 * should be ignored by the HWRM.
1472 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
1474 * When this bit is '1', the function is requesting none of the requests
1475 * from its children VF drivers to be forwarded to itself. This flag can
1476 * only be set by the PF driver. If a VF driver sets this flag, it
1477 * should be ignored by the HWRM.
1479 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
1482 /* This bit must be '1' for the os_type field to be configured. */
1483 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
1484 /* This bit must be '1' for the ver field to be configured. */
1485 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
1486 /* This bit must be '1' for the timestamp field to be configured. */
1487 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
1488 /* This bit must be '1' for the vf_req_fwd field to be configured. */
1489 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD UINT32_C(0x8)
1491 * This bit must be '1' for the async_event_fwd field to be configured.
1493 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
1497 /* This value indicates the type of OS. */
1499 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN \
1500 (UINT32_C(0x0) << 0)
1501 /* Other OS not listed below. */
1502 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER \
1503 (UINT32_C(0x1) << 0)
1505 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS \
1506 (UINT32_C(0xe) << 0)
1508 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS \
1509 (UINT32_C(0x12) << 0)
1511 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS \
1512 (UINT32_C(0x1d) << 0)
1514 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX \
1515 (UINT32_C(0x24) << 0)
1517 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD \
1518 (UINT32_C(0x2a) << 0)
1519 /* VMware ESXi OS. */
1520 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI \
1521 (UINT32_C(0x68) << 0)
1522 /* Microsoft Windows 8 64-bit OS. */
1523 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 \
1524 (UINT32_C(0x73) << 0)
1525 /* Microsoft Windows Server 2012 R2 OS. */
1526 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 \
1527 (UINT32_C(0x74) << 0)
1530 /* This is the major version of the driver. */
1533 /* This is the minor version of the driver. */
1536 /* This is the update version of the driver. */
1543 * This is a 32-bit timestamp provided by the driver for keep alive. The
1544 * timestamp is in multiples of 1ms.
1551 * This is a 256-bit bit mask provided by the PF driver for letting the
1552 * HWRM know what commands issued by the VF driver to the HWRM should be
1553 * forwarded to the PF driver. Nth bit refers to the Nth req_type.
1554 * Setting Nth bit to 1 indicates that requests from the VF driver with
1555 * req_type equal to N shall be forwarded to the parent PF driver. This
1556 * field is not valid for the VF driver.
1558 uint32_t vf_req_fwd[8];
1561 * This is a 256-bit bit mask provided by the function driver (PF or VF
1562 * driver) to indicate the list of asynchronous event completions to be
1563 * forwarded. Nth bit refers to the Nth event_id. Setting Nth bit to 1
1564 * by the function driver shall result in the HWRM forwarding
1565 * asynchronous event completion with event_id equal to N. If all bits
1566 * are set to 0 (value of 0), then the HWRM shall not forward any
1567 * asynchronous event completion to this function driver.
1569 uint32_t async_event_fwd[8];
1570 } __attribute__((packed));
1572 /* Output (16 bytes) */
1574 struct hwrm_func_drv_rgtr_output {
1576 * Pass/Fail or error type Note: receiver to verify the in parameters,
1577 * and fail the call with an error when appropriate
1579 uint16_t error_code;
1581 /* This field returns the type of original request. */
1584 /* This field provides original sequence number of the command. */
1588 * This field is the length of the response in bytes. The last byte of
1589 * the response is a valid flag that will read as '1' when the command
1590 * has been completely written to memory.
1600 * This field is used in Output records to indicate that the output is
1601 * completely written to RAM. This field should be read as '1' to
1602 * indicate that the output has been completely written. When writing a
1603 * command completion or response to an internal processor, the order of
1604 * writes has to be such that this field is written last.
1607 } __attribute__((packed));
1609 /* hwrm_func_drv_unrgtr */
1611 * Description: This command is used by the function driver to un register with
1612 * the HWRM. A function driver shall implement this command. A function driver
1613 * shall use this command during the driver unloading.
1615 /* Input (24 bytes) */
1617 struct hwrm_func_drv_unrgtr_input {
1619 * This value indicates what type of request this is. The format for the
1620 * rest of the command is determined by this field.
1625 * This value indicates the what completion ring the request will be
1626 * optionally completed on. If the value is -1, then no CR completion
1627 * will be generated. Any other value must be a valid CR ring_id value
1628 * for this function.
1632 /* This value indicates the command sequence number. */
1636 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1637 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1642 * This is the host address where the response will be written when the
1643 * request is complete. This area must be 16B aligned and must be
1644 * cleared to zero before the request is made.
1649 * When this bit is '1', the function driver is notifying the HWRM to
1650 * prepare for the shutdown.
1652 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
1657 } __attribute__((packed));
1659 /* Output (16 bytes) */
1660 struct hwrm_func_drv_unrgtr_output {
1662 * Pass/Fail or error type Note: receiver to verify the in parameters,
1663 * and fail the call with an error when appropriate
1665 uint16_t error_code;
1667 /* This field returns the type of original request. */
1670 /* This field provides original sequence number of the command. */
1674 * This field is the length of the response in bytes. The last byte of
1675 * the response is a valid flag that will read as '1' when the command
1676 * has been completely written to memory.
1686 * This field is used in Output records to indicate that the output is
1687 * completely written to RAM. This field should be read as '1' to
1688 * indicate that the output has been completely written. When writing a
1689 * command completion or response to an internal processor, the order of
1690 * writes has to be such that this field is written last.
1693 } __attribute__((packed));