Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_hwconfig.c
1307 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
/*@************************************************************
27
* include files
28
************************************************************/
29
30
#include "mp_precomp.h"
31
#include "phydm_precomp.h"
32
33
#define READ_AND_CONFIG_MP(ic, txt) (odm_read_and_config_mp_##ic##txt(dm))
34
#define READ_AND_CONFIG_TC(ic, txt) (odm_read_and_config_tc_##ic##txt(dm))
35
36
#if (PHYDM_TESTCHIP_SUPPORT == 1)
37
#define READ_AND_CONFIG(ic, txt) \
38
do { \
39
if (dm->is_mp_chip) \
40
READ_AND_CONFIG_MP(ic, txt); \
41
else \
42
READ_AND_CONFIG_TC(ic, txt); \
43
} while (0)
44
#else
45
#define READ_AND_CONFIG READ_AND_CONFIG_MP
46
#endif
47
48
#define GET_VERSION_MP(ic, txt) (odm_get_version_mp_##ic##txt())
49
#define GET_VERSION_TC(ic, txt) (odm_get_version_tc_##ic##txt())
50
51
#if (PHYDM_TESTCHIP_SUPPORT == 1)
52
#define GET_VERSION(ic, txt) (dm->is_mp_chip ? GET_VERSION_MP(ic, txt) : GET_VERSION_TC(ic, txt))
53
#else
54
#define GET_VERSION(ic, txt) GET_VERSION_MP(ic, txt)
55
#endif
56
57
enum hal_status
58
odm_config_rf_with_header_file(struct dm_struct *dm,
59
enum odm_rf_config_type config_type,
60
u8 e_rf_path)
61
{
62
#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)
63
void *adapter = dm->adapter;
64
PMGNT_INFO mgnt_info = &((PADAPTER)adapter)->MgntInfo;
65
#endif
66
enum hal_status result = HAL_STATUS_SUCCESS;
67
68
PHYDM_DBG(dm, ODM_COMP_INIT, "===>%s (%s)\n", __func__,
69
(dm->is_mp_chip) ? "MPChip" : "TestChip");
70
PHYDM_DBG(dm, ODM_COMP_INIT,
71
"support_platform: 0x%X, support_interface: 0x%X, board_type: 0x%X\n",
72
dm->support_platform, dm->support_interface, dm->board_type);
73
74
/* @1 AP doesn't use PHYDM power tracking table in these ICs */
75
#if (DM_ODM_SUPPORT_TYPE != ODM_AP)
76
#if (RTL8812A_SUPPORT == 1)
77
if (dm->support_ic_type == ODM_RTL8812) {
78
if (config_type == CONFIG_RF_RADIO) {
79
if (e_rf_path == RF_PATH_A)
80
READ_AND_CONFIG_MP(8812a, _radioa);
81
else if (e_rf_path == RF_PATH_B)
82
READ_AND_CONFIG_MP(8812a, _radiob);
83
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
84
#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) && (DEV_BUS_TYPE == RT_PCI_INTERFACE)
85
HAL_DATA_TYPE * hal_data = GET_HAL_DATA(((PADAPTER)adapter));
86
if ((hal_data->EEPROMSVID == 0x17AA && hal_data->EEPROMSMID == 0xA811) ||
87
(hal_data->EEPROMSVID == 0x10EC && hal_data->EEPROMSMID == 0xA812) ||
88
(hal_data->EEPROMSVID == 0x10EC && hal_data->EEPROMSMID == 0x8812))
89
READ_AND_CONFIG_MP(8812a, _txpwr_lmt_hm812a03);
90
else
91
#endif
92
READ_AND_CONFIG_MP(8812a, _txpwr_lmt);
93
}
94
}
95
#endif
96
#if (RTL8821A_SUPPORT == 1)
97
if (dm->support_ic_type == ODM_RTL8821) {
98
if (config_type == CONFIG_RF_RADIO) {
99
if (e_rf_path == RF_PATH_A)
100
READ_AND_CONFIG_MP(8821a, _radioa);
101
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
102
if (dm->support_interface == ODM_ITRF_USB) {
103
if (dm->ext_pa_5g || dm->ext_lna_5g)
104
READ_AND_CONFIG_MP(8821a, _txpwr_lmt_8811a_u_fem);
105
else
106
READ_AND_CONFIG_MP(8821a, _txpwr_lmt_8811a_u_ipa);
107
} else {
108
#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)
109
if (mgnt_info->CustomerID == RT_CID_8821AE_ASUS_MB)
110
READ_AND_CONFIG_MP(8821a, _txpwr_lmt_8821a_sar_8mm);
111
else if (mgnt_info->CustomerID == RT_CID_ASUS_NB)
112
READ_AND_CONFIG_MP(8821a, _txpwr_lmt_8821a_sar_5mm);
113
else
114
#endif
115
READ_AND_CONFIG_MP(8821a, _txpwr_lmt_8821a);
116
}
117
}
118
}
119
#endif
120
#if (RTL8192E_SUPPORT == 1)
121
if (dm->support_ic_type == ODM_RTL8192E) {
122
if (config_type == CONFIG_RF_RADIO) {
123
if (e_rf_path == RF_PATH_A)
124
READ_AND_CONFIG_MP(8192e, _radioa);
125
else if (e_rf_path == RF_PATH_B)
126
READ_AND_CONFIG_MP(8192e, _radiob);
127
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
128
#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) && (DEV_BUS_TYPE == RT_PCI_INTERFACE) /*Refine by Vincent Lan for 5mm SAR pwr limit*/
129
HAL_DATA_TYPE * hal_data = GET_HAL_DATA(((PADAPTER)adapter));
130
131
if ((hal_data->EEPROMSVID == 0x11AD && hal_data->EEPROMSMID == 0x8192) ||
132
(hal_data->EEPROMSVID == 0x11AD && hal_data->EEPROMSMID == 0x8193))
133
READ_AND_CONFIG_MP(8192e, _txpwr_lmt_8192e_sar_5mm);
134
else
135
#endif
136
READ_AND_CONFIG_MP(8192e, _txpwr_lmt);
137
}
138
}
139
#endif
140
#if (RTL8723D_SUPPORT == 1)
141
if (dm->support_ic_type == ODM_RTL8723D) {
142
if (config_type == CONFIG_RF_RADIO) {
143
if (e_rf_path == RF_PATH_A)
144
READ_AND_CONFIG_MP(8723d, _radioa);
145
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
146
READ_AND_CONFIG_MP(8723d, _txpwr_lmt);
147
}
148
}
149
#endif
150
/* @JJ ADD 20161014 */
151
#if (RTL8710B_SUPPORT == 1)
152
if (dm->support_ic_type == ODM_RTL8710B) {
153
if (config_type == CONFIG_RF_RADIO) {
154
if (e_rf_path == RF_PATH_A)
155
READ_AND_CONFIG_MP(8710b, _radioa);
156
} else if (config_type == CONFIG_RF_TXPWR_LMT)
157
READ_AND_CONFIG_MP(8710b, _txpwr_lmt);
158
}
159
#endif
160
161
#endif /* @(DM_ODM_SUPPORT_TYPE != ODM_AP) */
162
/* @1 All platforms support */
163
#if (RTL8188E_SUPPORT == 1)
164
if (dm->support_ic_type == ODM_RTL8188E) {
165
if (config_type == CONFIG_RF_RADIO) {
166
if (e_rf_path == RF_PATH_A)
167
READ_AND_CONFIG_MP(8188e, _radioa);
168
} else if (config_type == CONFIG_RF_TXPWR_LMT)
169
READ_AND_CONFIG_MP(8188e, _txpwr_lmt);
170
}
171
#endif
172
#if (RTL8723B_SUPPORT == 1)
173
if (dm->support_ic_type == ODM_RTL8723B) {
174
if (config_type == CONFIG_RF_RADIO)
175
READ_AND_CONFIG_MP(8723b, _radioa);
176
else if (config_type == CONFIG_RF_TXPWR_LMT)
177
READ_AND_CONFIG_MP(8723b, _txpwr_lmt);
178
}
179
#endif
180
#if (RTL8814A_SUPPORT == 1)
181
if (dm->support_ic_type == ODM_RTL8814A) {
182
if (config_type == CONFIG_RF_RADIO) {
183
if (e_rf_path == RF_PATH_A)
184
READ_AND_CONFIG_MP(8814a, _radioa);
185
else if (e_rf_path == RF_PATH_B)
186
READ_AND_CONFIG_MP(8814a, _radiob);
187
else if (e_rf_path == RF_PATH_C)
188
READ_AND_CONFIG_MP(8814a, _radioc);
189
else if (e_rf_path == RF_PATH_D)
190
READ_AND_CONFIG_MP(8814a, _radiod);
191
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
192
if (dm->rfe_type == 0)
193
READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type0);
194
else if (dm->rfe_type == 1)
195
READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type1);
196
else if (dm->rfe_type == 2)
197
READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type2);
198
else if (dm->rfe_type == 3)
199
READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type3);
200
else if (dm->rfe_type == 5)
201
READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type5);
202
else if (dm->rfe_type == 7)
203
READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type7);
204
else if (dm->rfe_type == 8)
205
READ_AND_CONFIG_MP(8814a, _txpwr_lmt_type8);
206
else
207
READ_AND_CONFIG_MP(8814a, _txpwr_lmt);
208
}
209
}
210
#endif
211
#if (RTL8703B_SUPPORT == 1)
212
if (dm->support_ic_type == ODM_RTL8703B) {
213
if (config_type == CONFIG_RF_RADIO) {
214
if (e_rf_path == RF_PATH_A)
215
READ_AND_CONFIG_MP(8703b, _radioa);
216
}
217
}
218
#endif
219
#if (RTL8188F_SUPPORT == 1)
220
if (dm->support_ic_type == ODM_RTL8188F) {
221
if (config_type == CONFIG_RF_RADIO) {
222
if (e_rf_path == RF_PATH_A)
223
READ_AND_CONFIG_MP(8188f, _radioa);
224
} else if (config_type == CONFIG_RF_TXPWR_LMT)
225
READ_AND_CONFIG_MP(8188f, _txpwr_lmt);
226
}
227
#endif
228
#if (RTL8822B_SUPPORT == 1)
229
if (dm->support_ic_type == ODM_RTL8822B) {
230
if (config_type == CONFIG_RF_RADIO) {
231
if (e_rf_path == RF_PATH_A)
232
READ_AND_CONFIG_MP(8822b, _radioa);
233
else if (e_rf_path == RF_PATH_B)
234
READ_AND_CONFIG_MP(8822b, _radiob);
235
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
236
if (dm->rfe_type == 5)
237
READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type5);
238
else if (dm->rfe_type == 2)
239
READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type2);
240
else if (dm->rfe_type == 3)
241
READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type3);
242
else if (dm->rfe_type == 4)
243
READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type4);
244
else if (dm->rfe_type == 12)
245
READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type12);
246
else if (dm->rfe_type == 15)
247
READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type15);
248
else if (dm->rfe_type == 16)
249
READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type16);
250
else if (dm->rfe_type == 17)
251
READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type17);
252
else if (dm->rfe_type == 18)
253
READ_AND_CONFIG_MP(8822b, _txpwr_lmt_type18);
254
else
255
READ_AND_CONFIG_MP(8822b, _txpwr_lmt);
256
}
257
}
258
#endif
259
260
#if (RTL8197F_SUPPORT == 1)
261
if (dm->support_ic_type == ODM_RTL8197F) {
262
if (config_type == CONFIG_RF_RADIO) {
263
if (e_rf_path == RF_PATH_A)
264
READ_AND_CONFIG_MP(8197f, _radioa);
265
else if (e_rf_path == RF_PATH_B)
266
READ_AND_CONFIG_MP(8197f, _radiob);
267
}
268
}
269
#endif
270
/*@jj add 20170822*/
271
#if (RTL8192F_SUPPORT == 1)
272
if (dm->support_ic_type == ODM_RTL8192F) {
273
if (config_type == CONFIG_RF_RADIO) {
274
if (e_rf_path == RF_PATH_A)
275
READ_AND_CONFIG_MP(8192f, _radioa);
276
else if (e_rf_path == RF_PATH_B)
277
READ_AND_CONFIG_MP(8192f, _radiob);
278
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
279
if (dm->rfe_type == 0)
280
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type0);
281
else if (dm->rfe_type == 1)
282
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type1);
283
else if (dm->rfe_type == 2)
284
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type2);
285
else if (dm->rfe_type == 3)
286
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type3);
287
else if (dm->rfe_type == 4)
288
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type4);
289
else if (dm->rfe_type == 5)
290
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type5);
291
else if (dm->rfe_type == 6)
292
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type6);
293
else if (dm->rfe_type == 7)
294
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type7);
295
else if (dm->rfe_type == 8)
296
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type8);
297
else if (dm->rfe_type == 9)
298
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type9);
299
else if (dm->rfe_type == 10)
300
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type10);
301
else if (dm->rfe_type == 11)
302
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type11);
303
else if (dm->rfe_type == 12)
304
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type12);
305
else if (dm->rfe_type == 13)
306
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type13);
307
else if (dm->rfe_type == 14)
308
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type14);
309
else if (dm->rfe_type == 15)
310
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type15);
311
else if (dm->rfe_type == 16)
312
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type16);
313
else if (dm->rfe_type == 17)
314
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type17);
315
else if (dm->rfe_type == 18)
316
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type18);
317
else if (dm->rfe_type == 19)
318
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type19);
319
else if (dm->rfe_type == 20)
320
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type20);
321
else if (dm->rfe_type == 21)
322
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type21);
323
else if (dm->rfe_type == 22)
324
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type22);
325
else if (dm->rfe_type == 23)
326
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type23);
327
else if (dm->rfe_type == 24)
328
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type24);
329
else if (dm->rfe_type == 25)
330
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type25);
331
else if (dm->rfe_type == 26)
332
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type26);
333
else if (dm->rfe_type == 27)
334
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type27);
335
else if (dm->rfe_type == 28)
336
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type28);
337
else if (dm->rfe_type == 29)
338
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type29);
339
else if (dm->rfe_type == 30)
340
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type30);
341
else if (dm->rfe_type == 31)
342
READ_AND_CONFIG_MP(8192f, _txpwr_lmt_type31);
343
else
344
READ_AND_CONFIG_MP(8192f, _txpwr_lmt);
345
}
346
}
347
#endif
348
#if (RTL8721D_SUPPORT == 1)
349
if (dm->support_ic_type == ODM_RTL8721D) {
350
if (config_type == CONFIG_RF_RADIO) {
351
if (e_rf_path == RF_PATH_A)
352
READ_AND_CONFIG_MP(8721d, _radioa);
353
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
354
if (dm->power_voltage == ODM_POWER_18V)
355
READ_AND_CONFIG_MP(8721d, _txpwr_lmt_type0);
356
else
357
READ_AND_CONFIG_MP(8721d, _txpwr_lmt_type1);
358
}
359
}
360
#endif
361
362
#if (RTL8710C_SUPPORT == 1)
363
if (dm->support_ic_type == ODM_RTL8710C) {
364
if (config_type == CONFIG_RF_RADIO) {
365
if (e_rf_path == RF_PATH_A)
366
READ_AND_CONFIG_MP(8710c, _radioa);
367
} else if (config_type == CONFIG_RF_TXPWR_LMT)
368
READ_AND_CONFIG_MP(8710c, _txpwr_lmt);
369
}
370
#endif
371
372
#if (RTL8821C_SUPPORT == 1)
373
if (dm->support_ic_type == ODM_RTL8821C) {
374
if (config_type == CONFIG_RF_RADIO) {
375
if (e_rf_path == RF_PATH_A)
376
READ_AND_CONFIG(8821c, _radioa);
377
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
378
READ_AND_CONFIG(8821c, _txpwr_lmt);
379
}
380
}
381
#endif
382
#if (RTL8195B_SUPPORT == 1)
383
if (dm->support_ic_type == ODM_RTL8195B) {
384
if (config_type == CONFIG_RF_RADIO) {
385
if (e_rf_path == RF_PATH_A)
386
READ_AND_CONFIG(8195b, _radioa);
387
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
388
READ_AND_CONFIG(8195b, _txpwr_lmt);
389
}
390
}
391
#endif
392
#if (RTL8198F_SUPPORT == 1)
393
if (dm->support_ic_type == ODM_RTL8198F) {
394
if (config_type == CONFIG_RF_RADIO) {
395
if (e_rf_path == RF_PATH_A)
396
READ_AND_CONFIG_MP(8198f, _radioa);
397
else if (e_rf_path == RF_PATH_B)
398
READ_AND_CONFIG_MP(8198f, _radiob);
399
else if (e_rf_path == RF_PATH_C)
400
READ_AND_CONFIG_MP(8198f, _radioc);
401
else if (e_rf_path == RF_PATH_D)
402
READ_AND_CONFIG_MP(8198f, _radiod);
403
}
404
}
405
#endif
406
/*#if (RTL8814B_SUPPORT == 1)
407
if (dm->support_ic_type == ODM_RTL8814B) {
408
if (config_type == CONFIG_RF_RADIO) {
409
if (e_rf_path == RF_PATH_A)
410
READ_AND_CONFIG_MP(8814b, _radioa);
411
else if (e_rf_path == RF_PATH_B)
412
READ_AND_CONFIG_MP(8814b, _radiob);
413
else if (e_rf_path == RF_PATH_C)
414
READ_AND_CONFIG_MP(8814b, _radioc);
415
else if (e_rf_path == RF_PATH_D)
416
READ_AND_CONFIG_MP(8814b, _radiod);
417
}
418
}
419
#endif
420
*/
421
#if (RTL8822C_SUPPORT)
422
if (dm->support_ic_type == ODM_RTL8822C) {
423
if (config_type == CONFIG_RF_RADIO) {
424
if (e_rf_path == RF_PATH_A)
425
READ_AND_CONFIG_MP(8822c, _radioa);
426
else if (e_rf_path == RF_PATH_B)
427
READ_AND_CONFIG_MP(8822c, _radiob);
428
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
429
READ_AND_CONFIG_MP(8822c, _txpwr_lmt);
430
}
431
}
432
#endif
433
#if (RTL8812F_SUPPORT)
434
if (dm->support_ic_type == ODM_RTL8812F) {
435
if (config_type == CONFIG_RF_RADIO) {
436
if (e_rf_path == RF_PATH_A)
437
READ_AND_CONFIG_MP(8812f, _radioa);
438
else if (e_rf_path == RF_PATH_B)
439
READ_AND_CONFIG_MP(8812f, _radiob);
440
}
441
}
442
#endif
443
#if (RTL8197G_SUPPORT)
444
if (dm->support_ic_type == ODM_RTL8197G) {
445
if (config_type == CONFIG_RF_RADIO) {
446
if (e_rf_path == RF_PATH_A)
447
READ_AND_CONFIG_MP(8197g, _radioa);
448
else if (e_rf_path == RF_PATH_B)
449
READ_AND_CONFIG_MP(8197g, _radiob);
450
}
451
}
452
#endif
453
454
/*8814B need review, when phydm has related files*/
455
#if (RTL8814B_SUPPORT)
456
if (dm->support_ic_type == ODM_RTL8814B) {
457
if (config_type == CONFIG_RF_RADIO) {
458
if (e_rf_path == RF_PATH_A)
459
READ_AND_CONFIG_MP(8814b, _radioa);
460
else if (e_rf_path == RF_PATH_B)
461
READ_AND_CONFIG_MP(8814b, _radiob);
462
else if (e_rf_path == RF_PATH_C)
463
READ_AND_CONFIG_MP(8814b, _radioc);
464
else if (e_rf_path == RF_PATH_D)
465
READ_AND_CONFIG_MP(8814b, _radiod);
466
}
467
if (config_type == CONFIG_RF_SYN_RADIO) {
468
if (e_rf_path == RF_SYN0)
469
READ_AND_CONFIG_MP(8814b, _radiosyn0);
470
else if (e_rf_path == RF_SYN1)
471
READ_AND_CONFIG_MP(8814b, _radiosyn1);
472
} else if (config_type == CONFIG_RF_TXPWR_LMT) {
473
READ_AND_CONFIG_MP(8814b, _txpwr_lmt);
474
}
475
}
476
#endif
477
478
if (config_type == CONFIG_RF_RADIO) {
479
if (dm->fw_offload_ability & PHYDM_PHY_PARAM_OFFLOAD) {
480
result = phydm_set_reg_by_fw(dm,
481
PHYDM_HALMAC_CMD_END,
482
0,
483
0,
484
0,
485
(enum rf_path)0,
486
0);
487
PHYDM_DBG(dm, ODM_COMP_INIT,
488
"rf param offload end!result = %d", result);
489
}
490
}
491
492
return result;
493
}
494
495
enum hal_status
496
odm_config_rf_with_tx_pwr_track_header_file(struct dm_struct *dm)
497
{
498
PHYDM_DBG(dm, ODM_COMP_INIT, "===>%s (%s)\n", __func__,
499
(dm->is_mp_chip) ? "MPChip" : "TestChip");
500
PHYDM_DBG(dm, ODM_COMP_INIT,
501
"support_platform: 0x%X, support_interface: 0x%X, board_type: 0x%X\n",
502
dm->support_platform, dm->support_interface, dm->board_type);
503
504
/* @1 AP doesn't use PHYDM power tracking table in these ICs */
505
#if (DM_ODM_SUPPORT_TYPE != ODM_AP)
506
#if RTL8821A_SUPPORT
507
if (dm->support_ic_type == ODM_RTL8821) {
508
if (dm->support_interface == ODM_ITRF_PCIE)
509
READ_AND_CONFIG_MP(8821a, _txpowertrack_pcie);
510
else if (dm->support_interface == ODM_ITRF_USB)
511
READ_AND_CONFIG_MP(8821a, _txpowertrack_usb);
512
else if (dm->support_interface == ODM_ITRF_SDIO)
513
READ_AND_CONFIG_MP(8821a, _txpowertrack_sdio);
514
}
515
#endif
516
#if RTL8812A_SUPPORT
517
if (dm->support_ic_type == ODM_RTL8812) {
518
if (dm->support_interface == ODM_ITRF_PCIE)
519
READ_AND_CONFIG_MP(8812a, _txpowertrack_pcie);
520
else if (dm->support_interface == ODM_ITRF_USB) {
521
if (dm->rfe_type == 3 && dm->is_mp_chip)
522
READ_AND_CONFIG_MP(8812a, _txpowertrack_rfe3);
523
else
524
READ_AND_CONFIG_MP(8812a, _txpowertrack_usb);
525
}
526
}
527
#endif
528
#if RTL8192E_SUPPORT
529
if (dm->support_ic_type == ODM_RTL8192E) {
530
if (dm->support_interface == ODM_ITRF_PCIE)
531
READ_AND_CONFIG_MP(8192e, _txpowertrack_pcie);
532
else if (dm->support_interface == ODM_ITRF_USB)
533
READ_AND_CONFIG_MP(8192e, _txpowertrack_usb);
534
else if (dm->support_interface == ODM_ITRF_SDIO)
535
READ_AND_CONFIG_MP(8192e, _txpowertrack_sdio);
536
}
537
#endif
538
#if RTL8723D_SUPPORT
539
if (dm->support_ic_type == ODM_RTL8723D) {
540
if (dm->support_interface == ODM_ITRF_PCIE)
541
READ_AND_CONFIG_MP(8723d, _txpowertrack_pcie);
542
else if (dm->support_interface == ODM_ITRF_USB)
543
READ_AND_CONFIG_MP(8723d, _txpowertrack_usb);
544
else if (dm->support_interface == ODM_ITRF_SDIO)
545
READ_AND_CONFIG_MP(8723d, _txpowertrack_sdio);
546
547
READ_AND_CONFIG_MP(8723d, _txxtaltrack);
548
}
549
#endif
550
/* @JJ ADD 20161014 */
551
#if RTL8710B_SUPPORT
552
if (dm->support_ic_type == ODM_RTL8710B) {
553
if (dm->package_type == 1)
554
READ_AND_CONFIG_MP(8710b, _txpowertrack_qfn48m_smic);
555
else if (dm->package_type == 5)
556
READ_AND_CONFIG_MP(8710b, _txpowertrack_qfn48m_umc);
557
558
READ_AND_CONFIG_MP(8710b, _txxtaltrack);
559
}
560
#endif
561
#if RTL8188E_SUPPORT
562
if (dm->support_ic_type == ODM_RTL8188E) {
563
if (odm_get_mac_reg(dm, R_0xf0, 0xF000) >= 8) { /*@if 0xF0[15:12] >= 8, SMIC*/
564
if (dm->support_interface == ODM_ITRF_PCIE)
565
READ_AND_CONFIG_MP(8188e, _txpowertrack_pcie_icut);
566
else if (dm->support_interface == ODM_ITRF_USB)
567
READ_AND_CONFIG_MP(8188e, _txpowertrack_usb_icut);
568
else if (dm->support_interface == ODM_ITRF_SDIO)
569
READ_AND_CONFIG_MP(8188e, _txpowertrack_sdio_icut);
570
} else { /*@else 0xF0[15:12] < 8, TSMC*/
571
if (dm->support_interface == ODM_ITRF_PCIE)
572
READ_AND_CONFIG_MP(8188e, _txpowertrack_pcie);
573
else if (dm->support_interface == ODM_ITRF_USB)
574
READ_AND_CONFIG_MP(8188e, _txpowertrack_usb);
575
else if (dm->support_interface == ODM_ITRF_SDIO)
576
READ_AND_CONFIG_MP(8188e, _txpowertrack_sdio);
577
}
578
}
579
#endif
580
#endif /* @(DM_ODM_SUPPORT_TYPE != ODM_AP) */
581
/* @1 All platforms support */
582
#if RTL8723B_SUPPORT
583
if (dm->support_ic_type == ODM_RTL8723B) {
584
if (dm->support_interface == ODM_ITRF_PCIE)
585
READ_AND_CONFIG_MP(8723b, _txpowertrack_pcie);
586
else if (dm->support_interface == ODM_ITRF_USB)
587
READ_AND_CONFIG_MP(8723b, _txpowertrack_usb);
588
else if (dm->support_interface == ODM_ITRF_SDIO)
589
READ_AND_CONFIG_MP(8723b, _txpowertrack_sdio);
590
}
591
#endif
592
#if RTL8814A_SUPPORT
593
if (dm->support_ic_type == ODM_RTL8814A) {
594
if (dm->rfe_type == 0)
595
READ_AND_CONFIG_MP(8814a, _txpowertrack_type0);
596
else if (dm->rfe_type == 2)
597
READ_AND_CONFIG_MP(8814a, _txpowertrack_type2);
598
else if (dm->rfe_type == 5)
599
READ_AND_CONFIG_MP(8814a, _txpowertrack_type5);
600
else if (dm->rfe_type == 7)
601
READ_AND_CONFIG_MP(8814a, _txpowertrack_type7);
602
else if (dm->rfe_type == 8)
603
READ_AND_CONFIG_MP(8814a, _txpowertrack_type8);
604
else
605
READ_AND_CONFIG_MP(8814a, _txpowertrack);
606
607
READ_AND_CONFIG_MP(8814a, _txpowertssi);
608
}
609
#endif
610
#if RTL8703B_SUPPORT
611
if (dm->support_ic_type == ODM_RTL8703B) {
612
if (dm->support_interface == ODM_ITRF_USB)
613
READ_AND_CONFIG_MP(8703b, _txpowertrack_usb);
614
else if (dm->support_interface == ODM_ITRF_SDIO)
615
READ_AND_CONFIG_MP(8703b, _txpowertrack_sdio);
616
617
READ_AND_CONFIG_MP(8703b, _txxtaltrack);
618
}
619
#endif
620
#if RTL8188F_SUPPORT
621
if (dm->support_ic_type == ODM_RTL8188F) {
622
if (dm->support_interface == ODM_ITRF_USB)
623
READ_AND_CONFIG_MP(8188f, _txpowertrack_usb);
624
else if (dm->support_interface == ODM_ITRF_SDIO)
625
READ_AND_CONFIG_MP(8188f, _txpowertrack_sdio);
626
}
627
#endif
628
#if RTL8822B_SUPPORT
629
if (dm->support_ic_type == ODM_RTL8822B) {
630
if (dm->rfe_type == 0)
631
READ_AND_CONFIG_MP(8822b, _txpowertrack_type0);
632
else if (dm->rfe_type == 1)
633
READ_AND_CONFIG_MP(8822b, _txpowertrack_type1);
634
else if (dm->rfe_type == 2)
635
READ_AND_CONFIG_MP(8822b, _txpowertrack_type2);
636
else if ((dm->rfe_type == 3) || (dm->rfe_type == 5))
637
READ_AND_CONFIG_MP(8822b, _txpowertrack_type3_type5);
638
else if (dm->rfe_type == 4)
639
READ_AND_CONFIG_MP(8822b, _txpowertrack_type4);
640
else if (dm->rfe_type == 6)
641
READ_AND_CONFIG_MP(8822b, _txpowertrack_type6);
642
else if (dm->rfe_type == 7)
643
READ_AND_CONFIG_MP(8822b, _txpowertrack_type7);
644
else if (dm->rfe_type == 8)
645
READ_AND_CONFIG_MP(8822b, _txpowertrack_type8);
646
else if (dm->rfe_type == 9)
647
READ_AND_CONFIG_MP(8822b, _txpowertrack_type9);
648
else if (dm->rfe_type == 10)
649
READ_AND_CONFIG_MP(8822b, _txpowertrack_type10);
650
else if (dm->rfe_type == 11)
651
READ_AND_CONFIG_MP(8822b, _txpowertrack_type11);
652
else if (dm->rfe_type == 12)
653
READ_AND_CONFIG_MP(8822b, _txpowertrack_type12);
654
else if (dm->rfe_type == 13)
655
READ_AND_CONFIG_MP(8822b, _txpowertrack_type13);
656
else if (dm->rfe_type == 14)
657
READ_AND_CONFIG_MP(8822b, _txpowertrack_type14);
658
else if (dm->rfe_type == 15)
659
READ_AND_CONFIG_MP(8822b, _txpowertrack_type15);
660
else if (dm->rfe_type == 16)
661
READ_AND_CONFIG_MP(8822b, _txpowertrack_type16);
662
else if (dm->rfe_type == 17)
663
READ_AND_CONFIG_MP(8822b, _txpowertrack_type17);
664
else if (dm->rfe_type == 18)
665
READ_AND_CONFIG_MP(8822b, _txpowertrack_type18);
666
else
667
READ_AND_CONFIG_MP(8822b, _txpowertrack);
668
}
669
#endif
670
#if RTL8197F_SUPPORT
671
if (dm->support_ic_type == ODM_RTL8197F) {
672
if (dm->rfe_type == 0)
673
READ_AND_CONFIG_MP(8197f, _txpowertrack_type0);
674
else if (dm->rfe_type == 1)
675
READ_AND_CONFIG_MP(8197f, _txpowertrack_type1);
676
else
677
READ_AND_CONFIG_MP(8197f, _txpowertrack);
678
}
679
#endif
680
/*@jj add 20170822*/
681
#if RTL8192F_SUPPORT
682
if (dm->support_ic_type == ODM_RTL8192F) {
683
if (dm->rfe_type == 0)
684
READ_AND_CONFIG_MP(8192f, _txpowertrack_type0);
685
else if (dm->rfe_type == 1)
686
READ_AND_CONFIG_MP(8192f, _txpowertrack_type1);
687
else if (dm->rfe_type == 2)
688
READ_AND_CONFIG_MP(8192f, _txpowertrack_type2);
689
else if (dm->rfe_type == 3)
690
READ_AND_CONFIG_MP(8192f, _txpowertrack_type3);
691
else if (dm->rfe_type == 4)
692
READ_AND_CONFIG_MP(8192f, _txpowertrack_type4);
693
else if (dm->rfe_type == 5)
694
READ_AND_CONFIG_MP(8192f, _txpowertrack_type5);
695
else if (dm->rfe_type == 6)
696
READ_AND_CONFIG_MP(8192f, _txpowertrack_type6);
697
else if (dm->rfe_type == 7)
698
READ_AND_CONFIG_MP(8192f, _txpowertrack_type7);
699
else if (dm->rfe_type == 8)
700
READ_AND_CONFIG_MP(8192f, _txpowertrack_type8);
701
else if (dm->rfe_type == 9)
702
READ_AND_CONFIG_MP(8192f, _txpowertrack_type9);
703
else if (dm->rfe_type == 10)
704
READ_AND_CONFIG_MP(8192f, _txpowertrack_type10);
705
else if (dm->rfe_type == 11)
706
READ_AND_CONFIG_MP(8192f, _txpowertrack_type11);
707
else if (dm->rfe_type == 12)
708
READ_AND_CONFIG_MP(8192f, _txpowertrack_type12);
709
else if (dm->rfe_type == 13)
710
READ_AND_CONFIG_MP(8192f, _txpowertrack_type13);
711
else if (dm->rfe_type == 14)
712
READ_AND_CONFIG_MP(8192f, _txpowertrack_type14);
713
else if (dm->rfe_type == 15)
714
READ_AND_CONFIG_MP(8192f, _txpowertrack_type15);
715
else if (dm->rfe_type == 16)
716
READ_AND_CONFIG_MP(8192f, _txpowertrack_type16);
717
else if (dm->rfe_type == 17)
718
READ_AND_CONFIG_MP(8192f, _txpowertrack_type17);
719
else if (dm->rfe_type == 18)
720
READ_AND_CONFIG_MP(8192f, _txpowertrack_type18);
721
else if (dm->rfe_type == 19)
722
READ_AND_CONFIG_MP(8192f, _txpowertrack_type19);
723
else if (dm->rfe_type == 20)
724
READ_AND_CONFIG_MP(8192f, _txpowertrack_type20);
725
else if (dm->rfe_type == 21)
726
READ_AND_CONFIG_MP(8192f, _txpowertrack_type21);
727
else if (dm->rfe_type == 22)
728
READ_AND_CONFIG_MP(8192f, _txpowertrack_type22);
729
else if (dm->rfe_type == 23)
730
READ_AND_CONFIG_MP(8192f, _txpowertrack_type23);
731
else if (dm->rfe_type == 24)
732
READ_AND_CONFIG_MP(8192f, _txpowertrack_type24);
733
else if (dm->rfe_type == 25)
734
READ_AND_CONFIG_MP(8192f, _txpowertrack_type25);
735
else if (dm->rfe_type == 26)
736
READ_AND_CONFIG_MP(8192f, _txpowertrack_type26);
737
else if (dm->rfe_type == 27)
738
READ_AND_CONFIG_MP(8192f, _txpowertrack_type27);
739
else if (dm->rfe_type == 28)
740
READ_AND_CONFIG_MP(8192f, _txpowertrack_type28);
741
else if (dm->rfe_type == 29)
742
READ_AND_CONFIG_MP(8192f, _txpowertrack_type29);
743
else if (dm->rfe_type == 30)
744
READ_AND_CONFIG_MP(8192f, _txpowertrack_type30);
745
else if (dm->rfe_type == 31)
746
READ_AND_CONFIG_MP(8192f, _txpowertrack_type31);
747
else
748
READ_AND_CONFIG_MP(8192f, _txpowertrack);
749
750
READ_AND_CONFIG_MP(8192f, _txxtaltrack);
751
}
752
#endif
753
754
#if RTL8721D_SUPPORT
755
if (dm->support_ic_type == ODM_RTL8721D) {
756
#if 0
757
if (dm->package_type == 1)
758
READ_AND_CONFIG_MP(8721d, _txpowertrack_qfn48m_smic);
759
else if (dm->package_type == 5)
760
READ_AND_CONFIG_MP(8721d, _txpowertrack_qfn48m_umc);
761
#endif
762
READ_AND_CONFIG_MP(8721d, _txpowertrack);
763
READ_AND_CONFIG_MP(8721d, _txxtaltrack);
764
}
765
#endif
766
767
#if RTL8710C_SUPPORT
768
if (dm->support_ic_type == ODM_RTL8710C) {
769
#if 0
770
if (dm->package_type == 1)
771
READ_AND_CONFIG_MP(8710c, _txpowertrack_qfn48m_smic);
772
else if (dm->package_type == 5)
773
READ_AND_CONFIG_MP(8710c, _txpowertrack_qfn48m_umc);
774
#endif
775
READ_AND_CONFIG_MP(8710c, _txpowertrack);
776
READ_AND_CONFIG_MP(8710c, _txxtaltrack);
777
}
778
#endif
779
780
#if RTL8821C_SUPPORT
781
if (dm->support_ic_type == ODM_RTL8821C) {
782
if (dm->rfe_type == 0x5)
783
READ_AND_CONFIG(8821c, _txpowertrack_type0x28);
784
else if (dm->rfe_type == 0x4)
785
READ_AND_CONFIG(8821c, _txpowertrack_type0x20);
786
else
787
READ_AND_CONFIG(8821c, _txpowertrack);
788
}
789
#endif
790
791
#if RTL8198F_SUPPORT
792
if (dm->support_ic_type == ODM_RTL8198F) {
793
if (dm->rfe_type == 0)
794
READ_AND_CONFIG_MP(8198f, _txpowertrack_type0);
795
else if (dm->rfe_type == 1)
796
READ_AND_CONFIG_MP(8198f, _txpowertrack_type1);
797
else if (dm->rfe_type == 3)
798
READ_AND_CONFIG_MP(8198f, _txpowertrack_type3);
799
else
800
READ_AND_CONFIG_MP(8198f, _txpowertrack);
801
}
802
#endif
803
804
#if RTL8195B_SUPPORT
805
if (dm->support_ic_type == ODM_RTL8195B) {
806
READ_AND_CONFIG_MP(8195b, _txpowertrack);
807
READ_AND_CONFIG_MP(8195b, _txxtaltrack);
808
}
809
#endif
810
811
#if (RTL8822C_SUPPORT)
812
if (dm->support_ic_type == ODM_RTL8822C) {
813
if (dm->en_tssi_mode)
814
READ_AND_CONFIG_MP(8822c, _txpowertracktssi);
815
else
816
READ_AND_CONFIG_MP(8822c, _txpowertrack);
817
}
818
#endif
819
820
#if (RTL8812F_SUPPORT)
821
if (dm->support_ic_type == ODM_RTL8812F) {
822
if (dm->rfe_type == 0)
823
READ_AND_CONFIG_MP(8812f, _txpowertrack_type0);
824
else if (dm->rfe_type == 1)
825
READ_AND_CONFIG_MP(8812f, _txpowertrack_type1);
826
else if (dm->rfe_type == 2)
827
READ_AND_CONFIG_MP(8812f, _txpowertrack_type2);
828
else if (dm->rfe_type == 3)
829
READ_AND_CONFIG_MP(8812f, _txpowertrack_type3);
830
else
831
READ_AND_CONFIG_MP(8812f, _txpowertrack);
832
}
833
#endif
834
835
#if (RTL8197G_SUPPORT)
836
if (dm->support_ic_type == ODM_RTL8197G)
837
READ_AND_CONFIG_MP(8197g, _txpowertrack);
838
#endif
839
840
#if RTL8814B_SUPPORT
841
if (dm->support_ic_type == ODM_RTL8814B) {
842
if (dm->rfe_type == 0)
843
READ_AND_CONFIG_MP(8814b, _txpowertrack_type0);
844
else if (dm->rfe_type == 1)
845
READ_AND_CONFIG_MP(8814b, _txpowertrack_type1);
846
else if (dm->rfe_type == 2)
847
READ_AND_CONFIG_MP(8814b, _txpowertrack_type2);
848
#if 0
849
else if (dm->rfe_type == 3)
850
READ_AND_CONFIG_MP(8814b, _txpowertrack_type3);
851
else if (dm->rfe_type == 6)
852
READ_AND_CONFIG_MP(8814b, _txpowertrack_type6);
853
#endif
854
else
855
READ_AND_CONFIG_MP(8814b, _txpowertrack);
856
}
857
#endif
858
859
return HAL_STATUS_SUCCESS;
860
}
861
862
enum hal_status
863
odm_config_bb_with_header_file(struct dm_struct *dm,
864
enum odm_bb_config_type config_type)
865
{
866
#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)
867
void *adapter = dm->adapter;
868
PMGNT_INFO mgnt_info = &((PADAPTER)adapter)->MgntInfo;
869
#endif
870
enum hal_status result = HAL_STATUS_SUCCESS;
871
872
/* @1 AP doesn't use PHYDM initialization in these ICs */
873
#if (DM_ODM_SUPPORT_TYPE != ODM_AP)
874
#if (RTL8812A_SUPPORT == 1)
875
if (dm->support_ic_type == ODM_RTL8812) {
876
if (config_type == CONFIG_BB_PHY_REG)
877
READ_AND_CONFIG_MP(8812a, _phy_reg);
878
else if (config_type == CONFIG_BB_AGC_TAB)
879
READ_AND_CONFIG_MP(8812a, _agc_tab);
880
else if (config_type == CONFIG_BB_PHY_REG_PG) {
881
if (dm->rfe_type == 3 && dm->is_mp_chip)
882
READ_AND_CONFIG_MP(8812a, _phy_reg_pg_asus);
883
#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)
884
else if (mgnt_info->CustomerID == RT_CID_WNC_NEC && dm->is_mp_chip)
885
READ_AND_CONFIG_MP(8812a, _phy_reg_pg_nec);
886
#if RT_PLATFORM == PLATFORM_MACOSX
887
/*@{1827}{1024} for BUFFALO power by rate table. Isaiah 2013-11-29*/
888
else if (mgnt_info->CustomerID == RT_CID_DNI_BUFFALO)
889
READ_AND_CONFIG_MP(8812a, _phy_reg_pg_dni);
890
/* TP-Link T4UH, Isaiah 2015-03-16*/
891
else if (mgnt_info->CustomerID == RT_CID_TPLINK_HPWR) {
892
pr_debug("RT_CID_TPLINK_HPWR:: _PHY_REG_PG_TPLINK\n");
893
READ_AND_CONFIG_MP(8812a, _phy_reg_pg_tplink);
894
}
895
#endif
896
#endif
897
else
898
READ_AND_CONFIG_MP(8812a, _phy_reg_pg);
899
} else if (config_type == CONFIG_BB_PHY_REG_MP)
900
READ_AND_CONFIG_MP(8812a, _phy_reg_mp);
901
else if (config_type == CONFIG_BB_AGC_TAB_DIFF) {
902
dm->fw_offload_ability &= ~PHYDM_PHY_PARAM_OFFLOAD;
903
/*@AGC_TAB DIFF dont support FW offload*/
904
if ((*dm->channel >= 36) && (*dm->channel <= 64))
905
AGC_DIFF_CONFIG_MP(8812a, lb);
906
else if (*dm->channel >= 100)
907
AGC_DIFF_CONFIG_MP(8812a, hb);
908
}
909
}
910
#endif
911
#if (RTL8821A_SUPPORT == 1)
912
if (dm->support_ic_type == ODM_RTL8821) {
913
if (config_type == CONFIG_BB_PHY_REG)
914
READ_AND_CONFIG_MP(8821a, _phy_reg);
915
else if (config_type == CONFIG_BB_AGC_TAB)
916
READ_AND_CONFIG_MP(8821a, _agc_tab);
917
else if (config_type == CONFIG_BB_PHY_REG_PG) {
918
#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)
919
#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)
920
HAL_DATA_TYPE * hal_data = GET_HAL_DATA(((PADAPTER)adapter));
921
922
if ((hal_data->EEPROMSVID == 0x1043 && hal_data->EEPROMSMID == 0x207F))
923
READ_AND_CONFIG_MP(8821a, _phy_reg_pg_e202_sa);
924
else
925
#endif
926
#if (RT_PLATFORM == PLATFORM_MACOSX)
927
/*@ for BUFFALO pwr by rate table */
928
if (mgnt_info->CustomerID == RT_CID_DNI_BUFFALO) {
929
/*@ for BUFFALO pwr by rate table (JP/US)*/
930
if (mgnt_info->ChannelPlan == RT_CHANNEL_DOMAIN_US_2G_CANADA_5G)
931
READ_AND_CONFIG_MP(8821a, _phy_reg_pg_dni_us);
932
else
933
READ_AND_CONFIG_MP(8821a, _phy_reg_pg_dni_jp);
934
} else
935
#endif
936
#endif
937
READ_AND_CONFIG_MP(8821a, _phy_reg_pg);
938
}
939
}
940
#endif
941
#if (RTL8192E_SUPPORT == 1)
942
if (dm->support_ic_type == ODM_RTL8192E) {
943
if (config_type == CONFIG_BB_PHY_REG)
944
READ_AND_CONFIG_MP(8192e, _phy_reg);
945
else if (config_type == CONFIG_BB_AGC_TAB)
946
READ_AND_CONFIG_MP(8192e, _agc_tab);
947
else if (config_type == CONFIG_BB_PHY_REG_PG)
948
READ_AND_CONFIG_MP(8192e, _phy_reg_pg);
949
}
950
#endif
951
#if (RTL8723D_SUPPORT == 1)
952
if (dm->support_ic_type == ODM_RTL8723D) {
953
if (config_type == CONFIG_BB_PHY_REG)
954
READ_AND_CONFIG_MP(8723d, _phy_reg);
955
else if (config_type == CONFIG_BB_AGC_TAB)
956
READ_AND_CONFIG_MP(8723d, _agc_tab);
957
else if (config_type == CONFIG_BB_PHY_REG_PG)
958
READ_AND_CONFIG_MP(8723d, _phy_reg_pg);
959
}
960
#endif
961
/* @JJ ADD 20161014 */
962
#if (RTL8710B_SUPPORT == 1)
963
if (dm->support_ic_type == ODM_RTL8710B) {
964
if (config_type == CONFIG_BB_PHY_REG)
965
READ_AND_CONFIG_MP(8710b, _phy_reg);
966
else if (config_type == CONFIG_BB_AGC_TAB)
967
READ_AND_CONFIG_MP(8710b, _agc_tab);
968
else if (config_type == CONFIG_BB_PHY_REG_PG)
969
READ_AND_CONFIG_MP(8710b, _phy_reg_pg);
970
}
971
#endif
972
973
#endif /* @(DM_ODM_SUPPORT_TYPE != ODM_AP) */
974
/* @1 All platforms support */
975
#if (RTL8188E_SUPPORT == 1)
976
if (dm->support_ic_type == ODM_RTL8188E) {
977
if (config_type == CONFIG_BB_PHY_REG)
978
READ_AND_CONFIG_MP(8188e, _phy_reg);
979
else if (config_type == CONFIG_BB_AGC_TAB)
980
READ_AND_CONFIG_MP(8188e, _agc_tab);
981
else if (config_type == CONFIG_BB_PHY_REG_PG)
982
READ_AND_CONFIG_MP(8188e, _phy_reg_pg);
983
}
984
#endif
985
#if (RTL8723B_SUPPORT == 1)
986
if (dm->support_ic_type == ODM_RTL8723B) {
987
if (config_type == CONFIG_BB_PHY_REG)
988
READ_AND_CONFIG_MP(8723b, _phy_reg);
989
else if (config_type == CONFIG_BB_AGC_TAB)
990
READ_AND_CONFIG_MP(8723b, _agc_tab);
991
else if (config_type == CONFIG_BB_PHY_REG_PG)
992
READ_AND_CONFIG_MP(8723b, _phy_reg_pg);
993
}
994
#endif
995
#if (RTL8814A_SUPPORT == 1)
996
if (dm->support_ic_type == ODM_RTL8814A) {
997
if (config_type == CONFIG_BB_PHY_REG)
998
READ_AND_CONFIG_MP(8814a, _phy_reg);
999
else if (config_type == CONFIG_BB_AGC_TAB)
1000
READ_AND_CONFIG_MP(8814a, _agc_tab);
1001
else if (config_type == CONFIG_BB_PHY_REG_PG) {
1002
if (dm->rfe_type == 0)
1003
READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type0);
1004
else if (dm->rfe_type == 2)
1005
READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type2);
1006
else if (dm->rfe_type == 3)
1007
READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type3);
1008
else if (dm->rfe_type == 4)
1009
READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type4);
1010
else if (dm->rfe_type == 5)
1011
READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type5);
1012
else if (dm->rfe_type == 7)
1013
READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type7);
1014
else if (dm->rfe_type == 8)
1015
READ_AND_CONFIG_MP(8814a, _phy_reg_pg_type8);
1016
else
1017
READ_AND_CONFIG_MP(8814a, _phy_reg_pg);
1018
} else if (config_type == CONFIG_BB_PHY_REG_MP)
1019
READ_AND_CONFIG_MP(8814a, _phy_reg_mp);
1020
}
1021
#endif
1022
#if (RTL8703B_SUPPORT == 1)
1023
if (dm->support_ic_type == ODM_RTL8703B) {
1024
if (config_type == CONFIG_BB_PHY_REG)
1025
READ_AND_CONFIG_MP(8703b, _phy_reg);
1026
else if (config_type == CONFIG_BB_AGC_TAB)
1027
READ_AND_CONFIG_MP(8703b, _agc_tab);
1028
else if (config_type == CONFIG_BB_PHY_REG_PG)
1029
READ_AND_CONFIG_MP(8703b, _phy_reg_pg);
1030
}
1031
#endif
1032
#if (RTL8188F_SUPPORT == 1)
1033
if (dm->support_ic_type == ODM_RTL8188F) {
1034
if (config_type == CONFIG_BB_PHY_REG)
1035
READ_AND_CONFIG_MP(8188f, _phy_reg);
1036
else if (config_type == CONFIG_BB_AGC_TAB)
1037
READ_AND_CONFIG_MP(8188f, _agc_tab);
1038
else if (config_type == CONFIG_BB_PHY_REG_PG)
1039
READ_AND_CONFIG_MP(8188f, _phy_reg_pg);
1040
}
1041
#endif
1042
#if (RTL8822B_SUPPORT == 1)
1043
if (dm->support_ic_type == ODM_RTL8822B) {
1044
if (config_type == CONFIG_BB_PHY_REG) {
1045
READ_AND_CONFIG_MP(8822b, _phy_reg);
1046
} else if (config_type == CONFIG_BB_AGC_TAB) {
1047
READ_AND_CONFIG_MP(8822b, _agc_tab);
1048
} else if (config_type == CONFIG_BB_PHY_REG_PG) {
1049
if (dm->rfe_type == 2)
1050
READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type2);
1051
else if (dm->rfe_type == 3)
1052
READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type3);
1053
else if (dm->rfe_type == 4)
1054
READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type4);
1055
else if (dm->rfe_type == 5)
1056
READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type5);
1057
else if (dm->rfe_type == 12)
1058
READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type12);
1059
else if (dm->rfe_type == 15)
1060
READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type15);
1061
else if (dm->rfe_type == 16)
1062
READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type16);
1063
else if (dm->rfe_type == 17)
1064
READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type17);
1065
else if (dm->rfe_type == 18)
1066
READ_AND_CONFIG_MP(8822b, _phy_reg_pg_type18);
1067
else
1068
READ_AND_CONFIG_MP(8822b, _phy_reg_pg);
1069
}
1070
}
1071
#endif
1072
1073
#if (RTL8197F_SUPPORT == 1)
1074
if (dm->support_ic_type == ODM_RTL8197F) {
1075
if (config_type == CONFIG_BB_PHY_REG) {
1076
READ_AND_CONFIG_MP(8197f, _phy_reg);
1077
if (dm->cut_version == ODM_CUT_A)
1078
phydm_phypara_a_cut(dm);
1079
} else if (config_type == CONFIG_BB_AGC_TAB)
1080
READ_AND_CONFIG_MP(8197f, _agc_tab);
1081
}
1082
#endif
1083
/*@jj add 20170822*/
1084
#if (RTL8192F_SUPPORT == 1)
1085
if (dm->support_ic_type == ODM_RTL8192F) {
1086
if (config_type == CONFIG_BB_PHY_REG) {
1087
READ_AND_CONFIG_MP(8192f, _phy_reg);
1088
} else if (config_type == CONFIG_BB_AGC_TAB) {
1089
READ_AND_CONFIG_MP(8192f, _agc_tab);
1090
} else if (config_type == CONFIG_BB_PHY_REG_PG) {
1091
if (dm->rfe_type == 0)
1092
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type0);
1093
else if (dm->rfe_type == 1)
1094
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type1);
1095
else if (dm->rfe_type == 2)
1096
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type2);
1097
else if (dm->rfe_type == 3)
1098
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type3);
1099
else if (dm->rfe_type == 4)
1100
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type4);
1101
else if (dm->rfe_type == 5)
1102
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type5);
1103
else if (dm->rfe_type == 6)
1104
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type6);
1105
else if (dm->rfe_type == 7)
1106
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type7);
1107
else if (dm->rfe_type == 8)
1108
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type8);
1109
else if (dm->rfe_type == 9)
1110
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type9);
1111
else if (dm->rfe_type == 10)
1112
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type10);
1113
else if (dm->rfe_type == 11)
1114
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type11);
1115
else if (dm->rfe_type == 12)
1116
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type12);
1117
else if (dm->rfe_type == 13)
1118
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type13);
1119
else if (dm->rfe_type == 14)
1120
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type14);
1121
else if (dm->rfe_type == 15)
1122
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type15);
1123
else if (dm->rfe_type == 16)
1124
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type16);
1125
else if (dm->rfe_type == 17)
1126
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type17);
1127
else if (dm->rfe_type == 18)
1128
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type18);
1129
else if (dm->rfe_type == 19)
1130
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type19);
1131
else if (dm->rfe_type == 20)
1132
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type20);
1133
else if (dm->rfe_type == 21)
1134
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type21);
1135
else if (dm->rfe_type == 22)
1136
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type22);
1137
else if (dm->rfe_type == 23)
1138
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type23);
1139
else if (dm->rfe_type == 24)
1140
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type24);
1141
else if (dm->rfe_type == 25)
1142
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type25);
1143
else if (dm->rfe_type == 26)
1144
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type26);
1145
else if (dm->rfe_type == 27)
1146
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type27);
1147
else if (dm->rfe_type == 28)
1148
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type28);
1149
else if (dm->rfe_type == 29)
1150
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type29);
1151
else if (dm->rfe_type == 30)
1152
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type30);
1153
else if (dm->rfe_type == 31)
1154
READ_AND_CONFIG_MP(8192f, _phy_reg_pg_type31);
1155
else
1156
READ_AND_CONFIG_MP(8192f, _phy_reg_pg);
1157
}
1158
}
1159
#endif
1160
#if (RTL8721D_SUPPORT == 1)
1161
if (dm->support_ic_type == ODM_RTL8721D) {
1162
if (config_type == CONFIG_BB_PHY_REG)
1163
READ_AND_CONFIG_MP(8721d, _phy_reg);
1164
else if (config_type == CONFIG_BB_AGC_TAB)
1165
READ_AND_CONFIG_MP(8721d, _agc_tab);
1166
else if (config_type == CONFIG_BB_PHY_REG_PG) {
1167
if (dm->power_voltage == ODM_POWER_18V)
1168
READ_AND_CONFIG_MP(8721d, _phy_reg_pg_type0);
1169
else
1170
READ_AND_CONFIG_MP(8721d, _phy_reg_pg_type1);
1171
}
1172
}
1173
#endif
1174
1175
#if (RTL8710C_SUPPORT == 1)
1176
if (dm->support_ic_type == ODM_RTL8710C) {
1177
if (config_type == CONFIG_BB_PHY_REG)
1178
READ_AND_CONFIG_MP(8710c, _phy_reg);
1179
else if (config_type == CONFIG_BB_AGC_TAB)
1180
READ_AND_CONFIG_MP(8710c, _agc_tab);
1181
else if (config_type == CONFIG_BB_PHY_REG_PG)
1182
READ_AND_CONFIG_MP(8710c, _phy_reg_pg);
1183
}
1184
#endif
1185
1186
#if (RTL8821C_SUPPORT == 1)
1187
if (dm->support_ic_type == ODM_RTL8821C) {
1188
if (config_type == CONFIG_BB_PHY_REG) {
1189
READ_AND_CONFIG(8821c, _phy_reg);
1190
} else if (config_type == CONFIG_BB_AGC_TAB) {
1191
READ_AND_CONFIG(8821c, _agc_tab);
1192
/* @According to RFEtype, choosing correct AGC table*/
1193
if (dm->default_rf_set_8821c == SWITCH_TO_BTG)
1194
AGC_DIFF_CONFIG_MP(8821c, btg);
1195
} else if (config_type == CONFIG_BB_PHY_REG_PG) {
1196
if (dm->rfe_type == 0x5)
1197
READ_AND_CONFIG(8821c, _phy_reg_pg_type0x28);
1198
else
1199
READ_AND_CONFIG(8821c, _phy_reg_pg);
1200
} else if (config_type == CONFIG_BB_AGC_TAB_DIFF) {
1201
dm->fw_offload_ability &= ~PHYDM_PHY_PARAM_OFFLOAD;
1202
/*@AGC_TAB DIFF dont support FW offload*/
1203
if (dm->current_rf_set_8821c == SWITCH_TO_BTG)
1204
AGC_DIFF_CONFIG_MP(8821c, btg);
1205
else if (dm->current_rf_set_8821c == SWITCH_TO_WLG)
1206
AGC_DIFF_CONFIG_MP(8821c, wlg);
1207
} else if (config_type == CONFIG_BB_PHY_REG_MP) {
1208
READ_AND_CONFIG(8821c, _phy_reg_mp);
1209
}
1210
}
1211
#endif
1212
1213
#if (RTL8195A_SUPPORT == 1)
1214
if (dm->support_ic_type == ODM_RTL8195A) {
1215
if (config_type == CONFIG_BB_PHY_REG)
1216
READ_AND_CONFIG(8195a, _phy_reg);
1217
else if (config_type == CONFIG_BB_AGC_TAB)
1218
READ_AND_CONFIG(8195a, _agc_tab);
1219
else if (config_type == CONFIG_BB_PHY_REG_PG)
1220
READ_AND_CONFIG(8195a, _phy_reg_pg);
1221
}
1222
#endif
1223
#if (RTL8195B_SUPPORT == 1)
1224
if (dm->support_ic_type == ODM_RTL8195B) {
1225
if (config_type == CONFIG_BB_PHY_REG)
1226
READ_AND_CONFIG(8195b, _phy_reg);
1227
else if (config_type == CONFIG_BB_AGC_TAB)
1228
READ_AND_CONFIG(8195b, _agc_tab);
1229
else if (config_type == CONFIG_BB_PHY_REG_PG)
1230
READ_AND_CONFIG(8195b, _phy_reg_pg);
1231
}
1232
#endif
1233
#if (RTL8198F_SUPPORT == 1)
1234
if (dm->support_ic_type == ODM_RTL8198F) {
1235
if (config_type == CONFIG_BB_PHY_REG)
1236
READ_AND_CONFIG_MP(8198f, _phy_reg);
1237
else if (config_type == CONFIG_BB_AGC_TAB)
1238
READ_AND_CONFIG_MP(8198f, _agc_tab);
1239
}
1240
#endif
1241
#if (RTL8814B_SUPPORT == 1)
1242
if (dm->support_ic_type == ODM_RTL8814B) {
1243
if (config_type == CONFIG_BB_PHY_REG)
1244
READ_AND_CONFIG_MP(8814b, _phy_reg);
1245
else if (config_type == CONFIG_BB_AGC_TAB)
1246
READ_AND_CONFIG_MP(8814b, _agc_tab);
1247
else if (config_type == CONFIG_BB_PHY_REG_PG) {
1248
if (dm->rfe_type == 1)
1249
READ_AND_CONFIG(8814b, _phy_reg_pg_type1);
1250
else
1251
READ_AND_CONFIG(8814b, _phy_reg_pg);
1252
}
1253
}
1254
#endif
1255
#if (RTL8822C_SUPPORT)
1256
if (dm->support_ic_type == ODM_RTL8822C) {
1257
if (config_type == CONFIG_BB_PHY_REG)
1258
READ_AND_CONFIG_MP(8822c, _phy_reg);
1259
else if (config_type == CONFIG_BB_AGC_TAB)
1260
READ_AND_CONFIG_MP(8822c, _agc_tab);
1261
else if (config_type == CONFIG_BB_PHY_REG_PG)
1262
READ_AND_CONFIG(8822c, _phy_reg_pg);
1263
}
1264
#endif
1265
#if (RTL8812F_SUPPORT)
1266
if (dm->support_ic_type == ODM_RTL8812F) {
1267
if (config_type == CONFIG_BB_PHY_REG)
1268
READ_AND_CONFIG_MP(8812f, _phy_reg);
1269
else if (config_type == CONFIG_BB_AGC_TAB)
1270
READ_AND_CONFIG_MP(8812f, _agc_tab);
1271
else if (config_type == CONFIG_BB_PHY_REG_PG)
1272
READ_AND_CONFIG(8812f, _phy_reg_pg);
1273
}
1274
#endif
1275
#if (RTL8197G_SUPPORT)
1276
if (dm->support_ic_type == ODM_RTL8197G) {
1277
if (config_type == CONFIG_BB_PHY_REG)
1278
READ_AND_CONFIG_MP(8197g, _phy_reg);
1279
else if (config_type == CONFIG_BB_AGC_TAB)
1280
READ_AND_CONFIG_MP(8197g, _agc_tab);
1281
else if (config_type == CONFIG_BB_PHY_REG_PG)
1282
READ_AND_CONFIG(8197g, _phy_reg_pg);
1283
}
1284
#endif
1285
1286
if (config_type == CONFIG_BB_PHY_REG ||
1287
config_type == CONFIG_BB_AGC_TAB)
1288
if (dm->fw_offload_ability & PHYDM_PHY_PARAM_OFFLOAD) {
1289
result = phydm_set_reg_by_fw(dm,
1290
PHYDM_HALMAC_CMD_END,
1291
0,
1292
0,
1293
0,
1294
(enum rf_path)0,
1295
0);
1296
PHYDM_DBG(dm, ODM_COMP_INIT,
1297
"phy param offload end!result = %d", result);
1298
}
1299
1300
return result;
1301
}
1302
1303
enum hal_status
1304
odm_config_mac_with_header_file(struct dm_struct *dm)
1305
{
1306
enum hal_status result = HAL_STATUS_SUCCESS;
1307
1308
PHYDM_DBG(dm, ODM_COMP_INIT, "===>%s (%s)\n", __func__,
1309
(dm->is_mp_chip) ? "MPChip" : "TestChip");
1310
PHYDM_DBG(dm, ODM_COMP_INIT,
1311
"support_platform: 0x%X, support_interface: 0x%X, board_type: 0x%X\n",
1312
dm->support_platform, dm->support_interface, dm->board_type);
1313
1314
#if (RTL8822C_SUPPORT || RTL8812F_SUPPORT || RTL8814B_SUPPORT)
1315
if (dm->support_ic_type &
1316
(ODM_RTL8822C | ODM_RTL8812F | ODM_RTL8814B)) {
1317
PHYDM_DBG(dm, ODM_COMP_INIT, "MAC para-package in HALMAC\n");
1318
return result;
1319
}
1320
#endif
1321
1322
/* @1 AP doesn't use PHYDM initialization in these ICs */
1323
#if (DM_ODM_SUPPORT_TYPE != ODM_AP)
1324
#if (RTL8812A_SUPPORT == 1)
1325
if (dm->support_ic_type == ODM_RTL8812)
1326
READ_AND_CONFIG_MP(8812a, _mac_reg);
1327
#endif
1328
#if (RTL8821A_SUPPORT == 1)
1329
if (dm->support_ic_type == ODM_RTL8821)
1330
READ_AND_CONFIG_MP(8821a, _mac_reg);
1331
#endif
1332
#if (RTL8192E_SUPPORT == 1)
1333
if (dm->support_ic_type == ODM_RTL8192E)
1334
READ_AND_CONFIG_MP(8192e, _mac_reg);
1335
#endif
1336
#if (RTL8723D_SUPPORT == 1)
1337
if (dm->support_ic_type == ODM_RTL8723D)
1338
READ_AND_CONFIG_MP(8723d, _mac_reg);
1339
#endif
1340
#if (RTL8710B_SUPPORT == 1)
1341
if (dm->support_ic_type == ODM_RTL8710B)
1342
READ_AND_CONFIG_MP(8710b, _mac_reg);
1343
#endif
1344
#endif /* @(DM_ODM_SUPPORT_TYPE != ODM_AP) */
1345
1346
/* @1 All platforms support */
1347
#if (RTL8188E_SUPPORT == 1)
1348
if (dm->support_ic_type == ODM_RTL8188E)
1349
READ_AND_CONFIG_MP(8188e, _mac_reg);
1350
#endif
1351
#if (RTL8723B_SUPPORT == 1)
1352
if (dm->support_ic_type == ODM_RTL8723B)
1353
READ_AND_CONFIG_MP(8723b, _mac_reg);
1354
#endif
1355
#if (RTL8814A_SUPPORT == 1)
1356
if (dm->support_ic_type == ODM_RTL8814A)
1357
READ_AND_CONFIG_MP(8814a, _mac_reg);
1358
#endif
1359
#if (RTL8703B_SUPPORT == 1)
1360
if (dm->support_ic_type == ODM_RTL8703B)
1361
READ_AND_CONFIG_MP(8703b, _mac_reg);
1362
#endif
1363
#if (RTL8188F_SUPPORT == 1)
1364
if (dm->support_ic_type == ODM_RTL8188F)
1365
READ_AND_CONFIG_MP(8188f, _mac_reg);
1366
#endif
1367
#if (RTL8822B_SUPPORT == 1)
1368
if (dm->support_ic_type == ODM_RTL8822B)
1369
READ_AND_CONFIG_MP(8822b, _mac_reg);
1370
#endif
1371
#if (RTL8197F_SUPPORT == 1)
1372
if (dm->support_ic_type == ODM_RTL8197F)
1373
READ_AND_CONFIG_MP(8197f, _mac_reg);
1374
#endif
1375
#if (RTL8192F_SUPPORT == 1)
1376
if (dm->support_ic_type == ODM_RTL8192F)
1377
READ_AND_CONFIG_MP(8192f, _mac_reg);
1378
#endif
1379
#if (RTL8721D_SUPPORT == 1)
1380
if (dm->support_ic_type == ODM_RTL8721D)
1381
READ_AND_CONFIG_MP(8721d, _mac_reg);
1382
#endif
1383
1384
#if (RTL8710C_SUPPORT == 1)
1385
if (dm->support_ic_type == ODM_RTL8710C)
1386
READ_AND_CONFIG_MP(8710c, _mac_reg);
1387
#endif
1388
1389
#if (RTL8821C_SUPPORT == 1)
1390
if (dm->support_ic_type == ODM_RTL8821C)
1391
READ_AND_CONFIG(8821c, _mac_reg);
1392
#endif
1393
#if (RTL8195A_SUPPORT == 1)
1394
if (dm->support_ic_type == ODM_RTL8195A)
1395
READ_AND_CONFIG_MP(8195a, _mac_reg);
1396
#endif
1397
#if (RTL8195B_SUPPORT == 1)
1398
if (dm->support_ic_type == ODM_RTL8195B)
1399
READ_AND_CONFIG_MP(8195b, _mac_reg);
1400
#endif
1401
#if (RTL8198F_SUPPORT == 1)
1402
if (dm->support_ic_type == ODM_RTL8198F)
1403
READ_AND_CONFIG_MP(8198f, _mac_reg);
1404
#endif
1405
#if (RTL8197G_SUPPORT == 1)
1406
if (dm->support_ic_type == ODM_RTL8197G)
1407
READ_AND_CONFIG_MP(8197g, _mac_reg);
1408
#endif
1409
1410
if (dm->fw_offload_ability & PHYDM_PHY_PARAM_OFFLOAD) {
1411
result = phydm_set_reg_by_fw(dm,
1412
PHYDM_HALMAC_CMD_END,
1413
0,
1414
0,
1415
0,
1416
(enum rf_path)0,
1417
0);
1418
PHYDM_DBG(dm, ODM_COMP_INIT,
1419
"mac param offload end!result = %d", result);
1420
}
1421
1422
return result;
1423
}
1424
1425
u32 odm_get_hw_img_version(struct dm_struct *dm)
1426
{
1427
u32 version = 0;
1428
1429
switch (dm->support_ic_type) {
1430
/* @1 AP doesn't use PHYDM initialization in these ICs */
1431
#if (DM_ODM_SUPPORT_TYPE != ODM_AP)
1432
#if (RTL8821A_SUPPORT)
1433
case ODM_RTL8821:
1434
version = odm_get_version_mp_8821a_phy_reg();
1435
break;
1436
#endif
1437
#if (RTL8192E_SUPPORT)
1438
case ODM_RTL8192E:
1439
version = odm_get_version_mp_8192e_phy_reg();
1440
break;
1441
#endif
1442
#if (RTL8812A_SUPPORT)
1443
case ODM_RTL8812:
1444
version = odm_get_version_mp_8812a_phy_reg();
1445
break;
1446
#endif
1447
#endif /* @(DM_ODM_SUPPORT_TYPE != ODM_AP) */
1448
#if (RTL8723D_SUPPORT)
1449
case ODM_RTL8723D:
1450
version = odm_get_version_mp_8723d_phy_reg();
1451
break;
1452
#endif
1453
#if (RTL8710B_SUPPORT)
1454
case ODM_RTL8710B:
1455
version = odm_get_version_mp_8710b_phy_reg();
1456
break;
1457
#endif
1458
#if (RTL8188E_SUPPORT)
1459
case ODM_RTL8188E:
1460
version = odm_get_version_mp_8188e_phy_reg();
1461
break;
1462
#endif
1463
#if (RTL8723B_SUPPORT)
1464
case ODM_RTL8723B:
1465
version = odm_get_version_mp_8723b_phy_reg();
1466
break;
1467
#endif
1468
#if (RTL8814A_SUPPORT)
1469
case ODM_RTL8814A:
1470
version = odm_get_version_mp_8814a_phy_reg();
1471
break;
1472
#endif
1473
#if (RTL8703B_SUPPORT)
1474
case ODM_RTL8703B:
1475
version = odm_get_version_mp_8703b_phy_reg();
1476
break;
1477
#endif
1478
#if (RTL8188F_SUPPORT)
1479
case ODM_RTL8188F:
1480
version = odm_get_version_mp_8188f_phy_reg();
1481
break;
1482
#endif
1483
#if (RTL8822B_SUPPORT)
1484
case ODM_RTL8822B:
1485
version = odm_get_version_mp_8822b_phy_reg();
1486
break;
1487
#endif
1488
#if (RTL8197F_SUPPORT)
1489
case ODM_RTL8197F:
1490
version = odm_get_version_mp_8197f_phy_reg();
1491
break;
1492
#endif
1493
1494
#if (RTL8192F_SUPPORT)
1495
case ODM_RTL8192F:
1496
version = odm_get_version_mp_8192f_phy_reg();
1497
break;
1498
#endif
1499
#if (RTL8721D_SUPPORT)
1500
case ODM_RTL8721D:
1501
version = odm_get_version_mp_8721d_phy_reg();
1502
break;
1503
#endif
1504
#if (RTL8710C_SUPPORT)
1505
case ODM_RTL8710C:
1506
version = GET_VERSION_MP(8710c, _mac_reg);
1507
#endif
1508
#if (RTL8821C_SUPPORT)
1509
case ODM_RTL8821C:
1510
version = odm_get_version_mp_8821c_phy_reg();
1511
break;
1512
#endif
1513
#if (RTL8195B_SUPPORT)
1514
case ODM_RTL8195B:
1515
version = odm_get_version_mp_8195b_phy_reg();
1516
break;
1517
#endif
1518
#if (RTL8198F_SUPPORT)
1519
case ODM_RTL8198F:
1520
version = odm_get_version_mp_8198f_phy_reg();
1521
break;
1522
#endif
1523
#if (RTL8822C_SUPPORT)
1524
case ODM_RTL8822C:
1525
version = odm_get_version_mp_8822c_phy_reg();
1526
break;
1527
#endif
1528
#if (RTL8812F_SUPPORT)
1529
case ODM_RTL8812F:
1530
version = odm_get_version_mp_8812f_phy_reg();
1531
break;
1532
#endif
1533
#if (RTL8197G_SUPPORT)
1534
case ODM_RTL8197G:
1535
version = odm_get_version_mp_8197g_phy_reg();
1536
break;
1537
#endif
1538
#if (RTL8814B_SUPPORT)
1539
case ODM_RTL8814B:
1540
version = odm_get_version_mp_8814b_phy_reg();
1541
break;
1542
#endif
1543
}
1544
1545
return version;
1546
}
1547
1548
u32 query_phydm_trx_capability(struct dm_struct *dm)
1549
{
1550
u32 value32 = 0xFFFFFFFF;
1551
1552
#if (RTL8821C_SUPPORT == 1)
1553
if (dm->support_ic_type == ODM_RTL8821C)
1554
value32 = query_phydm_trx_capability_8821c(dm);
1555
#endif
1556
#if (RTL8195B_SUPPORT == 1)
1557
if (dm->support_ic_type == ODM_RTL8195B)
1558
value32 = query_phydm_trx_capability_8195b(dm);
1559
#endif
1560
return value32;
1561
}
1562
1563
u32 query_phydm_stbc_capability(struct dm_struct *dm)
1564
{
1565
u32 value32 = 0xFFFFFFFF;
1566
1567
#if (RTL8821C_SUPPORT == 1)
1568
if (dm->support_ic_type == ODM_RTL8821C)
1569
value32 = query_phydm_stbc_capability_8821c(dm);
1570
#endif
1571
#if (RTL8195B_SUPPORT == 1)
1572
if (dm->support_ic_type == ODM_RTL8195B)
1573
value32 = query_phydm_stbc_capability_8195b(dm);
1574
#endif
1575
1576
return value32;
1577
}
1578
1579
u32 query_phydm_ldpc_capability(struct dm_struct *dm)
1580
{
1581
u32 value32 = 0xFFFFFFFF;
1582
1583
#if (RTL8821C_SUPPORT == 1)
1584
if (dm->support_ic_type == ODM_RTL8821C)
1585
value32 = query_phydm_ldpc_capability_8821c(dm);
1586
#endif
1587
#if (RTL8195B_SUPPORT == 1)
1588
if (dm->support_ic_type == ODM_RTL8195B)
1589
value32 = query_phydm_ldpc_capability_8195b(dm);
1590
#endif
1591
return value32;
1592
}
1593
1594
u32 query_phydm_txbf_parameters(struct dm_struct *dm)
1595
{
1596
u32 value32 = 0xFFFFFFFF;
1597
1598
#if (RTL8821C_SUPPORT == 1)
1599
if (dm->support_ic_type == ODM_RTL8821C)
1600
value32 = query_phydm_txbf_parameters_8821c(dm);
1601
#endif
1602
#if (RTL8195B_SUPPORT == 1)
1603
if (dm->support_ic_type == ODM_RTL8195B)
1604
value32 = query_phydm_txbf_parameters_8195b(dm);
1605
#endif
1606
return value32;
1607
}
1608
1609
u32 query_phydm_txbf_capability(struct dm_struct *dm)
1610
{
1611
u32 value32 = 0xFFFFFFFF;
1612
1613
#if (RTL8821C_SUPPORT == 1)
1614
if (dm->support_ic_type == ODM_RTL8821C)
1615
value32 = query_phydm_txbf_capability_8821c(dm);
1616
#endif
1617
#if (RTL8195B_SUPPORT == 1)
1618
if (dm->support_ic_type == ODM_RTL8195B)
1619
value32 = query_phydm_txbf_capability_8195b(dm);
1620
#endif
1621
return value32;
1622
}
1623
1624