1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef __HAL_COM_PHYCFG_H__
16#define __HAL_COM_PHYCFG_H__
17
18#define PathA 0x0
19#define PathB 0x1
20#define PathC 0x2
21#define PathD 0x3
22
23enum RATE_SECTION {
24 CCK = 0,
25 OFDM,
26 HT_MCS0_MCS7,
27 HT_MCS8_MCS15,
28 HT_MCS16_MCS23,
29 HT_MCS24_MCS31,
30 VHT_1SSMCS0_1SSMCS9,
31 VHT_2SSMCS0_2SSMCS9,
32 VHT_3SSMCS0_3SSMCS9,
33 VHT_4SSMCS0_4SSMCS9,
34};
35
36enum RF_TX_NUM {
37 RF_1TX = 0,
38 RF_2TX,
39 RF_3TX,
40 RF_4TX,
41 RF_MAX_TX_NUM,
42 RF_TX_NUM_NONIMPLEMENT,
43};
44
45#define MAX_POWER_INDEX 0x3F
46
47enum _REGULATION_TXPWR_LMT {
48 TXPWR_LMT_FCC = 0,
49 TXPWR_LMT_MKK,
50 TXPWR_LMT_ETSI,
51 TXPWR_LMT_WW,
52 TXPWR_LMT_MAX_REGULATION_NUM,
53};
54
55
56struct bb_register_def {
57 u32 rfintfs;
58
59
60 u32 rfintfo;
61
62
63 u32 rfintfe;
64
65
66 u32 rf3wireOffset;
67
68
69 u32 rfHSSIPara2;
70
71
72
73 u32 rfLSSIReadBack;
74
75
76 u32 rfLSSIReadBackPi;
77
78
79};
80
81u8
82PHY_GetTxPowerByRateBase(
83struct adapter * Adapter,
84u8 Band,
85u8 RfPath,
86u8 TxNum,
87enum RATE_SECTION RateSection
88 );
89
90u8
91PHY_GetRateSectionIndexOfTxPowerByRate(
92struct adapter *padapter,
93u32 RegAddr,
94u32 BitMask
95 );
96
97void
98PHY_GetRateValuesOfTxPowerByRate(
99struct adapter *padapter,
100u32 RegAddr,
101u32 BitMask,
102u32 Value,
103 u8* RateIndex,
104 s8* PwrByRateVal,
105 u8* RateNum
106 );
107
108u8
109PHY_GetRateIndexOfTxPowerByRate(
110u8 Rate
111 );
112
113void
114PHY_SetTxPowerIndexByRateSection(
115struct adapter * padapter,
116u8 RFPath,
117u8 Channel,
118u8 RateSection
119 );
120
121s8
122PHY_GetTxPowerByRate(
123struct adapter *padapter,
124u8 Band,
125u8 RFPath,
126u8 TxNum,
127u8 RateIndex
128 );
129
130void
131PHY_SetTxPowerByRate(
132struct adapter *padapter,
133u8 Band,
134u8 RFPath,
135u8 TxNum,
136u8 Rate,
137s8 Value
138 );
139
140void
141PHY_SetTxPowerLevelByPath(
142struct adapter *Adapter,
143u8 channel,
144u8 path
145 );
146
147void
148PHY_SetTxPowerIndexByRateArray(
149struct adapter * padapter,
150u8 RFPath,
151enum CHANNEL_WIDTH BandWidth,
152u8 Channel,
153u8* Rates,
154u8 RateArraySize
155 );
156
157void
158PHY_InitTxPowerByRate(
159struct adapter *padapter
160 );
161
162void
163PHY_StoreTxPowerByRate(
164struct adapter *padapter,
165u32 Band,
166u32 RfPath,
167u32 TxNum,
168u32 RegAddr,
169u32 BitMask,
170u32 Data
171 );
172
173void
174PHY_TxPowerByRateConfiguration(
175 struct adapter * padapter
176 );
177
178u8
179PHY_GetTxPowerIndexBase(
180struct adapter * padapter,
181u8 RFPath,
182u8 Rate,
183enum CHANNEL_WIDTH BandWidth,
184u8 Channel,
185 bool *bIn24G
186 );
187
188s8 PHY_GetTxPowerLimit (struct adapter *adapter, u32 RegPwrTblSel,
189 enum BAND_TYPE Band, enum CHANNEL_WIDTH Bandwidth,
190u8 RfPath,
191u8 DataRate,
192u8 Channel
193 );
194
195void
196PHY_SetTxPowerLimit(
197struct adapter * Adapter,
198u8 *Regulation,
199u8 *Band,
200u8 *Bandwidth,
201u8 *RateSection,
202u8 *RfPath,
203u8 *Channel,
204u8 *PowerLimit
205 );
206
207void
208PHY_ConvertTxPowerLimitToPowerIndex(
209struct adapter * Adapter
210 );
211
212void
213PHY_InitTxPowerLimit(
214struct adapter * Adapter
215 );
216
217s8
218PHY_GetTxPowerTrackingOffset(
219 struct adapter *padapter,
220 u8 Rate,
221 u8 RFPath
222 );
223
224u8
225PHY_GetTxPowerIndex(
226struct adapter * padapter,
227u8 RFPath,
228u8 Rate,
229enum CHANNEL_WIDTH BandWidth,
230u8 Channel
231 );
232
233void
234PHY_SetTxPowerIndex(
235struct adapter * padapter,
236u32 PowerIndex,
237u8 RFPath,
238u8 Rate
239 );
240
241void
242Hal_ChannelPlanToRegulation(
243struct adapter * Adapter,
244u16 ChannelPlan
245 );
246
247#define MAX_PARA_FILE_BUF_LEN 25600
248
249#define LOAD_MAC_PARA_FILE BIT0
250#define LOAD_BB_PARA_FILE BIT1
251#define LOAD_BB_PG_PARA_FILE BIT2
252#define LOAD_BB_MP_PARA_FILE BIT3
253#define LOAD_RF_PARA_FILE BIT4
254#define LOAD_RF_TXPWR_TRACK_PARA_FILE BIT5
255#define LOAD_RF_TXPWR_LMT_PARA_FILE BIT6
256
257int phy_ConfigMACWithParaFile(struct adapter *Adapter, char*pFileName);
258
259int phy_ConfigBBWithParaFile(struct adapter *Adapter, char*pFileName, u32 ConfigType);
260
261int phy_ConfigBBWithPgParaFile(struct adapter *Adapter, char*pFileName);
262
263int phy_ConfigBBWithMpParaFile(struct adapter *Adapter, char*pFileName);
264
265int PHY_ConfigRFWithParaFile(struct adapter *Adapter, char*pFileName, u8 eRFPath);
266
267int PHY_ConfigRFWithTxPwrTrackParaFile(struct adapter *Adapter, char*pFileName);
268
269int PHY_ConfigRFWithPowerLimitTableParaFile(struct adapter *Adapter, char*pFileName);
270
271void phy_free_filebuf(struct adapter *padapter);
272
273#endif
274