hc
2024-08-16 62c46c9150c4afde7e5b25436263fddf79d66f0b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#ifndef __MARLIN3_RF_H__
#define __MARLIN3_RF_H__
struct nvm_cali_cmd {
   int8_t itm[64];
   int32_t par[512];
   int32_t num;
};
 
struct nvm_name_table {
   int8_t *itm;
   uint32_t mem_offset;
   int32_t type;
};
/*[Section 1: Version] */
struct version_t {
   uint16_t major;
   uint16_t minor;
};
 
/*[Section 2: Board Config]*/
struct board_config_t {
   uint16_t calib_bypass;
   uint8_t txchain_mask;
   uint8_t rxchain_mask;
};
 
/*[Section 3: Board Config TPC]*/
struct board_config_tpc_t {
   uint8_t dpd_lut_idx[8];
   uint16_t tpc_goal_chain0[8];
   uint16_t tpc_goal_chain1[8];
};
 
struct tpc_element_lut_t {
   uint8_t rf_gain_idx;
   uint8_t pa_bias_idx;
   int8_t  dvga_offset;
   int8_t  residual_error;
};
/*[Section 4: TPC-LUT]*/
struct tpc_lut_t {
   struct tpc_element_lut_t chain0_lut[8];
   struct tpc_element_lut_t chain1_lut[8];
};
 
/*[Section 5: Board Config Frequency Compensation]*/
struct board_conf_freq_comp_t {
   int8_t channel_2g_chain0[14];
   int8_t channel_2g_chain1[14];
   int8_t channel_5g_chain0[25];
   int8_t channel_5g_chain1[25];
   int8_t reserved[2];
};
 
/*[Section 6: Rate To Power with BW 20M]*/
struct power_20m_t {
   int8_t power_11b[4];
   int8_t power_11ag[8];
   int8_t power_11n[17];
   int8_t power_11ac[20];
   int8_t reserved[3];
};
 
/*[Section 7: Power Backoff]*/
struct power_backoff_t {
   int8_t green_wifi_offset;
   int8_t ht40_power_offset;
   int8_t vht40_power_offset;
   int8_t vht80_power_offset;
   int8_t sar_power_offset;
   int8_t mean_power_offset;
   int8_t tpc_mode;
   int8_t magic_word;
};
 
/*[Section 8: Reg Domain]*/
struct reg_domain_t {
   uint32_t reg_domain1;
   uint32_t reg_domain2;
};
 
/*[Section 9: Band Edge Power offset (MKK, FCC, ETSI)]*/
struct band_edge_power_offset_t {
   uint8_t bw20m[39];
   uint8_t bw40m[21];
   uint8_t bw80m[6];
   uint8_t reserved[2];
};
 
/*[Section 10: TX Scale]*/
struct tx_scale_t {
   int8_t chain0[39][16];
   int8_t chain1[39][16];
};
 
/*[Section 11: misc]*/
struct misc_t {
   int8_t dfs_switch;
   int8_t power_save_switch;
   int8_t fem_lan_param_setup;
   int8_t rssi_report_diff;
};
 
/*[Section 12: debug reg]*/
struct debug_reg_t {
   uint32_t address[16];
   uint32_t value[16];
};
 
/*[Section 13:coex_config] */
struct coex_config_t {
   uint32_t bt_performance_cfg0;
   uint32_t bt_performance_cfg1;
   uint32_t wifi_performance_cfg0;
   uint32_t wifi_performance_cfg2;
   uint32_t strategy_cfg0;
   uint32_t strategy_cfg1;
   uint32_t strategy_cfg2;
   uint32_t compatibility_cfg0;
   uint32_t compatibility_cfg1;
   uint32_t ant_cfg0;
   uint32_t ant_cfg1;
   uint32_t isolation_cfg0;
   uint32_t isolation_cfg1;
   uint32_t reserved_cfg0;
   uint32_t reserved_cfg1;
   uint32_t reserved_cfg2;
   uint32_t reserved_cfg3;
   uint32_t reserved_cfg4;
   uint32_t reserved_cfg5;
   uint32_t reserved_cfg6;
   uint32_t reserved_cfg7;
};
 
struct rf_config_t {
   int rf_data_len;
   uint8_t rf_data[1500];
};
 
/*wifi config section1 struct*/
struct wifi_conf_sec1_t {
   struct version_t version;
   struct board_config_t board_config;
   struct board_config_tpc_t board_config_tpc;
   struct tpc_lut_t tpc_lut;
   struct board_conf_freq_comp_t board_conf_freq_comp;
   struct power_20m_t power_20m;
   struct power_backoff_t power_backoff;
   struct reg_domain_t reg_domain;
   struct band_edge_power_offset_t band_edge_power_offset;
};
 
/*wifi config section2 struct*/
struct wifi_conf_sec2_t {
   struct tx_scale_t tx_scale;
   struct misc_t misc;
   struct debug_reg_t debug_reg;
   struct coex_config_t coex_config;
};
 
/*wifi config struct*/
struct wifi_conf_t {
   struct version_t version;
   struct board_config_t board_config;
   struct board_config_tpc_t board_config_tpc;
   struct tpc_lut_t tpc_lut;
   struct board_conf_freq_comp_t board_conf_freq_comp;
   struct power_20m_t power_20m;
   struct power_backoff_t power_backoff;
   struct reg_domain_t reg_domain;
   struct band_edge_power_offset_t band_edge_power_offset;
   struct tx_scale_t tx_scale;
   struct misc_t misc;
   struct debug_reg_t debug_reg;
   struct coex_config_t coex_config;
   struct rf_config_t rf_config;
};
 
int get_wifi_config_param(struct wifi_conf_t *p);
unsigned int marlin_get_wcn_chipid(void);
#endif