qcacmn: Update cfr metadata len calculation logic

Separate the common fields of csi_cfr_header and update
the logic of calculating the cfr_metadata_len.
Move cmn header update code to single place.

CRs-Fixed: 2916901
Change-Id: I97d99df45f667f4ed3b80264b12d3d09a3bcae95
This commit is contained in:
Shwetha G K
2021-04-06 12:33:29 +05:30
committed by Madan Koyyalamudi
parent 26086e7971
commit 8159fecc91
7 changed files with 103 additions and 120 deletions

View File

@@ -247,7 +247,10 @@ struct cfr_metadata_version_5 {
#endif
struct csi_cfr_header {
#define CFR_META_DATA_LEN \
(sizeof(struct csi_cfr_header) - sizeof(struct cfr_header_cmn))
struct cfr_header_cmn {
u_int32_t start_magic_num;
u_int32_t vendorid;
u_int8_t cfr_metadata_version;
@@ -255,7 +258,10 @@ struct csi_cfr_header {
u_int8_t chip_type;
u_int8_t pltform_type;
u_int32_t cfr_metadata_len;
} __attribute__ ((__packed__));
struct csi_cfr_header {
struct cfr_header_cmn cmn;
union {
struct cfr_metadata_version_1 meta_v1;
struct cfr_metadata_version_2 meta_v2;