-/* hwrm_ver_get */
-/*
- * Description: This function is called by a driver to determine the HWRM
- * interface version supported by the HWRM firmware, the version of HWRM
- * firmware implementation, the name of HWRM firmware, the versions of other
- * embedded firmwares, and the names of other embedded firmwares, etc. Any
- * interface or firmware version with major = 0, minor = 0, and update = 0 shall
- * be considered an invalid version.
- */
-
-/* Input (24 bytes) */
-struct hwrm_ver_get_input {
- /*
- * This value indicates what type of request this is. The format for the
- * rest of the command is determined by this field.
- */
- uint16_t req_type;
-
- /*
- * This value indicates the what completion ring the request will be
- * optionally completed on. If the value is -1, then no CR completion
- * will be generated. Any other value must be a valid CR ring_id value
- * for this function.
- */
- uint16_t cmpl_ring;
-
- /* This value indicates the command sequence number. */
- uint16_t seq_id;
-
- /*
- * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
- * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
- */
- uint16_t target_id;
-
- /*
- * This is the host address where the response will be written when the
- * request is complete. This area must be 16B aligned and must be
- * cleared to zero before the request is made.
- */
- uint64_t resp_addr;
-
- /*
- * This field represents the major version of HWRM interface
- * specification supported by the driver HWRM implementation. The
- * interface major version is intended to change only when non backward
- * compatible changes are made to the HWRM interface specification.
- */
- uint8_t hwrm_intf_maj;
-
- /*
- * This field represents the minor version of HWRM interface
- * specification supported by the driver HWRM implementation. A change
- * in interface minor version is used to reflect significant backward
- * compatible modification to HWRM interface specification. This can be
- * due to addition or removal of functionality. HWRM interface
- * specifications with the same major version but different minor
- * versions are compatible.
- */
- uint8_t hwrm_intf_min;
-
- /*
- * This field represents the update version of HWRM interface
- * specification supported by the driver HWRM implementation. The
- * interface update version is used to reflect minor changes or bug
- * fixes to a released HWRM interface specification.
- */
- uint8_t hwrm_intf_upd;
-
- uint8_t unused_0[5];
-} __attribute__((packed));
-
-/* Output (128 bytes) */
-struct hwrm_ver_get_output {
- /*
- * Pass/Fail or error type Note: receiver to verify the in parameters,
- * and fail the call with an error when appropriate
- */
- uint16_t error_code;
-
- /* This field returns the type of original request. */
- uint16_t req_type;
-
- /* This field provides original sequence number of the command. */
- uint16_t seq_id;
-
- /*
- * This field is the length of the response in bytes. The last byte of
- * the response is a valid flag that will read as '1' when the command
- * has been completely written to memory.
- */
- uint16_t resp_len;
-
- /*
- * This field represents the major version of HWRM interface
- * specification supported by the HWRM implementation. The interface
- * major version is intended to change only when non backward compatible
- * changes are made to the HWRM interface specification. A HWRM
- * implementation that is compliant with this specification shall
- * provide value of 1 in this field.
- */
- uint8_t hwrm_intf_maj;
-
- /*
- * This field represents the minor version of HWRM interface
- * specification supported by the HWRM implementation. A change in
- * interface minor version is used to reflect significant backward
- * compatible modification to HWRM interface specification. This can be
- * due to addition or removal of functionality. HWRM interface
- * specifications with the same major version but different minor
- * versions are compatible. A HWRM implementation that is compliant with
- * this specification shall provide value of 0 in this field.
- */
- uint8_t hwrm_intf_min;
-
- /*
- * This field represents the update version of HWRM interface
- * specification supported by the HWRM implementation. The interface
- * update version is used to reflect minor changes or bug fixes to a
- * released HWRM interface specification. A HWRM implementation that is
- * compliant with this specification shall provide value of 1 in this
- * field.
- */
- uint8_t hwrm_intf_upd;
-
- uint8_t hwrm_intf_rsvd;
-
- /*
- * This field represents the major version of HWRM firmware. A change in
- * firmware major version represents a major firmware release.
- */
- uint8_t hwrm_fw_maj;
-
- /*
- * This field represents the minor version of HWRM firmware. A change in
- * firmware minor version represents significant firmware functionality
- * changes.
- */
- uint8_t hwrm_fw_min;
-
- /*
- * This field represents the build version of HWRM firmware. A change in
- * firmware build version represents bug fixes to a released firmware.
- */
- uint8_t hwrm_fw_bld;
-
- /*
- * This field is a reserved field. This field can be used to represent
- * firmware branches or customer specific releases tied to a specific
- * (major,minor,update) version of the HWRM firmware.
- */
- uint8_t hwrm_fw_rsvd;
-
- /*
- * This field represents the major version of mgmt firmware. A change in
- * major version represents a major release.
- */
- uint8_t mgmt_fw_maj;
-
- /*
- * This field represents the minor version of mgmt firmware. A change in
- * minor version represents significant functionality changes.
- */
- uint8_t mgmt_fw_min;
-
- /*
- * This field represents the build version of mgmt firmware. A change in
- * update version represents bug fixes.
- */
- uint8_t mgmt_fw_bld;
-
- /*
- * This field is a reserved field. This field can be used to represent
- * firmware branches or customer specific releases tied to a specific
- * (major,minor,update) version
- */
- uint8_t mgmt_fw_rsvd;
-
- /*
- * This field represents the major version of network control firmware.
- * A change in major version represents a major release.
- */
- uint8_t netctrl_fw_maj;
-
- /*
- * This field represents the minor version of network control firmware.
- * A change in minor version represents significant functionality
- * changes.
- */
- uint8_t netctrl_fw_min;
-
- /*
- * This field represents the build version of network control firmware.
- * A change in update version represents bug fixes.
- */
- uint8_t netctrl_fw_bld;
-
- /*
- * This field is a reserved field. This field can be used to represent
- * firmware branches or customer specific releases tied to a specific
- * (major,minor,update) version
- */
- uint8_t netctrl_fw_rsvd;
-
- /*
- * This field is reserved for future use. The responder should set it to
- * 0. The requester should ignore this field.
- */
- uint32_t reserved1;
-
- /*
- * This field represents the major version of RoCE firmware. A change in
- * major version represents a major release.
- */
- uint8_t roce_fw_maj;
-
- /*
- * This field represents the minor version of RoCE firmware. A change in
- * minor version represents significant functionality changes.
- */
- uint8_t roce_fw_min;
-
- /*
- * This field represents the build version of RoCE firmware. A change in
- * update version represents bug fixes.
- */
- uint8_t roce_fw_bld;
-
- /*
- * This field is a reserved field. This field can be used to represent
- * firmware branches or customer specific releases tied to a specific
- * (major,minor,update) version
- */
- uint8_t roce_fw_rsvd;
-
- /*
- * This field represents the name of HWRM FW (ASCII chars without NULL
- * at the end).
- */
- char hwrm_fw_name[16];
-
- /*
- * This field represents the name of mgmt FW (ASCII chars without NULL
- * at the end).
- */
- char mgmt_fw_name[16];
-
- /*
- * This field represents the name of network control firmware (ASCII
- * chars without NULL at the end).
- */
- char netctrl_fw_name[16];
-
- /*
- * This field is reserved for future use. The responder should set it to
- * 0. The requester should ignore this field.
- */
- uint32_t reserved2[4];
-
- /*
- * This field represents the name of RoCE FW (ASCII chars without NULL
- * at the end).
- */
- char roce_fw_name[16];
-
- /* This field returns the chip number. */
- uint16_t chip_num;
-
- /* This field returns the revision of chip. */
- uint8_t chip_rev;
-
- /* This field returns the chip metal number. */
- uint8_t chip_metal;
-
- /* This field returns the bond id of the chip. */
- uint8_t chip_bond_id;
-
- /*
- * This value indicates the type of platform used for chip
- * implementation.
- */
- /* ASIC */
- #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC \
- (UINT32_C(0x0) << 0)
- /* FPGA platform of the chip. */
- #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA \
- (UINT32_C(0x1) << 0)
- /* Palladium platform of the chip. */
- #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM \
- (UINT32_C(0x2) << 0)
- uint8_t chip_platform_type;
-
- /*
- * This field returns the maximum value of request window that is
- * supported by the HWRM. The request window is mapped into device
- * address space using MMIO.
- */
- uint16_t max_req_win_len;
-
- /*
- * This field returns the maximum value of response buffer in bytes. If
- * a request specifies the response buffer length that is greater than
- * this value, then the HWRM should fail it. The value of this field
- * shall be 4KB or more.
- */
- uint16_t max_resp_len;
-
- /*
- * This field returns the default request timeout value in milliseconds.
- */
- uint16_t def_req_timeout;
-
- uint8_t unused_0;
- uint8_t unused_1;
- uint8_t unused_2;
-
- /*
- * This field is used in Output records to indicate that the output is
- * completely written to RAM. This field should be read as '1' to
- * indicate that the output has been completely written. When writing a
- * command completion or response to an internal processor, the order of
- * writes has to be such that this field is written last.
- */
- uint8_t valid;
-} __attribute__((packed));
-