Linux 6.13-rc6
[linux.git] / drivers / net / ethernet / mellanox / mlxfw / mlxfw_mfa2_format.h
blob47f6cc0401c398ecd319794a6933fda010881d3f
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;
25 __be16 num_devices;
26 __be32 cb_offset;
27 __be32 cb_archive_size;
28 __be32 cb_size_h;
29 __be32 cb_size_l;
30 u8 padding[3];
31 u8 cv_compression;
32 __be32 user_data_offset;
33 } __packed;
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;
40 __be16 total_len;
41 } __packed;
43 MLXFW_MFA2_TLV(multi, struct mlxfw_mfa2_tlv_multi,
44 MLXFW_MFA2_TLV_MULTI_PART);
46 struct mlxfw_mfa2_tlv_psid {
47 DECLARE_FLEX_ARRAY(u8, psid);
48 } __packed;
50 MLXFW_MFA2_TLV_VARSIZE(psid, struct mlxfw_mfa2_tlv_psid,
51 MLXFW_MFA2_TLV_PSID);
53 struct mlxfw_mfa2_tlv_component_ptr {
54 __be16 storage_id;
55 __be16 component_index;
56 __be32 storage_address;
57 } __packed;
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;
64 __be16 identifier;
65 __be32 cb_offset_h;
66 __be32 cb_offset_l;
67 __be32 size;
68 } __packed;
70 MLXFW_MFA2_TLV(component_descriptor, struct mlxfw_mfa2_tlv_component_descriptor,
71 MLXFW_MFA2_TLV_COMPONENT_DESCRIPTOR);
73 #endif