aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-23 12:09:10 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-23 12:38:56 -0500
commitfc856b803c1c91f778c63da2ce4f09bedd1bba71 (patch)
tree3f0e3aac4a70f06fd2fa4c3b06e7e637cfb5624e
parent530877d8ddf300d9553e493398117ddecc274ffd (diff)
Staging: rtl8821ae: removed unused functions and variables
Clean up a bunch of build warnings by removing functions and variables that aren't being used. Cc: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/rtl8821ae/rtl8821ae/dm.c123
-rw-r--r--drivers/staging/rtl8821ae/rtl8821ae/fw.c5
-rw-r--r--drivers/staging/rtl8821ae/rtl8821ae/phy.c228
-rw-r--r--drivers/staging/rtl8821ae/rtl8821ae/trx.c1
4 files changed, 3 insertions, 354 deletions
diff --git a/drivers/staging/rtl8821ae/rtl8821ae/dm.c b/drivers/staging/rtl8821ae/rtl8821ae/dm.c
index 881ea11df8a6..41bd21d0e8cd 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/dm.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/dm.c
@@ -556,11 +556,6 @@ void rtl8821ae_dm_initialize_txpower_tracking_thermalmeter(
556 } 556 }
557} 557}
558 558
559static void rtl8821ae_dm_initialize_txpower_tracking(struct ieee80211_hw *hw)
560{
561 rtl8821ae_dm_initialize_txpower_tracking_thermalmeter(hw);
562}
563
564static void rtl8821ae_dm_init_dynamic_bb_powersaving(struct ieee80211_hw *hw) 559static void rtl8821ae_dm_init_dynamic_bb_powersaving(struct ieee80211_hw *hw)
565{ 560{
566 dm_pstable.pre_ccastate = CCA_MAX; 561 dm_pstable.pre_ccastate = CCA_MAX;
@@ -775,7 +770,6 @@ void rtl8812ae_dm_rssi_dump_to_register(
775static void rtl8821ae_dm_check_rssi_monitor(struct ieee80211_hw *hw) 770static void rtl8821ae_dm_check_rssi_monitor(struct ieee80211_hw *hw)
776{ 771{
777 struct rtl_priv *rtlpriv = rtl_priv(hw); 772 struct rtl_priv *rtlpriv = rtl_priv(hw);
778 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
779 struct rtl_sta_info *drv_priv; 773 struct rtl_sta_info *drv_priv;
780 u8 h2c_parameter[3] = { 0 }; 774 u8 h2c_parameter[3] = { 0 };
781 long tmp_entry_max_pwdb = 0, tmp_entry_min_pwdb = 0xff; 775 long tmp_entry_max_pwdb = 0, tmp_entry_min_pwdb = 0xff;
@@ -1131,12 +1125,6 @@ void rtl8812ae_dm_check_txpower_tracking_thermalmeter(
1131 } 1125 }
1132} 1126}
1133 1127
1134static void rtl8821ae_dm_dynamic_txpower(struct ieee80211_hw *hw)
1135{
1136 /* 8723BE does not support ODM_BB_DYNAMIC_TXPWR*/
1137 return;
1138}
1139
1140static void rtl8821ae_dm_iq_calibrate(struct ieee80211_hw *hw) 1128static void rtl8821ae_dm_iq_calibrate(struct ieee80211_hw *hw)
1141{ 1129{
1142 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 1130 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
@@ -1166,107 +1154,6 @@ static void rtl8821ae_dm_iq_calibrate(struct ieee80211_hw *hw)
1166} 1154}
1167 1155
1168 1156
1169static void rtl8821ae_set_iqk_matrix(struct ieee80211_hw *hw,
1170 u8 ofdm_index,
1171 u8 rfpath,
1172 long iqk_result_x,
1173 long iqk_result_y)
1174{
1175 long ele_a = 0, ele_d, ele_c = 0, value32;
1176
1177 if (ofdm_index >= OFDM_TABLE_SIZE)
1178 ofdm_index = OFDM_TABLE_SIZE - 1;
1179 else if (ofdm_index < 0)
1180 ofdm_index = 0;
1181
1182 ele_d = (ofdmswing_table[ofdm_index] & 0xFFC00000)>>22;
1183
1184 if (iqk_result_x != 0){
1185 if ((iqk_result_x & 0x00000200) != 0)
1186 iqk_result_x = iqk_result_x | 0xFFFFFC00;
1187 ele_a = ((iqk_result_x * ele_d)>>8)&0x000003FF;
1188
1189 if ((iqk_result_y & 0x00000200) != 0)
1190 iqk_result_y = iqk_result_y | 0xFFFFFC00;
1191 ele_c = ((iqk_result_y * ele_d)>>8)&0x000003FF;
1192
1193 switch (rfpath){
1194 case RF90_PATH_A:
1195 value32 = (ele_d << 22)|((ele_c & 0x3F)<<16) | ele_a;
1196 rtl_set_bbreg(hw, ROFDM0_XATXIQIMBALANCE, MASKDWORD, value32);
1197 value32 = (ele_c & 0x000003C0) >> 6;
1198 rtl_set_bbreg(hw, ROFDM0_XCTXAFE, MASKH4BITS, value32);
1199 value32 = ((iqk_result_x * ele_d) >> 7) & 0x01;
1200 rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, BIT(24), value32);
1201 break;
1202 default:
1203 break;
1204 }
1205 } else {
1206 switch (rfpath){
1207 case RF90_PATH_A:
1208 rtl_set_bbreg(hw, ROFDM0_XATXIQIMBALANCE, MASKDWORD, ofdmswing_table[ofdm_index]);
1209 rtl_set_bbreg(hw, ROFDM0_XCTXAFE, MASKH4BITS, 0x00);
1210 rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, BIT(24), 0x00);
1211 break;
1212 default:
1213 break;
1214 }
1215 }
1216}
1217
1218
1219static void rtl8821ae_dm_tx_power_track_set_power(struct ieee80211_hw *hw,
1220 enum pwr_track_control_method method,
1221 u8 rfpath,
1222 u8 channel_mapped_index)
1223{
1224 struct rtl_priv *rtlpriv = rtl_priv(hw);
1225 struct rtl_phy *rtlphy = &(rtlpriv->phy);
1226 struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw));
1227
1228 if (method == TXAGC) {
1229 rtl8821ae_phy_set_txpower_level(hw,rtlphy->current_channel);
1230 } else if (method == BBSWING) {
1231 if (rtldm->bb_swing_idx_cck >= CCK_TABLE_SIZE)
1232 rtldm->bb_swing_idx_cck = CCK_TABLE_SIZE-1;
1233 else if (rtldm->bb_swing_idx_cck < 0)
1234 rtldm->bb_swing_idx_cck = 0;
1235
1236 if (!rtldm->b_cck_inch14) {
1237 rtl_write_byte(rtlpriv, 0xa22, cckswing_table_ch1ch13[rtldm->bb_swing_idx_cck][0]);
1238 rtl_write_byte(rtlpriv, 0xa23, cckswing_table_ch1ch13[rtldm->bb_swing_idx_cck][1]);
1239 rtl_write_byte(rtlpriv, 0xa24, cckswing_table_ch1ch13[rtldm->bb_swing_idx_cck][2]);
1240 rtl_write_byte(rtlpriv, 0xa25, cckswing_table_ch1ch13[rtldm->bb_swing_idx_cck][3]);
1241 rtl_write_byte(rtlpriv, 0xa26, cckswing_table_ch1ch13[rtldm->bb_swing_idx_cck][4]);
1242 rtl_write_byte(rtlpriv, 0xa27, cckswing_table_ch1ch13[rtldm->bb_swing_idx_cck][5]);
1243 rtl_write_byte(rtlpriv, 0xa28, cckswing_table_ch1ch13[rtldm->bb_swing_idx_cck][6]);
1244 rtl_write_byte(rtlpriv, 0xa29, cckswing_table_ch1ch13[rtldm->bb_swing_idx_cck][7]);
1245 } else{
1246 rtl_write_byte(rtlpriv, 0xa22, cckswing_table_ch14[rtldm->bb_swing_idx_cck][0]);
1247 rtl_write_byte(rtlpriv, 0xa23, cckswing_table_ch14[rtldm->bb_swing_idx_cck][1]);
1248 rtl_write_byte(rtlpriv, 0xa24, cckswing_table_ch14[rtldm->bb_swing_idx_cck][2]);
1249 rtl_write_byte(rtlpriv, 0xa25, cckswing_table_ch14[rtldm->bb_swing_idx_cck][3]);
1250 rtl_write_byte(rtlpriv, 0xa26, cckswing_table_ch14[rtldm->bb_swing_idx_cck][4]);
1251 rtl_write_byte(rtlpriv, 0xa27, cckswing_table_ch14[rtldm->bb_swing_idx_cck][5]);
1252 rtl_write_byte(rtlpriv, 0xa28, cckswing_table_ch14[rtldm->bb_swing_idx_cck][6]);
1253 rtl_write_byte(rtlpriv, 0xa29, cckswing_table_ch14[rtldm->bb_swing_idx_cck][7]);
1254 }
1255
1256 if (rfpath == RF90_PATH_A){
1257 rtl8821ae_set_iqk_matrix(hw, rtldm->bb_swing_idx_ofdm[rfpath], rfpath,
1258 rtlphy->iqk_matrix_regsetting[channel_mapped_index].value[0][0],
1259 rtlphy->iqk_matrix_regsetting[channel_mapped_index].value[0][1]);
1260 } else if (rfpath == RF90_PATH_B) {
1261 rtl8821ae_set_iqk_matrix(hw, rtldm->bb_swing_idx_ofdm[rfpath], rfpath,
1262 rtlphy->iqk_matrix_regsetting[channel_mapped_index].value[0][4],
1263 rtlphy->iqk_matrix_regsetting[channel_mapped_index].value[0][5]);
1264 }
1265 } else {
1266 return;
1267 }
1268}
1269
1270void rtl8812ae_get_delta_swing_table( 1157void rtl8812ae_get_delta_swing_table(
1271 struct ieee80211_hw *hw, 1158 struct ieee80211_hw *hw,
1272 u8 **temperature_up_a, 1159 u8 **temperature_up_a,
@@ -1323,8 +1210,6 @@ void rtl8812ae_phy_lccalibrate(
1323 struct ieee80211_hw *hw) 1210 struct ieee80211_hw *hw)
1324{ 1211{
1325 struct rtl_priv *rtlpriv = rtl_priv(hw); 1212 struct rtl_priv *rtlpriv = rtl_priv(hw);
1326 bool b_start_cont_tx = false, b_single_tone = false, b_carrier_suppression = false;
1327
1328 1213
1329 RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("===> rtl8812ae_phy_lccalibrate\n")); 1214 RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("===> rtl8812ae_phy_lccalibrate\n"));
1330 1215
@@ -1455,8 +1340,6 @@ void rtl8812ae_dm_txpwr_track_set_pwr(struct ieee80211_hw *hw,
1455 u8 pwr_tracking_limit = 26; /*+1.0dB*/ 1340 u8 pwr_tracking_limit = 26; /*+1.0dB*/
1456 u8 tx_rate = 0xFF; 1341 u8 tx_rate = 0xFF;
1457 char final_ofdm_swing_index = 0; 1342 char final_ofdm_swing_index = 0;
1458 char final_cck_swing_index = 0;
1459 u8 i = 0;
1460 1343
1461 if(rtldm->tx_rate != 0xFF) 1344 if(rtldm->tx_rate != 0xFF)
1462 tx_rate = rtl8812ae_hw_rate_to_mrate(hw, rtldm->tx_rate); 1345 tx_rate = rtl8812ae_hw_rate_to_mrate(hw, rtldm->tx_rate);
@@ -2083,8 +1966,6 @@ void rtl8821ae_phy_lccalibrate(
2083 struct ieee80211_hw *hw) 1966 struct ieee80211_hw *hw)
2084{ 1967{
2085 struct rtl_priv *rtlpriv = rtl_priv(hw); 1968 struct rtl_priv *rtlpriv = rtl_priv(hw);
2086 bool b_start_cont_tx = false, b_single_tone = false, b_carrier_suppression = false;
2087
2088 1969
2089 RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("===> rtl8812ae_phy_lccalibrate\n")); 1970 RT_TRACE(COMP_POWER_TRACKING, DBG_LOUD, ("===> rtl8812ae_phy_lccalibrate\n"));
2090 1971
@@ -2119,8 +2000,6 @@ void rtl8821ae_dm_txpwr_track_set_pwr(struct ieee80211_hw *hw,
2119 u8 pwr_tracking_limit = 26; /*+1.0dB*/ 2000 u8 pwr_tracking_limit = 26; /*+1.0dB*/
2120 u8 tx_rate = 0xFF; 2001 u8 tx_rate = 0xFF;
2121 char final_ofdm_swing_index = 0; 2002 char final_ofdm_swing_index = 0;
2122 char final_cck_swing_index = 0;
2123 u8 i = 0;
2124 2003
2125 if(rtldm->tx_rate != 0xFF) 2004 if(rtldm->tx_rate != 0xFF)
2126 tx_rate = rtl8812ae_hw_rate_to_mrate(hw, rtldm->tx_rate); 2005 tx_rate = rtl8812ae_hw_rate_to_mrate(hw, rtldm->tx_rate);
@@ -2806,7 +2685,7 @@ static void rtl8821ae_dm_check_edca_turbo(struct ieee80211_hw *hw)
2806 rtlpriv->dm.bcurrent_turbo_edca = false; 2685 rtlpriv->dm.bcurrent_turbo_edca = false;
2807 } 2686 }
2808 2687
2809dm_CheckEdcaTurbo_EXIT: 2688/* dm_CheckEdcaTurbo_EXIT: */
2810 rtlpriv->dm.bis_any_nonbepkts = false; 2689 rtlpriv->dm.bis_any_nonbepkts = false;
2811 rtldm->last_tx_ok_cnt = rtlpriv->stats.txbytesunicast; 2690 rtldm->last_tx_ok_cnt = rtlpriv->stats.txbytesunicast;
2812 rtldm->last_rx_ok_cnt = rtlpriv->stats.rxbytesunicast; 2691 rtldm->last_rx_ok_cnt = rtlpriv->stats.rxbytesunicast;
diff --git a/drivers/staging/rtl8821ae/rtl8821ae/fw.c b/drivers/staging/rtl8821ae/rtl8821ae/fw.c
index 89ce456c7ab9..4083cab926a3 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/fw.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/fw.c
@@ -1289,13 +1289,8 @@ void rtl8812ae_c2h_ra_report_handler(
1289 u8 cmd_len 1289 u8 cmd_len
1290) 1290)
1291{ 1291{
1292 struct rtl_priv *rtlpriv = rtl_priv(hw);
1293 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 1292 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
1294
1295 u8 rate = cmd_buf[0] & 0x3F; 1293 u8 rate = cmd_buf[0] & 0x3F;
1296 u8 mac_id = cmd_buf[1];
1297 bool b_ldpc = cmd_buf[2] & BIT(0);
1298 bool b_tx_bf = (cmd_buf[2] & BIT(1)) >> 1;
1299 1294
1300 rtlhal->current_ra_rate= rtl8812ae_hw_rate_to_mrate(hw, rate); 1295 rtlhal->current_ra_rate= rtl8812ae_hw_rate_to_mrate(hw, rate);
1301 1296
diff --git a/drivers/staging/rtl8821ae/rtl8821ae/phy.c b/drivers/staging/rtl8821ae/rtl8821ae/phy.c
index 2532b89e5764..09ffdc2e63a3 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/phy.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/phy.c
@@ -3088,40 +3088,6 @@ u8 rtl8821ae_phy_sw_chnl(struct ieee80211_hw *hw)
3088 return 1; 3088 return 1;
3089} 3089}
3090 3090
3091static u8 _rtl8821ae_phy_path_a_iqk(struct ieee80211_hw *hw, bool config_pathb)
3092{
3093 u32 reg_eac, reg_e94, reg_e9c, reg_ea4;
3094 u8 result = 0x00;
3095
3096 rtl_set_bbreg(hw, 0xe30, MASKDWORD, 0x10008c1c);
3097 rtl_set_bbreg(hw, 0xe34, MASKDWORD, 0x30008c1c);
3098 rtl_set_bbreg(hw, 0xe38, MASKDWORD, 0x8214032a);
3099 rtl_set_bbreg(hw, 0xe3c, MASKDWORD, 0x28160000);
3100
3101 rtl_set_bbreg(hw, 0xe4c, MASKDWORD, 0x00462911);
3102 rtl_set_bbreg(hw, 0xe48, MASKDWORD, 0xf9000000);
3103 rtl_set_bbreg(hw, 0xe48, MASKDWORD, 0xf8000000);
3104
3105 mdelay(IQK_DELAY_TIME);
3106
3107 reg_eac = rtl_get_bbreg(hw, 0xeac, MASKDWORD);
3108 reg_e94 = rtl_get_bbreg(hw, 0xe94, MASKDWORD);
3109 reg_e9c = rtl_get_bbreg(hw, 0xe9c, MASKDWORD);
3110 reg_ea4 = rtl_get_bbreg(hw, 0xea4, MASKDWORD);
3111
3112 if (!(reg_eac & BIT(28)) &&
3113 (((reg_e94 & 0x03FF0000) >> 16) != 0x142) &&
3114 (((reg_e9c & 0x03FF0000) >> 16) != 0x42))
3115 result |= 0x01;
3116 else
3117 return result;
3118/*
3119 if (!(reg_eac & BIT(27)) &&
3120 (((reg_ea4 & 0x03FF0000) >> 16) != 0x132) &&
3121 (((reg_eac & 0x03FF0000) >> 16) != 0x36))
3122 result |= 0x02;*/
3123 return result;
3124}
3125#if 0 3091#if 0
3126static u8 _rtl8821ae_phy_path_b_iqk(struct ieee80211_hw *hw) 3092static u8 _rtl8821ae_phy_path_b_iqk(struct ieee80211_hw *hw)
3127{ 3093{
@@ -3234,196 +3200,6 @@ static u8 _rtl8821ae_phy_path_a_rx_iqk(struct ieee80211_hw *hw, bool config_path
3234 return result; 3200 return result;
3235} 3201}
3236#endif 3202#endif
3237static void _rtl8821ae_phy_path_a_fill_iqk_matrix(struct ieee80211_hw *hw,
3238 bool b_iqk_ok, long result[][8],
3239 u8 final_candidate, bool btxonly)
3240{
3241 u32 oldval_0, x, tx0_a, reg;
3242 long y, tx0_c;
3243
3244 if (final_candidate == 0xFF) {
3245 return;
3246 } else if (b_iqk_ok) {
3247 oldval_0 = (rtl_get_bbreg(hw, ROFDM0_XATXIQIMBALANCE,
3248 MASKDWORD) >> 22) & 0x3FF;
3249 x = result[final_candidate][0];
3250 if ((x & 0x00000200) != 0)
3251 x = x | 0xFFFFFC00;
3252 tx0_a = (x * oldval_0) >> 8;
3253 rtl_set_bbreg(hw, ROFDM0_XATXIQIMBALANCE, 0x3FF, tx0_a);
3254 rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, BIT(31),
3255 ((x * oldval_0 >> 7) & 0x1));
3256 y = result[final_candidate][1];
3257 if ((y & 0x00000200) != 0)
3258 y = y | 0xFFFFFC00;
3259 tx0_c = (y * oldval_0) >> 8;
3260 rtl_set_bbreg(hw, ROFDM0_XCTXAFE, 0xF0000000,
3261 ((tx0_c & 0x3C0) >> 6));
3262 rtl_set_bbreg(hw, ROFDM0_XATXIQIMBALANCE, 0x003F0000,
3263 (tx0_c & 0x3F));
3264 rtl_set_bbreg(hw, ROFDM0_ECCATHRESHOLD, BIT(29),
3265 ((y * oldval_0 >> 7) & 0x1));
3266 if (btxonly)
3267 return;
3268 reg = result[final_candidate][2];
3269 rtl_set_bbreg(hw, ROFDM0_XARXIQIMBALANCE, 0x3FF, reg);
3270 reg = result[final_candidate][3] & 0x3F;
3271 rtl_set_bbreg(hw, ROFDM0_XARXIQIMBALANCE, 0xFC00, reg);
3272 reg = (result[final_candidate][3] >> 6) & 0xF;
3273 rtl_set_bbreg(hw, 0xca0, 0xF0000000, reg);
3274 }
3275}
3276
3277
3278static void _rtl8821ae_phy_save_adda_registers(struct ieee80211_hw *hw,
3279 u32 *addareg, u32 *addabackup,
3280 u32 registernum)
3281{
3282 u32 i;
3283
3284 for (i = 0; i < registernum; i++)
3285 addabackup[i] = rtl_get_bbreg(hw, addareg[i], MASKDWORD);
3286}
3287
3288static void _rtl8821ae_phy_save_mac_registers(struct ieee80211_hw *hw,
3289 u32 *macreg, u32 *macbackup)
3290{
3291 struct rtl_priv *rtlpriv = rtl_priv(hw);
3292 u32 i;
3293
3294 for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++)
3295 macbackup[i] = rtl_read_byte(rtlpriv, macreg[i]);
3296 macbackup[i] = rtl_read_dword(rtlpriv, macreg[i]);
3297}
3298
3299static void _rtl8821ae_phy_reload_adda_registers(struct ieee80211_hw *hw,
3300 u32 *addareg, u32 *addabackup,
3301 u32 regiesternum)
3302{
3303 u32 i;
3304
3305 for (i = 0; i < regiesternum; i++)
3306 rtl_set_bbreg(hw, addareg[i], MASKDWORD, addabackup[i]);
3307}
3308
3309static void _rtl8821ae_phy_reload_mac_registers(struct ieee80211_hw *hw,
3310 u32 *macreg, u32 *macbackup)
3311{
3312 struct rtl_priv *rtlpriv = rtl_priv(hw);
3313 u32 i;
3314
3315 for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++)
3316 rtl_write_byte(rtlpriv, macreg[i], (u8) macbackup[i]);
3317 rtl_write_dword(rtlpriv, macreg[i], macbackup[i]);
3318}
3319
3320static void _rtl8821ae_phy_path_adda_on(struct ieee80211_hw *hw,
3321 u32 *addareg, bool is_patha_on, bool is2t)
3322{
3323 u32 pathOn;
3324 u32 i;
3325
3326 pathOn = is_patha_on ? 0x04db25a4 : 0x0b1b25a4;
3327 if (false == is2t) {
3328 pathOn = 0x0bdb25a0;
3329 rtl_set_bbreg(hw, addareg[0], MASKDWORD, 0x0b1b25a0);
3330 } else {
3331 rtl_set_bbreg(hw, addareg[0], MASKDWORD, pathOn);
3332 }
3333
3334 for (i = 1; i < IQK_ADDA_REG_NUM; i++)
3335 rtl_set_bbreg(hw, addareg[i], MASKDWORD, pathOn);
3336}
3337
3338static void _rtl8821ae_phy_mac_setting_calibration(struct ieee80211_hw *hw,
3339 u32 *macreg, u32 *macbackup)
3340{
3341 struct rtl_priv *rtlpriv = rtl_priv(hw);
3342 u32 i = 0;
3343
3344 rtl_write_byte(rtlpriv, macreg[i], 0x3F);
3345
3346 for (i = 1; i < (IQK_MAC_REG_NUM - 1); i++)
3347 rtl_write_byte(rtlpriv, macreg[i],
3348 (u8) (macbackup[i] & (~BIT(3))));
3349 rtl_write_byte(rtlpriv, macreg[i], (u8) (macbackup[i] & (~BIT(5))));
3350}
3351
3352static void _rtl8821ae_phy_path_a_standby(struct ieee80211_hw *hw)
3353{
3354 rtl_set_bbreg(hw, 0xe28, MASKDWORD, 0x0);
3355 rtl_set_bbreg(hw, 0x840, MASKDWORD, 0x00010000);
3356 rtl_set_bbreg(hw, 0xe28, MASKDWORD, 0x80800000);
3357}
3358
3359static void _rtl8821ae_phy_pi_mode_switch(struct ieee80211_hw *hw, bool pi_mode)
3360{
3361 u32 mode;
3362
3363 mode = pi_mode ? 0x01000100 : 0x01000000;
3364 rtl_set_bbreg(hw, 0x820, MASKDWORD, mode);
3365 rtl_set_bbreg(hw, 0x828, MASKDWORD, mode);
3366}
3367
3368static bool _rtl8821ae_phy_simularity_compare(struct ieee80211_hw *hw,
3369 long result[][8], u8 c1, u8 c2)
3370{
3371 u32 i, j, diff, simularity_bitmap, bound;
3372 //struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
3373
3374 u8 final_candidate[2] = { 0xFF, 0xFF };
3375 bool bresult = true, is2t = true;//= IS_92C_SERIAL(rtlhal->version);
3376
3377 if (is2t)
3378 bound = 8;
3379 else
3380 bound = 4;
3381
3382 simularity_bitmap = 0;
3383
3384 for (i = 0; i < bound; i++) {
3385 diff = (result[c1][i] > result[c2][i]) ?
3386 (result[c1][i] - result[c2][i]) :
3387 (result[c2][i] - result[c1][i]);
3388
3389 if (diff > MAX_TOLERANCE) {
3390 if ((i == 2 || i == 6) && !simularity_bitmap) {
3391 if (result[c1][i] + result[c1][i + 1] == 0)
3392 final_candidate[(i / 4)] = c2;
3393 else if (result[c2][i] + result[c2][i + 1] == 0)
3394 final_candidate[(i / 4)] = c1;
3395 else
3396 simularity_bitmap = simularity_bitmap |
3397 (1 << i);
3398 } else
3399 simularity_bitmap =
3400 simularity_bitmap | (1 << i);
3401 }
3402 }
3403
3404 if (simularity_bitmap == 0) {
3405 for (i = 0; i < (bound / 4); i++) {
3406 if (final_candidate[i] != 0xFF) {
3407 for (j = i * 4; j < (i + 1) * 4 - 2; j++)
3408 result[3][j] =
3409 result[final_candidate[i]][j];
3410 bresult = false;
3411 }
3412 }
3413 return bresult;
3414 } else if (!(simularity_bitmap & 0x0F)) {
3415 for (i = 0; i < 4; i++)
3416 result[3][i] = result[c1][i];
3417 return false;
3418 } else if (!(simularity_bitmap & 0xF0) && is2t) {
3419 for (i = 4; i < 8; i++)
3420 result[3][i] = result[c1][i];
3421 return false;
3422 } else {
3423 return false;
3424 }
3425
3426}
3427 3203
3428u8 _rtl8812ae_get_right_chnl_place_for_iqk(u8 chnl) 3204u8 _rtl8812ae_get_right_chnl_place_for_iqk(u8 chnl)
3429{ 3205{
@@ -3640,7 +3416,7 @@ void _rtl8812ae_iqk_tx(
3640 struct rtl_phy *rtlphy = &(rtlpriv->phy); 3416 struct rtl_phy *rtlphy = &(rtlpriv->phy);
3641 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 3417 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
3642 3418
3643 u8 delay_count, cal = 0; 3419 u8 delay_count;
3644 u8 cal0_retry, cal1_retry; 3420 u8 cal0_retry, cal1_retry;
3645 u8 tx0_average = 0, tx1_average = 0, rx0_average = 0, rx1_average = 0; 3421 u8 tx0_average = 0, tx1_average = 0, rx0_average = 0, rx1_average = 0;
3646 int tx0_x = 0, tx0_y = 0, rx0_x = 0, rx0_y = 0; 3422 int tx0_x = 0, tx0_y = 0, rx0_x = 0, rx0_y = 0;
@@ -3651,7 +3427,7 @@ void _rtl8812ae_iqk_tx(
3651 bool iqk0_ready = false, tx0_finish = false, rx0_finish = false; 3427 bool iqk0_ready = false, tx0_finish = false, rx0_finish = false;
3652 bool tx1iqkok = false, rx1iqkok = false, tx1_fail = true, rx1_fail; 3428 bool tx1iqkok = false, rx1iqkok = false, tx1_fail = true, rx1_fail;
3653 bool iqk1_ready = false, tx1_finish = false, rx1_finish = false, vdf_enable = false; 3429 bool iqk1_ready = false, tx1_finish = false, rx1_finish = false, vdf_enable = false;
3654 int i, k, vdf_y[3], vdf_x[3], tx_dt[3], rx_dt[3], ii, dx = 0, dy = 0, dt = 0; 3430 int i, tx_dt[3], rx_dt[3], ii, dx = 0, dy = 0;
3655 3431
3656 RT_TRACE(COMP_IQK, DBG_LOUD, 3432 RT_TRACE(COMP_IQK, DBG_LOUD,
3657 ("BandWidth = %d.\n", 3433 ("BandWidth = %d.\n",
diff --git a/drivers/staging/rtl8821ae/rtl8821ae/trx.c b/drivers/staging/rtl8821ae/rtl8821ae/trx.c
index 6a172c93f40d..2c797878567d 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/trx.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/trx.c
@@ -538,7 +538,6 @@ bool rtl8821ae_rx_query_desc(struct ieee80211_hw *hw,
538 u8 *pdesc, struct sk_buff *skb) 538 u8 *pdesc, struct sk_buff *skb)
539{ 539{
540 struct rtl_priv *rtlpriv = rtl_priv(hw); 540 struct rtl_priv *rtlpriv = rtl_priv(hw);
541 struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw));
542 struct rx_fwinfo_8821ae *p_drvinfo; 541 struct rx_fwinfo_8821ae *p_drvinfo;
543 struct ieee80211_hdr *hdr; 542 struct ieee80211_hdr *hdr;
544 543