Lines Matching +full:0 +full:- +full:9 +full:a +full:- +full:d
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2009-2010 Realtek Corporation.*/
17 0x081, /* 0, -12.0dB */
18 0x088, /* 1, -11.5dB */
19 0x090, /* 2, -11.0dB */
20 0x099, /* 3, -10.5dB */
21 0x0A2, /* 4, -10.0dB */
22 0x0AC, /* 5, -9.5dB */
23 0x0B6, /* 6, -9.0dB */
24 0x0C0, /* 7, -8.5dB */
25 0x0CC, /* 8, -8.0dB */
26 0x0D8, /* 9, -7.5dB */
27 0x0E5, /* 10, -7.0dB */
28 0x0F2, /* 11, -6.5dB */
29 0x101, /* 12, -6.0dB */
30 0x110, /* 13, -5.5dB */
31 0x120, /* 14, -5.0dB */
32 0x131, /* 15, -4.5dB */
33 0x143, /* 16, -4.0dB */
34 0x156, /* 17, -3.5dB */
35 0x16A, /* 18, -3.0dB */
36 0x180, /* 19, -2.5dB */
37 0x197, /* 20, -2.0dB */
38 0x1AF, /* 21, -1.5dB */
39 0x1C8, /* 22, -1.0dB */
40 0x1E3, /* 23, -0.5dB */
41 0x200, /* 24, +0 dB */
42 0x21E, /* 25, +0.5dB */
43 0x23E, /* 26, +1.0dB */
44 0x261, /* 27, +1.5dB */
45 0x285, /* 28, +2.0dB */
46 0x2AB, /* 29, +2.5dB */
47 0x2D3, /* 30, +3.0dB */
48 0x2FE, /* 31, +3.5dB */
49 0x32B, /* 32, +4.0dB */
50 0x35C, /* 33, +4.5dB */
51 0x38E, /* 34, +5.0dB */
52 0x3C4, /* 35, +5.5dB */
53 0x3FE /* 36, +6.0dB */
57 0x081, /* 0, -12.0dB */
58 0x088, /* 1, -11.5dB */
59 0x090, /* 2, -11.0dB */
60 0x099, /* 3, -10.5dB */
61 0x0A2, /* 4, -10.0dB */
62 0x0AC, /* 5, -9.5dB */
63 0x0B6, /* 6, -9.0dB */
64 0x0C0, /* 7, -8.5dB */
65 0x0CC, /* 8, -8.0dB */
66 0x0D8, /* 9, -7.5dB */
67 0x0E5, /* 10, -7.0dB */
68 0x0F2, /* 11, -6.5dB */
69 0x101, /* 12, -6.0dB */
70 0x110, /* 13, -5.5dB */
71 0x120, /* 14, -5.0dB */
72 0x131, /* 15, -4.5dB */
73 0x143, /* 16, -4.0dB */
74 0x156, /* 17, -3.5dB */
75 0x16A, /* 18, -3.0dB */
76 0x180, /* 19, -2.5dB */
77 0x197, /* 20, -2.0dB */
78 0x1AF, /* 21, -1.5dB */
79 0x1C8, /* 22, -1.0dB */
80 0x1E3, /* 23, -0.5dB */
81 0x200, /* 24, +0 dB */
82 0x21E, /* 25, +0.5dB */
83 0x23E, /* 26, +1.0dB */
84 0x261, /* 27, +1.5dB */
85 0x285, /* 28, +2.0dB */
86 0x2AB, /* 29, +2.5dB */
87 0x2D3, /* 30, +3.0dB */
88 0x2FE, /* 31, +3.5dB */
89 0x32B, /* 32, +4.0dB */
90 0x35C, /* 33, +4.5dB */
91 0x38E, /* 34, +5.0dB */
92 0x3C4, /* 35, +5.5dB */
93 0x3FE /* 36, +6.0dB */
97 0xa44f, /* 0 UNKNOWN */
98 0x5ea44f, /* 1 REALTEK_90 */
99 0x5e4322, /* 2 REALTEK_92SE */
100 0x5ea42b, /* 3 BROAD */
101 0xa44f, /* 4 RAL */
102 0xa630, /* 5 ATH */
103 0x5ea630, /* 6 CISCO */
104 0x5ea42b, /* 7 MARVELL */
108 0x5e4322, /* 0 UNKNOWN */
109 0xa44f, /* 1 REALTEK_90 */
110 0x5ea44f, /* 2 REALTEK_92SE */
111 0x5ea32b, /* 3 BROAD */
112 0x5ea422, /* 4 RAL */
113 0x5ea322, /* 5 ATH */
114 0x3ea430, /* 6 CISCO */
115 0x5ea44f, /* 7 MARV */
119 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4,
120 4, 4, 4, 5, 5, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9};
123 0, 0, 0, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6,
124 7, 7, 7, 7, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 11};
127 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6,
128 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11};
131 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6,
132 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9};
135 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6,
136 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11};
139 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6,
140 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9};
143 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6,
144 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11};
147 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6,
148 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9};
151 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6,
152 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11};
155 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6,
156 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9};
159 {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7,
160 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13},
161 {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7,
162 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13},
163 {0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 9, 10, 11,
168 {0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8,
169 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11},
170 {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8,
171 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11},
172 {0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9,
173 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11},
177 {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8,
178 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13},
179 {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 9,
180 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13},
181 {0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11,
186 {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 7, 7, 8,
187 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11},
188 {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8,
189 9, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11},
190 {0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 9, 9,
195 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6,
196 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10};
199 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8,
200 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12};
203 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6,
204 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10};
207 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8,
208 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12};
211 {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11,
213 {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11,
215 {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11,
220 {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11,
222 {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11,
224 {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11,
234 u8 pwr_val = 0; in rtl8821ae_dm_txpower_track_adjust()
236 if (type == 0) { in rtl8821ae_dm_txpower_track_adjust()
237 if (rtlpriv->dm.swing_idx_ofdm[RF90_PATH_A] <= in rtl8821ae_dm_txpower_track_adjust()
238 rtlpriv->dm.swing_idx_ofdm_base[RF90_PATH_A]) { in rtl8821ae_dm_txpower_track_adjust()
240 pwr_val = rtldm->swing_idx_ofdm_base[RF90_PATH_A] - in rtl8821ae_dm_txpower_track_adjust()
241 rtldm->swing_idx_ofdm[RF90_PATH_A]; in rtl8821ae_dm_txpower_track_adjust()
244 pwr_val = rtldm->swing_idx_ofdm[RF90_PATH_A] - in rtl8821ae_dm_txpower_track_adjust()
245 rtldm->swing_idx_ofdm_base[RF90_PATH_A]; in rtl8821ae_dm_txpower_track_adjust()
248 if (rtldm->swing_idx_cck <= rtldm->swing_idx_cck_base) { in rtl8821ae_dm_txpower_track_adjust()
250 pwr_val = rtldm->swing_idx_cck_base - in rtl8821ae_dm_txpower_track_adjust()
251 rtldm->swing_idx_cck; in rtl8821ae_dm_txpower_track_adjust()
254 pwr_val = rtldm->swing_idx_cck - in rtl8821ae_dm_txpower_track_adjust()
255 rtldm->swing_idx_cck_base; in rtl8821ae_dm_txpower_track_adjust()
272 u8 p = 0; in rtl8821ae_dm_clear_txpower_tracking_state()
274 rtldm->swing_idx_cck_base = rtldm->default_cck_index; in rtl8821ae_dm_clear_txpower_tracking_state()
275 rtldm->swing_idx_cck = rtldm->default_cck_index; in rtl8821ae_dm_clear_txpower_tracking_state()
276 rtldm->cck_index = 0; in rtl8821ae_dm_clear_txpower_tracking_state()
279 rtldm->swing_idx_ofdm_base[p] = rtldm->default_ofdm_index; in rtl8821ae_dm_clear_txpower_tracking_state()
280 rtldm->swing_idx_ofdm[p] = rtldm->default_ofdm_index; in rtl8821ae_dm_clear_txpower_tracking_state()
281 rtldm->ofdm_index[p] = rtldm->default_ofdm_index; in rtl8821ae_dm_clear_txpower_tracking_state()
283 rtldm->power_index_offset[p] = 0; in rtl8821ae_dm_clear_txpower_tracking_state()
284 rtldm->delta_power_index[p] = 0; in rtl8821ae_dm_clear_txpower_tracking_state()
285 rtldm->delta_power_index_last[p] = 0; in rtl8821ae_dm_clear_txpower_tracking_state()
287 rtldm->absolute_ofdm_swing_idx[p] = 0; in rtl8821ae_dm_clear_txpower_tracking_state()
288 rtldm->remnant_ofdm_swing_idx[p] = 0; in rtl8821ae_dm_clear_txpower_tracking_state()
291 rtldm->modify_txagc_flag_path_a = false; in rtl8821ae_dm_clear_txpower_tracking_state()
293 rtldm->modify_txagc_flag_path_b = false; in rtl8821ae_dm_clear_txpower_tracking_state()
294 rtldm->remnant_cck_idx = 0; in rtl8821ae_dm_clear_txpower_tracking_state()
295 rtldm->thermalvalue = rtlefuse->eeprom_thermalmeter; in rtl8821ae_dm_clear_txpower_tracking_state()
296 rtldm->thermalvalue_iqk = rtlefuse->eeprom_thermalmeter; in rtl8821ae_dm_clear_txpower_tracking_state()
297 rtldm->thermalvalue_lck = rtlefuse->eeprom_thermalmeter; in rtl8821ae_dm_clear_txpower_tracking_state()
303 u8 i = 0; in rtl8821ae_dm_get_swing_index()
306 bb_swing = phy_get_tx_swing_8812A(hw, rtlhal->current_bandtype, in rtl8821ae_dm_get_swing_index()
309 for (i = 0; i < TXSCALE_TABLE_SIZE; ++i) in rtl8821ae_dm_get_swing_index()
322 u8 default_swing_index = 0; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
323 u8 p = 0; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
325 rtlpriv->dm.txpower_track_control = true; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
326 rtldm->thermalvalue = rtlefuse->eeprom_thermalmeter; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
327 rtldm->thermalvalue_iqk = rtlefuse->eeprom_thermalmeter; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
328 rtldm->thermalvalue_lck = rtlefuse->eeprom_thermalmeter; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
331 rtldm->default_ofdm_index = in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
334 rtldm->default_cck_index = 24; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
336 rtldm->swing_idx_cck_base = rtldm->default_cck_index; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
337 rtldm->cck_index = rtldm->default_cck_index; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
340 rtldm->swing_idx_ofdm_base[p] = in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
341 rtldm->default_ofdm_index; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
342 rtldm->ofdm_index[p] = rtldm->default_ofdm_index; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
343 rtldm->delta_power_index[p] = 0; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
344 rtldm->power_index_offset[p] = 0; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
345 rtldm->delta_power_index_last[p] = 0; in rtl8821ae_dm_initialize_txpower_tracking_thermalmeter()
353 rtlpriv->dm.current_turbo_edca = false; in rtl8821ae_dm_init_edca_turbo()
354 rtlpriv->dm.is_any_nonbepkts = false; in rtl8821ae_dm_init_edca_turbo()
355 rtlpriv->dm.is_cur_rdlstate = false; in rtl8821ae_dm_init_edca_turbo()
361 struct rate_adaptive *p_ra = &rtlpriv->ra; in rtl8821ae_dm_init_rate_adaptive_mask()
363 p_ra->ratr_state = DM_RATR_STA_INIT; in rtl8821ae_dm_init_rate_adaptive_mask()
364 p_ra->pre_ratr_state = DM_RATR_STA_INIT; in rtl8821ae_dm_init_rate_adaptive_mask()
366 rtlpriv->dm.dm_type = DM_TYPE_BYDRIVER; in rtl8821ae_dm_init_rate_adaptive_mask()
367 if (rtlpriv->dm.dm_type == DM_TYPE_BYDRIVER) in rtl8821ae_dm_init_rate_adaptive_mask()
368 rtlpriv->dm.useramask = true; in rtl8821ae_dm_init_rate_adaptive_mask()
370 rtlpriv->dm.useramask = false; in rtl8821ae_dm_init_rate_adaptive_mask()
372 p_ra->high_rssi_thresh_for_ra = 50; in rtl8821ae_dm_init_rate_adaptive_mask()
373 p_ra->low_rssi_thresh_for_ra40m = 20; in rtl8821ae_dm_init_rate_adaptive_mask()
380 rtlpriv->dm.crystal_cap = rtlpriv->efuse.crystalcap; in rtl8821ae_dm_init_dynamic_atc_switch()
382 rtlpriv->dm.atc_status = rtl_get_bbreg(hw, ROFDM1_CFOTRACKING, BIT(11)); in rtl8821ae_dm_init_dynamic_atc_switch()
383 rtlpriv->dm.cfo_threshold = CFO_THRESHOLD_XTAL; in rtl8821ae_dm_init_dynamic_atc_switch()
389 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_dm_common_info_self_init()
392 rtlphy->cck_high_power = in rtl8821ae_dm_common_info_self_init()
398 if (tmp & BIT(0)) in rtl8821ae_dm_common_info_self_init()
399 rtlpriv->dm.rfpath_rxenable[0] = true; in rtl8821ae_dm_common_info_self_init()
401 rtlpriv->dm.rfpath_rxenable[1] = true; in rtl8821ae_dm_common_info_self_init()
407 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_dm_init()
408 u32 cur_igvalue = rtl_get_bbreg(hw, ROFDM0_XAAGCCORE1, 0x7f); in rtl8821ae_dm_init()
410 spin_lock(&rtlpriv->locks.iqk_lock); in rtl8821ae_dm_init()
411 rtlphy->lck_inprogress = false; in rtl8821ae_dm_init()
412 spin_unlock(&rtlpriv->locks.iqk_lock); in rtl8821ae_dm_init()
414 rtlpriv->dm.dm_type = DM_TYPE_BYDRIVER; in rtl8821ae_dm_init()
426 struct dig_t *rtl_dm_dig = &rtlpriv->dm_digtable; in rtl8821ae_dm_find_minimum_rssi()
430 if ((mac->link_state < MAC80211_LINKED) && in rtl8821ae_dm_find_minimum_rssi()
431 (rtlpriv->dm.entry_min_undec_sm_pwdb == 0)) { in rtl8821ae_dm_find_minimum_rssi()
432 rtl_dm_dig->min_undec_pwdb_for_dm = 0; in rtl8821ae_dm_find_minimum_rssi()
435 if (mac->link_state >= MAC80211_LINKED) { in rtl8821ae_dm_find_minimum_rssi()
436 if (mac->opmode == NL80211_IFTYPE_AP || in rtl8821ae_dm_find_minimum_rssi()
437 mac->opmode == NL80211_IFTYPE_ADHOC) { in rtl8821ae_dm_find_minimum_rssi()
438 rtl_dm_dig->min_undec_pwdb_for_dm = in rtl8821ae_dm_find_minimum_rssi()
439 rtlpriv->dm.entry_min_undec_sm_pwdb; in rtl8821ae_dm_find_minimum_rssi()
441 "AP Client PWDB = 0x%lx\n", in rtl8821ae_dm_find_minimum_rssi()
442 rtlpriv->dm.entry_min_undec_sm_pwdb); in rtl8821ae_dm_find_minimum_rssi()
444 rtl_dm_dig->min_undec_pwdb_for_dm = in rtl8821ae_dm_find_minimum_rssi()
445 rtlpriv->dm.undec_sm_pwdb; in rtl8821ae_dm_find_minimum_rssi()
447 "STA Default Port PWDB = 0x%x\n", in rtl8821ae_dm_find_minimum_rssi()
448 rtl_dm_dig->min_undec_pwdb_for_dm); in rtl8821ae_dm_find_minimum_rssi()
451 rtl_dm_dig->min_undec_pwdb_for_dm = in rtl8821ae_dm_find_minimum_rssi()
452 rtlpriv->dm.entry_min_undec_sm_pwdb; in rtl8821ae_dm_find_minimum_rssi()
454 "AP Ext Port or disconnect PWDB = 0x%x\n", in rtl8821ae_dm_find_minimum_rssi()
455 rtl_dm_dig->min_undec_pwdb_for_dm); in rtl8821ae_dm_find_minimum_rssi()
458 "MinUndecoratedPWDBForDM =%d\n", in rtl8821ae_dm_find_minimum_rssi()
459 rtl_dm_dig->min_undec_pwdb_for_dm); in rtl8821ae_dm_find_minimum_rssi()
467 rtlpriv->stats.rx_rssi_percentage[0]); in rtl8812ae_dm_rssi_dump_to_register()
469 rtlpriv->stats.rx_rssi_percentage[1]); in rtl8812ae_dm_rssi_dump_to_register()
473 rtlpriv->stats.rx_evm_dbm[0]); in rtl8812ae_dm_rssi_dump_to_register()
475 rtlpriv->stats.rx_evm_dbm[1]); in rtl8812ae_dm_rssi_dump_to_register()
479 (u8)(rtlpriv->stats.rx_snr_db[0])); in rtl8812ae_dm_rssi_dump_to_register()
481 (u8)(rtlpriv->stats.rx_snr_db[1])); in rtl8812ae_dm_rssi_dump_to_register()
485 rtlpriv->stats.rx_cfo_short[0]); in rtl8812ae_dm_rssi_dump_to_register()
487 rtlpriv->stats.rx_cfo_short[1]); in rtl8812ae_dm_rssi_dump_to_register()
491 rtlpriv->stats.rx_cfo_tail[0]); in rtl8812ae_dm_rssi_dump_to_register()
493 rtlpriv->stats.rx_cfo_tail[1]); in rtl8812ae_dm_rssi_dump_to_register()
499 struct dig_t *dm_digtable = &rtlpriv->dm_digtable; in rtl8821ae_dm_check_rssi_monitor()
503 u8 h2c_parameter[4] = { 0 }; in rtl8821ae_dm_check_rssi_monitor()
504 long tmp_entry_max_pwdb = 0, tmp_entry_min_pwdb = 0xff; in rtl8821ae_dm_check_rssi_monitor()
505 u8 stbc_tx = 0; in rtl8821ae_dm_check_rssi_monitor()
506 u64 cur_rxokcnt = 0; in rtl8821ae_dm_check_rssi_monitor()
507 static u64 last_txokcnt = 0, last_rxokcnt; in rtl8821ae_dm_check_rssi_monitor()
509 cur_rxokcnt = rtlpriv->stats.rxbytesunicast - last_rxokcnt; in rtl8821ae_dm_check_rssi_monitor()
510 last_txokcnt = rtlpriv->stats.txbytesunicast; in rtl8821ae_dm_check_rssi_monitor()
511 last_rxokcnt = rtlpriv->stats.rxbytesunicast; in rtl8821ae_dm_check_rssi_monitor()
513 h2c_parameter[3] = 0x01; in rtl8821ae_dm_check_rssi_monitor()
515 h2c_parameter[3] = 0x00; in rtl8821ae_dm_check_rssi_monitor()
518 if (mac->opmode == NL80211_IFTYPE_AP || in rtl8821ae_dm_check_rssi_monitor()
519 mac->opmode == NL80211_IFTYPE_ADHOC || in rtl8821ae_dm_check_rssi_monitor()
520 mac->opmode == NL80211_IFTYPE_MESH_POINT) { in rtl8821ae_dm_check_rssi_monitor()
521 spin_lock_bh(&rtlpriv->locks.entry_list_lock); in rtl8821ae_dm_check_rssi_monitor()
522 list_for_each_entry(drv_priv, &rtlpriv->entry_list, list) { in rtl8821ae_dm_check_rssi_monitor()
523 if (drv_priv->rssi_stat.undec_sm_pwdb < in rtl8821ae_dm_check_rssi_monitor()
526 drv_priv->rssi_stat.undec_sm_pwdb; in rtl8821ae_dm_check_rssi_monitor()
527 if (drv_priv->rssi_stat.undec_sm_pwdb > in rtl8821ae_dm_check_rssi_monitor()
530 drv_priv->rssi_stat.undec_sm_pwdb; in rtl8821ae_dm_check_rssi_monitor()
532 spin_unlock_bh(&rtlpriv->locks.entry_list_lock); in rtl8821ae_dm_check_rssi_monitor()
535 if (tmp_entry_max_pwdb != 0) { in rtl8821ae_dm_check_rssi_monitor()
536 rtlpriv->dm.entry_max_undec_sm_pwdb = in rtl8821ae_dm_check_rssi_monitor()
539 "EntryMaxPWDB = 0x%lx(%ld)\n", in rtl8821ae_dm_check_rssi_monitor()
542 rtlpriv->dm.entry_max_undec_sm_pwdb = 0; in rtl8821ae_dm_check_rssi_monitor()
545 if (tmp_entry_min_pwdb != 0xff) { in rtl8821ae_dm_check_rssi_monitor()
546 rtlpriv->dm.entry_min_undec_sm_pwdb = in rtl8821ae_dm_check_rssi_monitor()
549 "EntryMinPWDB = 0x%lx(%ld)\n", in rtl8821ae_dm_check_rssi_monitor()
552 rtlpriv->dm.entry_min_undec_sm_pwdb = 0; in rtl8821ae_dm_check_rssi_monitor()
556 if (rtlpriv->dm.useramask) { in rtl8821ae_dm_check_rssi_monitor()
557 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in rtl8821ae_dm_check_rssi_monitor()
558 if (mac->mode == WIRELESS_MODE_AC_24G || in rtl8821ae_dm_check_rssi_monitor()
559 mac->mode == WIRELESS_MODE_AC_5G || in rtl8821ae_dm_check_rssi_monitor()
560 mac->mode == WIRELESS_MODE_AC_ONLY) in rtl8821ae_dm_check_rssi_monitor()
561 stbc_tx = (mac->vht_cur_stbc & in rtl8821ae_dm_check_rssi_monitor()
562 STBC_VHT_ENABLE_TX) ? 1 : 0; in rtl8821ae_dm_check_rssi_monitor()
564 stbc_tx = (mac->ht_cur_stbc & in rtl8821ae_dm_check_rssi_monitor()
565 STBC_HT_ENABLE_TX) ? 1 : 0; in rtl8821ae_dm_check_rssi_monitor()
569 (u8)(rtlpriv->dm.undec_sm_pwdb & 0xFF); in rtl8821ae_dm_check_rssi_monitor()
570 h2c_parameter[1] = 0x20; in rtl8821ae_dm_check_rssi_monitor()
571 h2c_parameter[0] = 0; in rtl8821ae_dm_check_rssi_monitor()
572 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in rtl8821ae_dm_check_rssi_monitor()
579 rtl_write_byte(rtlpriv, 0x4fe, rtlpriv->dm.undec_sm_pwdb); in rtl8821ae_dm_check_rssi_monitor()
581 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in rtl8821ae_dm_check_rssi_monitor()
584 dm_digtable->rssi_val_min = rtlpriv->dm_digtable.min_undec_pwdb_for_dm; in rtl8821ae_dm_check_rssi_monitor()
590 struct dig_t *dm_digtable = &rtlpriv->dm_digtable; in rtl8821ae_dm_write_cck_cca_thres()
592 if (dm_digtable->cur_cck_cca_thres != current_cca) in rtl8821ae_dm_write_cck_cca_thres()
595 dm_digtable->pre_cck_cca_thres = dm_digtable->cur_cck_cca_thres; in rtl8821ae_dm_write_cck_cca_thres()
596 dm_digtable->cur_cck_cca_thres = current_cca; in rtl8821ae_dm_write_cck_cca_thres()
602 struct dig_t *dm_digtable = &rtlpriv->dm_digtable; in rtl8821ae_dm_write_dig()
604 if (dm_digtable->stop_dig) in rtl8821ae_dm_write_dig()
607 if (dm_digtable->cur_igvalue != current_igi) { in rtl8821ae_dm_write_dig()
610 if (rtlpriv->phy.rf_type != RF_1T1R) in rtl8821ae_dm_write_dig()
614 dm_digtable->cur_igvalue = current_igi; in rtl8821ae_dm_write_dig()
620 struct dig_t *dm_digtable = &rtlpriv->dm_digtable; in rtl8821ae_dm_dig()
627 u8 current_igi = dm_digtable->cur_igvalue; in rtl8821ae_dm_dig()
631 if (mac->act_scanning) { in rtl8821ae_dm_dig()
638 dig_min_0 = dm_digtable->dig_min_0; in rtl8821ae_dm_dig()
639 first_connect = (mac->link_state >= MAC80211_LINKED) && in rtl8821ae_dm_dig()
640 (!dm_digtable->media_connect_0); in rtl8821ae_dm_dig()
641 first_disconnect = (mac->link_state < MAC80211_LINKED) && in rtl8821ae_dm_dig()
642 (dm_digtable->media_connect_0); in rtl8821ae_dm_dig()
646 dm_dig_max = 0x5A; in rtl8821ae_dm_dig()
648 if (rtlhal->hw_type != HARDWARE_TYPE_RTL8821AE) in rtl8821ae_dm_dig()
651 dm_dig_min = 0x1C; in rtl8821ae_dm_dig()
655 if (mac->link_state >= MAC80211_LINKED) { in rtl8821ae_dm_dig()
656 if (rtlhal->hw_type != HARDWARE_TYPE_RTL8821AE) in rtl8821ae_dm_dig()
661 if ((dm_digtable->rssi_val_min + offset) > dm_dig_max) in rtl8821ae_dm_dig()
662 dm_digtable->rx_gain_max = dm_dig_max; in rtl8821ae_dm_dig()
663 else if ((dm_digtable->rssi_val_min + offset) < dm_dig_min) in rtl8821ae_dm_dig()
664 dm_digtable->rx_gain_max = dm_dig_min; in rtl8821ae_dm_dig()
666 dm_digtable->rx_gain_max = in rtl8821ae_dm_dig()
667 dm_digtable->rssi_val_min + offset; in rtl8821ae_dm_dig()
670 "dm_digtable->rssi_val_min=0x%x,dm_digtable->rx_gain_max = 0x%x\n", in rtl8821ae_dm_dig()
671 dm_digtable->rssi_val_min, in rtl8821ae_dm_dig()
672 dm_digtable->rx_gain_max); in rtl8821ae_dm_dig()
673 if (rtlpriv->dm.one_entry_only) { in rtl8821ae_dm_dig()
674 offset = 0; in rtl8821ae_dm_dig()
676 if (dm_digtable->rssi_val_min - offset < dm_dig_min) in rtl8821ae_dm_dig()
678 else if (dm_digtable->rssi_val_min - in rtl8821ae_dm_dig()
683 dm_digtable->rssi_val_min - offset; in rtl8821ae_dm_dig()
686 "bOneEntryOnly=TRUE, dig_min_0=0x%x\n", in rtl8821ae_dm_dig()
692 dm_digtable->rx_gain_max = dm_dig_max; in rtl8821ae_dm_dig()
697 if (rtlpriv->falsealm_cnt.cnt_all > 10000) { in rtl8821ae_dm_dig()
701 if (dm_digtable->large_fa_hit != 3) in rtl8821ae_dm_dig()
702 dm_digtable->large_fa_hit++; in rtl8821ae_dm_dig()
703 if (dm_digtable->forbidden_igi < current_igi) { in rtl8821ae_dm_dig()
704 dm_digtable->forbidden_igi = current_igi; in rtl8821ae_dm_dig()
705 dm_digtable->large_fa_hit = 1; in rtl8821ae_dm_dig()
708 if (dm_digtable->large_fa_hit >= 3) { in rtl8821ae_dm_dig()
709 if ((dm_digtable->forbidden_igi + 1) > in rtl8821ae_dm_dig()
710 dm_digtable->rx_gain_max) in rtl8821ae_dm_dig()
711 dm_digtable->rx_gain_min = in rtl8821ae_dm_dig()
712 dm_digtable->rx_gain_max; in rtl8821ae_dm_dig()
714 dm_digtable->rx_gain_min = in rtl8821ae_dm_dig()
715 (dm_digtable->forbidden_igi + 1); in rtl8821ae_dm_dig()
716 dm_digtable->recover_cnt = 3600; in rtl8821ae_dm_dig()
720 if (dm_digtable->recover_cnt != 0) { in rtl8821ae_dm_dig()
721 dm_digtable->recover_cnt--; in rtl8821ae_dm_dig()
723 if (dm_digtable->large_fa_hit < 3) { in rtl8821ae_dm_dig()
724 if ((dm_digtable->forbidden_igi - 1) < in rtl8821ae_dm_dig()
726 dm_digtable->forbidden_igi = in rtl8821ae_dm_dig()
728 dm_digtable->rx_gain_min = in rtl8821ae_dm_dig()
733 dm_digtable->forbidden_igi--; in rtl8821ae_dm_dig()
734 dm_digtable->rx_gain_min = in rtl8821ae_dm_dig()
735 (dm_digtable->forbidden_igi + 1); in rtl8821ae_dm_dig()
740 dm_digtable->large_fa_hit = 0; in rtl8821ae_dm_dig()
745 "pDM_DigTable->LargeFAHit=%d\n", in rtl8821ae_dm_dig()
746 dm_digtable->large_fa_hit); in rtl8821ae_dm_dig()
748 if (rtlpriv->dm.dbginfo.num_qry_beacon_pkt < 10) in rtl8821ae_dm_dig()
749 dm_digtable->rx_gain_min = dm_dig_min; in rtl8821ae_dm_dig()
751 if (dm_digtable->rx_gain_min > dm_digtable->rx_gain_max) in rtl8821ae_dm_dig()
752 dm_digtable->rx_gain_min = dm_digtable->rx_gain_max; in rtl8821ae_dm_dig()
755 if (mac->link_state >= MAC80211_LINKED) { in rtl8821ae_dm_dig()
759 if (dm_digtable->rssi_val_min <= dig_max_of_min) in rtl8821ae_dm_dig()
760 current_igi = dm_digtable->rssi_val_min; in rtl8821ae_dm_dig()
766 if (rtlpriv->falsealm_cnt.cnt_all > DM_DIG_FA_TH2) in rtl8821ae_dm_dig()
768 else if (rtlpriv->falsealm_cnt.cnt_all > DM_DIG_FA_TH1) in rtl8821ae_dm_dig()
770 else if (rtlpriv->falsealm_cnt.cnt_all < DM_DIG_FA_TH0) in rtl8821ae_dm_dig()
771 current_igi = current_igi - 2; in rtl8821ae_dm_dig()
773 if ((rtlpriv->dm.dbginfo.num_qry_beacon_pkt < 10) && in rtl8821ae_dm_dig()
774 (rtlpriv->falsealm_cnt.cnt_all < DM_DIG_FA_TH1)) { in rtl8821ae_dm_dig()
775 current_igi = dm_digtable->rx_gain_min; in rtl8821ae_dm_dig()
777 "Beacon is less than 10 and FA is less than 768, IGI GOES TO 0x1E!!!!!!!!!!!!\n"); in rtl8821ae_dm_dig()
784 current_igi = dm_digtable->rx_gain_min; in rtl8821ae_dm_dig()
791 if (rtlpriv->falsealm_cnt.cnt_all > 2000) in rtl8821ae_dm_dig()
793 else if (rtlpriv->falsealm_cnt.cnt_all > 600) in rtl8821ae_dm_dig()
795 else if (rtlpriv->falsealm_cnt.cnt_all < 300) in rtl8821ae_dm_dig()
796 current_igi = current_igi - 2; in rtl8821ae_dm_dig()
798 if (current_igi >= 0x3e) in rtl8821ae_dm_dig()
799 current_igi = 0x3e; in rtl8821ae_dm_dig()
808 if (current_igi > dm_digtable->rx_gain_max) in rtl8821ae_dm_dig()
809 current_igi = dm_digtable->rx_gain_max; in rtl8821ae_dm_dig()
810 if (current_igi < dm_digtable->rx_gain_min) in rtl8821ae_dm_dig()
811 current_igi = dm_digtable->rx_gain_min; in rtl8821ae_dm_dig()
814 "rx_gain_max=0x%x, rx_gain_min=0x%x\n", in rtl8821ae_dm_dig()
815 dm_digtable->rx_gain_max, dm_digtable->rx_gain_min); in rtl8821ae_dm_dig()
817 "TotalFA=%d\n", rtlpriv->falsealm_cnt.cnt_all); in rtl8821ae_dm_dig()
819 "CurIGValue=0x%x\n", current_igi); in rtl8821ae_dm_dig()
822 dm_digtable->media_connect_0 = in rtl8821ae_dm_dig()
823 ((mac->link_state >= MAC80211_LINKED) ? true : false); in rtl8821ae_dm_dig()
824 dm_digtable->dig_min_0 = dig_min_0; in rtl8821ae_dm_dig()
832 rtlpriv->dm.tx_rate = 0xff; in rtl8821ae_dm_common_info_self_update()
834 rtlpriv->dm.one_entry_only = false; in rtl8821ae_dm_common_info_self_update()
836 if (rtlpriv->mac80211.opmode == NL80211_IFTYPE_STATION && in rtl8821ae_dm_common_info_self_update()
837 rtlpriv->mac80211.link_state >= MAC80211_LINKED) { in rtl8821ae_dm_common_info_self_update()
838 rtlpriv->dm.one_entry_only = true; in rtl8821ae_dm_common_info_self_update()
842 if (rtlpriv->mac80211.opmode == NL80211_IFTYPE_AP || in rtl8821ae_dm_common_info_self_update()
843 rtlpriv->mac80211.opmode == NL80211_IFTYPE_ADHOC || in rtl8821ae_dm_common_info_self_update()
844 rtlpriv->mac80211.opmode == NL80211_IFTYPE_MESH_POINT) { in rtl8821ae_dm_common_info_self_update()
845 spin_lock_bh(&rtlpriv->locks.entry_list_lock); in rtl8821ae_dm_common_info_self_update()
846 cnt = list_count_nodes(&rtlpriv->entry_list); in rtl8821ae_dm_common_info_self_update()
847 spin_unlock_bh(&rtlpriv->locks.entry_list_lock); in rtl8821ae_dm_common_info_self_update()
850 rtlpriv->dm.one_entry_only = true; in rtl8821ae_dm_common_info_self_update()
857 struct false_alarm_statistics *falsealm_cnt = &rtlpriv->falsealm_cnt; in rtl8821ae_dm_false_alarm_counter_statistics()
858 u32 cck_enable = 0; in rtl8821ae_dm_false_alarm_counter_statistics()
861 falsealm_cnt->cnt_ofdm_fail = in rtl8821ae_dm_false_alarm_counter_statistics()
863 falsealm_cnt->cnt_cck_fail = in rtl8821ae_dm_false_alarm_counter_statistics()
867 if (cck_enable) /*if(pDM_Odm->pBandType == ODM_BAND_2_4G)*/ in rtl8821ae_dm_false_alarm_counter_statistics()
868 falsealm_cnt->cnt_all = falsealm_cnt->cnt_ofdm_fail + in rtl8821ae_dm_false_alarm_counter_statistics()
869 falsealm_cnt->cnt_cck_fail; in rtl8821ae_dm_false_alarm_counter_statistics()
871 falsealm_cnt->cnt_all = falsealm_cnt->cnt_ofdm_fail; in rtl8821ae_dm_false_alarm_counter_statistics()
875 rtl_set_bbreg(hw, ODM_REG_OFDM_FA_RST_11AC, BIT(17), 0); in rtl8821ae_dm_false_alarm_counter_statistics()
877 rtl_set_bbreg(hw, ODM_REG_CCK_FA_RST_11AC, BIT(15), 0); in rtl8821ae_dm_false_alarm_counter_statistics()
880 rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "Cnt_Cck_fail=%d\n", in rtl8821ae_dm_false_alarm_counter_statistics()
881 falsealm_cnt->cnt_cck_fail); in rtl8821ae_dm_false_alarm_counter_statistics()
882 rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "cnt_ofdm_fail=%d\n", in rtl8821ae_dm_false_alarm_counter_statistics()
883 falsealm_cnt->cnt_ofdm_fail); in rtl8821ae_dm_false_alarm_counter_statistics()
884 rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "Total False Alarm=%d\n", in rtl8821ae_dm_false_alarm_counter_statistics()
885 falsealm_cnt->cnt_all); in rtl8821ae_dm_false_alarm_counter_statistics()
893 if (!rtlpriv->dm.tm_trigger) { in rtl8812ae_dm_check_txpower_tracking_thermalmeter()
895 BIT(17) | BIT(16), 0x03); in rtl8812ae_dm_check_txpower_tracking_thermalmeter()
898 rtlpriv->dm.tm_trigger = 1; in rtl8812ae_dm_check_txpower_tracking_thermalmeter()
912 if (mac->link_state >= MAC80211_LINKED) { in rtl8821ae_dm_iq_calibrate()
913 if (rtldm->linked_interval < 3) in rtl8821ae_dm_iq_calibrate()
914 rtldm->linked_interval++; in rtl8821ae_dm_iq_calibrate()
916 if (rtldm->linked_interval == 2) { in rtl8821ae_dm_iq_calibrate()
917 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in rtl8821ae_dm_iq_calibrate()
923 rtldm->linked_interval = 0; in rtl8821ae_dm_iq_calibrate()
934 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8812ae_get_delta_swing_table()
936 u8 channel = rtlphy->current_channel; in rtl8812ae_get_delta_swing_table()
937 u8 rate = rtldm->tx_rate; in rtl8812ae_get_delta_swing_table()
952 *up_a = rtl8812ae_delta_swing_table_idx_5ga_p[0]; in rtl8812ae_get_delta_swing_table()
953 *down_a = rtl8812ae_delta_swing_table_idx_5ga_n[0]; in rtl8812ae_get_delta_swing_table()
954 *up_b = rtl8812ae_delta_swing_table_idx_5gb_p[0]; in rtl8812ae_get_delta_swing_table()
955 *down_b = rtl8812ae_delta_swing_table_idx_5gb_n[0]; in rtl8812ae_get_delta_swing_table()
979 u8 p = 0; in rtl8821ae_dm_update_init_rate()
982 "Get C2H Command! Rate=0x%x\n", rate); in rtl8821ae_dm_update_init_rate()
984 rtldm->tx_rate = rate; in rtl8821ae_dm_update_init_rate()
986 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in rtl8821ae_dm_update_init_rate()
987 rtl8821ae_dm_txpwr_track_set_pwr(hw, MIX_MODE, RF90_PATH_A, 0); in rtl8821ae_dm_update_init_rate()
990 rtl8812ae_dm_txpwr_track_set_pwr(hw, MIX_MODE, p, 0); in rtl8821ae_dm_update_init_rate()
1153 /*-----------------------------------------------------------------------------
1167 * 04/23/2012 MHC Create Version 0.
1169 *---------------------------------------------------------------------------
1177 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8812ae_dm_txpwr_track_set_pwr()
1180 u8 tx_rate = 0xFF; in rtl8812ae_dm_txpwr_track_set_pwr()
1181 s8 final_ofdm_swing_index = 0; in rtl8812ae_dm_txpwr_track_set_pwr()
1183 if (rtldm->tx_rate != 0xFF) in rtl8812ae_dm_txpwr_track_set_pwr()
1185 rtl8821ae_hw_rate_to_mrate(hw, rtldm->tx_rate); in rtl8812ae_dm_txpwr_track_set_pwr()
1190 if (tx_rate != 0xFF) { in rtl8812ae_dm_txpwr_track_set_pwr()
1235 pwr_tracking_limit = 24; /*+0dB*/ in rtl8812ae_dm_txpwr_track_set_pwr()
1237 pwr_tracking_limit = 22; /*-1dB*/ in rtl8812ae_dm_txpwr_track_set_pwr()
1253 pwr_tracking_limit = 24; /*+0dB*/ in rtl8812ae_dm_txpwr_track_set_pwr()
1255 pwr_tracking_limit = 22; /*-1dB*/ in rtl8812ae_dm_txpwr_track_set_pwr()
1260 "TxRate=0x%x, PwrTrackingLimit=%d\n", in rtl8812ae_dm_txpwr_track_set_pwr()
1271 (rtldm->ofdm_index[RF90_PATH_A] > in rtl8812ae_dm_txpwr_track_set_pwr()
1274 rtldm->ofdm_index[RF90_PATH_A]; in rtl8812ae_dm_txpwr_track_set_pwr()
1277 …"pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_A]=%d,pDM_Odm->RealBbSwingIdx[ODM_RF_PATH_A]=%d\n… in rtl8812ae_dm_txpwr_track_set_pwr()
1278 rtldm->ofdm_index[RF90_PATH_A], in rtl8812ae_dm_txpwr_track_set_pwr()
1281 rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, in rtl8812ae_dm_txpwr_track_set_pwr()
1287 rtldm->ofdm_index[RF90_PATH_B] > in rtl8812ae_dm_txpwr_track_set_pwr()
1290 rtldm->ofdm_index[RF90_PATH_B]; in rtl8812ae_dm_txpwr_track_set_pwr()
1293 …"pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_B]=%d, pDM_Odm->RealBbSwingIdx[ODM_RF_PATH_B]=%d\… in rtl8812ae_dm_txpwr_track_set_pwr()
1294 rtldm->ofdm_index[RF90_PATH_B], in rtl8812ae_dm_txpwr_track_set_pwr()
1297 rtl_set_bbreg(hw, RB_TXSCALE, 0xFFE00000, in rtl8812ae_dm_txpwr_track_set_pwr()
1302 "pDM_Odm->DefaultOfdmIndex=%d, pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n", in rtl8812ae_dm_txpwr_track_set_pwr()
1303 rtldm->default_ofdm_index, in rtl8812ae_dm_txpwr_track_set_pwr()
1304 rtldm->absolute_ofdm_swing_idx[rf_path], in rtl8812ae_dm_txpwr_track_set_pwr()
1307 final_ofdm_swing_index = rtldm->default_ofdm_index + in rtl8812ae_dm_txpwr_track_set_pwr()
1308 rtldm->absolute_ofdm_swing_idx[rf_path]; in rtl8812ae_dm_txpwr_track_set_pwr()
1313 rtldm->remnant_cck_idx = in rtl8812ae_dm_txpwr_track_set_pwr()
1314 final_ofdm_swing_index - in rtl8812ae_dm_txpwr_track_set_pwr()
1317 * as Path A in rtl8812ae_dm_txpwr_track_set_pwr()
1319 rtldm->remnant_ofdm_swing_idx[rf_path] = in rtl8812ae_dm_txpwr_track_set_pwr()
1320 final_ofdm_swing_index - in rtl8812ae_dm_txpwr_track_set_pwr()
1323 rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, in rtl8812ae_dm_txpwr_track_set_pwr()
1326 rtldm->modify_txagc_flag_path_a = true; in rtl8812ae_dm_txpwr_track_set_pwr()
1330 rtlphy->current_channel, in rtl8812ae_dm_txpwr_track_set_pwr()
1334 "******Path_A Over BBSwing Limit ,PwrTrackingLimit = %d ,Remnant TxAGC Value = %d\n", in rtl8812ae_dm_txpwr_track_set_pwr()
1336 rtldm->remnant_ofdm_swing_idx[rf_path]); in rtl8812ae_dm_txpwr_track_set_pwr()
1337 } else if (final_ofdm_swing_index < 0) { in rtl8812ae_dm_txpwr_track_set_pwr()
1338 rtldm->remnant_cck_idx = final_ofdm_swing_index; in rtl8812ae_dm_txpwr_track_set_pwr()
1339 /* CCK Follow the same compensate value as Path A*/ in rtl8812ae_dm_txpwr_track_set_pwr()
1340 rtldm->remnant_ofdm_swing_idx[rf_path] = in rtl8812ae_dm_txpwr_track_set_pwr()
1343 rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, in rtl8812ae_dm_txpwr_track_set_pwr()
1344 txscaling_tbl[0]); in rtl8812ae_dm_txpwr_track_set_pwr()
1346 rtldm->modify_txagc_flag_path_a = true; in rtl8812ae_dm_txpwr_track_set_pwr()
1350 rtlphy->current_channel, RF90_PATH_A); in rtl8812ae_dm_txpwr_track_set_pwr()
1353 "******Path_A Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", in rtl8812ae_dm_txpwr_track_set_pwr()
1354 rtldm->remnant_ofdm_swing_idx[rf_path]); in rtl8812ae_dm_txpwr_track_set_pwr()
1356 rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, in rtl8812ae_dm_txpwr_track_set_pwr()
1360 "******Path_A Compensate with BBSwing, Final_OFDM_Swing_Index = %d\n", in rtl8812ae_dm_txpwr_track_set_pwr()
1363 if (rtldm->modify_txagc_flag_path_a) { in rtl8812ae_dm_txpwr_track_set_pwr()
1364 rtldm->remnant_cck_idx = 0; in rtl8812ae_dm_txpwr_track_set_pwr()
1365 rtldm->remnant_ofdm_swing_idx[rf_path] = 0; in rtl8812ae_dm_txpwr_track_set_pwr()
1369 rtlphy->current_channel, RF90_PATH_A); in rtl8812ae_dm_txpwr_track_set_pwr()
1370 rtldm->modify_txagc_flag_path_a = false; in rtl8812ae_dm_txpwr_track_set_pwr()
1374 "******Path_A pDM_Odm->Modify_TxAGC_Flag = FALSE\n"); in rtl8812ae_dm_txpwr_track_set_pwr()
1381 rtldm->remnant_ofdm_swing_idx[rf_path] = in rtl8812ae_dm_txpwr_track_set_pwr()
1382 final_ofdm_swing_index - in rtl8812ae_dm_txpwr_track_set_pwr()
1386 0xFFE00000, in rtl8812ae_dm_txpwr_track_set_pwr()
1389 rtldm->modify_txagc_flag_path_b = true; in rtl8812ae_dm_txpwr_track_set_pwr()
1393 rtlphy->current_channel, RF90_PATH_B); in rtl8812ae_dm_txpwr_track_set_pwr()
1396 "******Path_B Over BBSwing Limit , PwrTrackingLimit = %d , Remnant TxAGC Value = %d\n", in rtl8812ae_dm_txpwr_track_set_pwr()
1398 rtldm->remnant_ofdm_swing_idx[rf_path]); in rtl8812ae_dm_txpwr_track_set_pwr()
1399 } else if (final_ofdm_swing_index < 0) { in rtl8812ae_dm_txpwr_track_set_pwr()
1400 rtldm->remnant_ofdm_swing_idx[rf_path] = in rtl8812ae_dm_txpwr_track_set_pwr()
1403 rtl_set_bbreg(hw, RB_TXSCALE, 0xFFE00000, in rtl8812ae_dm_txpwr_track_set_pwr()
1404 txscaling_tbl[0]); in rtl8812ae_dm_txpwr_track_set_pwr()
1406 rtldm->modify_txagc_flag_path_b = true; in rtl8812ae_dm_txpwr_track_set_pwr()
1410 rtlphy->current_channel, RF90_PATH_B); in rtl8812ae_dm_txpwr_track_set_pwr()
1413 "******Path_B Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", in rtl8812ae_dm_txpwr_track_set_pwr()
1414 rtldm->remnant_ofdm_swing_idx[rf_path]); in rtl8812ae_dm_txpwr_track_set_pwr()
1416 rtl_set_bbreg(hw, RB_TXSCALE, 0xFFE00000, in rtl8812ae_dm_txpwr_track_set_pwr()
1420 "******Path_B Compensate with BBSwing ,Final_OFDM_Swing_Index = %d\n", in rtl8812ae_dm_txpwr_track_set_pwr()
1423 if (rtldm->modify_txagc_flag_path_b) { in rtl8812ae_dm_txpwr_track_set_pwr()
1424 rtldm->remnant_ofdm_swing_idx[rf_path] = 0; in rtl8812ae_dm_txpwr_track_set_pwr()
1428 rtlphy->current_channel, RF90_PATH_B); in rtl8812ae_dm_txpwr_track_set_pwr()
1430 rtldm->modify_txagc_flag_path_b = in rtl8812ae_dm_txpwr_track_set_pwr()
1434 "******Path_B pDM_Odm->Modify_TxAGC_Flag = FALSE\n"); in rtl8812ae_dm_txpwr_track_set_pwr()
1450 u8 thermal_value = 0, delta, delta_lck, delta_iqk, p = 0, i = 0; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1451 u8 thermal_value_avg_count = 0; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1452 u32 thermal_value_avg = 0; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1455 /* GetRightChnlPlaceforIQK(pHalData->CurrentChannel)*/ in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1456 u8 index_for_channel = 0; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1472 rtldm->txpower_trackinginit = true; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1475 …"pDM_Odm->BbSwingIdxCckBase: %d, pDM_Odm->BbSwingIdxOfdmBase[A]:%d, pDM_Odm->DefaultOfdmIndex: %d\… in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1476 rtldm->swing_idx_cck_base, in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1477 rtldm->swing_idx_ofdm_base[RF90_PATH_A], in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1478 rtldm->default_ofdm_index); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1481 /*0x42: RF Reg[15:10] 88E*/ in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1482 RF_T_METER_8812A, 0xfc00); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1484 "Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1485 thermal_value, rtlefuse->eeprom_thermalmeter); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1486 if (!rtldm->txpower_track_control || in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1487 rtlefuse->eeprom_thermalmeter == 0 || in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1488 rtlefuse->eeprom_thermalmeter == 0xFF) in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1493 if (rtlhal->reloadtxpowerindex) in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1498 rtldm->thermalvalue_avg[rtldm->thermalvalue_avg_index] = thermal_value; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1499 rtldm->thermalvalue_avg_index++; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1500 if (rtldm->thermalvalue_avg_index == AVG_THERMAL_NUM_8812A) in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1502 rtldm->thermalvalue_avg_index = 0; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1504 for (i = 0; i < AVG_THERMAL_NUM_8812A; i++) { in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1505 if (rtldm->thermalvalue_avg[i]) { in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1506 thermal_value_avg += rtldm->thermalvalue_avg[i]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1515 "AVG Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1516 thermal_value, rtlefuse->eeprom_thermalmeter); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1523 delta = (thermal_value > rtldm->thermalvalue) ? in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1524 (thermal_value - rtldm->thermalvalue) : in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1525 (rtldm->thermalvalue - thermal_value); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1526 delta_lck = (thermal_value > rtldm->thermalvalue_lck) ? in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1527 (thermal_value - rtldm->thermalvalue_lck) : in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1528 (rtldm->thermalvalue_lck - thermal_value); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1529 delta_iqk = (thermal_value > rtldm->thermalvalue_iqk) ? in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1530 (thermal_value - rtldm->thermalvalue_iqk) : in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1531 (rtldm->thermalvalue_iqk - thermal_value); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1534 "(delta, delta_LCK, delta_IQK) = (%d, %d, %d)\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1542 "delta_LCK(%d) >= Threshold_IQK(%d)\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1544 rtldm->thermalvalue_lck = thermal_value; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1550 if (delta > 0 && rtldm->txpower_track_control) { in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1554 delta = thermal_value > rtlefuse->eeprom_thermalmeter ? in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1555 (thermal_value - rtlefuse->eeprom_thermalmeter) : in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1556 (rtlefuse->eeprom_thermalmeter - thermal_value); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1559 delta = TXPWR_TRACK_TABLE_SIZE - 1; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1563 if (thermal_value > rtlefuse->eeprom_thermalmeter) { in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1565 "delta_swing_table_idx_tup_a[%d] = %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1567 rtldm->delta_power_index_last[RF90_PATH_A] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1568 rtldm->delta_power_index[RF90_PATH_A]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1569 rtldm->delta_power_index[RF90_PATH_A] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1572 rtldm->absolute_ofdm_swing_idx[RF90_PATH_A] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1577 "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1578 rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1581 "delta_swing_table_idx_tup_b[%d] = %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1583 rtldm->delta_power_index_last[RF90_PATH_B] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1584 rtldm->delta_power_index[RF90_PATH_B]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1585 rtldm->delta_power_index[RF90_PATH_B] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1588 rtldm->absolute_ofdm_swing_idx[RF90_PATH_B] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1593 "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1594 rtldm->absolute_ofdm_swing_idx[RF90_PATH_B]); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1597 "delta_swing_table_idx_tdown_a[%d] = %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1600 rtldm->delta_power_index_last[RF90_PATH_A] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1601 rtldm->delta_power_index[RF90_PATH_A]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1602 rtldm->delta_power_index[RF90_PATH_A] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1603 -1 * delta_swing_table_idx_tdown_a[delta]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1605 rtldm->absolute_ofdm_swing_idx[RF90_PATH_A] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1606 -1 * delta_swing_table_idx_tdown_a[delta]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1609 "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1610 rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1613 "deltaSwingTableIdx_TDOWN_B[%d] = %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1616 rtldm->delta_power_index_last[RF90_PATH_B] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1617 rtldm->delta_power_index[RF90_PATH_B]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1618 rtldm->delta_power_index[RF90_PATH_B] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1619 -1 * delta_swing_table_idx_tdown_b[delta]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1621 rtldm->absolute_ofdm_swing_idx[RF90_PATH_B] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1622 -1 * delta_swing_table_idx_tdown_b[delta]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1626 "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1627 rtldm->absolute_ofdm_swing_idx[RF90_PATH_B]); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1632 …"============================= [Path-%c]Calculating PowerIndexOffset =============================… in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1633 (p == RF90_PATH_A ? 'A' : 'B')); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1635 if (rtldm->delta_power_index[p] == in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1636 rtldm->delta_power_index_last[p]) in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1639 rtldm->power_index_offset[p] = 0; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1641 rtldm->power_index_offset[p] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1642 rtldm->delta_power_index[p] - in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1643 rtldm->delta_power_index_last[p]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1648 "[Path-%c] PowerIndexOffset(%d) =DeltaPowerIndex(%d) -DeltaPowerIndexLast(%d)\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1649 (p == RF90_PATH_A ? 'A' : 'B'), in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1650 rtldm->power_index_offset[p], in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1651 rtldm->delta_power_index[p], in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1652 rtldm->delta_power_index_last[p]); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1654 rtldm->ofdm_index[p] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1655 rtldm->swing_idx_ofdm_base[p] + in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1656 rtldm->power_index_offset[p]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1657 rtldm->cck_index = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1658 rtldm->swing_idx_cck_base + in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1659 rtldm->power_index_offset[p]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1661 rtldm->swing_idx_cck = rtldm->cck_index; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1662 rtldm->swing_idx_ofdm[p] = rtldm->ofdm_index[p]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1667 "The 'CCK' final index(%d) = BaseIndex(%d) + PowerIndexOffset(%d)\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1668 rtldm->swing_idx_cck, in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1669 rtldm->swing_idx_cck_base, in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1670 rtldm->power_index_offset[p]); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1672 "The 'OFDM' final index(%d) = BaseIndex[%c](%d) + PowerIndexOffset(%d)\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1673 rtldm->swing_idx_ofdm[p], in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1674 (p == RF90_PATH_A ? 'A' : 'B'), in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1675 rtldm->swing_idx_ofdm_base[p], in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1676 rtldm->power_index_offset[p]); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1680 if (rtldm->ofdm_index[p] > TXSCALE_TABLE_SIZE - 1) in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1681 rtldm->ofdm_index[p] = TXSCALE_TABLE_SIZE - 1; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1682 else if (rtldm->ofdm_index[p] < ofdm_min_index) in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1683 rtldm->ofdm_index[p] = ofdm_min_index; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1687 if (rtldm->cck_index > TXSCALE_TABLE_SIZE - 1) in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1688 rtldm->cck_index = TXSCALE_TABLE_SIZE - 1; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1689 else if (rtldm->cck_index < 0) in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1690 rtldm->cck_index = 0; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1693 … meter is unchanged or TxPowerTracking OFF(%d): ThermalValue: %d , pDM_Odm->RFCalibrateInfo.Therma… in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1694 rtldm->txpower_track_control, in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1696 rtldm->thermalvalue); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1699 rtldm->power_index_offset[p] = 0; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1703 "TxPowerTracking: [CCK] Swing Current Index: %d,Swing Base Index: %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1704 rtldm->cck_index, rtldm->swing_idx_cck_base); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1707 "TxPowerTracking: [OFDM] Swing Current Index: %d,Swing Base Index[%c]: %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1708 rtldm->ofdm_index[p], in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1709 (p == RF90_PATH_A ? 'A' : 'B'), in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1710 rtldm->swing_idx_ofdm_base[p]); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1713 if ((rtldm->power_index_offset[RF90_PATH_A] != 0 || in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1714 rtldm->power_index_offset[RF90_PATH_B] != 0) && in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1715 rtldm->txpower_track_control) { in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1726 if (thermal_value > rtldm->thermalvalue) { in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1728 "Temperature Increasing(A): delta_pi: %d , delta_t: %d, Now_t: %d,EFUSE_t: %d, Last_t: %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1729 rtldm->power_index_offset[RF90_PATH_A], in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1731 rtlefuse->eeprom_thermalmeter, in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1732 rtldm->thermalvalue); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1735 "Temperature Increasing(B): delta_pi: %d ,delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1736 rtldm->power_index_offset[RF90_PATH_B], in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1738 rtlefuse->eeprom_thermalmeter, in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1739 rtldm->thermalvalue); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1740 } else if (thermal_value < rtldm->thermalvalue) { /*Low temperature*/ in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1742 "Temperature Decreasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1743 rtldm->power_index_offset[RF90_PATH_A], in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1745 rtlefuse->eeprom_thermalmeter, in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1746 rtldm->thermalvalue); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1749 "Temperature Decreasing(B): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1750 rtldm->power_index_offset[RF90_PATH_B], in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1752 rtlefuse->eeprom_thermalmeter, in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1753 rtldm->thermalvalue); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1756 if (thermal_value > rtlefuse->eeprom_thermalmeter) { in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1758 "Temperature(%d) higher than PG value(%d)\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1759 thermal_value, rtlefuse->eeprom_thermalmeter); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1765 p, 0); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1768 "Temperature(%d) lower than PG value(%d)\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1769 thermal_value, rtlefuse->eeprom_thermalmeter); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1778 rtldm->swing_idx_cck_base = rtldm->swing_idx_cck; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1780 rtldm->swing_idx_ofdm_base[p] = in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1781 rtldm->swing_idx_ofdm[p]; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1784 "pDM_Odm->RFCalibrateInfo.ThermalValue =%d ThermalValue= %d\n", in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1785 rtldm->thermalvalue, thermal_value); in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1787 rtldm->thermalvalue = thermal_value; in rtl8812ae_dm_txpower_tracking_callback_thermalmeter()
1803 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_get_delta_swing_table()
1805 u8 channel = rtlphy->current_channel; in rtl8821ae_get_delta_swing_table()
1806 u8 rate = rtldm->tx_rate; in rtl8821ae_get_delta_swing_table()
1817 *up_a = rtl8821ae_delta_swing_table_idx_5ga_p[0]; in rtl8821ae_get_delta_swing_table()
1818 *down_a = rtl8821ae_delta_swing_table_idx_5ga_n[0]; in rtl8821ae_get_delta_swing_table()
1832 /*-----------------------------------------------------------------------------
1846 * 04/23/2012 MHC Create Version 0.
1848 *---------------------------------------------------------------------------
1856 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_dm_txpwr_track_set_pwr()
1859 u8 tx_rate = 0xFF; in rtl8821ae_dm_txpwr_track_set_pwr()
1860 s8 final_ofdm_swing_index = 0; in rtl8821ae_dm_txpwr_track_set_pwr()
1862 if (rtldm->tx_rate != 0xFF) in rtl8821ae_dm_txpwr_track_set_pwr()
1863 tx_rate = rtl8821ae_hw_rate_to_mrate(hw, rtldm->tx_rate); in rtl8821ae_dm_txpwr_track_set_pwr()
1867 if (tx_rate != 0xFF) { /* Mimic Modify High Rate BBSwing Limit.*/ in rtl8821ae_dm_txpwr_track_set_pwr()
1902 pwr_tracking_limit = 24; /*+0dB*/ in rtl8821ae_dm_txpwr_track_set_pwr()
1904 pwr_tracking_limit = 22; /*-1dB*/ in rtl8821ae_dm_txpwr_track_set_pwr()
1909 "TxRate=0x%x, PwrTrackingLimit=%d\n", in rtl8821ae_dm_txpwr_track_set_pwr()
1917 (rtldm->ofdm_index[RF90_PATH_A] > in rtl8821ae_dm_txpwr_track_set_pwr()
1920 rtldm->ofdm_index[RF90_PATH_A]; in rtl8821ae_dm_txpwr_track_set_pwr()
1922 …"pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_A]=%d,pDM_Odm->RealBbSwingIdx[ODM_RF_PATH_A]=%d\n… in rtl8821ae_dm_txpwr_track_set_pwr()
1923 rtldm->ofdm_index[RF90_PATH_A], in rtl8821ae_dm_txpwr_track_set_pwr()
1926 rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, in rtl8821ae_dm_txpwr_track_set_pwr()
1931 "pDM_Odm->DefaultOfdmIndex=%d,pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n", in rtl8821ae_dm_txpwr_track_set_pwr()
1932 rtldm->default_ofdm_index, in rtl8821ae_dm_txpwr_track_set_pwr()
1933 rtldm->absolute_ofdm_swing_idx[rf_path], in rtl8821ae_dm_txpwr_track_set_pwr()
1937 rtldm->default_ofdm_index + in rtl8821ae_dm_txpwr_track_set_pwr()
1938 rtldm->absolute_ofdm_swing_idx[rf_path]; in rtl8821ae_dm_txpwr_track_set_pwr()
1942 rtldm->remnant_cck_idx = in rtl8821ae_dm_txpwr_track_set_pwr()
1943 final_ofdm_swing_index - in rtl8821ae_dm_txpwr_track_set_pwr()
1945 /* CCK Follow the same compensate value as Path A*/ in rtl8821ae_dm_txpwr_track_set_pwr()
1946 rtldm->remnant_ofdm_swing_idx[rf_path] = in rtl8821ae_dm_txpwr_track_set_pwr()
1947 final_ofdm_swing_index - in rtl8821ae_dm_txpwr_track_set_pwr()
1951 0xFFE00000, in rtl8821ae_dm_txpwr_track_set_pwr()
1954 rtldm->modify_txagc_flag_path_a = true; in rtl8821ae_dm_txpwr_track_set_pwr()
1958 rtlphy->current_channel, in rtl8821ae_dm_txpwr_track_set_pwr()
1962 " ******Path_A Over BBSwing Limit , PwrTrackingLimit = %d , Remnant TxAGC Value = %d\n", in rtl8821ae_dm_txpwr_track_set_pwr()
1964 rtldm->remnant_ofdm_swing_idx[rf_path]); in rtl8821ae_dm_txpwr_track_set_pwr()
1965 } else if (final_ofdm_swing_index < 0) { in rtl8821ae_dm_txpwr_track_set_pwr()
1966 rtldm->remnant_cck_idx = final_ofdm_swing_index; in rtl8821ae_dm_txpwr_track_set_pwr()
1967 /* CCK Follow the same compensate value as Path A*/ in rtl8821ae_dm_txpwr_track_set_pwr()
1968 rtldm->remnant_ofdm_swing_idx[rf_path] = in rtl8821ae_dm_txpwr_track_set_pwr()
1971 rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, in rtl8821ae_dm_txpwr_track_set_pwr()
1972 txscaling_tbl[0]); in rtl8821ae_dm_txpwr_track_set_pwr()
1974 rtldm->modify_txagc_flag_path_a = true; in rtl8821ae_dm_txpwr_track_set_pwr()
1978 rtlphy->current_channel, RF90_PATH_A); in rtl8821ae_dm_txpwr_track_set_pwr()
1981 "******Path_A Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", in rtl8821ae_dm_txpwr_track_set_pwr()
1982 rtldm->remnant_ofdm_swing_idx[rf_path]); in rtl8821ae_dm_txpwr_track_set_pwr()
1984 rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, in rtl8821ae_dm_txpwr_track_set_pwr()
1988 "******Path_A Compensate with BBSwing ,Final_OFDM_Swing_Index = %d\n", in rtl8821ae_dm_txpwr_track_set_pwr()
1991 if (rtldm->modify_txagc_flag_path_a) { in rtl8821ae_dm_txpwr_track_set_pwr()
1992 rtldm->remnant_cck_idx = 0; in rtl8821ae_dm_txpwr_track_set_pwr()
1993 rtldm->remnant_ofdm_swing_idx[rf_path] = 0; in rtl8821ae_dm_txpwr_track_set_pwr()
1997 rtlphy->current_channel, RF90_PATH_A); in rtl8821ae_dm_txpwr_track_set_pwr()
1999 rtldm->modify_txagc_flag_path_a = false; in rtl8821ae_dm_txpwr_track_set_pwr()
2003 "******Path_A pDM_Odm->Modify_TxAGC_Flag= FALSE\n"); in rtl8821ae_dm_txpwr_track_set_pwr()
2019 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2021 u8 thermal_value = 0, delta, delta_lck, delta_iqk, p = 0, i = 0; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2022 u8 thermal_value_avg_count = 0; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2023 u32 thermal_value_avg = 0; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2026 /* GetRightChnlPlaceforIQK(pHalData->CurrentChannel)*/ in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2027 u8 index_for_channel = 0; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2040 rtldm->txpower_trackinginit = true; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2043 …"===>%s,\n pDM_Odm->BbSwingIdxCckBase: %d,pDM_Odm->BbSwingIdxOfdmBase[A]:%d, pDM_Odm->DefaultOfdmI… in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2045 rtldm->swing_idx_cck_base, in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2046 rtldm->swing_idx_ofdm_base[RF90_PATH_A], in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2047 rtldm->default_ofdm_index); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2048 /*0x42: RF Reg[15:10] 88E*/ in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2050 RF90_PATH_A, RF_T_METER_8812A, 0xfc00); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2051 if (!rtldm->txpower_track_control || in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2052 rtlefuse->eeprom_thermalmeter == 0 || in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2053 rtlefuse->eeprom_thermalmeter == 0xFF) in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2058 if (rtlhal->reloadtxpowerindex) { in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2064 rtldm->thermalvalue_avg[rtldm->thermalvalue_avg_index] = thermal_value; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2065 rtldm->thermalvalue_avg_index++; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2066 if (rtldm->thermalvalue_avg_index == AVG_THERMAL_NUM_8812A) in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2068 rtldm->thermalvalue_avg_index = 0; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2070 for (i = 0; i < AVG_THERMAL_NUM_8812A; i++) { in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2071 if (rtldm->thermalvalue_avg[i]) { in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2072 thermal_value_avg += rtldm->thermalvalue_avg[i]; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2081 "AVG Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2082 thermal_value, rtlefuse->eeprom_thermalmeter); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2089 delta = (thermal_value > rtldm->thermalvalue) ? in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2090 (thermal_value - rtldm->thermalvalue) : in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2091 (rtldm->thermalvalue - thermal_value); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2092 delta_lck = (thermal_value > rtldm->thermalvalue_lck) ? in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2093 (thermal_value - rtldm->thermalvalue_lck) : in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2094 (rtldm->thermalvalue_lck - thermal_value); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2095 delta_iqk = (thermal_value > rtldm->thermalvalue_iqk) ? in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2096 (thermal_value - rtldm->thermalvalue_iqk) : in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2097 (rtldm->thermalvalue_iqk - thermal_value); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2100 "(delta, delta_LCK, delta_IQK) = (%d, %d, %d)\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2107 "delta_LCK(%d) >= Threshold_IQK(%d)\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2109 rtldm->thermalvalue_lck = thermal_value; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2115 if (delta > 0 && rtldm->txpower_track_control) { in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2119 delta = thermal_value > rtlefuse->eeprom_thermalmeter ? in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2120 (thermal_value - rtlefuse->eeprom_thermalmeter) : in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2121 (rtlefuse->eeprom_thermalmeter - thermal_value); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2124 delta = TXSCALE_TABLE_SIZE - 1; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2128 if (thermal_value > rtlefuse->eeprom_thermalmeter) { in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2130 "delta_swing_table_idx_tup_a[%d] = %d\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2132 rtldm->delta_power_index_last[RF90_PATH_A] = in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2133 rtldm->delta_power_index[RF90_PATH_A]; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2134 rtldm->delta_power_index[RF90_PATH_A] = in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2137 rtldm->absolute_ofdm_swing_idx[RF90_PATH_A] = in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2142 "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2143 rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2146 "delta_swing_table_idx_tdown_a[%d] = %d\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2149 rtldm->delta_power_index_last[RF90_PATH_A] = in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2150 rtldm->delta_power_index[RF90_PATH_A]; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2151 rtldm->delta_power_index[RF90_PATH_A] = in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2152 -1 * delta_swing_table_idx_tdown_a[delta]; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2154 rtldm->absolute_ofdm_swing_idx[RF90_PATH_A] = in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2155 -1 * delta_swing_table_idx_tdown_a[delta]; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2158 "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2159 rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2164 …"\n\n================================ [Path-%c]Calculating PowerIndexOffset ======================… in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2165 (p == RF90_PATH_A ? 'A' : 'B')); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2169 if (rtldm->delta_power_index[p] == in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2170 rtldm->delta_power_index_last[p]) in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2172 rtldm->power_index_offset[p] = 0; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2174 rtldm->power_index_offset[p] = in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2175 rtldm->delta_power_index[p] - in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2176 rtldm->delta_power_index_last[p]; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2180 "[Path-%c] PowerIndexOffset(%d) = DeltaPowerIndex(%d) - DeltaPowerIndexLast(%d)\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2181 (p == RF90_PATH_A ? 'A' : 'B'), in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2182 rtldm->power_index_offset[p], in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2183 rtldm->delta_power_index[p] , in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2184 rtldm->delta_power_index_last[p]); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2186 rtldm->ofdm_index[p] = in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2187 rtldm->swing_idx_ofdm_base[p] + in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2188 rtldm->power_index_offset[p]; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2189 rtldm->cck_index = in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2190 rtldm->swing_idx_cck_base + in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2191 rtldm->power_index_offset[p]; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2193 rtldm->swing_idx_cck = rtldm->cck_index; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2194 rtldm->swing_idx_ofdm[p] = rtldm->ofdm_index[p]; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2199 "The 'CCK' final index(%d) = BaseIndex(%d) + PowerIndexOffset(%d)\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2200 rtldm->swing_idx_cck, in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2201 rtldm->swing_idx_cck_base, in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2202 rtldm->power_index_offset[p]); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2204 "The 'OFDM' final index(%d) = BaseIndex[%c](%d) + PowerIndexOffset(%d)\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2205 rtldm->swing_idx_ofdm[p], in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2206 (p == RF90_PATH_A ? 'A' : 'B'), in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2207 rtldm->swing_idx_ofdm_base[p], in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2208 rtldm->power_index_offset[p]); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2212 if (rtldm->ofdm_index[p] > TXSCALE_TABLE_SIZE - 1) in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2213 rtldm->ofdm_index[p] = TXSCALE_TABLE_SIZE - 1; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2214 else if (rtldm->ofdm_index[p] < ofdm_min_index) in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2215 rtldm->ofdm_index[p] = ofdm_min_index; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2219 if (rtldm->cck_index > TXSCALE_TABLE_SIZE - 1) in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2220 rtldm->cck_index = TXSCALE_TABLE_SIZE - 1; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2221 else if (rtldm->cck_index < 0) in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2222 rtldm->cck_index = 0; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2225 …l meter is unchanged or TxPowerTracking OFF(%d):ThermalValue: %d , pDM_Odm->RFCalibrateInfo.Therma… in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2226 rtldm->txpower_track_control, in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2228 rtldm->thermalvalue); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2231 rtldm->power_index_offset[p] = 0; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2234 "TxPowerTracking: [CCK] Swing Current Index: %d, Swing Base Index: %d\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2236 rtldm->cck_index, rtldm->swing_idx_cck_base); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2239 "TxPowerTracking: [OFDM] Swing Current Index: %d, Swing Base Index[%c]: %d\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2240 rtldm->ofdm_index[p], in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2241 (p == RF90_PATH_A ? 'A' : 'B'), in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2242 rtldm->swing_idx_ofdm_base[p]); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2245 if ((rtldm->power_index_offset[RF90_PATH_A] != 0 || in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2246 rtldm->power_index_offset[RF90_PATH_B] != 0) && in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2247 rtldm->txpower_track_control) { in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2258 if (thermal_value > rtldm->thermalvalue) { in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2260 "Temperature Increasing(A): delta_pi: %d , delta_t: %d,Now_t: %d, EFUSE_t: %d, Last_t: %d\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2261 rtldm->power_index_offset[RF90_PATH_A], in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2263 rtlefuse->eeprom_thermalmeter, in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2264 rtldm->thermalvalue); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2265 } else if (thermal_value < rtldm->thermalvalue) { /*Low temperature*/ in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2267 "Temperature Decreasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2268 rtldm->power_index_offset[RF90_PATH_A], in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2270 rtlefuse->eeprom_thermalmeter, in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2271 rtldm->thermalvalue); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2274 if (thermal_value > rtlefuse->eeprom_thermalmeter) { in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2276 "Temperature(%d) higher than PG value(%d)\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2277 thermal_value, rtlefuse->eeprom_thermalmeter); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2286 "Temperature(%d) lower than PG value(%d)\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2287 thermal_value, rtlefuse->eeprom_thermalmeter); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2296 rtldm->swing_idx_cck_base = rtldm->swing_idx_cck; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2298 rtldm->swing_idx_ofdm_base[p] = rtldm->swing_idx_ofdm[p]; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2301 "pDM_Odm->RFCalibrateInfo.ThermalValue = %d ThermalValue= %d\n", in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2302 rtldm->thermalvalue, thermal_value); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2304 rtldm->thermalvalue = thermal_value; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2310 if (!rtlphy->lck_inprogress) { in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2311 spin_lock(&rtlpriv->locks.iqk_lock); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2312 rtlphy->lck_inprogress = true; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2313 spin_unlock(&rtlpriv->locks.iqk_lock); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2317 spin_lock(&rtlpriv->locks.iqk_lock); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2318 rtlphy->lck_inprogress = false; in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2319 spin_unlock(&rtlpriv->locks.iqk_lock); in rtl8821ae_dm_txpower_tracking_callback_thermalmeter()
2329 if (!rtlpriv->dm.tm_trigger) { in rtl8821ae_dm_check_txpower_tracking_thermalmeter()
2331 0x03); in rtl8821ae_dm_check_txpower_tracking_thermalmeter()
2334 rtlpriv->dm.tm_trigger = 1; in rtl8821ae_dm_check_txpower_tracking_thermalmeter()
2341 rtlpriv->dm.tm_trigger = 0; in rtl8821ae_dm_check_txpower_tracking_thermalmeter()
2350 struct rate_adaptive *p_ra = &rtlpriv->ra; in rtl8821ae_dm_refresh_rate_adaptive_mask()
2351 u32 low_rssithresh_for_ra = p_ra->low2high_rssi_thresh_for_ra40m; in rtl8821ae_dm_refresh_rate_adaptive_mask()
2352 u32 high_rssithresh_for_ra = p_ra->high_rssi_thresh_for_ra; in rtl8821ae_dm_refresh_rate_adaptive_mask()
2362 if (!rtlpriv->dm.useramask) { in rtl8821ae_dm_refresh_rate_adaptive_mask()
2368 if (mac->link_state == MAC80211_LINKED && in rtl8821ae_dm_refresh_rate_adaptive_mask()
2369 mac->opmode == NL80211_IFTYPE_STATION) { in rtl8821ae_dm_refresh_rate_adaptive_mask()
2370 switch (p_ra->pre_ratr_state) { in rtl8821ae_dm_refresh_rate_adaptive_mask()
2382 if (rtlpriv->dm.undec_sm_pwdb > in rtl8821ae_dm_refresh_rate_adaptive_mask()
2384 p_ra->ratr_state = DM_RATR_STA_HIGH; in rtl8821ae_dm_refresh_rate_adaptive_mask()
2385 else if (rtlpriv->dm.undec_sm_pwdb > in rtl8821ae_dm_refresh_rate_adaptive_mask()
2387 p_ra->ratr_state = DM_RATR_STA_MIDDLE; in rtl8821ae_dm_refresh_rate_adaptive_mask()
2389 p_ra->ratr_state = DM_RATR_STA_LOW; in rtl8821ae_dm_refresh_rate_adaptive_mask()
2391 if (p_ra->pre_ratr_state != p_ra->ratr_state) { in rtl8821ae_dm_refresh_rate_adaptive_mask()
2394 rtlpriv->dm.undec_sm_pwdb); in rtl8821ae_dm_refresh_rate_adaptive_mask()
2396 "RSSI_LEVEL = %d\n", p_ra->ratr_state); in rtl8821ae_dm_refresh_rate_adaptive_mask()
2398 "PreState = %d, CurState = %d\n", in rtl8821ae_dm_refresh_rate_adaptive_mask()
2399 p_ra->pre_ratr_state, p_ra->ratr_state); in rtl8821ae_dm_refresh_rate_adaptive_mask()
2402 sta = rtl_find_sta(hw, mac->bssid); in rtl8821ae_dm_refresh_rate_adaptive_mask()
2404 rtlpriv->cfg->ops->update_rate_tbl(hw, in rtl8821ae_dm_refresh_rate_adaptive_mask()
2405 sta, p_ra->ratr_state, true); in rtl8821ae_dm_refresh_rate_adaptive_mask()
2408 p_ra->pre_ratr_state = p_ra->ratr_state; in rtl8821ae_dm_refresh_rate_adaptive_mask()
2416 struct dig_t *dm_digtable = &rtlpriv->dm_digtable; in rtl8821ae_dm_refresh_basic_rate_mask()
2417 struct rtl_mac *mac = &rtlpriv->mac80211; in rtl8821ae_dm_refresh_basic_rate_mask()
2419 u8 cur_stage = 0; in rtl8821ae_dm_refresh_basic_rate_mask()
2422 if (mac->link_state < MAC80211_LINKED) in rtl8821ae_dm_refresh_basic_rate_mask()
2423 cur_stage = 0; in rtl8821ae_dm_refresh_basic_rate_mask()
2424 else if (dm_digtable->rssi_val_min < 25) in rtl8821ae_dm_refresh_basic_rate_mask()
2426 else if (dm_digtable->rssi_val_min > 30) in rtl8821ae_dm_refresh_basic_rate_mask()
2433 basic_rate &= (!(basic_rate ^ mac->basic_rates)); in rtl8821ae_dm_refresh_basic_rate_mask()
2434 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_dm_refresh_basic_rate_mask()
2437 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_dm_refresh_basic_rate_mask()
2438 HW_VAR_BASIC_RATE, (u8 *)&mac->basic_rates); in rtl8821ae_dm_refresh_basic_rate_mask()
2481 /*Keep past Tx/Rx packet count for RT-to-RT EDCA turbo.*/ in rtl8821ae_dm_check_edca_turbo()
2482 u64 cur_tx_ok_cnt = 0; in rtl8821ae_dm_check_edca_turbo()
2483 u64 cur_rx_ok_cnt = 0; in rtl8821ae_dm_check_edca_turbo()
2484 u32 edca_be_ul = 0x5ea42b; in rtl8821ae_dm_check_edca_turbo()
2485 u32 edca_be_dl = 0x5ea42b; in rtl8821ae_dm_check_edca_turbo()
2486 u32 edca_be = 0x5ea42b; in rtl8821ae_dm_check_edca_turbo()
2487 u8 iot_peer = 0; in rtl8821ae_dm_check_edca_turbo()
2495 "Original BE PARAM: 0x%x\n", in rtl8821ae_dm_check_edca_turbo()
2498 if (rtlpriv->dm.dbginfo.num_non_be_pkt > 0x100) in rtl8821ae_dm_check_edca_turbo()
2499 rtlpriv->dm.is_any_nonbepkts = true; in rtl8821ae_dm_check_edca_turbo()
2500 rtlpriv->dm.dbginfo.num_non_be_pkt = 0; in rtl8821ae_dm_check_edca_turbo()
2506 pb_is_cur_rdl_state = &rtlpriv->dm.is_cur_rdlstate; in rtl8821ae_dm_check_edca_turbo()
2508 cur_tx_ok_cnt = rtlpriv->stats.txbytesunicast - rtldm->last_tx_ok_cnt; in rtl8821ae_dm_check_edca_turbo()
2509 cur_rx_ok_cnt = rtlpriv->stats.rxbytesunicast - rtldm->last_rx_ok_cnt; in rtl8821ae_dm_check_edca_turbo()
2511 rtldm->last_tx_ok_cnt = rtlpriv->stats.txbytesunicast; in rtl8821ae_dm_check_edca_turbo()
2512 rtldm->last_rx_ok_cnt = rtlpriv->stats.rxbytesunicast; in rtl8821ae_dm_check_edca_turbo()
2514 iot_peer = rtlpriv->mac80211.vendor; in rtl8821ae_dm_check_edca_turbo()
2516 b_edca_turbo_on = ((!rtlpriv->dm.is_any_nonbepkts) && in rtl8821ae_dm_check_edca_turbo()
2517 (!rtlpriv->dm.disable_framebursting)) ? in rtl8821ae_dm_check_edca_turbo()
2520 if (rtlpriv->rtlhal.hw_type != HARDWARE_TYPE_RTL8812AE) { in rtl8821ae_dm_check_edca_turbo()
2522 (mac->mode == WIRELESS_MODE_N_24G)) { in rtl8821ae_dm_check_edca_turbo()
2529 "bIsAnyNonBEPkts : 0x%x bDisableFrameBursting : 0x%x\n", in rtl8821ae_dm_check_edca_turbo()
2530 rtlpriv->dm.is_any_nonbepkts, in rtl8821ae_dm_check_edca_turbo()
2531 rtlpriv->dm.disable_framebursting); in rtl8821ae_dm_check_edca_turbo()
2534 "bEdcaTurboOn : 0x%x bBiasOnRx : 0x%x\n", in rtl8821ae_dm_check_edca_turbo()
2539 "curTxOkCnt : 0x%llx\n", cur_tx_ok_cnt); in rtl8821ae_dm_check_edca_turbo()
2541 "curRxOkCnt : 0x%llx\n", cur_rx_ok_cnt); in rtl8821ae_dm_check_edca_turbo()
2554 "EDCA Turbo on: EDCA_BE:0x%x\n", edca_be); in rtl8821ae_dm_check_edca_turbo()
2556 rtlpriv->dm.current_turbo_edca = true; in rtl8821ae_dm_check_edca_turbo()
2559 "EDCA_BE_DL : 0x%x EDCA_BE_UL : 0x%x EDCA_BE : 0x%x\n", in rtl8821ae_dm_check_edca_turbo()
2562 if (rtlpriv->dm.current_turbo_edca) { in rtl8821ae_dm_check_edca_turbo()
2564 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM, in rtl8821ae_dm_check_edca_turbo()
2567 rtlpriv->dm.current_turbo_edca = false; in rtl8821ae_dm_check_edca_turbo()
2570 rtlpriv->dm.is_any_nonbepkts = false; in rtl8821ae_dm_check_edca_turbo()
2571 rtldm->last_tx_ok_cnt = rtlpriv->stats.txbytesunicast; in rtl8821ae_dm_check_edca_turbo()
2572 rtldm->last_rx_ok_cnt = rtlpriv->stats.rxbytesunicast; in rtl8821ae_dm_check_edca_turbo()
2578 struct dig_t *dm_digtable = &rtlpriv->dm_digtable; in rtl8821ae_dm_cck_packet_detection_thresh()
2581 if (rtlpriv->mac80211.link_state >= MAC80211_LINKED) { in rtl8821ae_dm_cck_packet_detection_thresh()
2582 if (dm_digtable->rssi_val_min > 25) { in rtl8821ae_dm_cck_packet_detection_thresh()
2583 cur_cck_cca_thresh = 0xcd; in rtl8821ae_dm_cck_packet_detection_thresh()
2584 } else if ((dm_digtable->rssi_val_min <= 25) && in rtl8821ae_dm_cck_packet_detection_thresh()
2585 (dm_digtable->rssi_val_min > 10)) { in rtl8821ae_dm_cck_packet_detection_thresh()
2586 cur_cck_cca_thresh = 0x83; in rtl8821ae_dm_cck_packet_detection_thresh()
2588 if (rtlpriv->falsealm_cnt.cnt_cck_fail > 1000) in rtl8821ae_dm_cck_packet_detection_thresh()
2589 cur_cck_cca_thresh = 0x83; in rtl8821ae_dm_cck_packet_detection_thresh()
2591 cur_cck_cca_thresh = 0x40; in rtl8821ae_dm_cck_packet_detection_thresh()
2594 if (rtlpriv->falsealm_cnt.cnt_cck_fail > 1000) in rtl8821ae_dm_cck_packet_detection_thresh()
2595 cur_cck_cca_thresh = 0x83; in rtl8821ae_dm_cck_packet_detection_thresh()
2597 cur_cck_cca_thresh = 0x40; in rtl8821ae_dm_cck_packet_detection_thresh()
2600 if (dm_digtable->cur_cck_cca_thres != cur_cck_cca_thresh) in rtl8821ae_dm_cck_packet_detection_thresh()
2604 dm_digtable->pre_cck_cca_thres = dm_digtable->cur_cck_cca_thres; in rtl8821ae_dm_cck_packet_detection_thresh()
2605 dm_digtable->cur_cck_cca_thres = cur_cck_cca_thresh; in rtl8821ae_dm_cck_packet_detection_thresh()
2607 "CCK cca thresh hold =%x\n", dm_digtable->cur_cck_cca_thres); in rtl8821ae_dm_cck_packet_detection_thresh()
2616 int cfo_khz_a, cfo_khz_b, cfo_ave = 0, adjust_xtal = 0; in rtl8821ae_dm_dynamic_atc_switch()
2619 if (rtlpriv->mac80211.link_state < MAC80211_LINKED) { in rtl8821ae_dm_dynamic_atc_switch()
2621 if (rtldm->atc_status == ATC_STATUS_OFF) { in rtl8821ae_dm_dynamic_atc_switch()
2623 rtldm->atc_status = ATC_STATUS_ON; in rtl8821ae_dm_dynamic_atc_switch()
2628 "atc_status = %d\n", rtldm->atc_status); in rtl8821ae_dm_dynamic_atc_switch()
2630 if (rtldm->crystal_cap != rtlpriv->efuse.crystalcap) { in rtl8821ae_dm_dynamic_atc_switch()
2631 rtldm->crystal_cap = rtlpriv->efuse.crystalcap; in rtl8821ae_dm_dynamic_atc_switch()
2632 crystal_cap = rtldm->crystal_cap & 0x3f; in rtl8821ae_dm_dynamic_atc_switch()
2633 crystal_cap = crystal_cap & 0x3f; in rtl8821ae_dm_dynamic_atc_switch()
2634 if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8812AE) in rtl8821ae_dm_dynamic_atc_switch()
2636 0x7ff80000, (crystal_cap | in rtl8821ae_dm_dynamic_atc_switch()
2640 0xfff000, (crystal_cap | in rtl8821ae_dm_dynamic_atc_switch()
2643 rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "crystal_cap = 0x%x\n", in rtl8821ae_dm_dynamic_atc_switch()
2644 rtldm->crystal_cap); in rtl8821ae_dm_dynamic_atc_switch()
2646 /*1. Calculate CFO for path-A & path-B*/ in rtl8821ae_dm_dynamic_atc_switch()
2647 cfo_khz_a = (int)(rtldm->cfo_tail[0] * 3125) / 1280; in rtl8821ae_dm_dynamic_atc_switch()
2648 cfo_khz_b = (int)(rtldm->cfo_tail[1] * 3125) / 1280; in rtl8821ae_dm_dynamic_atc_switch()
2649 packet_count = rtldm->packet_count; in rtl8821ae_dm_dynamic_atc_switch()
2652 if (packet_count == rtldm->packet_count_pre) { in rtl8821ae_dm_dynamic_atc_switch()
2658 rtldm->packet_count_pre = packet_count; in rtl8821ae_dm_dynamic_atc_switch()
2660 "packet counter = %d\n", in rtl8821ae_dm_dynamic_atc_switch()
2661 rtldm->packet_count); in rtl8821ae_dm_dynamic_atc_switch()
2664 if (rtlpriv->phy.rf_type == RF_1T1R) in rtl8821ae_dm_dynamic_atc_switch()
2674 cfo_ave_diff = (rtldm->cfo_ave_pre >= cfo_ave) ? in rtl8821ae_dm_dynamic_atc_switch()
2675 (rtldm->cfo_ave_pre - cfo_ave) : in rtl8821ae_dm_dynamic_atc_switch()
2676 (cfo_ave - rtldm->cfo_ave_pre); in rtl8821ae_dm_dynamic_atc_switch()
2678 if (cfo_ave_diff > 20 && !rtldm->large_cfo_hit) { in rtl8821ae_dm_dynamic_atc_switch()
2681 rtldm->large_cfo_hit = true; in rtl8821ae_dm_dynamic_atc_switch()
2684 rtldm->large_cfo_hit = false; in rtl8821ae_dm_dynamic_atc_switch()
2686 rtldm->cfo_ave_pre = cfo_ave; in rtl8821ae_dm_dynamic_atc_switch()
2691 if (cfo_ave >= -rtldm->cfo_threshold && in rtl8821ae_dm_dynamic_atc_switch()
2692 cfo_ave <= rtldm->cfo_threshold && in rtl8821ae_dm_dynamic_atc_switch()
2693 rtldm->is_freeze == 0) { in rtl8821ae_dm_dynamic_atc_switch()
2694 if (rtldm->cfo_threshold == CFO_THRESHOLD_XTAL) { in rtl8821ae_dm_dynamic_atc_switch()
2695 rtldm->cfo_threshold = CFO_THRESHOLD_XTAL + 10; in rtl8821ae_dm_dynamic_atc_switch()
2696 rtldm->is_freeze = 1; in rtl8821ae_dm_dynamic_atc_switch()
2698 rtldm->cfo_threshold = CFO_THRESHOLD_XTAL; in rtl8821ae_dm_dynamic_atc_switch()
2702 "Dynamic threshold = %d\n", in rtl8821ae_dm_dynamic_atc_switch()
2703 rtldm->cfo_threshold); in rtl8821ae_dm_dynamic_atc_switch()
2706 if (cfo_ave > rtldm->cfo_threshold && rtldm->crystal_cap < 0x3f) in rtl8821ae_dm_dynamic_atc_switch()
2707 adjust_xtal = ((cfo_ave - CFO_THRESHOLD_XTAL) >> 2) + 1; in rtl8821ae_dm_dynamic_atc_switch()
2708 else if ((cfo_ave < -rtlpriv->dm.cfo_threshold) && in rtl8821ae_dm_dynamic_atc_switch()
2709 rtlpriv->dm.crystal_cap > 0) in rtl8821ae_dm_dynamic_atc_switch()
2710 adjust_xtal = ((cfo_ave + CFO_THRESHOLD_XTAL) >> 2) - 1; in rtl8821ae_dm_dynamic_atc_switch()
2712 "Crystal cap = 0x%x, Crystal cap offset = %d\n", in rtl8821ae_dm_dynamic_atc_switch()
2713 rtldm->crystal_cap, adjust_xtal); in rtl8821ae_dm_dynamic_atc_switch()
2716 if (adjust_xtal != 0) { in rtl8821ae_dm_dynamic_atc_switch()
2717 rtldm->is_freeze = 0; in rtl8821ae_dm_dynamic_atc_switch()
2718 rtldm->crystal_cap += adjust_xtal; in rtl8821ae_dm_dynamic_atc_switch()
2720 if (rtldm->crystal_cap > 0x3f) in rtl8821ae_dm_dynamic_atc_switch()
2721 rtldm->crystal_cap = 0x3f; in rtl8821ae_dm_dynamic_atc_switch()
2722 else if (rtldm->crystal_cap < 0) in rtl8821ae_dm_dynamic_atc_switch()
2723 rtldm->crystal_cap = 0; in rtl8821ae_dm_dynamic_atc_switch()
2725 crystal_cap = rtldm->crystal_cap & 0x3f; in rtl8821ae_dm_dynamic_atc_switch()
2726 crystal_cap = crystal_cap & 0x3f; in rtl8821ae_dm_dynamic_atc_switch()
2727 if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8812AE) in rtl8821ae_dm_dynamic_atc_switch()
2729 0x7ff80000, (crystal_cap | in rtl8821ae_dm_dynamic_atc_switch()
2733 0xfff000, (crystal_cap | in rtl8821ae_dm_dynamic_atc_switch()
2736 "New crystal cap = 0x%x\n", in rtl8821ae_dm_dynamic_atc_switch()
2737 rtldm->crystal_cap); in rtl8821ae_dm_dynamic_atc_switch()
2750 rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_FW_PSMODE_STATUS, in rtl8821ae_dm_watchdog()
2753 rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_FWLPS_RF_ON, in rtl8821ae_dm_watchdog()
2756 if (ppsc->p2p_ps_info.p2p_ps_mode) in rtl8821ae_dm_watchdog()
2759 spin_lock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_dm_watchdog()
2760 if ((ppsc->rfpwr_state == ERFON) && in rtl8821ae_dm_watchdog()
2762 (!ppsc->rfchange_inprogress)) { in rtl8821ae_dm_watchdog()
2772 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in rtl8821ae_dm_watchdog()
2778 spin_unlock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_dm_watchdog()
2780 rtlpriv->dm.dbginfo.num_qry_beacon_pkt = 0; in rtl8821ae_dm_watchdog()
2790 struct fast_ant_training *pfat_table = &rtldm->fat_table; in rtl8821ae_dm_set_tx_ant_by_tx_info()
2793 if (rtlhal->hw_type != HARDWARE_TYPE_RTL8812AE) in rtl8821ae_dm_set_tx_ant_by_tx_info()
2796 if (rtlefuse->antenna_div_type == CG_TRX_HW_ANTDIV) in rtl8821ae_dm_set_tx_ant_by_tx_info()
2797 set_tx_desc_tx_ant(pdesc32, pfat_table->antsel_a[mac_id]); in rtl8821ae_dm_set_tx_ant_by_tx_info()