1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2 /* Copyright (c) 2017-2019 Mellanox Technologies. All rights reserved */
4 #ifndef _MLXFW_MFA2_FORMAT_H
5 #define _MLXFW_MFA2_FORMAT_H
7 #include "mlxfw_mfa2_file.h"
8 #include "mlxfw_mfa2_tlv.h"
10 enum mlxfw_mfa2_tlv_type {
11 MLXFW_MFA2_TLV_MULTI_PART = 0x01,
12 MLXFW_MFA2_TLV_PACKAGE_DESCRIPTOR = 0x02,
13 MLXFW_MFA2_TLV_COMPONENT_DESCRIPTOR = 0x04,
14 MLXFW_MFA2_TLV_COMPONENT_PTR = 0x22,
15 MLXFW_MFA2_TLV_PSID = 0x2A,
18 enum mlxfw_mfa2_compression_type {
19 MLXFW_MFA2_COMPRESSION_TYPE_NONE,
20 MLXFW_MFA2_COMPRESSION_TYPE_XZ,
23 struct mlxfw_mfa2_tlv_package_descriptor {
24 __be16 num_components;
27 __be32 cb_archive_size;
32 __be32 user_data_offset;
35 MLXFW_MFA2_TLV(package_descriptor, struct mlxfw_mfa2_tlv_package_descriptor,
36 MLXFW_MFA2_TLV_PACKAGE_DESCRIPTOR);
38 struct mlxfw_mfa2_tlv_multi {
39 __be16 num_extensions;
43 MLXFW_MFA2_TLV(multi, struct mlxfw_mfa2_tlv_multi,
44 MLXFW_MFA2_TLV_MULTI_PART);
46 struct mlxfw_mfa2_tlv_psid {
50 MLXFW_MFA2_TLV_VARSIZE(psid, struct mlxfw_mfa2_tlv_psid,
53 struct mlxfw_mfa2_tlv_component_ptr {
55 __be16 component_index;
56 __be32 storage_address;
59 MLXFW_MFA2_TLV(component_ptr, struct mlxfw_mfa2_tlv_component_ptr,
60 MLXFW_MFA2_TLV_COMPONENT_PTR);
62 struct mlxfw_mfa2_tlv_component_descriptor {
63 __be16 pldm_classification;
70 MLXFW_MFA2_TLV(component_descriptor, struct mlxfw_mfa2_tlv_component_descriptor,
71 MLXFW_MFA2_TLV_COMPONENT_DESCRIPTOR);