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_QUEUE_QPORTCFG (UINT32_C(0x30))
60 * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
61 * inside the chip. The HWRM is implemented in firmware, and runs on embedded
62 * processors inside the chip. This firmware is vital part of the chip's
63 * hardware. The chip can not be used by driver without it.
66 /* Input (16 bytes) */
69 * This value indicates what type of request this is. The format for the
70 * rest of the command is determined by this field.
75 * This value indicates the what completion ring the request will be
76 * optionally completed on. If the value is -1, then no CR completion
77 * will be generated. Any other value must be a valid CR ring_id value
82 /* This value indicates the command sequence number. */
86 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
87 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
92 * This is the host address where the response will be written when the
93 * request is complete. This area must be 16B aligned and must be
94 * cleared to zero before the request is made.
97 } __attribute__((packed));
99 /* Output (8 bytes) */
102 * Pass/Fail or error type Note: receiver to verify the in parameters,
103 * and fail the call with an error when appropriate
107 /* This field returns the type of original request. */
110 /* This field provides original sequence number of the command. */
114 * This field is the length of the response in bytes. The last byte of
115 * the response is a valid flag that will read as '1' when the command
116 * has been completely written to memory.
119 } __attribute__((packed));
121 /* hwrm_func_qcaps */
123 * Description: This command returns capabilities of a function. The input FID
124 * value is used to indicate what function is being queried. This allows a
125 * physical function driver to query virtual functions that are children of the
126 * physical function. The output FID value is needed to configure Rings and
127 * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
130 /* Input (24 bytes) */
131 struct hwrm_func_qcaps_input {
133 * This value indicates what type of request this is. The format for the
134 * rest of the command is determined by this field.
139 * This value indicates the what completion ring the request will be
140 * optionally completed on. If the value is -1, then no CR completion
141 * will be generated. Any other value must be a valid CR ring_id value
146 /* This value indicates the command sequence number. */
150 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
151 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
156 * This is the host address where the response will be written when the
157 * request is complete. This area must be 16B aligned and must be
158 * cleared to zero before the request is made.
163 * Function ID of the function that is being queried. 0xFF... (All Fs)
164 * if the query is for the requesting function.
168 uint16_t unused_0[3];
169 } __attribute__((packed));
171 /* Output (80 bytes) */
172 struct hwrm_func_qcaps_output {
174 * Pass/Fail or error type Note: receiver to verify the in parameters,
175 * and fail the call with an error when appropriate
179 /* This field returns the type of original request. */
182 /* This field provides original sequence number of the command. */
186 * This field is the length of the response in bytes. The last byte of
187 * the response is a valid flag that will read as '1' when the command
188 * has been completely written to memory.
193 * FID value. This value is used to identify operations on the PCI bus
194 * as belonging to a particular PCI function.
199 * Port ID of port that this function is associated with. Valid only for
200 * the PF. 0xFF... (All Fs) if this function is not associated with any
201 * port. 0xFF... (All Fs) if this function is called from a VF.
205 /* If 1, then Push mode is supported on this function. */
206 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED UINT32_C(0x1)
208 * If 1, then the global MSI-X auto-masking is enabled for the device.
210 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
213 * If 1, then the Precision Time Protocol (PTP) processing is supported
214 * on this function. The HWRM should enable PTP on only a single
215 * Physical Function (PF) per port.
217 #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED UINT32_C(0x4)
221 * This value is current MAC address configured for this function. A
222 * value of 00-00-00-00-00-00 indicates no MAC address is currently
225 uint8_t perm_mac_address[6];
228 * The maximum number of RSS/COS contexts that can be allocated to the
231 uint16_t max_rsscos_ctx;
234 * The maximum number of completion rings that can be allocated to the
237 uint16_t max_cmpl_rings;
240 * The maximum number of transmit rings that can be allocated to the
243 uint16_t max_tx_rings;
246 * The maximum number of receive rings that can be allocated to the
249 uint16_t max_rx_rings;
252 * The maximum number of L2 contexts that can be allocated to the
255 uint16_t max_l2_ctxs;
257 /* The maximum number of VNICs that can be allocated to the function. */
261 * The identifier for the first VF enabled on a PF. This is valid only
262 * on the PF with SR-IOV enabled. 0xFF... (All Fs) if this command is
263 * called on a PF with SR-IOV disabled or on a VF.
265 uint16_t first_vf_id;
268 * The maximum number of VFs that can be allocated to the function. This
269 * is valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if this
270 * command is called on a PF with SR-IOV disabled or on a VF.
275 * The maximum number of statistic contexts that can be allocated to the
278 uint16_t max_stat_ctx;
281 * The maximum number of Encapsulation records that can be offloaded by
284 uint32_t max_encap_records;
287 * The maximum number of decapsulation records that can be offloaded by
290 uint32_t max_decap_records;
293 * The maximum number of Exact Match (EM) flows that can be offloaded by
294 * this function on the TX side.
296 uint32_t max_tx_em_flows;
299 * The maximum number of Wildcard Match (WM) flows that can be offloaded
300 * by this function on the TX side.
302 uint32_t max_tx_wm_flows;
305 * The maximum number of Exact Match (EM) flows that can be offloaded by
306 * this function on the RX side.
308 uint32_t max_rx_em_flows;
311 * The maximum number of Wildcard Match (WM) flows that can be offloaded
312 * by this function on the RX side.
314 uint32_t max_rx_wm_flows;
317 * The maximum number of multicast filters that can be supported by this
318 * function on the RX side.
320 uint32_t max_mcast_filters;
323 * The maximum value of flow_id that can be supported in completion
326 uint32_t max_flow_id;
329 * The maximum number of HW ring groups that can be supported on this
332 uint32_t max_hw_ring_grps;
339 * This field is used in Output records to indicate that the output is
340 * completely written to RAM. This field should be read as '1' to
341 * indicate that the output has been completely written. When writing a
342 * command completion or response to an internal processor, the order of
343 * writes has to be such that this field is written last.
346 } __attribute__((packed));
350 * Description: This function is called by a driver to determine the HWRM
351 * interface version supported by the HWRM firmware, the version of HWRM
352 * firmware implementation, the name of HWRM firmware, the versions of other
353 * embedded firmwares, and the names of other embedded firmwares, etc. Any
354 * interface or firmware version with major = 0, minor = 0, and update = 0 shall
355 * be considered an invalid version.
358 /* Input (24 bytes) */
359 struct hwrm_ver_get_input {
361 * This value indicates what type of request this is. The format for the
362 * rest of the command is determined by this field.
367 * This value indicates the what completion ring the request will be
368 * optionally completed on. If the value is -1, then no CR completion
369 * will be generated. Any other value must be a valid CR ring_id value
374 /* This value indicates the command sequence number. */
378 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
379 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
384 * This is the host address where the response will be written when the
385 * request is complete. This area must be 16B aligned and must be
386 * cleared to zero before the request is made.
391 * This field represents the major version of HWRM interface
392 * specification supported by the driver HWRM implementation. The
393 * interface major version is intended to change only when non backward
394 * compatible changes are made to the HWRM interface specification.
396 uint8_t hwrm_intf_maj;
399 * This field represents the minor version of HWRM interface
400 * specification supported by the driver HWRM implementation. A change
401 * in interface minor version is used to reflect significant backward
402 * compatible modification to HWRM interface specification. This can be
403 * due to addition or removal of functionality. HWRM interface
404 * specifications with the same major version but different minor
405 * versions are compatible.
407 uint8_t hwrm_intf_min;
410 * This field represents the update version of HWRM interface
411 * specification supported by the driver HWRM implementation. The
412 * interface update version is used to reflect minor changes or bug
413 * fixes to a released HWRM interface specification.
415 uint8_t hwrm_intf_upd;
418 } __attribute__((packed));
420 /* Output (128 bytes) */
421 struct hwrm_ver_get_output {
423 * Pass/Fail or error type Note: receiver to verify the in parameters,
424 * and fail the call with an error when appropriate
428 /* This field returns the type of original request. */
431 /* This field provides original sequence number of the command. */
435 * This field is the length of the response in bytes. The last byte of
436 * the response is a valid flag that will read as '1' when the command
437 * has been completely written to memory.
442 * This field represents the major version of HWRM interface
443 * specification supported by the HWRM implementation. The interface
444 * major version is intended to change only when non backward compatible
445 * changes are made to the HWRM interface specification. A HWRM
446 * implementation that is compliant with this specification shall
447 * provide value of 1 in this field.
449 uint8_t hwrm_intf_maj;
452 * This field represents the minor version of HWRM interface
453 * specification supported by the HWRM implementation. A change in
454 * interface minor version is used to reflect significant backward
455 * compatible modification to HWRM interface specification. This can be
456 * due to addition or removal of functionality. HWRM interface
457 * specifications with the same major version but different minor
458 * versions are compatible. A HWRM implementation that is compliant with
459 * this specification shall provide value of 0 in this field.
461 uint8_t hwrm_intf_min;
464 * This field represents the update version of HWRM interface
465 * specification supported by the HWRM implementation. The interface
466 * update version is used to reflect minor changes or bug fixes to a
467 * released HWRM interface specification. A HWRM implementation that is
468 * compliant with this specification shall provide value of 1 in this
471 uint8_t hwrm_intf_upd;
473 uint8_t hwrm_intf_rsvd;
476 * This field represents the major version of HWRM firmware. A change in
477 * firmware major version represents a major firmware release.
482 * This field represents the minor version of HWRM firmware. A change in
483 * firmware minor version represents significant firmware functionality
489 * This field represents the build version of HWRM firmware. A change in
490 * firmware build version represents bug fixes to a released firmware.
495 * This field is a reserved field. This field can be used to represent
496 * firmware branches or customer specific releases tied to a specific
497 * (major,minor,update) version of the HWRM firmware.
499 uint8_t hwrm_fw_rsvd;
502 * This field represents the major version of mgmt firmware. A change in
503 * major version represents a major release.
508 * This field represents the minor version of mgmt firmware. A change in
509 * minor version represents significant functionality changes.
514 * This field represents the build version of mgmt firmware. A change in
515 * update version represents bug fixes.
520 * This field is a reserved field. This field can be used to represent
521 * firmware branches or customer specific releases tied to a specific
522 * (major,minor,update) version
524 uint8_t mgmt_fw_rsvd;
527 * This field represents the major version of network control firmware.
528 * A change in major version represents a major release.
530 uint8_t netctrl_fw_maj;
533 * This field represents the minor version of network control firmware.
534 * A change in minor version represents significant functionality
537 uint8_t netctrl_fw_min;
540 * This field represents the build version of network control firmware.
541 * A change in update version represents bug fixes.
543 uint8_t netctrl_fw_bld;
546 * This field is a reserved field. This field can be used to represent
547 * firmware branches or customer specific releases tied to a specific
548 * (major,minor,update) version
550 uint8_t netctrl_fw_rsvd;
553 * This field is reserved for future use. The responder should set it to
554 * 0. The requester should ignore this field.
559 * This field represents the major version of RoCE firmware. A change in
560 * major version represents a major release.
565 * This field represents the minor version of RoCE firmware. A change in
566 * minor version represents significant functionality changes.
571 * This field represents the build version of RoCE firmware. A change in
572 * update version represents bug fixes.
577 * This field is a reserved field. This field can be used to represent
578 * firmware branches or customer specific releases tied to a specific
579 * (major,minor,update) version
581 uint8_t roce_fw_rsvd;
584 * This field represents the name of HWRM FW (ASCII chars without NULL
587 char hwrm_fw_name[16];
590 * This field represents the name of mgmt FW (ASCII chars without NULL
593 char mgmt_fw_name[16];
596 * This field represents the name of network control firmware (ASCII
597 * chars without NULL at the end).
599 char netctrl_fw_name[16];
602 * This field is reserved for future use. The responder should set it to
603 * 0. The requester should ignore this field.
605 uint32_t reserved2[4];
608 * This field represents the name of RoCE FW (ASCII chars without NULL
611 char roce_fw_name[16];
613 /* This field returns the chip number. */
616 /* This field returns the revision of chip. */
619 /* This field returns the chip metal number. */
622 /* This field returns the bond id of the chip. */
623 uint8_t chip_bond_id;
626 * This value indicates the type of platform used for chip
630 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC \
632 /* FPGA platform of the chip. */
633 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA \
635 /* Palladium platform of the chip. */
636 #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM \
638 uint8_t chip_platform_type;
641 * This field returns the maximum value of request window that is
642 * supported by the HWRM. The request window is mapped into device
643 * address space using MMIO.
645 uint16_t max_req_win_len;
648 * This field returns the maximum value of response buffer in bytes. If
649 * a request specifies the response buffer length that is greater than
650 * this value, then the HWRM should fail it. The value of this field
651 * shall be 4KB or more.
653 uint16_t max_resp_len;
656 * This field returns the default request timeout value in milliseconds.
658 uint16_t def_req_timeout;
665 * This field is used in Output records to indicate that the output is
666 * completely written to RAM. This field should be read as '1' to
667 * indicate that the output has been completely written. When writing a
668 * command completion or response to an internal processor, the order of
669 * writes has to be such that this field is written last.
672 } __attribute__((packed));
674 /* hwrm_queue_qportcfg */
676 * Description: This function is called by a driver to query queue configuration
677 * of a port. # The HWRM shall at least advertise one queue with lossy service
678 * profile. # The driver shall use this command to query queue ids before
679 * configuring or using any queues. # If a service profile is not set for a
680 * queue, then the driver shall not use that queue without configuring a service
681 * profile for it. # If the driver is not allowed to configure service profiles,
682 * then the driver shall only use queues for which service profiles are pre-
686 /* Input (24 bytes) */
687 struct hwrm_queue_qportcfg_input {
689 * This value indicates what type of request this is. The format for the
690 * rest of the command is determined by this field.
695 * This value indicates the what completion ring the request will be
696 * optionally completed on. If the value is -1, then no CR completion
697 * will be generated. Any other value must be a valid CR ring_id value
702 /* This value indicates the command sequence number. */
706 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
707 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
712 * This is the host address where the response will be written when the
713 * request is complete. This area must be 16B aligned and must be
714 * cleared to zero before the request is made.
719 * Enumeration denoting the RX, TX type of the resource. This
720 * enumeration is used for resources that are similar for both TX and RX
723 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH \
726 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX \
729 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX \
731 #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
732 HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
736 * Port ID of port for which the queue configuration is being queried.
737 * This field is only required when sent by IPC.
742 } __attribute__((packed));
744 /* Output (32 bytes) */
745 struct hwrm_queue_qportcfg_output {
747 * Pass/Fail or error type Note: receiver to verify the in parameters,
748 * and fail the call with an error when appropriate
752 /* This field returns the type of original request. */
755 /* This field provides original sequence number of the command. */
759 * This field is the length of the response in bytes. The last byte of
760 * the response is a valid flag that will read as '1' when the command
761 * has been completely written to memory.
765 /* The maximum number of queues that can be configured. */
766 uint8_t max_configurable_queues;
768 /* The maximum number of lossless queues that can be configured. */
769 uint8_t max_configurable_lossless_queues;
772 * 0 - Not allowed. Non-zero - Allowed. If this value is non-zero, then
773 * the HWRM shall allow the host SW driver to configure queues using
776 uint8_t queue_cfg_allowed;
779 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
780 * the HWRM shall allow the host SW driver to configure queue buffers
781 * using hwrm_queue_buffers_cfg.
783 uint8_t queue_buffers_cfg_allowed;
786 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
787 * the HWRM shall allow the host SW driver to configure PFC using
788 * hwrm_queue_pfcenable_cfg.
790 uint8_t queue_pfcenable_cfg_allowed;
793 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
794 * the HWRM shall allow the host SW driver to configure Priority to CoS
795 * mapping using hwrm_queue_pri2cos_cfg.
797 uint8_t queue_pri2cos_cfg_allowed;
800 * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
801 * the HWRM shall allow the host SW driver to configure CoS Bandwidth
802 * configuration using hwrm_queue_cos2bw_cfg.
804 uint8_t queue_cos2bw_cfg_allowed;
806 /* ID of CoS Queue 0. FF - Invalid id */
809 /* This value is applicable to CoS queues only. */
810 /* Lossy (best-effort) */
811 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
814 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
817 * Set to 0xFF... (All Fs) if there is no service profile
820 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
821 (UINT32_C(0xff) << 0)
822 uint8_t queue_id0_service_profile;
824 /* ID of CoS Queue 1. FF - Invalid id */
826 /* This value is applicable to CoS queues only. */
827 /* Lossy (best-effort) */
828 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
831 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
834 * Set to 0xFF... (All Fs) if there is no service profile
837 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
838 (UINT32_C(0xff) << 0)
839 uint8_t queue_id1_service_profile;
841 /* ID of CoS Queue 2. FF - Invalid id */
843 /* This value is applicable to CoS queues only. */
844 /* Lossy (best-effort) */
845 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
848 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
851 * Set to 0xFF... (All Fs) if there is no service profile
854 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
855 (UINT32_C(0xff) << 0)
856 uint8_t queue_id2_service_profile;
858 /* ID of CoS Queue 3. FF - Invalid id */
861 /* This value is applicable to CoS queues only. */
862 /* Lossy (best-effort) */
863 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
866 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
869 * Set to 0xFF... (All Fs) if there is no service profile
872 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
873 (UINT32_C(0xff) << 0)
874 uint8_t queue_id3_service_profile;
876 /* ID of CoS Queue 4. FF - Invalid id */
878 /* This value is applicable to CoS queues only. */
879 /* Lossy (best-effort) */
880 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
883 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
886 * Set to 0xFF... (All Fs) if there is no service profile
889 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
890 (UINT32_C(0xff) << 0)
891 uint8_t queue_id4_service_profile;
893 /* ID of CoS Queue 5. FF - Invalid id */
896 /* This value is applicable to CoS queues only. */
897 /* Lossy (best-effort) */
898 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
901 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
904 * Set to 0xFF... (All Fs) if there is no service profile
907 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
908 (UINT32_C(0xff) << 0)
909 uint8_t queue_id5_service_profile;
911 /* ID of CoS Queue 6. FF - Invalid id */
912 uint8_t queue_id6_service_profile;
913 /* This value is applicable to CoS queues only. */
914 /* Lossy (best-effort) */
915 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
918 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
921 * Set to 0xFF... (All Fs) if there is no service profile
924 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
925 (UINT32_C(0xff) << 0)
928 /* ID of CoS Queue 7. FF - Invalid id */
931 /* This value is applicable to CoS queues only. */
932 /* Lossy (best-effort) */
933 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
936 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
939 * Set to 0xFF... (All Fs) if there is no service profile
942 #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
943 (UINT32_C(0xff) << 0)
944 uint8_t queue_id7_service_profile;
947 * This field is used in Output records to indicate that the output is
948 * completely written to RAM. This field should be read as '1' to
949 * indicate that the output has been completely written. When writing a
950 * command completion or response to an internal processor, the order of
951 * writes has to be such that this field is written last.
954 } __attribute__((packed));
956 /* hwrm_func_drv_rgtr */
958 * Description: This command is used by the function driver to register its
959 * information with the HWRM. A function driver shall implement this command. A
960 * function driver shall use this command during the driver initialization right
961 * after the HWRM version discovery and default ring resources allocation.
964 /* Input (80 bytes) */
965 struct hwrm_func_drv_rgtr_input {
967 * This value indicates what type of request this is. The format for the
968 * rest of the command is determined by this field.
973 * This value indicates the what completion ring the request will be
974 * optionally completed on. If the value is -1, then no CR completion
975 * will be generated. Any other value must be a valid CR ring_id value
980 /* This value indicates the command sequence number. */
984 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
985 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
990 * This is the host address where the response will be written when the
991 * request is complete. This area must be 16B aligned and must be
992 * cleared to zero before the request is made.
997 * When this bit is '1', the function driver is requesting all requests
998 * from its children VF drivers to be forwarded to itself. This flag can
999 * only be set by the PF driver. If a VF driver sets this flag, it
1000 * should be ignored by the HWRM.
1002 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_ALL_MODE UINT32_C(0x1)
1004 * When this bit is '1', the function is requesting none of the requests
1005 * from its children VF drivers to be forwarded to itself. This flag can
1006 * only be set by the PF driver. If a VF driver sets this flag, it
1007 * should be ignored by the HWRM.
1009 #define HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE UINT32_C(0x2)
1012 /* This bit must be '1' for the os_type field to be configured. */
1013 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_OS_TYPE UINT32_C(0x1)
1014 /* This bit must be '1' for the ver field to be configured. */
1015 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER UINT32_C(0x2)
1016 /* This bit must be '1' for the timestamp field to be configured. */
1017 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_TIMESTAMP UINT32_C(0x4)
1018 /* This bit must be '1' for the vf_req_fwd field to be configured. */
1019 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VF_REQ_FWD UINT32_C(0x8)
1021 * This bit must be '1' for the async_event_fwd field to be configured.
1023 #define HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD \
1027 /* This value indicates the type of OS. */
1029 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_UNKNOWN \
1030 (UINT32_C(0x0) << 0)
1031 /* Other OS not listed below. */
1032 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_OTHER \
1033 (UINT32_C(0x1) << 0)
1035 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_MSDOS \
1036 (UINT32_C(0xe) << 0)
1038 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WINDOWS \
1039 (UINT32_C(0x12) << 0)
1041 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_SOLARIS \
1042 (UINT32_C(0x1d) << 0)
1044 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_LINUX \
1045 (UINT32_C(0x24) << 0)
1047 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_FREEBSD \
1048 (UINT32_C(0x2a) << 0)
1049 /* VMware ESXi OS. */
1050 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_ESXI \
1051 (UINT32_C(0x68) << 0)
1052 /* Microsoft Windows 8 64-bit OS. */
1053 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN864 \
1054 (UINT32_C(0x73) << 0)
1055 /* Microsoft Windows Server 2012 R2 OS. */
1056 #define HWRM_FUNC_DRV_RGTR_INPUT_OS_TYPE_WIN2012R2 \
1057 (UINT32_C(0x74) << 0)
1060 /* This is the major version of the driver. */
1063 /* This is the minor version of the driver. */
1066 /* This is the update version of the driver. */
1073 * This is a 32-bit timestamp provided by the driver for keep alive. The
1074 * timestamp is in multiples of 1ms.
1081 * This is a 256-bit bit mask provided by the PF driver for letting the
1082 * HWRM know what commands issued by the VF driver to the HWRM should be
1083 * forwarded to the PF driver. Nth bit refers to the Nth req_type.
1084 * Setting Nth bit to 1 indicates that requests from the VF driver with
1085 * req_type equal to N shall be forwarded to the parent PF driver. This
1086 * field is not valid for the VF driver.
1088 uint32_t vf_req_fwd[8];
1091 * This is a 256-bit bit mask provided by the function driver (PF or VF
1092 * driver) to indicate the list of asynchronous event completions to be
1093 * forwarded. Nth bit refers to the Nth event_id. Setting Nth bit to 1
1094 * by the function driver shall result in the HWRM forwarding
1095 * asynchronous event completion with event_id equal to N. If all bits
1096 * are set to 0 (value of 0), then the HWRM shall not forward any
1097 * asynchronous event completion to this function driver.
1099 uint32_t async_event_fwd[8];
1100 } __attribute__((packed));
1102 /* Output (16 bytes) */
1104 struct hwrm_func_drv_rgtr_output {
1106 * Pass/Fail or error type Note: receiver to verify the in parameters,
1107 * and fail the call with an error when appropriate
1109 uint16_t error_code;
1111 /* This field returns the type of original request. */
1114 /* This field provides original sequence number of the command. */
1118 * This field is the length of the response in bytes. The last byte of
1119 * the response is a valid flag that will read as '1' when the command
1120 * has been completely written to memory.
1130 * This field is used in Output records to indicate that the output is
1131 * completely written to RAM. This field should be read as '1' to
1132 * indicate that the output has been completely written. When writing a
1133 * command completion or response to an internal processor, the order of
1134 * writes has to be such that this field is written last.
1137 } __attribute__((packed));
1139 /* hwrm_func_drv_unrgtr */
1141 * Description: This command is used by the function driver to un register with
1142 * the HWRM. A function driver shall implement this command. A function driver
1143 * shall use this command during the driver unloading.
1145 /* Input (24 bytes) */
1147 struct hwrm_func_drv_unrgtr_input {
1149 * This value indicates what type of request this is. The format for the
1150 * rest of the command is determined by this field.
1155 * This value indicates the what completion ring the request will be
1156 * optionally completed on. If the value is -1, then no CR completion
1157 * will be generated. Any other value must be a valid CR ring_id value
1158 * for this function.
1162 /* This value indicates the command sequence number. */
1166 * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
1167 * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
1172 * This is the host address where the response will be written when the
1173 * request is complete. This area must be 16B aligned and must be
1174 * cleared to zero before the request is made.
1179 * When this bit is '1', the function driver is notifying the HWRM to
1180 * prepare for the shutdown.
1182 #define HWRM_FUNC_DRV_UNRGTR_INPUT_FLAGS_PREPARE_FOR_SHUTDOWN \
1187 } __attribute__((packed));
1189 /* Output (16 bytes) */
1190 struct hwrm_func_drv_unrgtr_output {
1192 * Pass/Fail or error type Note: receiver to verify the in parameters,
1193 * and fail the call with an error when appropriate
1195 uint16_t error_code;
1197 /* This field returns the type of original request. */
1200 /* This field provides original sequence number of the command. */
1204 * This field is the length of the response in bytes. The last byte of
1205 * the response is a valid flag that will read as '1' when the command
1206 * has been completely written to memory.
1216 * This field is used in Output records to indicate that the output is
1217 * completely written to RAM. This field should be read as '1' to
1218 * indicate that the output has been completely written. When writing a
1219 * command completion or response to an internal processor, the order of
1220 * writes has to be such that this field is written last.
1223 } __attribute__((packed));