Lines Matching refs:hw

38 u32 rtl92c_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)  in rtl92c_phy_query_bb_reg()  argument
40 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_query_bb_reg()
57 void rtl92c_phy_set_bb_reg(struct ieee80211_hw *hw, in rtl92c_phy_set_bb_reg() argument
60 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_set_bb_reg()
81 u32 _rtl92c_phy_fw_rf_serial_read(struct ieee80211_hw *hw, in _rtl92c_phy_fw_rf_serial_read() argument
89 void _rtl92c_phy_fw_rf_serial_write(struct ieee80211_hw *hw, in _rtl92c_phy_fw_rf_serial_write() argument
97 u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw, in _rtl92c_phy_rf_serial_read() argument
100 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_rf_serial_read()
110 if (RT_CANNOT_IO(hw)) { in _rtl92c_phy_rf_serial_read()
114 tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD); in _rtl92c_phy_rf_serial_read()
118 tmplong2 = rtl_get_bbreg(hw, pphyreg->rfhssi_para2, MASKDWORD); in _rtl92c_phy_rf_serial_read()
121 rtl_set_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD, in _rtl92c_phy_rf_serial_read()
124 rtl_set_bbreg(hw, pphyreg->rfhssi_para2, MASKDWORD, tmplong2); in _rtl92c_phy_rf_serial_read()
126 rtl_set_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD, in _rtl92c_phy_rf_serial_read()
130 rfpi_enable = (u8)rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER1, in _rtl92c_phy_rf_serial_read()
133 rfpi_enable = (u8)rtl_get_bbreg(hw, RFPGA0_XB_HSSIPARAMETER1, in _rtl92c_phy_rf_serial_read()
136 retvalue = rtl_get_bbreg(hw, pphyreg->rf_rbpi, in _rtl92c_phy_rf_serial_read()
139 retvalue = rtl_get_bbreg(hw, pphyreg->rf_rb, in _rtl92c_phy_rf_serial_read()
148 void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw, in _rtl92c_phy_rf_serial_write() argument
154 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_rf_serial_write()
158 if (RT_CANNOT_IO(hw)) { in _rtl92c_phy_rf_serial_write()
165 rtl_set_bbreg(hw, pphyreg->rf3wire_offset, MASKDWORD, data_and_addr); in _rtl92c_phy_rf_serial_write()
184 static void _rtl92c_phy_bb_config_1t(struct ieee80211_hw *hw) in _rtl92c_phy_bb_config_1t() argument
186 rtl_set_bbreg(hw, RFPGA0_TXINFO, 0x3, 0x2); in _rtl92c_phy_bb_config_1t()
187 rtl_set_bbreg(hw, RFPGA1_TXINFO, 0x300033, 0x200022); in _rtl92c_phy_bb_config_1t()
188 rtl_set_bbreg(hw, RCCK0_AFESETTING, MASKBYTE3, 0x45); in _rtl92c_phy_bb_config_1t()
189 rtl_set_bbreg(hw, ROFDM0_TRXPATHENABLE, MASKBYTE0, 0x23); in _rtl92c_phy_bb_config_1t()
190 rtl_set_bbreg(hw, ROFDM0_AGCPARAMETER1, 0x30, 0x1); in _rtl92c_phy_bb_config_1t()
191 rtl_set_bbreg(hw, 0xe74, 0x0c000000, 0x2); in _rtl92c_phy_bb_config_1t()
192 rtl_set_bbreg(hw, 0xe78, 0x0c000000, 0x2); in _rtl92c_phy_bb_config_1t()
193 rtl_set_bbreg(hw, 0xe7c, 0x0c000000, 0x2); in _rtl92c_phy_bb_config_1t()
194 rtl_set_bbreg(hw, 0xe80, 0x0c000000, 0x2); in _rtl92c_phy_bb_config_1t()
195 rtl_set_bbreg(hw, 0xe88, 0x0c000000, 0x2); in _rtl92c_phy_bb_config_1t()
198 bool rtl92c_phy_rf_config(struct ieee80211_hw *hw) in rtl92c_phy_rf_config() argument
200 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_rf_config()
202 return rtlpriv->cfg->ops->phy_rf6052_config(hw); in rtl92c_phy_rf_config()
206 bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw) in _rtl92c_phy_bb8192c_config_parafile() argument
208 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_bb8192c_config_parafile()
210 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in _rtl92c_phy_bb8192c_config_parafile()
213 rtstatus = rtlpriv->cfg->ops->config_bb_with_headerfile(hw, in _rtl92c_phy_bb8192c_config_parafile()
220 _rtl92c_phy_bb_config_1t(hw); in _rtl92c_phy_bb8192c_config_parafile()
225 rtstatus = rtlpriv->cfg->ops->config_bb_with_pgheaderfile(hw, in _rtl92c_phy_bb8192c_config_parafile()
232 rtstatus = rtlpriv->cfg->ops->config_bb_with_headerfile(hw, in _rtl92c_phy_bb8192c_config_parafile()
239 (bool)(rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, 0x200)); in _rtl92c_phy_bb8192c_config_parafile()
246 void _rtl92c_store_pwrIndex_diffrate_offset(struct ieee80211_hw *hw, in _rtl92c_store_pwrIndex_diffrate_offset() argument
250 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_store_pwrIndex_diffrate_offset()
402 void rtl92c_phy_get_hw_reg_originalvalue(struct ieee80211_hw *hw) in rtl92c_phy_get_hw_reg_originalvalue() argument
404 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_get_hw_reg_originalvalue()
408 (u8)rtl_get_bbreg(hw, ROFDM0_XAAGCCORE1, MASKBYTE0); in rtl92c_phy_get_hw_reg_originalvalue()
410 (u8)rtl_get_bbreg(hw, ROFDM0_XBAGCCORE1, MASKBYTE0); in rtl92c_phy_get_hw_reg_originalvalue()
412 (u8)rtl_get_bbreg(hw, ROFDM0_XCAGCCORE1, MASKBYTE0); in rtl92c_phy_get_hw_reg_originalvalue()
414 (u8)rtl_get_bbreg(hw, ROFDM0_XDAGCCORE1, MASKBYTE0); in rtl92c_phy_get_hw_reg_originalvalue()
423 rtlphy->framesync = (u8)rtl_get_bbreg(hw, in rtl92c_phy_get_hw_reg_originalvalue()
425 rtlphy->framesync_c34 = rtl_get_bbreg(hw, in rtl92c_phy_get_hw_reg_originalvalue()
433 void _rtl92c_phy_init_bb_rf_register_definition(struct ieee80211_hw *hw) in _rtl92c_phy_init_bb_rf_register_definition() argument
435 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_init_bb_rf_register_definition()
521 void rtl92c_phy_get_txpower_level(struct ieee80211_hw *hw, long *powerlevel) in rtl92c_phy_get_txpower_level() argument
523 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_get_txpower_level()
525 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in rtl92c_phy_get_txpower_level()
530 txpwr_dbm = _rtl92c_phy_txpwr_idx_to_dbm(hw, WIRELESS_MODE_B, in rtl92c_phy_get_txpower_level()
534 if (_rtl92c_phy_txpwr_idx_to_dbm(hw, WIRELESS_MODE_G, in rtl92c_phy_get_txpower_level()
537 _rtl92c_phy_txpwr_idx_to_dbm(hw, WIRELESS_MODE_G, in rtl92c_phy_get_txpower_level()
540 if (_rtl92c_phy_txpwr_idx_to_dbm(hw, WIRELESS_MODE_N_24G, in rtl92c_phy_get_txpower_level()
543 _rtl92c_phy_txpwr_idx_to_dbm(hw, WIRELESS_MODE_N_24G, in rtl92c_phy_get_txpower_level()
548 static void _rtl92c_get_txpower_index(struct ieee80211_hw *hw, u8 channel, in _rtl92c_get_txpower_index() argument
551 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_get_txpower_index()
553 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in _rtl92c_get_txpower_index()
573 static void _rtl92c_ccxpower_index_check(struct ieee80211_hw *hw, in _rtl92c_ccxpower_index_check() argument
577 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_ccxpower_index_check()
584 void rtl92c_phy_set_txpower_level(struct ieee80211_hw *hw, u8 channel) in rtl92c_phy_set_txpower_level() argument
586 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_set_txpower_level()
587 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in rtl92c_phy_set_txpower_level()
592 _rtl92c_get_txpower_index(hw, channel, in rtl92c_phy_set_txpower_level()
594 _rtl92c_ccxpower_index_check(hw, channel, &cckpowerlevel[0], in rtl92c_phy_set_txpower_level()
596 rtlpriv->cfg->ops->phy_rf6052_set_cck_txpower(hw, &cckpowerlevel[0]); in rtl92c_phy_set_txpower_level()
597 rtlpriv->cfg->ops->phy_rf6052_set_ofdm_txpower(hw, &ofdmpowerlevel[0], in rtl92c_phy_set_txpower_level()
602 bool rtl92c_phy_update_txpower_dbm(struct ieee80211_hw *hw, long power_indbm) in rtl92c_phy_update_txpower_dbm() argument
604 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_update_txpower_dbm()
606 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); in rtl92c_phy_update_txpower_dbm()
609 u8 ccktxpwridx = _rtl92c_phy_dbm_to_txpwr_idx(hw, WIRELESS_MODE_B, in rtl92c_phy_update_txpower_dbm()
611 u8 ofdmtxpwridx = _rtl92c_phy_dbm_to_txpwr_idx(hw, WIRELESS_MODE_N_24G, in rtl92c_phy_update_txpower_dbm()
629 rtl92c_phy_set_txpower_level(hw, rtlphy->current_channel); in rtl92c_phy_update_txpower_dbm()
634 u8 _rtl92c_phy_dbm_to_txpwr_idx(struct ieee80211_hw *hw, in _rtl92c_phy_dbm_to_txpwr_idx() argument
666 long _rtl92c_phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw, in _rtl92c_phy_txpwr_idx_to_dbm() argument
690 void rtl92c_phy_set_bw_mode(struct ieee80211_hw *hw, in rtl92c_phy_set_bw_mode() argument
693 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_set_bw_mode()
695 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl92c_phy_set_bw_mode()
701 if ((!is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) { in rtl92c_phy_set_bw_mode()
702 rtlpriv->cfg->ops->phy_set_bw_mode_callback(hw); in rtl92c_phy_set_bw_mode()
712 void rtl92c_phy_sw_chnl_callback(struct ieee80211_hw *hw) in rtl92c_phy_sw_chnl_callback() argument
714 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_sw_chnl_callback()
715 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl92c_phy_sw_chnl_callback()
727 (hw, rtlphy->current_channel, &rtlphy->sw_chnl_stage, in rtl92c_phy_sw_chnl_callback()
742 u8 rtl92c_phy_sw_chnl(struct ieee80211_hw *hw) in rtl92c_phy_sw_chnl() argument
744 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_sw_chnl()
746 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl92c_phy_sw_chnl()
757 if (!(is_hal_stop(rtlhal)) && !(RT_CANNOT_IO(hw))) { in rtl92c_phy_sw_chnl()
758 rtl92c_phy_sw_chnl_callback(hw); in rtl92c_phy_sw_chnl()
771 static void _rtl92c_phy_sw_rf_seting(struct ieee80211_hw *hw, u8 channel) in _rtl92c_phy_sw_rf_seting() argument
773 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_sw_rf_seting()
775 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl92c_phy_sw_rf_seting()
779 rtl_set_rfreg(hw, RF90_PATH_A, RF_RX_G1, in _rtl92c_phy_sw_rf_seting()
783 (u32)rtl_get_rfreg(hw, RF90_PATH_A, RF_RX_G1, in _rtl92c_phy_sw_rf_seting()
785 rtl_set_rfreg(hw, RF90_PATH_A, RF_RX_G1, MASKDWORD, in _rtl92c_phy_sw_rf_seting()
814 bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw, in _rtl92c_phy_sw_chnl_step_by_step() argument
818 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_sw_chnl_step_by_step()
884 rtl92c_phy_set_txpower_level(hw, channel); in _rtl92c_phy_sw_chnl_step_by_step()
904 rtl_set_rfreg(hw, (enum radio_path)rfpath, in _rtl92c_phy_sw_chnl_step_by_step()
909 _rtl92c_phy_sw_rf_seting(hw, channel); in _rtl92c_phy_sw_chnl_step_by_step()
925 bool rtl8192_phy_check_is_legal_rfpath(struct ieee80211_hw *hw, u32 rfpath) in rtl8192_phy_check_is_legal_rfpath() argument
931 static u8 _rtl92c_phy_path_a_iqk(struct ieee80211_hw *hw, bool config_pathb) in _rtl92c_phy_path_a_iqk() argument
936 rtl_set_bbreg(hw, 0xe30, MASKDWORD, 0x10008c1f); in _rtl92c_phy_path_a_iqk()
937 rtl_set_bbreg(hw, 0xe34, MASKDWORD, 0x10008c1f); in _rtl92c_phy_path_a_iqk()
938 rtl_set_bbreg(hw, 0xe38, MASKDWORD, 0x82140102); in _rtl92c_phy_path_a_iqk()
939 rtl_set_bbreg(hw, 0xe3c, MASKDWORD, in _rtl92c_phy_path_a_iqk()
943 rtl_set_bbreg(hw, 0xe50, MASKDWORD, 0x10008c22); in _rtl92c_phy_path_a_iqk()
944 rtl_set_bbreg(hw, 0xe54, MASKDWORD, 0x10008c22); in _rtl92c_phy_path_a_iqk()
945 rtl_set_bbreg(hw, 0xe58, MASKDWORD, 0x82140102); in _rtl92c_phy_path_a_iqk()
946 rtl_set_bbreg(hw, 0xe5c, MASKDWORD, 0x28160202); in _rtl92c_phy_path_a_iqk()
949 rtl_set_bbreg(hw, 0xe4c, MASKDWORD, 0x001028d1); in _rtl92c_phy_path_a_iqk()
950 rtl_set_bbreg(hw, 0xe48, MASKDWORD, 0xf9000000); in _rtl92c_phy_path_a_iqk()
951 rtl_set_bbreg(hw, 0xe48, MASKDWORD, 0xf8000000); in _rtl92c_phy_path_a_iqk()
955 reg_eac = rtl_get_bbreg(hw, 0xeac, MASKDWORD); in _rtl92c_phy_path_a_iqk()
956 reg_e94 = rtl_get_bbreg(hw, 0xe94, MASKDWORD); in _rtl92c_phy_path_a_iqk()
957 reg_e9c = rtl_get_bbreg(hw, 0xe9c, MASKDWORD); in _rtl92c_phy_path_a_iqk()
958 reg_ea4 = rtl_get_bbreg(hw, 0xea4, MASKDWORD); in _rtl92c_phy_path_a_iqk()
974 static u8 _rtl92c_phy_path_b_iqk(struct ieee80211_hw *hw) in _rtl92c_phy_path_b_iqk() argument
979 rtl_set_bbreg(hw, 0xe60, MASKDWORD, 0x00000002); in _rtl92c_phy_path_b_iqk()
980 rtl_set_bbreg(hw, 0xe60, MASKDWORD, 0x00000000); in _rtl92c_phy_path_b_iqk()
982 reg_eac = rtl_get_bbreg(hw, 0xeac, MASKDWORD); in _rtl92c_phy_path_b_iqk()
983 reg_eb4 = rtl_get_bbreg(hw, 0xeb4, MASKDWORD); in _rtl92c_phy_path_b_iqk()
984 reg_ebc = rtl_get_bbreg(hw, 0xebc, MASKDWORD); in _rtl92c_phy_path_b_iqk()
985 reg_ec4 = rtl_get_bbreg(hw, 0xec4, MASKDWORD); in _rtl92c_phy_path_b_iqk()
986 reg_ecc = rtl_get_bbreg(hw, 0xecc, MASKDWORD); in _rtl92c_phy_path_b_iqk()
1001 static void _rtl92c_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw, in _rtl92c_phy_path_a_fill_iqk_matrix() argument
1011 oldval_0 = (rtl_get_bbreg(hw, ROFDM0_XATXIQIMBALANCE, in _rtl92c_phy_path_a_fill_iqk_matrix()
1017 rtl_set_bbreg(hw, ROFDM0_XATXIQIMBALANCE, 0x3FF, tx0_a); in _rtl92c_phy_path_a_fill_iqk_matrix()
1018 rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, BIT(31), in _rtl92c_phy_path_a_fill_iqk_matrix()
1024 rtl_set_bbreg(hw, ROFDM0_XCTXAFE, 0xF0000000, in _rtl92c_phy_path_a_fill_iqk_matrix()
1026 rtl_set_bbreg(hw, ROFDM0_XATXIQIMBALANCE, 0x003F0000, in _rtl92c_phy_path_a_fill_iqk_matrix()
1028 rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, BIT(29), in _rtl92c_phy_path_a_fill_iqk_matrix()
1033 rtl_set_bbreg(hw, ROFDM0_XARXIQIMBALANCE, 0x3FF, reg); in _rtl92c_phy_path_a_fill_iqk_matrix()
1035 rtl_set_bbreg(hw, ROFDM0_XARXIQIMBALANCE, 0xFC00, reg); in _rtl92c_phy_path_a_fill_iqk_matrix()
1037 rtl_set_bbreg(hw, 0xca0, 0xF0000000, reg); in _rtl92c_phy_path_a_fill_iqk_matrix()
1041 static void _rtl92c_phy_path_b_fill_iqk_matrix(struct ieee80211_hw *hw, in _rtl92c_phy_path_b_fill_iqk_matrix() argument
1051 oldval_1 = (rtl_get_bbreg(hw, ROFDM0_XBTXIQIMBALANCE, in _rtl92c_phy_path_b_fill_iqk_matrix()
1057 rtl_set_bbreg(hw, ROFDM0_XBTXIQIMBALANCE, 0x3FF, tx1_a); in _rtl92c_phy_path_b_fill_iqk_matrix()
1058 rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, BIT(27), in _rtl92c_phy_path_b_fill_iqk_matrix()
1064 rtl_set_bbreg(hw, ROFDM0_XDTXAFE, 0xF0000000, in _rtl92c_phy_path_b_fill_iqk_matrix()
1066 rtl_set_bbreg(hw, ROFDM0_XBTXIQIMBALANCE, 0x003F0000, in _rtl92c_phy_path_b_fill_iqk_matrix()
1068 rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, BIT(25), in _rtl92c_phy_path_b_fill_iqk_matrix()
1073 rtl_set_bbreg(hw, ROFDM0_XBRXIQIMBALANCE, 0x3FF, reg); in _rtl92c_phy_path_b_fill_iqk_matrix()
1075 rtl_set_bbreg(hw, ROFDM0_XBRXIQIMBALANCE, 0xFC00, reg); in _rtl92c_phy_path_b_fill_iqk_matrix()
1077 rtl_set_bbreg(hw, ROFDM0_AGCRSSITABLE, 0x0000F000, reg); in _rtl92c_phy_path_b_fill_iqk_matrix()
1081 static void _rtl92c_phy_save_adda_registers(struct ieee80211_hw *hw, in _rtl92c_phy_save_adda_registers() argument
1088 addabackup[i] = rtl_get_bbreg(hw, addareg[i], MASKDWORD); in _rtl92c_phy_save_adda_registers()
1091 static void _rtl92c_phy_save_mac_registers(struct ieee80211_hw *hw, in _rtl92c_phy_save_mac_registers() argument
1094 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_save_mac_registers()
1102 static void _rtl92c_phy_reload_adda_registers(struct ieee80211_hw *hw, in _rtl92c_phy_reload_adda_registers() argument
1109 rtl_set_bbreg(hw, addareg[i], MASKDWORD, addabackup[i]); in _rtl92c_phy_reload_adda_registers()
1112 static void _rtl92c_phy_reload_mac_registers(struct ieee80211_hw *hw, in _rtl92c_phy_reload_mac_registers() argument
1115 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_reload_mac_registers()
1123 static void _rtl92c_phy_path_adda_on(struct ieee80211_hw *hw, in _rtl92c_phy_path_adda_on() argument
1132 rtl_set_bbreg(hw, addareg[0], MASKDWORD, 0x0b1b25a0); in _rtl92c_phy_path_adda_on()
1134 rtl_set_bbreg(hw, addareg[0], MASKDWORD, pathOn); in _rtl92c_phy_path_adda_on()
1138 rtl_set_bbreg(hw, addareg[i], MASKDWORD, pathOn); in _rtl92c_phy_path_adda_on()
1141 static void _rtl92c_phy_mac_setting_calibration(struct ieee80211_hw *hw, in _rtl92c_phy_mac_setting_calibration() argument
1144 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_mac_setting_calibration()
1155 static void _rtl92c_phy_path_a_standby(struct ieee80211_hw *hw) in _rtl92c_phy_path_a_standby() argument
1157 rtl_set_bbreg(hw, 0xe28, MASKDWORD, 0x0); in _rtl92c_phy_path_a_standby()
1158 rtl_set_bbreg(hw, 0x840, MASKDWORD, 0x00010000); in _rtl92c_phy_path_a_standby()
1159 rtl_set_bbreg(hw, 0xe28, MASKDWORD, 0x80800000); in _rtl92c_phy_path_a_standby()
1162 static void _rtl92c_phy_pi_mode_switch(struct ieee80211_hw *hw, bool pi_mode) in _rtl92c_phy_pi_mode_switch() argument
1167 rtl_set_bbreg(hw, 0x820, MASKDWORD, mode); in _rtl92c_phy_pi_mode_switch()
1168 rtl_set_bbreg(hw, 0x828, MASKDWORD, mode); in _rtl92c_phy_pi_mode_switch()
1171 static bool _rtl92c_phy_simularity_compare(struct ieee80211_hw *hw, in _rtl92c_phy_simularity_compare() argument
1175 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl92c_phy_simularity_compare()
1230 static void _rtl92c_phy_iq_calibrate(struct ieee80211_hw *hw, in _rtl92c_phy_iq_calibrate() argument
1233 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_iq_calibrate()
1250 bbvalue = rtl_get_bbreg(hw, 0x800, MASKDWORD); in _rtl92c_phy_iq_calibrate()
1252 _rtl92c_phy_save_adda_registers(hw, adda_reg, in _rtl92c_phy_iq_calibrate()
1254 _rtl92c_phy_save_mac_registers(hw, iqk_mac_reg, in _rtl92c_phy_iq_calibrate()
1257 _rtl92c_phy_path_adda_on(hw, adda_reg, true, is2t); in _rtl92c_phy_iq_calibrate()
1260 (u8)rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER1, in _rtl92c_phy_iq_calibrate()
1265 _rtl92c_phy_pi_mode_switch(hw, true); in _rtl92c_phy_iq_calibrate()
1267 rtlphy->reg_c04 = rtl_get_bbreg(hw, 0xc04, MASKDWORD); in _rtl92c_phy_iq_calibrate()
1268 rtlphy->reg_c08 = rtl_get_bbreg(hw, 0xc08, MASKDWORD); in _rtl92c_phy_iq_calibrate()
1269 rtlphy->reg_874 = rtl_get_bbreg(hw, 0x874, MASKDWORD); in _rtl92c_phy_iq_calibrate()
1271 rtl_set_bbreg(hw, 0xc04, MASKDWORD, 0x03a05600); in _rtl92c_phy_iq_calibrate()
1272 rtl_set_bbreg(hw, 0xc08, MASKDWORD, 0x000800e4); in _rtl92c_phy_iq_calibrate()
1273 rtl_set_bbreg(hw, 0x874, MASKDWORD, 0x22204000); in _rtl92c_phy_iq_calibrate()
1275 rtl_set_bbreg(hw, 0x840, MASKDWORD, 0x00010000); in _rtl92c_phy_iq_calibrate()
1276 rtl_set_bbreg(hw, 0x844, MASKDWORD, 0x00010000); in _rtl92c_phy_iq_calibrate()
1278 _rtl92c_phy_mac_setting_calibration(hw, iqk_mac_reg, in _rtl92c_phy_iq_calibrate()
1280 rtl_set_bbreg(hw, 0xb68, MASKDWORD, 0x00080000); in _rtl92c_phy_iq_calibrate()
1282 rtl_set_bbreg(hw, 0xb6c, MASKDWORD, 0x00080000); in _rtl92c_phy_iq_calibrate()
1283 rtl_set_bbreg(hw, 0xe28, MASKDWORD, 0x80800000); in _rtl92c_phy_iq_calibrate()
1284 rtl_set_bbreg(hw, 0xe40, MASKDWORD, 0x01007c00); in _rtl92c_phy_iq_calibrate()
1285 rtl_set_bbreg(hw, 0xe44, MASKDWORD, 0x01004800); in _rtl92c_phy_iq_calibrate()
1287 patha_ok = _rtl92c_phy_path_a_iqk(hw, is2t); in _rtl92c_phy_iq_calibrate()
1289 result[t][0] = (rtl_get_bbreg(hw, 0xe94, MASKDWORD) & in _rtl92c_phy_iq_calibrate()
1291 result[t][1] = (rtl_get_bbreg(hw, 0xe9c, MASKDWORD) & in _rtl92c_phy_iq_calibrate()
1293 result[t][2] = (rtl_get_bbreg(hw, 0xea4, MASKDWORD) & in _rtl92c_phy_iq_calibrate()
1295 result[t][3] = (rtl_get_bbreg(hw, 0xeac, MASKDWORD) & in _rtl92c_phy_iq_calibrate()
1300 result[t][0] = (rtl_get_bbreg(hw, 0xe94, in _rtl92c_phy_iq_calibrate()
1304 (rtl_get_bbreg(hw, 0xe9c, MASKDWORD) & 0x3FF0000) >> 16; in _rtl92c_phy_iq_calibrate()
1309 _rtl92c_phy_path_a_standby(hw); in _rtl92c_phy_iq_calibrate()
1310 _rtl92c_phy_path_adda_on(hw, adda_reg, false, is2t); in _rtl92c_phy_iq_calibrate()
1312 pathb_ok = _rtl92c_phy_path_b_iqk(hw); in _rtl92c_phy_iq_calibrate()
1314 result[t][4] = (rtl_get_bbreg(hw, in _rtl92c_phy_iq_calibrate()
1319 (rtl_get_bbreg(hw, 0xebc, MASKDWORD) & in _rtl92c_phy_iq_calibrate()
1322 (rtl_get_bbreg(hw, 0xec4, MASKDWORD) & in _rtl92c_phy_iq_calibrate()
1325 (rtl_get_bbreg(hw, 0xecc, MASKDWORD) & in _rtl92c_phy_iq_calibrate()
1329 result[t][4] = (rtl_get_bbreg(hw, in _rtl92c_phy_iq_calibrate()
1334 result[t][5] = (rtl_get_bbreg(hw, 0xebc, MASKDWORD) & in _rtl92c_phy_iq_calibrate()
1338 rtl_set_bbreg(hw, 0xc04, MASKDWORD, rtlphy->reg_c04); in _rtl92c_phy_iq_calibrate()
1339 rtl_set_bbreg(hw, 0x874, MASKDWORD, rtlphy->reg_874); in _rtl92c_phy_iq_calibrate()
1340 rtl_set_bbreg(hw, 0xc08, MASKDWORD, rtlphy->reg_c08); in _rtl92c_phy_iq_calibrate()
1341 rtl_set_bbreg(hw, 0xe28, MASKDWORD, 0); in _rtl92c_phy_iq_calibrate()
1342 rtl_set_bbreg(hw, 0x840, MASKDWORD, 0x00032ed3); in _rtl92c_phy_iq_calibrate()
1344 rtl_set_bbreg(hw, 0x844, MASKDWORD, 0x00032ed3); in _rtl92c_phy_iq_calibrate()
1347 _rtl92c_phy_pi_mode_switch(hw, false); in _rtl92c_phy_iq_calibrate()
1348 _rtl92c_phy_reload_adda_registers(hw, adda_reg, in _rtl92c_phy_iq_calibrate()
1350 _rtl92c_phy_reload_mac_registers(hw, iqk_mac_reg, in _rtl92c_phy_iq_calibrate()
1355 static void _rtl92c_phy_ap_calibrate(struct ieee80211_hw *hw, in _rtl92c_phy_ap_calibrate() argument
1360 static void _rtl92c_phy_set_rfpath_switch(struct ieee80211_hw *hw, in _rtl92c_phy_set_rfpath_switch() argument
1363 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl92c_phy_set_rfpath_switch()
1366 rtl_set_bbreg(hw, REG_LEDCFG0, BIT(23), 0x01); in _rtl92c_phy_set_rfpath_switch()
1367 rtl_set_bbreg(hw, rFPGA0_XAB_RFPARAMETER, BIT(13), 0x01); in _rtl92c_phy_set_rfpath_switch()
1371 rtl_set_bbreg(hw, RFPGA0_XB_RFINTERFACEOE, in _rtl92c_phy_set_rfpath_switch()
1374 rtl_set_bbreg(hw, RFPGA0_XB_RFINTERFACEOE, in _rtl92c_phy_set_rfpath_switch()
1378 rtl_set_bbreg(hw, RFPGA0_XA_RFINTERFACEOE, 0x300, 0x2); in _rtl92c_phy_set_rfpath_switch()
1380 rtl_set_bbreg(hw, RFPGA0_XA_RFINTERFACEOE, 0x300, 0x1); in _rtl92c_phy_set_rfpath_switch()
1387 void rtl92c_phy_iq_calibrate(struct ieee80211_hw *hw, bool b_recovery) in rtl92c_phy_iq_calibrate() argument
1389 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_iq_calibrate()
1391 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl92c_phy_iq_calibrate()
1413 _rtl92c_phy_reload_adda_registers(hw, in rtl92c_phy_iq_calibrate()
1432 _rtl92c_phy_iq_calibrate(hw, result, i, true); in rtl92c_phy_iq_calibrate()
1434 _rtl92c_phy_iq_calibrate(hw, result, i, false); in rtl92c_phy_iq_calibrate()
1436 is12simular = _rtl92c_phy_simularity_compare(hw, in rtl92c_phy_iq_calibrate()
1445 is13simular = _rtl92c_phy_simularity_compare(hw, in rtl92c_phy_iq_calibrate()
1452 is23simular = _rtl92c_phy_simularity_compare(hw, in rtl92c_phy_iq_calibrate()
1494 _rtl92c_phy_path_a_fill_iqk_matrix(hw, b_patha_ok, result, in rtl92c_phy_iq_calibrate()
1499 _rtl92c_phy_path_b_fill_iqk_matrix(hw, b_pathb_ok, in rtl92c_phy_iq_calibrate()
1504 _rtl92c_phy_save_adda_registers(hw, iqk_bb_reg, in rtl92c_phy_iq_calibrate()
1509 void rtl92c_phy_lc_calibrate(struct ieee80211_hw *hw) in rtl92c_phy_lc_calibrate() argument
1511 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_lc_calibrate()
1512 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl92c_phy_lc_calibrate()
1515 rtlpriv->cfg->ops->phy_lc_calibrate(hw, true); in rtl92c_phy_lc_calibrate()
1517 rtlpriv->cfg->ops->phy_lc_calibrate(hw, false); in rtl92c_phy_lc_calibrate()
1521 void rtl92c_phy_ap_calibrate(struct ieee80211_hw *hw, char delta) in rtl92c_phy_ap_calibrate() argument
1523 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_ap_calibrate()
1525 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl92c_phy_ap_calibrate()
1530 _rtl92c_phy_ap_calibrate(hw, delta, true); in rtl92c_phy_ap_calibrate()
1532 _rtl92c_phy_ap_calibrate(hw, delta, false); in rtl92c_phy_ap_calibrate()
1536 void rtl92c_phy_set_rfpath_switch(struct ieee80211_hw *hw, bool bmain) in rtl92c_phy_set_rfpath_switch() argument
1538 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl92c_phy_set_rfpath_switch()
1541 _rtl92c_phy_set_rfpath_switch(hw, bmain, true); in rtl92c_phy_set_rfpath_switch()
1543 _rtl92c_phy_set_rfpath_switch(hw, bmain, false); in rtl92c_phy_set_rfpath_switch()
1547 bool rtl92c_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype) in rtl92c_phy_set_io_cmd() argument
1549 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_set_io_cmd()
1580 rtl92c_phy_set_io(hw); in rtl92c_phy_set_io_cmd()
1586 void rtl92c_phy_set_io(struct ieee80211_hw *hw) in rtl92c_phy_set_io() argument
1588 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92c_phy_set_io()
1598 rtl92c_dm_write_dig(hw); in rtl92c_phy_set_io()
1599 rtl92c_phy_set_txpower_level(hw, rtlphy->current_channel); in rtl92c_phy_set_io()
1604 rtl92c_dm_write_dig(hw); in rtl92c_phy_set_io()
1617 void rtl92ce_phy_set_rf_on(struct ieee80211_hw *hw) in rtl92ce_phy_set_rf_on() argument
1619 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl92ce_phy_set_rf_on()
1630 void _rtl92c_phy_set_rf_sleep(struct ieee80211_hw *hw) in _rtl92c_phy_set_rf_sleep() argument
1634 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl92c_phy_set_rf_sleep()
1637 rtl_set_rfreg(hw, RF90_PATH_A, 0x00, RFREG_OFFSET_MASK, 0x00); in _rtl92c_phy_set_rf_sleep()
1639 u4b_tmp = rtl_get_rfreg(hw, RF90_PATH_A, 0, RFREG_OFFSET_MASK); in _rtl92c_phy_set_rf_sleep()
1642 rtl_set_rfreg(hw, RF90_PATH_A, 0x00, RFREG_OFFSET_MASK, 0x00); in _rtl92c_phy_set_rf_sleep()
1644 u4b_tmp = rtl_get_rfreg(hw, RF90_PATH_A, 0, RFREG_OFFSET_MASK); in _rtl92c_phy_set_rf_sleep()