Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/halrf/halrf_kfree.h
1308 views
1
/******************************************************************************
2
*
3
* Copyright(c) 2007 - 2017 Realtek Corporation.
4
*
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms of version 2 of the GNU General Public License as
7
* published by the Free Software Foundation.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* The full GNU General Public License is included in this distribution in the
15
* file called LICENSE.
16
*
17
* Contact Information:
18
* wlanfae <[email protected]>
19
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20
* Hsinchu 300, Taiwan.
21
*
22
* Larry Finger <[email protected]>
23
*
24
*****************************************************************************/
25
26
#ifndef __HALRF_KFREE_H__
27
#define __HALRF_KFREE_H__
28
29
#define KFREE_VERSION "1.0"
30
31
#define KFREE_BAND_NUM 8
32
#define KFREE_CH_NUM 3
33
34
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_AP))
35
36
#define BB_GAIN_NUM 6
37
38
#endif
39
40
#define KFREE_FLAG_ON BIT(0)
41
#define KFREE_FLAG_THERMAL_K_ON BIT(1)
42
43
#define KFREE_FLAG_ON_2G BIT(2)
44
#define KFREE_FLAG_ON_5G BIT(3)
45
46
#define PA_BIAS_FLAG_ON BIT(4)
47
48
#define TSSI_TRIM_FLAG_ON BIT(5)
49
50
#define LNA_FLAG_ON BIT(6)
51
52
53
#define PPG_THERMAL_OFFSET_98F 0x50
54
#define PPG_2GM_TXAB_98F 0x51
55
#define PPG_2GM_TXCD_98F 0x52
56
#define PPG_2GL_TXAB_98F 0x53
57
#define PPG_2GL_TXCD_98F 0x54
58
#define PPG_2GH_TXAB_98F 0x55
59
#define PPG_2GH_TXCD_98F 0x56
60
61
#define PPG_PABIAS_2GAB_98F 0x57
62
#define PPG_PABIAS_2GCD_98F 0x58
63
64
#define PPG_LNA_2GA_98F 0x59
65
#define PPG_LNA_2GB_98F 0x5a
66
#define PPG_LNA_2GC_98F 0x5b
67
#define PPG_LNA_2GD_98F 0x5c
68
69
#define PPG_THERMAL_OFFSET_21C 0x1EF
70
#define PPG_2G_TXAB_21C 0x1EE
71
#define PPG_5GL1_TXA_21C 0x1EC
72
#define PPG_5GL2_TXA_21C 0x1E8
73
#define PPG_5GM1_TXA_21C 0x1E4
74
#define PPG_5GM2_TXA_21C 0x1E0
75
#define PPG_5GH1_TXA_21C 0x1DC
76
77
#define PPG_THERMAL_OFFSET_22B 0x3EF
78
#define PPG_2G_TXAB_22B 0x3EE
79
#define PPG_2G_TXCD_22B 0x3ED
80
#define PPG_5GL1_TXA_22B 0x3EC
81
#define PPG_5GL1_TXB_22B 0x3EB
82
#define PPG_5GL1_TXC_22B 0x3EA
83
#define PPG_5GL1_TXD_22B 0x3E9
84
#define PPG_5GL2_TXA_22B 0x3E8
85
#define PPG_5GL2_TXB_22B 0x3E7
86
#define PPG_5GL2_TXC_22B 0x3E6
87
#define PPG_5GL2_TXD_22B 0x3E5
88
#define PPG_5GM1_TXA_22B 0x3E4
89
#define PPG_5GM1_TXB_22B 0x3E3
90
#define PPG_5GM1_TXC_22B 0x3E2
91
#define PPG_5GM1_TXD_22B 0x3E1
92
#define PPG_5GM2_TXA_22B 0x3E0
93
#define PPG_5GM2_TXB_22B 0x3DF
94
#define PPG_5GM2_TXC_22B 0x3DE
95
#define PPG_5GM2_TXD_22B 0x3DD
96
#define PPG_5GH1_TXA_22B 0x3DC
97
#define PPG_5GH1_TXB_22B 0x3DB
98
#define PPG_5GH1_TXC_22B 0x3DA
99
#define PPG_5GH1_TXD_22B 0x3D9
100
101
#define PPG_PABIAS_2GA_22B 0x3D5
102
#define PPG_PABIAS_2GB_22B 0x3D6
103
104
#define PPG_THERMAL_A_OFFSET_22C 0x1ef
105
#define PPG_THERMAL_B_OFFSET_22C 0x1b0
106
#define PPG_2GL_TXAB_22C 0x1d4
107
#define PPG_2GM_TXAB_22C 0x1ee
108
#define PPG_2GH_TXAB_22C 0x1d2
109
#define PPG_5GL1_TXA_22C 0x1ec
110
#define PPG_5GL1_TXB_22C 0x1eb
111
#define PPG_5GL2_TXA_22C 0x1e8
112
#define PPG_5GL2_TXB_22C 0x1e7
113
#define PPG_5GM1_TXA_22C 0x1e4
114
#define PPG_5GM1_TXB_22C 0x1e3
115
#define PPG_5GM2_TXA_22C 0x1e0
116
#define PPG_5GM2_TXB_22C 0x1df
117
#define PPG_5GH1_TXA_22C 0x1dc
118
#define PPG_5GH1_TXB_22C 0x1db
119
120
#define PPG_PABIAS_2GA_22C 0x1d6
121
#define PPG_PABIAS_2GB_22C 0x1d5
122
#define PPG_PABIAS_5GA_22C 0x1d8
123
#define PPG_PABIAS_5GB_22C 0x1d7
124
125
#define TSSI_2GM_TXA_22C 0x1c0
126
#define TSSI_2GM_TXB_22C 0x1bf
127
#define TSSI_2GH_TXA_22C 0x1be
128
#define TSSI_2GH_TXB_22C 0x1bd
129
#define TSSI_5GL1_TXA_22C 0x1bc
130
#define TSSI_5GL1_TXB_22C 0x1bb
131
#define TSSI_5GL2_TXA_22C 0x1ba
132
#define TSSI_5GL2_TXB_22C 0x1b9
133
#define TSSI_5GM1_TXA_22C 0x1b8
134
#define TSSI_5GM1_TXB_22C 0x1b7
135
#define TSSI_5GM2_TXA_22C 0x1b6
136
#define TSSI_5GM2_TXB_22C 0x1b5
137
#define TSSI_5GH1_TXA_22C 0x1b4
138
#define TSSI_5GH1_TXB_22C 0x1b3
139
#define TSSI_5GH2_TXA_22C 0x1b2
140
#define TSSI_5GH2_TXB_22C 0x1b1
141
142
/*8195B*/
143
#define PPG_THERMAL_OFFSET_95B 0x1ef
144
#define PPG_2GL_TXA_95B 0x1d4
145
#define PPG_2GM_TXA_95B 0x1ee
146
#define PPG_2GH_TXA_95B 0x1d2
147
#define PPG_5GL1_TXA_95B 0x1ec
148
#define PPG_5GL2_TXA_95B 0x1e8
149
#define PPG_5GM1_TXA_95B 0x1e4
150
#define PPG_5GM2_TXA_95B 0x1e0
151
#define PPG_5GH1_TXA_95B 0x1dc
152
153
#define PPG_PABIAS_2GA_95B 0x1d6
154
#define PPG_PABIAS_5GA_95B 0x1d8
155
156
/*8721D*/
157
/*#define KFREE_BAND_NUM_8721D 6*/
158
#define PPG_THERMAL_OFFSET_8721D 0x1EF
159
#define PPG_2G_TXA_8721D 0x1EE
160
#define PPG_5GL1_TXA_8721D 0x1ED
161
#define PPG_5GL2_TXA_8721D 0x1EC
162
#define PPG_5GM1_TXA_8721D 0x1EB
163
#define PPG_5GM2_TXA_8721D 0x1EA
164
#define PPG_5GH1_TXA_8721D 0x1E9
165
166
#define PPG_THERMAL_OFFSET_97G 0x50
167
#define PPG_2GM_TXAB_97G 0x51
168
#define PPG_2GL_TXAB_97G 0x53
169
#define PPG_2GH_TXAB_97G 0x55
170
#define PPG_PABIAS_2GAB_97G 0x57
171
#define PPG_LNA_2GA_97G 0x21
172
#define PPG_LNA_2GB_97G 0x22
173
174
175
struct odm_power_trim_data {
176
u8 flag;
177
u8 pa_bias_flag;
178
u8 lna_flag;
179
s8 bb_gain[KFREE_BAND_NUM][MAX_RF_PATH];
180
s8 tssi_trim[KFREE_BAND_NUM][MAX_RF_PATH];
181
s8 thermal;
182
};
183
184
enum phydm_kfree_channeltosw {
185
PHYDM_2G = 0,
186
PHYDM_5GLB1 = 1,
187
PHYDM_5GLB2 = 2,
188
PHYDM_5GMB1 = 3,
189
PHYDM_5GMB2 = 4,
190
PHYDM_5GHB = 5,
191
};
192
193
void phydm_get_thermal_trim_offset(void *dm_void);
194
195
void phydm_get_power_trim_offset(void *dm_void);
196
197
void phydm_get_pa_bias_offset(void *dm_void);
198
199
s8 phydm_get_thermal_offset(void *dm_void);
200
201
void phydm_clear_kfree_to_rf(void *dm_void, u8 e_rf_path, u8 data);
202
203
void phydm_config_new_kfree(void *dm_void);
204
205
s8 phydm_get_tssi_trim_de(void *dm_void, u8 path);
206
207
void phydm_config_kfree(void *dm_void, u8 channel_to_sw);
208
209
#endif /*__HALRF_KFREE_H__*/
210
211