Lines Matching refs:hw

47 static u32 _rtl8821ae_phy_rf_serial_read(struct ieee80211_hw *hw,
49 static void _rtl8821ae_phy_rf_serial_write(struct ieee80211_hw *hw,
53 static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw);
55 static bool _rtl8821ae_phy_config_mac_with_headerfile(struct ieee80211_hw *hw);
56 static bool _rtl8821ae_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
58 static bool _rtl8821ae_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
60 static void phy_init_bb_rf_register_definition(struct ieee80211_hw *hw);
62 static long _rtl8821ae_phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw,
65 static void rtl8821ae_phy_set_rf_on(struct ieee80211_hw *hw);
66 static void rtl8821ae_phy_set_io(struct ieee80211_hw *hw);
68 static void rtl8812ae_fixspur(struct ieee80211_hw *hw, in rtl8812ae_fixspur() argument
71 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8812ae_fixspur()
76 rtl_set_bbreg(hw, RRFMOD, 0xC00, 0x3); in rtl8812ae_fixspur()
79 rtl_set_bbreg(hw, RRFMOD, 0xC00, 0x2); in rtl8812ae_fixspur()
87 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x3); in rtl8812ae_fixspur()
89 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 1); in rtl8812ae_fixspur()
93 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 1); in rtl8812ae_fixspur()
96 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x2); in rtl8812ae_fixspur()
98 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 0); in rtl8812ae_fixspur()
107 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x3); in rtl8812ae_fixspur()
110 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x2); in rtl8812ae_fixspur()
115 u32 rtl8821ae_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, in rtl8821ae_phy_query_bb_reg() argument
118 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_query_bb_reg()
134 void rtl8821ae_phy_set_bb_reg(struct ieee80211_hw *hw, in rtl8821ae_phy_set_bb_reg() argument
137 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_set_bb_reg()
158 u32 rtl8821ae_phy_query_rf_reg(struct ieee80211_hw *hw, in rtl8821ae_phy_query_rf_reg() argument
162 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_query_rf_reg()
172 original_value = _rtl8821ae_phy_rf_serial_read(hw, rfpath, regaddr); in rtl8821ae_phy_query_rf_reg()
185 void rtl8821ae_phy_set_rf_reg(struct ieee80211_hw *hw, in rtl8821ae_phy_set_rf_reg() argument
189 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_set_rf_reg()
201 _rtl8821ae_phy_rf_serial_read(hw, rfpath, regaddr); in rtl8821ae_phy_set_rf_reg()
206 _rtl8821ae_phy_rf_serial_write(hw, rfpath, regaddr, data); in rtl8821ae_phy_set_rf_reg()
215 static u32 _rtl8821ae_phy_rf_serial_read(struct ieee80211_hw *hw, in _rtl8821ae_phy_rf_serial_read() argument
218 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_rf_serial_read()
219 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_phy_rf_serial_read()
225 if (RT_CANNOT_IO(hw)) { in _rtl8821ae_phy_rf_serial_read()
235 rtl_set_bbreg(hw, RCCAONSEC, 0x8, 1); in _rtl8821ae_phy_rf_serial_read()
239 is_pi_mode = (bool)rtl_get_bbreg(hw, 0xC00, 0x4); in _rtl8821ae_phy_rf_serial_read()
241 is_pi_mode = (bool)rtl_get_bbreg(hw, 0xE00, 0x4); in _rtl8821ae_phy_rf_serial_read()
243 rtl_set_bbreg(hw, RHSSIREAD_8821AE, 0xff, offset); in _rtl8821ae_phy_rf_serial_read()
252 rtl_get_bbreg(hw, RA_PIREAD_8821A, BLSSIREADBACKDATA); in _rtl8821ae_phy_rf_serial_read()
255 rtl_get_bbreg(hw, RB_PIREAD_8821A, BLSSIREADBACKDATA); in _rtl8821ae_phy_rf_serial_read()
259 rtl_get_bbreg(hw, RA_SIREAD_8821A, BLSSIREADBACKDATA); in _rtl8821ae_phy_rf_serial_read()
262 rtl_get_bbreg(hw, RB_SIREAD_8821A, BLSSIREADBACKDATA); in _rtl8821ae_phy_rf_serial_read()
272 rtl_set_bbreg(hw, RCCAONSEC, 0x8, 0); in _rtl8821ae_phy_rf_serial_read()
276 static void _rtl8821ae_phy_rf_serial_write(struct ieee80211_hw *hw, in _rtl8821ae_phy_rf_serial_write() argument
280 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_rf_serial_write()
286 if (RT_CANNOT_IO(hw)) { in _rtl8821ae_phy_rf_serial_write()
294 rtl_set_bbreg(hw, pphyreg->rf3wire_offset, MASKDWORD, data_and_addr); in _rtl8821ae_phy_rf_serial_write()
311 bool rtl8821ae_phy_mac_config(struct ieee80211_hw *hw) in rtl8821ae_phy_mac_config() argument
315 rtstatus = _rtl8821ae_phy_config_mac_with_headerfile(hw); in rtl8821ae_phy_mac_config()
320 bool rtl8821ae_phy_bb_config(struct ieee80211_hw *hw) in rtl8821ae_phy_bb_config() argument
323 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_bb_config()
324 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in rtl8821ae_phy_bb_config()
326 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_phy_bb_config()
330 phy_init_bb_rf_register_definition(hw); in rtl8821ae_phy_bb_config()
341 rtstatus = _rtl8821ae_phy_bb8821a_config_parafile(hw); in rtl8821ae_phy_bb_config()
345 rtl_set_bbreg(hw, REG_MAC_PHY_CTRL, 0x7FF80000, in rtl8821ae_phy_bb_config()
349 rtl_set_bbreg(hw, REG_MAC_PHY_CTRL, 0xFFF000, in rtl8821ae_phy_bb_config()
357 bool rtl8821ae_phy_rf_config(struct ieee80211_hw *hw) in rtl8821ae_phy_rf_config() argument
359 return rtl8821ae_phy_rf6052_config(hw); in rtl8821ae_phy_rf_config()
362 u32 phy_get_tx_swing_8812A(struct ieee80211_hw *hw, u8 band, in phy_get_tx_swing_8812A() argument
365 struct rtl_priv *rtlpriv = rtl_priv(hw); in phy_get_tx_swing_8812A()
366 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in phy_get_tx_swing_8812A()
368 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in phy_get_tx_swing_8812A()
425 efuse_shadow_read(hw, 1, 0xC6, (u32 *)&swing); in phy_get_tx_swing_8812A()
440 efuse_shadow_read(hw, 1, 0xC7, (u32 *)&swing); in phy_get_tx_swing_8812A()
520 void rtl8821ae_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band) in rtl8821ae_phy_switch_wirelessband() argument
522 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_switch_wirelessband()
523 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_phy_switch_wirelessband()
529 txpath = rtl8821ae_phy_query_bb_reg(hw, RTXPATH, 0xf0); in rtl8821ae_phy_switch_wirelessband()
530 rxpath = rtl8821ae_phy_query_bb_reg(hw, RCCK_RX, 0x0f000000); in rtl8821ae_phy_switch_wirelessband()
535 rtl_set_bbreg(hw, ROFDMCCKEN, BOFDMEN|BCCKEN, 0x03); in rtl8821ae_phy_switch_wirelessband()
539 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF000, 0x7); in rtl8821ae_phy_switch_wirelessband()
541 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF0, 0x7); in rtl8821ae_phy_switch_wirelessband()
546 rtl_set_bbreg(hw, 0x834, 0x3, 0x1); in rtl8821ae_phy_switch_wirelessband()
551 rtl_set_bbreg(hw, RA_TXSCALE, 0xF00, 0); in rtl8821ae_phy_switch_wirelessband()
554 rtl_set_bbreg(hw, 0x82c, 0x3, 0); in rtl8821ae_phy_switch_wirelessband()
557 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, in rtl8821ae_phy_switch_wirelessband()
559 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, in rtl8821ae_phy_switch_wirelessband()
561 rtl_set_bbreg(hw, RA_RFE_INV, 0x3ff00000, 0x000); in rtl8821ae_phy_switch_wirelessband()
562 rtl_set_bbreg(hw, RB_RFE_INV, 0x3ff00000, 0x000); in rtl8821ae_phy_switch_wirelessband()
565 rtl_set_bbreg(hw, RTXPATH, 0xf0, 0x1); in rtl8821ae_phy_switch_wirelessband()
566 rtl_set_bbreg(hw, RCCK_RX, 0x0f000000, 0x1); in rtl8821ae_phy_switch_wirelessband()
574 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF000, 0x5); in rtl8821ae_phy_switch_wirelessband()
576 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF0, 0x4); in rtl8821ae_phy_switch_wirelessband()
603 rtl_set_bbreg(hw, ROFDMCCKEN, BOFDMEN|BCCKEN, 0x03); in rtl8821ae_phy_switch_wirelessband()
607 rtl_set_bbreg(hw, 0x834, 0x3, 0x2); in rtl8821ae_phy_switch_wirelessband()
613 rtl_set_bbreg(hw, RA_TXSCALE, 0xF00, 1); in rtl8821ae_phy_switch_wirelessband()
616 rtl_set_bbreg(hw, 0x82c, 0x3, 1); in rtl8821ae_phy_switch_wirelessband()
619 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, in rtl8821ae_phy_switch_wirelessband()
621 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, in rtl8821ae_phy_switch_wirelessband()
623 rtl_set_bbreg(hw, RA_RFE_INV, 0x3ff00000, 0x010); in rtl8821ae_phy_switch_wirelessband()
624 rtl_set_bbreg(hw, RB_RFE_INV, 0x3ff00000, 0x010); in rtl8821ae_phy_switch_wirelessband()
627 rtl_set_bbreg(hw, RTXPATH, 0xf0, 0); in rtl8821ae_phy_switch_wirelessband()
628 rtl_set_bbreg(hw, RCCK_RX, 0x0f000000, 0xf); in rtl8821ae_phy_switch_wirelessband()
638 rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, in rtl8821ae_phy_switch_wirelessband()
639 phy_get_tx_swing_8812A(hw, band, RF90_PATH_A)); in rtl8821ae_phy_switch_wirelessband()
641 rtl_set_bbreg(hw, RB_TXSCALE, 0xFFE00000, in rtl8821ae_phy_switch_wirelessband()
642 phy_get_tx_swing_8812A(hw, band, RF90_PATH_B)); in rtl8821ae_phy_switch_wirelessband()
656 rtl8821ae_dm_clear_txpower_tracking_state(hw); in rtl8821ae_phy_switch_wirelessband()
664 static bool _rtl8821ae_check_condition(struct ieee80211_hw *hw, in _rtl8821ae_check_condition() argument
667 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in _rtl8821ae_check_condition()
692 static void _rtl8821ae_config_rf_reg(struct ieee80211_hw *hw, in _rtl8821ae_config_rf_reg() argument
702 rtl_set_rfreg(hw, rfpath, regaddr, RFREG_OFFSET_MASK, data); in _rtl8821ae_config_rf_reg()
707 static void _rtl8821ae_config_rf_radio_a(struct ieee80211_hw *hw, in _rtl8821ae_config_rf_radio_a() argument
713 _rtl8821ae_config_rf_reg(hw, addr, data, in _rtl8821ae_config_rf_radio_a()
717 static void _rtl8821ae_config_rf_radio_b(struct ieee80211_hw *hw, in _rtl8821ae_config_rf_radio_b() argument
723 _rtl8821ae_config_rf_reg(hw, addr, data, in _rtl8821ae_config_rf_radio_b()
727 static void _rtl8821ae_config_bb_reg(struct ieee80211_hw *hw, in _rtl8821ae_config_bb_reg() argument
743 rtl_set_bbreg(hw, addr, MASKDWORD, data); in _rtl8821ae_config_bb_reg()
748 static void _rtl8821ae_phy_init_tx_power_by_rate(struct ieee80211_hw *hw) in _rtl8821ae_phy_init_tx_power_by_rate() argument
750 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_init_tx_power_by_rate()
764 static void _rtl8821ae_phy_set_txpower_by_rate_base(struct ieee80211_hw *hw, in _rtl8821ae_phy_set_txpower_by_rate_base() argument
769 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_set_txpower_by_rate_base()
833 static u8 _rtl8821ae_phy_get_txpower_by_rate_base(struct ieee80211_hw *hw, in _rtl8821ae_phy_get_txpower_by_rate_base() argument
837 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_get_txpower_by_rate_base()
905 static void _rtl8821ae_phy_store_txpower_by_rate_base(struct ieee80211_hw *hw) in _rtl8821ae_phy_store_txpower_by_rate_base() argument
907 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_store_txpower_by_rate_base()
915 _rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_2_4G, path, CCK, RF_1TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
919 _rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_2_4G, path, OFDM, RF_1TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
923 _rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_2_4G, path, HT_MCS0_MCS7, RF_1TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
927 _rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_2_4G, path, HT_MCS8_MCS15, RF_2TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
931 …_rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_2_4G, path, VHT_1SSMCS0_1SSMCS9, RF_1TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
935 …_rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_2_4G, path, VHT_2SSMCS0_2SSMCS9, RF_2TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
939 _rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_5G, path, OFDM, RF_1TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
943 _rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_5G, path, HT_MCS0_MCS7, RF_1TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
947 _rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_5G, path, HT_MCS8_MCS15, RF_2TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
951 _rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_5G, path, VHT_1SSMCS0_1SSMCS9, RF_1TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
955 _rtl8821ae_phy_set_txpower_by_rate_base(hw, BAND_ON_5G, path, VHT_2SSMCS0_2SSMCS9, RF_2TX, base); in _rtl8821ae_phy_store_txpower_by_rate_base()
984 static void _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit(struct ieee80211_hw *hw) in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit() argument
986 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1025 static u8 _rtl8812ae_phy_get_txpower_by_rate_base_index(struct ieee80211_hw *hw, in _rtl8812ae_phy_get_txpower_by_rate_base_index() argument
1028 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1150 static void _rtl8812ae_phy_convert_txpower_limit_to_power_index(struct ieee80211_hw *hw) in _rtl8812ae_phy_convert_txpower_limit_to_power_index() argument
1152 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1164 _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit(hw); in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1174 _rtl8812ae_phy_get_txpower_by_rate_base_index(hw, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1178 _rtl8812ae_phy_get_txpower_by_rate_base_index(hw, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1182 _rtl8812ae_phy_get_txpower_by_rate_base_index(hw, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1186 _rtl8812ae_phy_get_txpower_by_rate_base_index(hw, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1231 _rtl8812ae_phy_get_txpower_by_rate_base_index(hw, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1235 _rtl8812ae_phy_get_txpower_by_rate_base_index(hw, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1239 _rtl8812ae_phy_get_txpower_by_rate_base_index(hw, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1243 _rtl8812ae_phy_get_txpower_by_rate_base_index(hw, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1247 _rtl8812ae_phy_get_txpower_by_rate_base_index(hw, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1290 static void _rtl8821ae_phy_init_txpower_limit(struct ieee80211_hw *hw) in _rtl8821ae_phy_init_txpower_limit() argument
1292 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_init_txpower_limit()
1322 static void _rtl8821ae_phy_convert_txpower_dbm_to_relative_value(struct ieee80211_hw *hw) in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value() argument
1324 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1329 base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_2_4G, rfPath, RF_1TX, CCK); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1334 base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_2_4G, rfPath, RF_1TX, OFDM); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1342 base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_2_4G, rfPath, RF_1TX, HT_MCS0_MCS7); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1350 base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_2_4G, rfPath, RF_2TX, HT_MCS8_MCS15); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1360 …base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_2_4G, rfPath, RF_1TX, VHT_1SSMCS0_1SSMC… in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1371 …base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_2_4G, rfPath, RF_2TX, VHT_2SSMCS0_2SSMC… in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1382 base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_5G, rfPath, RF_1TX, OFDM); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1390 base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_5G, rfPath, RF_1TX, HT_MCS0_MCS7); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1398 base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_5G, rfPath, RF_2TX, HT_MCS8_MCS15); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1406 …base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_5G, rfPath, RF_1TX, VHT_1SSMCS0_1SSMCS9… in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1417 …base = _rtl8821ae_phy_get_txpower_by_rate_base(hw, BAND_ON_5G, rfPath, RF_2TX, VHT_2SSMCS0_2SSMCS9… in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1433 static void _rtl8821ae_phy_txpower_by_rate_configuration(struct ieee80211_hw *hw) in _rtl8821ae_phy_txpower_by_rate_configuration() argument
1435 _rtl8821ae_phy_store_txpower_by_rate_base(hw); in _rtl8821ae_phy_txpower_by_rate_configuration()
1436 _rtl8821ae_phy_convert_txpower_dbm_to_relative_value(hw); in _rtl8821ae_phy_txpower_by_rate_configuration()
1470 static char _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt(struct ieee80211_hw *hw, in _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt() argument
1473 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt()
1501 static void _rtl8812ae_phy_set_txpower_limit(struct ieee80211_hw *hw, u8 *pregulation, in _rtl8812ae_phy_set_txpower_limit() argument
1506 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8812ae_phy_set_txpower_limit()
1559 ret = _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt(hw, in _rtl8812ae_phy_set_txpower_limit()
1583 ret = _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt(hw, in _rtl8812ae_phy_set_txpower_limit()
1612 static void _rtl8812ae_phy_config_bb_txpwr_lmt(struct ieee80211_hw *hw, in _rtl8812ae_phy_config_bb_txpwr_lmt() argument
1618 _rtl8812ae_phy_set_txpower_limit(hw, regulation, band, bandwidth, in _rtl8812ae_phy_config_bb_txpwr_lmt()
1623 static void _rtl8821ae_phy_read_and_config_txpwr_lmt(struct ieee80211_hw *hw) in _rtl8821ae_phy_read_and_config_txpwr_lmt() argument
1625 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_read_and_config_txpwr_lmt()
1651 _rtl8812ae_phy_config_bb_txpwr_lmt(hw, regulation, band, in _rtl8821ae_phy_read_and_config_txpwr_lmt()
1657 static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw) in _rtl8821ae_phy_bb8821a_config_parafile() argument
1659 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_bb8821a_config_parafile()
1661 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in _rtl8821ae_phy_bb8821a_config_parafile()
1664 _rtl8821ae_phy_init_txpower_limit(hw); in _rtl8821ae_phy_bb8821a_config_parafile()
1668 _rtl8821ae_phy_read_and_config_txpwr_lmt(hw); in _rtl8821ae_phy_bb8821a_config_parafile()
1670 rtstatus = _rtl8821ae_phy_config_bb_with_headerfile(hw, in _rtl8821ae_phy_bb8821a_config_parafile()
1676 _rtl8821ae_phy_init_tx_power_by_rate(hw); in _rtl8821ae_phy_bb8821a_config_parafile()
1678 rtstatus = _rtl8821ae_phy_config_bb_with_pgheaderfile(hw, in _rtl8821ae_phy_bb8821a_config_parafile()
1686 _rtl8821ae_phy_txpower_by_rate_configuration(hw); in _rtl8821ae_phy_bb8821a_config_parafile()
1690 _rtl8812ae_phy_convert_txpower_limit_to_power_index(hw); in _rtl8821ae_phy_bb8821a_config_parafile()
1692 rtstatus = _rtl8821ae_phy_config_bb_with_headerfile(hw, in _rtl8821ae_phy_bb8821a_config_parafile()
1699 rtlphy->cck_high_power = (bool)(rtl_get_bbreg(hw, in _rtl8821ae_phy_bb8821a_config_parafile()
1704 static bool _rtl8821ae_phy_config_mac_with_headerfile(struct ieee80211_hw *hw) in _rtl8821ae_phy_config_mac_with_headerfile() argument
1706 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_config_mac_with_headerfile()
1729 if (!_rtl8821ae_check_condition(hw, v1)) { in _rtl8821ae_phy_config_mac_with_headerfile()
1755 static bool _rtl8821ae_phy_config_bb_with_headerfile(struct ieee80211_hw *hw, in _rtl8821ae_phy_config_bb_with_headerfile() argument
1758 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_config_bb_with_headerfile()
1778 _rtl8821ae_config_bb_reg(hw, v1, v2); in _rtl8821ae_phy_config_bb_with_headerfile()
1781 if (!_rtl8821ae_check_condition(hw, v1)) { in _rtl8821ae_phy_config_bb_with_headerfile()
1799 _rtl8821ae_config_bb_reg(hw, v1, in _rtl8821ae_phy_config_bb_with_headerfile()
1826 rtl_set_bbreg(hw, v1, MASKDWORD, v2); in _rtl8821ae_phy_config_bb_with_headerfile()
1830 if (!_rtl8821ae_check_condition(hw, v1)) { in _rtl8821ae_phy_config_bb_with_headerfile()
1847 rtl_set_bbreg(hw, v1, MASKDWORD, in _rtl8821ae_phy_config_bb_with_headerfile()
1883 static void _rtl8821ae_store_tx_power_by_rate(struct ieee80211_hw *hw, in _rtl8821ae_store_tx_power_by_rate() argument
1888 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_store_tx_power_by_rate()
1911 static bool _rtl8821ae_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw, in _rtl8821ae_phy_config_bb_with_pgheaderfile() argument
1914 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_config_bb_with_pgheaderfile()
1963 _rtl8821ae_store_tx_power_by_rate(hw, v1, v2, v3, in _rtl8821ae_phy_config_bb_with_pgheaderfile()
1968 if (!_rtl8821ae_check_condition(hw, v1)) { in _rtl8821ae_phy_config_bb_with_pgheaderfile()
1986 bool rtl8812ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, in rtl8812ae_phy_config_rf_with_headerfile() argument
1993 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8812ae_phy_config_rf_with_headerfile()
2010 _rtl8821ae_config_rf_radio_a(hw, v1, v2); in rtl8812ae_phy_config_rf_with_headerfile()
2013 if (!_rtl8821ae_check_condition(hw, v1)) { in rtl8812ae_phy_config_rf_with_headerfile()
2027 _rtl8821ae_config_rf_radio_a(hw, v1, v2); in rtl8812ae_phy_config_rf_with_headerfile()
2043 _rtl8821ae_config_rf_radio_b(hw, v1, v2); in rtl8812ae_phy_config_rf_with_headerfile()
2046 if (!_rtl8821ae_check_condition(hw, v1)) { in rtl8812ae_phy_config_rf_with_headerfile()
2060 _rtl8821ae_config_rf_radio_b(hw, v1, v2); in rtl8812ae_phy_config_rf_with_headerfile()
2082 bool rtl8821ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, in rtl8821ae_phy_config_rf_with_headerfile() argument
2097 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_config_rf_with_headerfile()
2113 _rtl8821ae_config_rf_radio_a(hw, v1, v2); in rtl8821ae_phy_config_rf_with_headerfile()
2115 if (!_rtl8821ae_check_condition(hw, v1)) { in rtl8821ae_phy_config_rf_with_headerfile()
2129 _rtl8821ae_config_rf_radio_a(hw, v1, v2); in rtl8821ae_phy_config_rf_with_headerfile()
2156 void rtl8821ae_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw) in rtl8821ae_phy_get_hw_reg_originalvalue() argument
2158 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_get_hw_reg_originalvalue()
2162 (u8)rtl_get_bbreg(hw, ROFDM0_XAAGCCORE1, MASKBYTE0); in rtl8821ae_phy_get_hw_reg_originalvalue()
2164 (u8)rtl_get_bbreg(hw, ROFDM0_XBAGCCORE1, MASKBYTE0); in rtl8821ae_phy_get_hw_reg_originalvalue()
2166 (u8)rtl_get_bbreg(hw, ROFDM0_XCAGCCORE1, MASKBYTE0); in rtl8821ae_phy_get_hw_reg_originalvalue()
2168 (u8)rtl_get_bbreg(hw, ROFDM0_XDAGCCORE1, MASKBYTE0); in rtl8821ae_phy_get_hw_reg_originalvalue()
2177 rtlphy->framesync = (u8)rtl_get_bbreg(hw, in rtl8821ae_phy_get_hw_reg_originalvalue()
2179 rtlphy->framesync_c34 = rtl_get_bbreg(hw, in rtl8821ae_phy_get_hw_reg_originalvalue()
2187 static void phy_init_bb_rf_register_definition(struct ieee80211_hw *hw) in phy_init_bb_rf_register_definition() argument
2189 struct rtl_priv *rtlpriv = rtl_priv(hw); in phy_init_bb_rf_register_definition()
2214 void rtl8821ae_phy_get_txpower_level(struct ieee80211_hw *hw, long *powerlevel) in rtl8821ae_phy_get_txpower_level() argument
2216 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_get_txpower_level()
2222 txpwr_dbm = _rtl8821ae_phy_txpwr_idx_to_dbm(hw, in rtl8821ae_phy_get_txpower_level()
2225 if (_rtl8821ae_phy_txpwr_idx_to_dbm(hw, in rtl8821ae_phy_get_txpower_level()
2229 _rtl8821ae_phy_txpwr_idx_to_dbm(hw, WIRELESS_MODE_G, in rtl8821ae_phy_get_txpower_level()
2232 if (_rtl8821ae_phy_txpwr_idx_to_dbm(hw, in rtl8821ae_phy_get_txpower_level()
2236 _rtl8821ae_phy_txpwr_idx_to_dbm(hw, WIRELESS_MODE_N_24G, in rtl8821ae_phy_get_txpower_level()
2365 static char _rtl8812ae_phy_get_txpower_limit(struct ieee80211_hw *hw, in _rtl8812ae_phy_get_txpower_limit() argument
2371 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8812ae_phy_get_txpower_limit()
2480 channel_temp = _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt(hw, in _rtl8812ae_phy_get_txpower_limit()
2483 channel_temp = _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt(hw, in _rtl8812ae_phy_get_txpower_limit()
2534 static char _rtl8821ae_phy_get_txpower_by_rate(struct ieee80211_hw *hw, in _rtl8821ae_phy_get_txpower_by_rate() argument
2537 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_get_txpower_by_rate()
2621 limit = _rtl8812ae_phy_get_txpower_limit(hw, band, in _rtl8821ae_phy_get_txpower_by_rate()
2645 static u8 _rtl8821ae_get_txpower_index(struct ieee80211_hw *hw, u8 path, in _rtl8821ae_get_txpower_index() argument
2648 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_get_txpower_index()
2650 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in _rtl8821ae_get_txpower_index()
2755 _rtl8821ae_phy_get_txpower_by_rate(hw, (u8)(!in_24g), in _rtl8821ae_get_txpower_index()
2775 static void _rtl8821ae_phy_set_txpower_index(struct ieee80211_hw *hw, in _rtl8821ae_phy_set_txpower_index() argument
2778 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_set_txpower_index()
2783 rtl_set_bbreg(hw, RTXAGC_A_CCK11_CCK1, in _rtl8821ae_phy_set_txpower_index()
2787 rtl_set_bbreg(hw, RTXAGC_A_CCK11_CCK1, in _rtl8821ae_phy_set_txpower_index()
2791 rtl_set_bbreg(hw, RTXAGC_A_CCK11_CCK1, in _rtl8821ae_phy_set_txpower_index()
2795 rtl_set_bbreg(hw, RTXAGC_A_CCK11_CCK1, in _rtl8821ae_phy_set_txpower_index()
2799 rtl_set_bbreg(hw, RTXAGC_A_OFDM18_OFDM6, in _rtl8821ae_phy_set_txpower_index()
2803 rtl_set_bbreg(hw, RTXAGC_A_OFDM18_OFDM6, in _rtl8821ae_phy_set_txpower_index()
2807 rtl_set_bbreg(hw, RTXAGC_A_OFDM18_OFDM6, in _rtl8821ae_phy_set_txpower_index()
2811 rtl_set_bbreg(hw, RTXAGC_A_OFDM18_OFDM6, in _rtl8821ae_phy_set_txpower_index()
2815 rtl_set_bbreg(hw, RTXAGC_A_OFDM54_OFDM24, in _rtl8821ae_phy_set_txpower_index()
2819 rtl_set_bbreg(hw, RTXAGC_A_OFDM54_OFDM24, in _rtl8821ae_phy_set_txpower_index()
2823 rtl_set_bbreg(hw, RTXAGC_A_OFDM54_OFDM24, in _rtl8821ae_phy_set_txpower_index()
2827 rtl_set_bbreg(hw, RTXAGC_A_OFDM54_OFDM24, in _rtl8821ae_phy_set_txpower_index()
2831 rtl_set_bbreg(hw, RTXAGC_A_MCS03_MCS00, in _rtl8821ae_phy_set_txpower_index()
2835 rtl_set_bbreg(hw, RTXAGC_A_MCS03_MCS00, in _rtl8821ae_phy_set_txpower_index()
2839 rtl_set_bbreg(hw, RTXAGC_A_MCS03_MCS00, in _rtl8821ae_phy_set_txpower_index()
2843 rtl_set_bbreg(hw, RTXAGC_A_MCS03_MCS00, in _rtl8821ae_phy_set_txpower_index()
2847 rtl_set_bbreg(hw, RTXAGC_A_MCS07_MCS04, in _rtl8821ae_phy_set_txpower_index()
2851 rtl_set_bbreg(hw, RTXAGC_A_MCS07_MCS04, in _rtl8821ae_phy_set_txpower_index()
2855 rtl_set_bbreg(hw, RTXAGC_A_MCS07_MCS04, in _rtl8821ae_phy_set_txpower_index()
2859 rtl_set_bbreg(hw, RTXAGC_A_MCS07_MCS04, in _rtl8821ae_phy_set_txpower_index()
2863 rtl_set_bbreg(hw, RTXAGC_A_MCS11_MCS08, in _rtl8821ae_phy_set_txpower_index()
2867 rtl_set_bbreg(hw, RTXAGC_A_MCS11_MCS08, in _rtl8821ae_phy_set_txpower_index()
2871 rtl_set_bbreg(hw, RTXAGC_A_MCS11_MCS08, in _rtl8821ae_phy_set_txpower_index()
2875 rtl_set_bbreg(hw, RTXAGC_A_MCS11_MCS08, in _rtl8821ae_phy_set_txpower_index()
2879 rtl_set_bbreg(hw, RTXAGC_A_MCS15_MCS12, in _rtl8821ae_phy_set_txpower_index()
2883 rtl_set_bbreg(hw, RTXAGC_A_MCS15_MCS12, in _rtl8821ae_phy_set_txpower_index()
2887 rtl_set_bbreg(hw, RTXAGC_A_MCS15_MCS12, in _rtl8821ae_phy_set_txpower_index()
2891 rtl_set_bbreg(hw, RTXAGC_A_MCS15_MCS12, in _rtl8821ae_phy_set_txpower_index()
2895 rtl_set_bbreg(hw, RTXAGC_A_NSS1INDEX3_NSS1INDEX0, in _rtl8821ae_phy_set_txpower_index()
2899 rtl_set_bbreg(hw, RTXAGC_A_NSS1INDEX3_NSS1INDEX0, in _rtl8821ae_phy_set_txpower_index()
2903 rtl_set_bbreg(hw, RTXAGC_A_NSS1INDEX3_NSS1INDEX0, in _rtl8821ae_phy_set_txpower_index()
2907 rtl_set_bbreg(hw, RTXAGC_A_NSS1INDEX3_NSS1INDEX0, in _rtl8821ae_phy_set_txpower_index()
2911 rtl_set_bbreg(hw, RTXAGC_A_NSS1INDEX7_NSS1INDEX4, in _rtl8821ae_phy_set_txpower_index()
2915 rtl_set_bbreg(hw, RTXAGC_A_NSS1INDEX7_NSS1INDEX4, in _rtl8821ae_phy_set_txpower_index()
2919 rtl_set_bbreg(hw, RTXAGC_A_NSS1INDEX7_NSS1INDEX4, in _rtl8821ae_phy_set_txpower_index()
2923 rtl_set_bbreg(hw, RTXAGC_A_NSS1INDEX7_NSS1INDEX4, in _rtl8821ae_phy_set_txpower_index()
2927 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX1_NSS1INDEX8, in _rtl8821ae_phy_set_txpower_index()
2931 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX1_NSS1INDEX8, in _rtl8821ae_phy_set_txpower_index()
2935 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX1_NSS1INDEX8, in _rtl8821ae_phy_set_txpower_index()
2939 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX1_NSS1INDEX8, in _rtl8821ae_phy_set_txpower_index()
2943 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX5_NSS2INDEX2, in _rtl8821ae_phy_set_txpower_index()
2947 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX5_NSS2INDEX2, in _rtl8821ae_phy_set_txpower_index()
2951 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX5_NSS2INDEX2, in _rtl8821ae_phy_set_txpower_index()
2955 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX5_NSS2INDEX2, in _rtl8821ae_phy_set_txpower_index()
2959 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX9_NSS2INDEX6, in _rtl8821ae_phy_set_txpower_index()
2963 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX9_NSS2INDEX6, in _rtl8821ae_phy_set_txpower_index()
2967 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX9_NSS2INDEX6, in _rtl8821ae_phy_set_txpower_index()
2971 rtl_set_bbreg(hw, RTXAGC_A_NSS2INDEX9_NSS2INDEX6, in _rtl8821ae_phy_set_txpower_index()
2982 rtl_set_bbreg(hw, RTXAGC_B_CCK11_CCK1, in _rtl8821ae_phy_set_txpower_index()
2986 rtl_set_bbreg(hw, RTXAGC_B_CCK11_CCK1, in _rtl8821ae_phy_set_txpower_index()
2990 rtl_set_bbreg(hw, RTXAGC_B_CCK11_CCK1, in _rtl8821ae_phy_set_txpower_index()
2994 rtl_set_bbreg(hw, RTXAGC_B_CCK11_CCK1, in _rtl8821ae_phy_set_txpower_index()
2998 rtl_set_bbreg(hw, RTXAGC_B_OFDM18_OFDM6, in _rtl8821ae_phy_set_txpower_index()
3002 rtl_set_bbreg(hw, RTXAGC_B_OFDM18_OFDM6, in _rtl8821ae_phy_set_txpower_index()
3006 rtl_set_bbreg(hw, RTXAGC_B_OFDM18_OFDM6, in _rtl8821ae_phy_set_txpower_index()
3010 rtl_set_bbreg(hw, RTXAGC_B_OFDM18_OFDM6, in _rtl8821ae_phy_set_txpower_index()
3014 rtl_set_bbreg(hw, RTXAGC_B_OFDM54_OFDM24, in _rtl8821ae_phy_set_txpower_index()
3018 rtl_set_bbreg(hw, RTXAGC_B_OFDM54_OFDM24, in _rtl8821ae_phy_set_txpower_index()
3022 rtl_set_bbreg(hw, RTXAGC_B_OFDM54_OFDM24, in _rtl8821ae_phy_set_txpower_index()
3026 rtl_set_bbreg(hw, RTXAGC_B_OFDM54_OFDM24, in _rtl8821ae_phy_set_txpower_index()
3030 rtl_set_bbreg(hw, RTXAGC_B_MCS03_MCS00, in _rtl8821ae_phy_set_txpower_index()
3034 rtl_set_bbreg(hw, RTXAGC_B_MCS03_MCS00, in _rtl8821ae_phy_set_txpower_index()
3038 rtl_set_bbreg(hw, RTXAGC_B_MCS03_MCS00, in _rtl8821ae_phy_set_txpower_index()
3042 rtl_set_bbreg(hw, RTXAGC_B_MCS03_MCS00, in _rtl8821ae_phy_set_txpower_index()
3046 rtl_set_bbreg(hw, RTXAGC_B_MCS07_MCS04, in _rtl8821ae_phy_set_txpower_index()
3050 rtl_set_bbreg(hw, RTXAGC_B_MCS07_MCS04, in _rtl8821ae_phy_set_txpower_index()
3054 rtl_set_bbreg(hw, RTXAGC_B_MCS07_MCS04, in _rtl8821ae_phy_set_txpower_index()
3058 rtl_set_bbreg(hw, RTXAGC_B_MCS07_MCS04, in _rtl8821ae_phy_set_txpower_index()
3062 rtl_set_bbreg(hw, RTXAGC_B_MCS11_MCS08, in _rtl8821ae_phy_set_txpower_index()
3066 rtl_set_bbreg(hw, RTXAGC_B_MCS11_MCS08, in _rtl8821ae_phy_set_txpower_index()
3070 rtl_set_bbreg(hw, RTXAGC_B_MCS11_MCS08, in _rtl8821ae_phy_set_txpower_index()
3074 rtl_set_bbreg(hw, RTXAGC_B_MCS11_MCS08, in _rtl8821ae_phy_set_txpower_index()
3078 rtl_set_bbreg(hw, RTXAGC_B_MCS15_MCS12, in _rtl8821ae_phy_set_txpower_index()
3082 rtl_set_bbreg(hw, RTXAGC_B_MCS15_MCS12, in _rtl8821ae_phy_set_txpower_index()
3086 rtl_set_bbreg(hw, RTXAGC_B_MCS15_MCS12, in _rtl8821ae_phy_set_txpower_index()
3090 rtl_set_bbreg(hw, RTXAGC_B_MCS15_MCS12, in _rtl8821ae_phy_set_txpower_index()
3094 rtl_set_bbreg(hw, RTXAGC_B_NSS1INDEX3_NSS1INDEX0, in _rtl8821ae_phy_set_txpower_index()
3098 rtl_set_bbreg(hw, RTXAGC_B_NSS1INDEX3_NSS1INDEX0, in _rtl8821ae_phy_set_txpower_index()
3102 rtl_set_bbreg(hw, RTXAGC_B_NSS1INDEX3_NSS1INDEX0, in _rtl8821ae_phy_set_txpower_index()
3106 rtl_set_bbreg(hw, RTXAGC_B_NSS1INDEX3_NSS1INDEX0, in _rtl8821ae_phy_set_txpower_index()
3110 rtl_set_bbreg(hw, RTXAGC_B_NSS1INDEX7_NSS1INDEX4, in _rtl8821ae_phy_set_txpower_index()
3114 rtl_set_bbreg(hw, RTXAGC_B_NSS1INDEX7_NSS1INDEX4, in _rtl8821ae_phy_set_txpower_index()
3118 rtl_set_bbreg(hw, RTXAGC_B_NSS1INDEX7_NSS1INDEX4, in _rtl8821ae_phy_set_txpower_index()
3122 rtl_set_bbreg(hw, RTXAGC_B_NSS1INDEX7_NSS1INDEX4, in _rtl8821ae_phy_set_txpower_index()
3126 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX1_NSS1INDEX8, in _rtl8821ae_phy_set_txpower_index()
3130 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX1_NSS1INDEX8, in _rtl8821ae_phy_set_txpower_index()
3134 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX1_NSS1INDEX8, in _rtl8821ae_phy_set_txpower_index()
3138 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX1_NSS1INDEX8, in _rtl8821ae_phy_set_txpower_index()
3142 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX5_NSS2INDEX2, in _rtl8821ae_phy_set_txpower_index()
3146 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX5_NSS2INDEX2, in _rtl8821ae_phy_set_txpower_index()
3150 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX5_NSS2INDEX2, in _rtl8821ae_phy_set_txpower_index()
3154 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX5_NSS2INDEX2, in _rtl8821ae_phy_set_txpower_index()
3158 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX9_NSS2INDEX6, in _rtl8821ae_phy_set_txpower_index()
3162 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX9_NSS2INDEX6, in _rtl8821ae_phy_set_txpower_index()
3166 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX9_NSS2INDEX6, in _rtl8821ae_phy_set_txpower_index()
3170 rtl_set_bbreg(hw, RTXAGC_B_NSS2INDEX9_NSS2INDEX6, in _rtl8821ae_phy_set_txpower_index()
3184 static void _rtl8821ae_phy_set_txpower_level_by_path(struct ieee80211_hw *hw, in _rtl8821ae_phy_set_txpower_level_by_path() argument
3188 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_set_txpower_level_by_path()
3195 _rtl8821ae_get_txpower_index(hw, path, array[i], in _rtl8821ae_phy_set_txpower_level_by_path()
3198 _rtl8821ae_phy_set_txpower_index(hw, power_index, path, in _rtl8821ae_phy_set_txpower_level_by_path()
3203 static void _rtl8821ae_phy_txpower_training_by_path(struct ieee80211_hw *hw, in _rtl8821ae_phy_txpower_training_by_path() argument
3206 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_txpower_training_by_path()
3218 _rtl8821ae_get_txpower_index(hw, RF90_PATH_A, in _rtl8821ae_phy_txpower_training_by_path()
3223 _rtl8821ae_get_txpower_index(hw, RF90_PATH_B, in _rtl8821ae_phy_txpower_training_by_path()
3238 rtl_set_bbreg(hw, offset, 0xffffff, data); in _rtl8821ae_phy_txpower_training_by_path()
3241 void rtl8821ae_phy_set_txpower_level_by_path(struct ieee80211_hw *hw, in rtl8821ae_phy_set_txpower_level_by_path() argument
3245 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_phy_set_txpower_level_by_path()
3246 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_set_txpower_level_by_path()
3277 _rtl8821ae_phy_set_txpower_level_by_path(hw, cck_rates, path, channel, in rtl8821ae_phy_set_txpower_level_by_path()
3280 _rtl8821ae_phy_set_txpower_level_by_path(hw, ofdm_rates, path, channel, in rtl8821ae_phy_set_txpower_level_by_path()
3282 _rtl8821ae_phy_set_txpower_level_by_path(hw, ht_rates_1t, path, channel, in rtl8821ae_phy_set_txpower_level_by_path()
3284 _rtl8821ae_phy_set_txpower_level_by_path(hw, vht_rates_1t, path, channel, in rtl8821ae_phy_set_txpower_level_by_path()
3288 _rtl8821ae_phy_set_txpower_level_by_path(hw, ht_rates_2t, path, in rtl8821ae_phy_set_txpower_level_by_path()
3291 _rtl8821ae_phy_set_txpower_level_by_path(hw, vht_rates_2t, path, in rtl8821ae_phy_set_txpower_level_by_path()
3296 _rtl8821ae_phy_txpower_training_by_path(hw, rtlphy->current_chan_bw, in rtl8821ae_phy_set_txpower_level_by_path()
3301 void rtl8821ae_phy_set_txpower_level(struct ieee80211_hw *hw, u8 channel) in rtl8821ae_phy_set_txpower_level() argument
3303 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_set_txpower_level()
3308 rtl8821ae_phy_set_txpower_level_by_path(hw, channel, path); in rtl8821ae_phy_set_txpower_level()
3311 static long _rtl8821ae_phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw, in _rtl8821ae_phy_txpwr_idx_to_dbm() argument
3334 void rtl8821ae_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation) in rtl8821ae_phy_scan_operation_backup() argument
3336 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_scan_operation_backup()
3337 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_phy_scan_operation_backup()
3344 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_phy_scan_operation_backup()
3351 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_phy_scan_operation_backup()
3358 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_phy_scan_operation_backup()
3435 void rtl8821ae_phy_set_bw_mode_callback(struct ieee80211_hw *hw) in rtl8821ae_phy_set_bw_mode_callback() argument
3437 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_set_bw_mode_callback()
3455 rtl_set_bbreg(hw, RRFMOD, 0x003003C3, 0x00300200); in rtl8821ae_phy_set_bw_mode_callback()
3456 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 0); in rtl8821ae_phy_set_bw_mode_callback()
3459 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, 7); in rtl8821ae_phy_set_bw_mode_callback()
3461 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, 8); in rtl8821ae_phy_set_bw_mode_callback()
3464 rtl_set_bbreg(hw, RRFMOD, 0x003003C3, 0x00300201); in rtl8821ae_phy_set_bw_mode_callback()
3465 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 0); in rtl8821ae_phy_set_bw_mode_callback()
3466 rtl_set_bbreg(hw, RRFMOD, 0x3C, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3467 rtl_set_bbreg(hw, RCCAONSEC, 0xf0000000, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3478 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, l1pk_val); in rtl8821ae_phy_set_bw_mode_callback()
3481 rtl_set_bbreg(hw, RCCK_SYSTEM, BCCK_SYSTEM, 1); in rtl8821ae_phy_set_bw_mode_callback()
3483 rtl_set_bbreg(hw, RCCK_SYSTEM, BCCK_SYSTEM, 0); in rtl8821ae_phy_set_bw_mode_callback()
3488 rtl_set_bbreg(hw, RRFMOD, 0x003003C3, 0x00300202); in rtl8821ae_phy_set_bw_mode_callback()
3490 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 1); in rtl8821ae_phy_set_bw_mode_callback()
3491 rtl_set_bbreg(hw, RRFMOD, 0x3C, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3492 rtl_set_bbreg(hw, RCCAONSEC, 0xf0000000, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3502 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, l1pk_val); in rtl8821ae_phy_set_bw_mode_callback()
3511 rtl8812ae_fixspur(hw, rtlphy->current_chan_bw, rtlphy->current_channel); in rtl8821ae_phy_set_bw_mode_callback()
3513 rtl8821ae_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw); in rtl8821ae_phy_set_bw_mode_callback()
3519 void rtl8821ae_phy_set_bw_mode(struct ieee80211_hw *hw, in rtl8821ae_phy_set_bw_mode() argument
3522 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_set_bw_mode()
3524 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_phy_set_bw_mode()
3530 if ((!is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) in rtl8821ae_phy_set_bw_mode()
3531 rtl8821ae_phy_set_bw_mode_callback(hw); in rtl8821ae_phy_set_bw_mode()
3540 void rtl8821ae_phy_sw_chnl_callback(struct ieee80211_hw *hw) in rtl8821ae_phy_sw_chnl_callback() argument
3542 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_sw_chnl_callback()
3543 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_phy_sw_chnl_callback()
3564 rtl_set_bbreg(hw, RFC_AREA, 0x1ffe0000, data); in rtl8821ae_phy_sw_chnl_callback()
3575 rtl8821ae_phy_set_rf_reg(hw, path, RF_CHNLBW, in rtl8821ae_phy_sw_chnl_callback()
3578 rtl8821ae_phy_set_rf_reg(hw, path, RF_CHNLBW, in rtl8821ae_phy_sw_chnl_callback()
3589 rtl8821ae_phy_set_rf_reg(hw, path, RF_APK, in rtl8821ae_phy_sw_chnl_callback()
3597 u8 rtl8821ae_phy_sw_chnl(struct ieee80211_hw *hw) in rtl8821ae_phy_sw_chnl() argument
3599 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_sw_chnl()
3601 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_phy_sw_chnl()
3610 if ((is_hal_stop(rtlhal)) || (RT_CANNOT_IO(hw))) { in rtl8821ae_phy_sw_chnl()
3621 rtl8821ae_phy_switch_wirelessband(hw, BAND_ON_5G); in rtl8821ae_phy_sw_chnl()
3623 rtl8821ae_phy_switch_wirelessband(hw, BAND_ON_2_4G); in rtl8821ae_phy_sw_chnl()
3633 rtl8821ae_phy_sw_chnl_callback(hw); in rtl8821ae_phy_sw_chnl()
3635 rtl8821ae_dm_clear_txpower_tracking_state(hw); in rtl8821ae_phy_sw_chnl()
3636 rtl8821ae_phy_set_txpower_level(hw, rtlphy->current_channel); in rtl8821ae_phy_sw_chnl()
3667 static void _rtl8821ae_iqk_backup_macbb(struct ieee80211_hw *hw, in _rtl8821ae_iqk_backup_macbb() argument
3671 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_iqk_backup_macbb()
3674 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_backup_macbb()
3682 static void _rtl8821ae_iqk_backup_afe(struct ieee80211_hw *hw, u32 *afe_backup, in _rtl8821ae_iqk_backup_afe() argument
3685 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_iqk_backup_afe()
3688 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_backup_afe()
3695 static void _rtl8821ae_iqk_backup_rf(struct ieee80211_hw *hw, u32 *rfa_backup, in _rtl8821ae_iqk_backup_rf() argument
3699 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_iqk_backup_rf()
3702 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_backup_rf()
3705 rfa_backup[i] = rtl_get_rfreg(hw, RF90_PATH_A, backup_rf_reg[i], in _rtl8821ae_iqk_backup_rf()
3707 rfb_backup[i] = rtl_get_rfreg(hw, RF90_PATH_B, backup_rf_reg[i], in _rtl8821ae_iqk_backup_rf()
3714 struct ieee80211_hw *hw in _rtl8821ae_iqk_configure_mac() argument
3717 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_iqk_configure_mac()
3719 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_configure_mac()
3721 rtl_set_bbreg(hw, 0x550, BIT(11) | BIT(3), 0x0); in _rtl8821ae_iqk_configure_mac()
3723 rtl_set_bbreg(hw, 0x838, 0xf, 0xc); /*CCA off*/ in _rtl8821ae_iqk_configure_mac()
3726 static void _rtl8821ae_iqk_tx_fill_iqc(struct ieee80211_hw *hw, in _rtl8821ae_iqk_tx_fill_iqc() argument
3729 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_iqk_tx_fill_iqc()
3733 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); in _rtl8821ae_iqk_tx_fill_iqc()
3737 rtl_set_bbreg(hw, 0xccc, 0x000007ff, tx_y); in _rtl8821ae_iqk_tx_fill_iqc()
3738 rtl_set_bbreg(hw, 0xcd4, 0x000007ff, tx_x); in _rtl8821ae_iqk_tx_fill_iqc()
3744 rtl_get_bbreg(hw, 0xcd4, 0x000007ff), in _rtl8821ae_iqk_tx_fill_iqc()
3745 rtl_get_bbreg(hw, 0xccc, 0x000007ff)); in _rtl8821ae_iqk_tx_fill_iqc()
3752 static void _rtl8821ae_iqk_rx_fill_iqc(struct ieee80211_hw *hw, in _rtl8821ae_iqk_rx_fill_iqc() argument
3755 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_iqk_rx_fill_iqc()
3758 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_rx_fill_iqc()
3759 rtl_set_bbreg(hw, 0xc10, 0x000003ff, rx_x>>1); in _rtl8821ae_iqk_rx_fill_iqc()
3760 rtl_set_bbreg(hw, 0xc10, 0x03ff0000, rx_y>>1); in _rtl8821ae_iqk_rx_fill_iqc()
3775 static void _rtl8821ae_iqk_tx(struct ieee80211_hw *hw, enum radio_path path) in _rtl8821ae_iqk_tx() argument
3777 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_iqk_tx()
3779 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_iqk_tx()
3799 temp_reg65 = rtl_get_rfreg(hw, path, 0x65, 0xffffffff); in _rtl8821ae_iqk_tx()
3801 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_tx()
3815 rtl_set_bbreg(hw, 0xc00, 0xf, 0x4); /*hardware 3-wire off*/ in _rtl8821ae_iqk_tx()
3820 rtl_set_bbreg(hw, 0xc5c, BIT(26) | BIT(25) | BIT(24), 0x7); in _rtl8821ae_iqk_tx()
3823 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80002); in _rtl8821ae_iqk_tx()
3824 rtl_set_rfreg(hw, path, 0x18, 0x00c00, 0x3); /* BW 20M */ in _rtl8821ae_iqk_tx()
3825 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x20000); in _rtl8821ae_iqk_tx()
3826 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0003f); in _rtl8821ae_iqk_tx()
3827 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xf3fc3); in _rtl8821ae_iqk_tx()
3828 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d5); in _rtl8821ae_iqk_tx()
3829 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
3830 rtl_set_bbreg(hw, 0xcb8, 0xf, 0xd); in _rtl8821ae_iqk_tx()
3833 rtl_set_bbreg(hw, 0xc94, BIT(0), 0x1); in _rtl8821ae_iqk_tx()
3838 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3855 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
3856 rtl_set_rfreg(hw, path, 0x58, 0x7fe00, rtl_get_rfreg(hw, path, 0x8, 0xffc00)); /* Load LOK */ in _rtl8821ae_iqk_tx()
3860 rtl_set_rfreg(hw, path, 0x18, 0x00c00, 0x1); in _rtl8821ae_iqk_tx()
3863 rtl_set_rfreg(hw, path, 0x18, 0x00c00, 0x0); in _rtl8821ae_iqk_tx()
3869 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3872 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
3873 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
3874 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x20000); in _rtl8821ae_iqk_tx()
3875 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0003f); in _rtl8821ae_iqk_tx()
3876 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xf3fc3); in _rtl8821ae_iqk_tx()
3877 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d5); in _rtl8821ae_iqk_tx()
3878 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
3879 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
3883 rtl_set_bbreg(hw, 0xc94, BIT(0), 0x1); in _rtl8821ae_iqk_tx()
3888 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3902 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
3905 rtl_set_bbreg(hw, 0xc80, BIT(28), 0x0); in _rtl8821ae_iqk_tx()
3906 rtl_set_bbreg(hw, 0xc84, BIT(28), 0x0); in _rtl8821ae_iqk_tx()
3907 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
3919 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x1); in _rtl8821ae_iqk_tx()
3920 rtl_set_bbreg(hw, 0xce8, 0x3fff0000, tx_dt[cal] & 0x00003fff); in _rtl8821ae_iqk_tx()
3936 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
3947 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
3951 vdf_x[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
3953 vdf_y[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
3957 rtl_set_bbreg(hw, 0xccc, 0x000007ff, 0x0); in _rtl8821ae_iqk_tx()
3958 rtl_set_bbreg(hw, 0xcd4, 0x000007ff, 0x200); in _rtl8821ae_iqk_tx()
3990 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4001 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
4005 tx_x0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4007 tx_y0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4011 rtl_set_bbreg(hw, 0xccc, 0x000007ff, 0x0); in _rtl8821ae_iqk_tx()
4012 rtl_set_bbreg(hw, 0xcd4, 0x000007ff, 0x200); in _rtl8821ae_iqk_tx()
4031 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x0); /* TX VDF Disable */ in _rtl8821ae_iqk_tx()
4035 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4037 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
4038 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
4039 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x00029); in _rtl8821ae_iqk_tx()
4040 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xd7ffb); in _rtl8821ae_iqk_tx()
4041 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, temp_reg65); in _rtl8821ae_iqk_tx()
4042 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
4043 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
4045 rtl_set_bbreg(hw, 0xcb8, 0xf, 0xd); in _rtl8821ae_iqk_tx()
4051 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
4057 rtl_set_bbreg(hw, 0xce8, BIT(30), 0x0); in _rtl8821ae_iqk_tx()
4064 rtl_set_bbreg(hw, 0xce8, BIT(30), 0x0); in _rtl8821ae_iqk_tx()
4081 rtl_set_bbreg(hw, 0xce8, 0x00003fff, rx_dt[cal] & 0x00003fff); in _rtl8821ae_iqk_tx()
4100 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4111 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
4115 tx_x0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4117 tx_y0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4145 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4147 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
4148 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
4149 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0002f); in _rtl8821ae_iqk_tx()
4150 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xfffbb); in _rtl8821ae_iqk_tx()
4151 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x88001); in _rtl8821ae_iqk_tx()
4152 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d8); in _rtl8821ae_iqk_tx()
4153 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
4155 rtl_set_bbreg(hw, 0x978, 0x03FF8000, (tx_x0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4156 rtl_set_bbreg(hw, 0x978, 0x000007FF, (tx_y0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4157 rtl_set_bbreg(hw, 0x978, BIT(31), 0x1); in _rtl8821ae_iqk_tx()
4158 rtl_set_bbreg(hw, 0x97c, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
4159 rtl_set_bbreg(hw, 0xcb8, 0xF, 0xe); in _rtl8821ae_iqk_tx()
4163 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
4164 rtl_set_bbreg(hw, 0xc80, BIT(29), 0x1); in _rtl8821ae_iqk_tx()
4165 rtl_set_bbreg(hw, 0xc84, BIT(29), 0x0); in _rtl8821ae_iqk_tx()
4171 rtl_set_bbreg(hw, 0xce8, BIT(30), 0x1); /* RX VDF Enable */ in _rtl8821ae_iqk_tx()
4184 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4195 rx_fail = rtl_get_bbreg(hw, 0xd00, BIT(11)); in _rtl8821ae_iqk_tx()
4198 vdf_x[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4200 vdf_y[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4204 rtl_set_bbreg(hw, 0xc10, 0x000003ff, 0x200>>1); in _rtl8821ae_iqk_tx()
4205 rtl_set_bbreg(hw, 0xc10, 0x03ff0000, 0x0>>1); in _rtl8821ae_iqk_tx()
4225 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x1); /* TX VDF Enable */ in _rtl8821ae_iqk_tx()
4230 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4232 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
4233 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
4234 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x00029); in _rtl8821ae_iqk_tx()
4235 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xd7ffb); in _rtl8821ae_iqk_tx()
4236 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, temp_reg65); in _rtl8821ae_iqk_tx()
4237 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
4238 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
4243 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
4259 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4270 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
4274 tx_x0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4276 tx_y0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4302 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4304 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
4305 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
4306 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0002f); in _rtl8821ae_iqk_tx()
4307 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xfffbb); in _rtl8821ae_iqk_tx()
4308 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x88001); in _rtl8821ae_iqk_tx()
4309 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d8); in _rtl8821ae_iqk_tx()
4310 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
4312 rtl_set_bbreg(hw, 0x978, 0x03FF8000, (tx_x0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4313 rtl_set_bbreg(hw, 0x978, 0x000007FF, (tx_y0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4314 rtl_set_bbreg(hw, 0x978, BIT(31), 0x1); in _rtl8821ae_iqk_tx()
4315 rtl_set_bbreg(hw, 0x97c, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
4320 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
4339 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4350 rx_fail = rtl_get_bbreg(hw, 0xd00, BIT(11)); in _rtl8821ae_iqk_tx()
4353 rx_x0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4355 rx_y0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4359 rtl_set_bbreg(hw, 0xc10, 0x000003ff, 0x200>>1); in _rtl8821ae_iqk_tx()
4360 rtl_set_bbreg(hw, 0xc10, 0x03ff0000, 0x0>>1); in _rtl8821ae_iqk_tx()
4380 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4381 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, temp_reg65); in _rtl8821ae_iqk_tx()
4425 _rtl8821ae_iqk_tx_fill_iqc(hw, path, tx_x, tx_y); /* ? */ in _rtl8821ae_iqk_tx()
4427 _rtl8821ae_iqk_tx_fill_iqc(hw, path, 0x200, 0x0); in _rtl8821ae_iqk_tx()
4455 _rtl8821ae_iqk_rx_fill_iqc(hw, path, rx_x, rx_y); in _rtl8821ae_iqk_tx()
4457 _rtl8821ae_iqk_rx_fill_iqc(hw, path, 0x200, 0x0); in _rtl8821ae_iqk_tx()
4464 static void _rtl8821ae_iqk_restore_rf(struct ieee80211_hw *hw, in _rtl8821ae_iqk_restore_rf() argument
4469 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_iqk_restore_rf()
4472 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_restore_rf()
4474 rtl_set_rfreg(hw, path, backup_rf_reg[i], RFREG_OFFSET_MASK, in _rtl8821ae_iqk_restore_rf()
4487 static void _rtl8821ae_iqk_restore_afe(struct ieee80211_hw *hw, in _rtl8821ae_iqk_restore_afe() argument
4492 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_iqk_restore_afe()
4494 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_restore_afe()
4498 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_restore_afe()
4511 static void _rtl8821ae_iqk_restore_macbb(struct ieee80211_hw *hw, in _rtl8821ae_iqk_restore_macbb() argument
4517 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_iqk_restore_macbb()
4519 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_restore_macbb()
4534 static void _rtl8821ae_phy_iq_calibrate(struct ieee80211_hw *hw) in _rtl8821ae_phy_iq_calibrate() argument
4550 _rtl8821ae_iqk_backup_macbb(hw, macbb_backup, backup_macbb_reg, in _rtl8821ae_phy_iq_calibrate()
4552 _rtl8821ae_iqk_backup_afe(hw, afe_backup, backup_afe_reg, AFE_REG_NUM); in _rtl8821ae_phy_iq_calibrate()
4553 _rtl8821ae_iqk_backup_rf(hw, rfa_backup, rfb_backup, backup_rf_reg, in _rtl8821ae_phy_iq_calibrate()
4556 _rtl8821ae_iqk_configure_mac(hw); in _rtl8821ae_phy_iq_calibrate()
4557 _rtl8821ae_iqk_tx(hw, RF90_PATH_A); in _rtl8821ae_phy_iq_calibrate()
4558 _rtl8821ae_iqk_restore_rf(hw, RF90_PATH_A, backup_rf_reg, rfa_backup, in _rtl8821ae_phy_iq_calibrate()
4561 _rtl8821ae_iqk_restore_afe(hw, afe_backup, backup_afe_reg, AFE_REG_NUM); in _rtl8821ae_phy_iq_calibrate()
4562 _rtl8821ae_iqk_restore_macbb(hw, macbb_backup, backup_macbb_reg, in _rtl8821ae_phy_iq_calibrate()
4566 static void _rtl8821ae_phy_set_rfpath_switch(struct ieee80211_hw *hw, bool main) in _rtl8821ae_phy_set_rfpath_switch() argument
4568 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_set_rfpath_switch()
4574 rtl_set_bbreg(hw, RA_RFE_PINMUX + 4, BIT(29) | BIT(28), 0x1); in _rtl8821ae_phy_set_rfpath_switch()
4576 rtl_set_bbreg(hw, RA_RFE_PINMUX + 4, BIT(29) | BIT(28), 0x2); in _rtl8821ae_phy_set_rfpath_switch()
4582 void rtl8812ae_phy_iq_calibrate(struct ieee80211_hw *hw, bool b_recovery) in rtl8812ae_phy_iq_calibrate() argument
4586 void rtl8812ae_do_iqk(struct ieee80211_hw *hw, u8 delta_thermal_index, in rtl8812ae_do_iqk() argument
4589 struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw)); in rtl8812ae_do_iqk()
4592 rtl8812ae_phy_iq_calibrate(hw, false); in rtl8812ae_do_iqk()
4595 void rtl8821ae_phy_iq_calibrate(struct ieee80211_hw *hw, bool b_recovery) in rtl8821ae_phy_iq_calibrate() argument
4597 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_iq_calibrate()
4605 _rtl8821ae_phy_iq_calibrate(hw); in rtl8821ae_phy_iq_calibrate()
4613 void rtl8821ae_reset_iqk_result(struct ieee80211_hw *hw) in rtl8821ae_reset_iqk_result() argument
4615 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_reset_iqk_result()
4640 void rtl8821ae_do_iqk(struct ieee80211_hw *hw, u8 delta_thermal_index, in rtl8821ae_do_iqk() argument
4643 struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw)); in rtl8821ae_do_iqk()
4645 rtl8821ae_reset_iqk_result(hw); in rtl8821ae_do_iqk()
4648 rtl8821ae_phy_iq_calibrate(hw, false); in rtl8821ae_do_iqk()
4651 void rtl8821ae_phy_lc_calibrate(struct ieee80211_hw *hw) in rtl8821ae_phy_lc_calibrate() argument
4655 void rtl8821ae_phy_ap_calibrate(struct ieee80211_hw *hw, char delta) in rtl8821ae_phy_ap_calibrate() argument
4659 void rtl8821ae_phy_set_rfpath_switch(struct ieee80211_hw *hw, bool bmain) in rtl8821ae_phy_set_rfpath_switch() argument
4661 _rtl8821ae_phy_set_rfpath_switch(hw, bmain); in rtl8821ae_phy_set_rfpath_switch()
4664 bool rtl8821ae_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype) in rtl8821ae_phy_set_io_cmd() argument
4666 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_set_io_cmd()
4698 rtl8821ae_phy_set_io(hw); in rtl8821ae_phy_set_io_cmd()
4703 static void rtl8821ae_phy_set_io(struct ieee80211_hw *hw) in rtl8821ae_phy_set_io() argument
4705 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_set_io()
4715 _rtl8821ae_resume_tx_beacon(hw); in rtl8821ae_phy_set_io()
4716 rtl8821ae_dm_write_dig(hw, rtlphy->initgain_backup.xaagccore1); in rtl8821ae_phy_set_io()
4717 rtl8821ae_dm_write_cck_cca_thres(hw, in rtl8821ae_phy_set_io()
4722 _rtl8821ae_stop_tx_beacon(hw); in rtl8821ae_phy_set_io()
4724 rtl8821ae_dm_write_dig(hw, 0x17); in rtl8821ae_phy_set_io()
4726 rtl8821ae_dm_write_cck_cca_thres(hw, 0x40); in rtl8821ae_phy_set_io()
4740 static void rtl8821ae_phy_set_rf_on(struct ieee80211_hw *hw) in rtl8821ae_phy_set_rf_on() argument
4742 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_phy_set_rf_on()
4751 static bool _rtl8821ae_phy_set_rf_power_state(struct ieee80211_hw *hw, in _rtl8821ae_phy_set_rf_power_state() argument
4754 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_phy_set_rf_power_state()
4755 struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); in _rtl8821ae_phy_set_rf_power_state()
4756 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in _rtl8821ae_phy_set_rf_power_state()
4757 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); in _rtl8821ae_phy_set_rf_power_state()
4773 rtstatus = rtl_ps_enable_nic(hw); in _rtl8821ae_phy_set_rf_power_state()
4784 rtl8821ae_phy_set_rf_on(hw); in _rtl8821ae_phy_set_rf_power_state()
4787 rtlpriv->cfg->ops->led_control(hw, in _rtl8821ae_phy_set_rf_power_state()
4790 rtlpriv->cfg->ops->led_control(hw, in _rtl8821ae_phy_set_rf_power_state()
4824 rtl_ps_disable_nic(hw); in _rtl8821ae_phy_set_rf_power_state()
4828 rtlpriv->cfg->ops->led_control(hw, in _rtl8821ae_phy_set_rf_power_state()
4831 rtlpriv->cfg->ops->led_control(hw, in _rtl8821ae_phy_set_rf_power_state()
4847 bool rtl8821ae_phy_set_rf_power_state(struct ieee80211_hw *hw, in rtl8821ae_phy_set_rf_power_state() argument
4850 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); in rtl8821ae_phy_set_rf_power_state()
4856 bresult = _rtl8821ae_phy_set_rf_power_state(hw, rfpwr_state); in rtl8821ae_phy_set_rf_power_state()