mirror of https://gitee.com/openkylin/linux.git
rtlwifi: btcoex: remove unused functions
A number of functions in the Bluetooth Coexistence routines are not used, and can be removed. Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Pkshih <pkshih@realtek.com> Cc: Birming Chiu <birming@realtek.com> Cc: Shaofu <shaofu@realtek.com> Cc: Steven Ting <steventing@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
38c51d03ce
commit
27a31a60a4
|
@ -376,7 +376,7 @@ static void halbtc8192e2ant_limited_tx(struct btc_coexist *btcoexist,
|
||||||
coex_dm->cur_sstype,
|
coex_dm->cur_sstype,
|
||||||
ra_masktype);
|
ra_masktype);
|
||||||
halbtc8192e2ant_Updatera_mask(btcoexist, force_exec, disra_mask);
|
halbtc8192e2ant_Updatera_mask(btcoexist, force_exec, disra_mask);
|
||||||
btc8192e2ant_autorate_fallback_retry(btcoexist, force_exec, arfr_type);
|
btc8192e2ant_autorate_fallback_retry(btcoexist, force_exec, arfr_type);
|
||||||
halbtc8192e2ant_retrylimit(btcoexist, force_exec, retrylimit_type);
|
halbtc8192e2ant_retrylimit(btcoexist, force_exec, retrylimit_type);
|
||||||
halbtc8192e2ant_ampdu_maxtime(btcoexist, force_exec, ampdutime_type);
|
halbtc8192e2ant_ampdu_maxtime(btcoexist, force_exec, ampdutime_type);
|
||||||
}
|
}
|
||||||
|
@ -1573,585 +1573,6 @@ static bool halbtc8192e2ant_is_common_action(struct btc_coexist *btcoexist)
|
||||||
return common;
|
return common;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void btc8192e_int1(struct btc_coexist *btcoexist, bool tx_pause,
|
|
||||||
int result)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
|
|
||||||
if (tx_pause) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], TxPause = 1\n");
|
|
||||||
|
|
||||||
if (coex_dm->cur_ps_tdma == 71) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 5);
|
|
||||||
coex_dm->tdma_adj_type = 5;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 1) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 5);
|
|
||||||
coex_dm->tdma_adj_type = 5;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 6);
|
|
||||||
coex_dm->tdma_adj_type = 6;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 3) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 4) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 8);
|
|
||||||
coex_dm->tdma_adj_type = 8;
|
|
||||||
}
|
|
||||||
if (coex_dm->cur_ps_tdma == 9) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 13);
|
|
||||||
coex_dm->tdma_adj_type = 13;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 10) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 14);
|
|
||||||
coex_dm->tdma_adj_type = 14;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 11) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 12) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 16);
|
|
||||||
coex_dm->tdma_adj_type = 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == -1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 5) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 6);
|
|
||||||
coex_dm->tdma_adj_type = 6;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 6) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 7) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 8);
|
|
||||||
coex_dm->tdma_adj_type = 8;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 13) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 14);
|
|
||||||
coex_dm->tdma_adj_type = 14;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 14) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 15) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 16);
|
|
||||||
coex_dm->tdma_adj_type = 16;
|
|
||||||
}
|
|
||||||
} else if (result == 1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 8) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 7) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 6);
|
|
||||||
coex_dm->tdma_adj_type = 6;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 6) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 5);
|
|
||||||
coex_dm->tdma_adj_type = 5;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 16) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 15) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 14);
|
|
||||||
coex_dm->tdma_adj_type = 14;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 14) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 13);
|
|
||||||
coex_dm->tdma_adj_type = 13;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], TxPause = 0\n");
|
|
||||||
if (coex_dm->cur_ps_tdma == 5) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 71);
|
|
||||||
coex_dm->tdma_adj_type = 71;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 6) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 7) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 8) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 4);
|
|
||||||
coex_dm->tdma_adj_type = 4;
|
|
||||||
}
|
|
||||||
if (coex_dm->cur_ps_tdma == 13) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 9);
|
|
||||||
coex_dm->tdma_adj_type = 9;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 14) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 10);
|
|
||||||
coex_dm->tdma_adj_type = 10;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 15) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 16) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 12);
|
|
||||||
coex_dm->tdma_adj_type = 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == -1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 71) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 1);
|
|
||||||
coex_dm->tdma_adj_type = 1;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 1) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 3) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 4);
|
|
||||||
coex_dm->tdma_adj_type = 4;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 9) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 10);
|
|
||||||
coex_dm->tdma_adj_type = 10;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 10) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 11) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 12);
|
|
||||||
coex_dm->tdma_adj_type = 12;
|
|
||||||
}
|
|
||||||
} else if (result == 1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 4) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 3) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 1);
|
|
||||||
coex_dm->tdma_adj_type = 1;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 1) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 71);
|
|
||||||
coex_dm->tdma_adj_type = 71;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 12) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 11) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 10);
|
|
||||||
coex_dm->tdma_adj_type = 10;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 10) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 9);
|
|
||||||
coex_dm->tdma_adj_type = 9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void btc8192e_int2(struct btc_coexist *btcoexist, bool tx_pause,
|
|
||||||
int result)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
|
|
||||||
if (tx_pause) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], TxPause = 1\n");
|
|
||||||
if (coex_dm->cur_ps_tdma == 1) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 6);
|
|
||||||
coex_dm->tdma_adj_type = 6;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 6);
|
|
||||||
coex_dm->tdma_adj_type = 6;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 3) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 4) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 8);
|
|
||||||
coex_dm->tdma_adj_type = 8;
|
|
||||||
}
|
|
||||||
if (coex_dm->cur_ps_tdma == 9) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 14);
|
|
||||||
coex_dm->tdma_adj_type = 14;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 10) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 14);
|
|
||||||
coex_dm->tdma_adj_type = 14;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 11) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 12) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 16);
|
|
||||||
coex_dm->tdma_adj_type = 16;
|
|
||||||
}
|
|
||||||
if (result == -1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 5) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 6);
|
|
||||||
coex_dm->tdma_adj_type = 6;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 6) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 7) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 8);
|
|
||||||
coex_dm->tdma_adj_type = 8;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 13) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 14);
|
|
||||||
coex_dm->tdma_adj_type = 14;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 14) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 15) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 16);
|
|
||||||
coex_dm->tdma_adj_type = 16;
|
|
||||||
}
|
|
||||||
} else if (result == 1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 8) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 7) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 6);
|
|
||||||
coex_dm->tdma_adj_type = 6;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 6) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 6);
|
|
||||||
coex_dm->tdma_adj_type = 6;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 16) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 15) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 14);
|
|
||||||
coex_dm->tdma_adj_type = 14;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 14) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 14);
|
|
||||||
coex_dm->tdma_adj_type = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], TxPause = 0\n");
|
|
||||||
if (coex_dm->cur_ps_tdma == 5) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 6) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 7) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 8) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 4);
|
|
||||||
coex_dm->tdma_adj_type = 4;
|
|
||||||
}
|
|
||||||
if (coex_dm->cur_ps_tdma == 13) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 10);
|
|
||||||
coex_dm->tdma_adj_type = 10;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 14) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 10);
|
|
||||||
coex_dm->tdma_adj_type = 10;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 15) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 16) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 12);
|
|
||||||
coex_dm->tdma_adj_type = 12;
|
|
||||||
}
|
|
||||||
if (result == -1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 1) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 3) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 4);
|
|
||||||
coex_dm->tdma_adj_type = 4;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 9) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 10);
|
|
||||||
coex_dm->tdma_adj_type = 10;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 10) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 11) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 12);
|
|
||||||
coex_dm->tdma_adj_type = 12;
|
|
||||||
}
|
|
||||||
} else if (result == 1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 4) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 3) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 12) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 11) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 10);
|
|
||||||
coex_dm->tdma_adj_type = 10;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 10) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 10);
|
|
||||||
coex_dm->tdma_adj_type = 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void btc8192e_int3(struct btc_coexist *btcoexist, bool tx_pause,
|
|
||||||
int result)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
|
|
||||||
if (tx_pause) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], TxPause = 1\n");
|
|
||||||
if (coex_dm->cur_ps_tdma == 1) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 3) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 4) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 8);
|
|
||||||
coex_dm->tdma_adj_type = 8;
|
|
||||||
}
|
|
||||||
if (coex_dm->cur_ps_tdma == 9) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 10) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 11) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 12) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 16);
|
|
||||||
coex_dm->tdma_adj_type = 16;
|
|
||||||
}
|
|
||||||
if (result == -1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 5) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 6) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 7) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 8);
|
|
||||||
coex_dm->tdma_adj_type = 8;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 13) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 14) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 15) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 16);
|
|
||||||
coex_dm->tdma_adj_type = 16;
|
|
||||||
}
|
|
||||||
} else if (result == 1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 8) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 7) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 6) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 7);
|
|
||||||
coex_dm->tdma_adj_type = 7;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 16) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 15) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 14) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 15);
|
|
||||||
coex_dm->tdma_adj_type = 15;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], TxPause = 0\n");
|
|
||||||
if (coex_dm->cur_ps_tdma == 5) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 6) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 7) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 8) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 4);
|
|
||||||
coex_dm->tdma_adj_type = 4;
|
|
||||||
}
|
|
||||||
if (coex_dm->cur_ps_tdma == 13) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 14) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 15) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 16) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 12);
|
|
||||||
coex_dm->tdma_adj_type = 12;
|
|
||||||
}
|
|
||||||
if (result == -1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 1) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 3) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 4);
|
|
||||||
coex_dm->tdma_adj_type = 4;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 9) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 10) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 11) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 12);
|
|
||||||
coex_dm->tdma_adj_type = 12;
|
|
||||||
}
|
|
||||||
} else if (result == 1) {
|
|
||||||
if (coex_dm->cur_ps_tdma == 4) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 3) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 3);
|
|
||||||
coex_dm->tdma_adj_type = 3;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 12) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 11) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 10) {
|
|
||||||
halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void halbtc8192e2ant_tdma_duration_adjust(struct btc_coexist *btcoexist,
|
static void halbtc8192e2ant_tdma_duration_adjust(struct btc_coexist *btcoexist,
|
||||||
bool sco_hid, bool tx_pause,
|
bool sco_hid, bool tx_pause,
|
||||||
u8 max_interval)
|
u8 max_interval)
|
||||||
|
@ -2322,12 +1743,6 @@ static void halbtc8192e2ant_tdma_duration_adjust(struct btc_coexist *btcoexist,
|
||||||
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
||||||
"[BTCoex], max Interval = %d\n", max_interval);
|
"[BTCoex], max Interval = %d\n", max_interval);
|
||||||
if (max_interval == 1)
|
|
||||||
btc8192e_int1(btcoexist, tx_pause, result);
|
|
||||||
else if (max_interval == 2)
|
|
||||||
btc8192e_int2(btcoexist, tx_pause, result);
|
|
||||||
else if (max_interval == 3)
|
|
||||||
btc8192e_int3(btcoexist, tx_pause, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if current PsTdma not match with
|
/* if current PsTdma not match with
|
||||||
|
@ -3761,11 +3176,6 @@ void ex_halbtc8192e2ant_bt_info_notify(struct btc_coexist *btcoexist,
|
||||||
halbtc8192e2ant_run_coexist_mechanism(btcoexist);
|
halbtc8192e2ant_run_coexist_mechanism(btcoexist);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ex_halbtc8192e2ant_stack_operation_notify(struct btc_coexist *btcoexist,
|
|
||||||
u8 type)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ex_halbtc8192e2ant_halt_notify(struct btc_coexist *btcoexist)
|
void ex_halbtc8192e2ant_halt_notify(struct btc_coexist *btcoexist)
|
||||||
{
|
{
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
||||||
|
|
|
@ -60,188 +60,6 @@ static u32 glcoex_ver_8723b_1ant = 0x47;
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
* local function start with halbtc8723b1ant_
|
* local function start with halbtc8723b1ant_
|
||||||
***************************************************************/
|
***************************************************************/
|
||||||
static u8 halbtc8723b1ant_bt_rssi_state(struct btc_coexist *btcoexist,
|
|
||||||
u8 level_num, u8 rssi_thresh,
|
|
||||||
u8 rssi_thresh1)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
s32 bt_rssi = 0;
|
|
||||||
u8 bt_rssi_state = coex_sta->pre_bt_rssi_state;
|
|
||||||
|
|
||||||
bt_rssi = coex_sta->bt_rssi;
|
|
||||||
|
|
||||||
if (level_num == 2) {
|
|
||||||
if ((coex_sta->pre_bt_rssi_state == BTC_RSSI_STATE_LOW) ||
|
|
||||||
(coex_sta->pre_bt_rssi_state == BTC_RSSI_STATE_STAY_LOW)) {
|
|
||||||
if (bt_rssi >= rssi_thresh +
|
|
||||||
BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT) {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_HIGH;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state switch to High\n");
|
|
||||||
} else {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_STAY_LOW;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state stay at Low\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (bt_rssi < rssi_thresh) {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_LOW;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state switch to Low\n");
|
|
||||||
} else {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_STAY_HIGH;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state stay at High\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (level_num == 3) {
|
|
||||||
if (rssi_thresh > rssi_thresh1) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi thresh error!!\n");
|
|
||||||
return coex_sta->pre_bt_rssi_state;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((coex_sta->pre_bt_rssi_state == BTC_RSSI_STATE_LOW) ||
|
|
||||||
(coex_sta->pre_bt_rssi_state == BTC_RSSI_STATE_STAY_LOW)) {
|
|
||||||
if (bt_rssi >= rssi_thresh +
|
|
||||||
BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT) {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_MEDIUM;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state switch to Medium\n");
|
|
||||||
} else {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_STAY_LOW;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state stay at Low\n");
|
|
||||||
}
|
|
||||||
} else if ((coex_sta->pre_bt_rssi_state ==
|
|
||||||
BTC_RSSI_STATE_MEDIUM) ||
|
|
||||||
(coex_sta->pre_bt_rssi_state ==
|
|
||||||
BTC_RSSI_STATE_STAY_MEDIUM)) {
|
|
||||||
if (bt_rssi >= rssi_thresh1 +
|
|
||||||
BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT) {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_HIGH;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state switch to High\n");
|
|
||||||
} else if (bt_rssi < rssi_thresh) {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_LOW;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state switch to Low\n");
|
|
||||||
} else {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_STAY_MEDIUM;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state stay at Medium\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (bt_rssi < rssi_thresh1) {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_MEDIUM;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state switch to Medium\n");
|
|
||||||
} else {
|
|
||||||
bt_rssi_state = BTC_RSSI_STATE_STAY_HIGH;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Rssi state stay at High\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
coex_sta->pre_bt_rssi_state = bt_rssi_state;
|
|
||||||
|
|
||||||
return bt_rssi_state;
|
|
||||||
}
|
|
||||||
|
|
||||||
static u8 halbtc8723b1ant_wifi_rssi_state(struct btc_coexist *btcoexist,
|
|
||||||
u8 index, u8 level_num,
|
|
||||||
u8 rssi_thresh, u8 rssi_thresh1)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
s32 wifi_rssi = 0;
|
|
||||||
u8 wifi_rssi_state = coex_sta->pre_wifi_rssi_state[index];
|
|
||||||
|
|
||||||
btcoexist->btc_get(btcoexist,
|
|
||||||
BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
|
|
||||||
|
|
||||||
if (level_num == 2) {
|
|
||||||
if ((coex_sta->pre_wifi_rssi_state[index] ==
|
|
||||||
BTC_RSSI_STATE_LOW) ||
|
|
||||||
(coex_sta->pre_wifi_rssi_state[index] ==
|
|
||||||
BTC_RSSI_STATE_STAY_LOW)) {
|
|
||||||
if (wifi_rssi >= rssi_thresh +
|
|
||||||
BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT) {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_HIGH;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state switch to High\n");
|
|
||||||
} else {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_STAY_LOW;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state stay at Low\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (wifi_rssi < rssi_thresh) {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_LOW;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state switch to Low\n");
|
|
||||||
} else {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_STAY_HIGH;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state stay at High\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (level_num == 3) {
|
|
||||||
if (rssi_thresh > rssi_thresh1) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI thresh error!!\n");
|
|
||||||
return coex_sta->pre_wifi_rssi_state[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((coex_sta->pre_wifi_rssi_state[index] ==
|
|
||||||
BTC_RSSI_STATE_LOW) ||
|
|
||||||
(coex_sta->pre_wifi_rssi_state[index] ==
|
|
||||||
BTC_RSSI_STATE_STAY_LOW)) {
|
|
||||||
if (wifi_rssi >= rssi_thresh +
|
|
||||||
BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT) {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_MEDIUM;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state switch to Medium\n");
|
|
||||||
} else {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_STAY_LOW;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state stay at Low\n");
|
|
||||||
}
|
|
||||||
} else if ((coex_sta->pre_wifi_rssi_state[index] ==
|
|
||||||
BTC_RSSI_STATE_MEDIUM) ||
|
|
||||||
(coex_sta->pre_wifi_rssi_state[index] ==
|
|
||||||
BTC_RSSI_STATE_STAY_MEDIUM)) {
|
|
||||||
if (wifi_rssi >= rssi_thresh1 +
|
|
||||||
BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT) {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_HIGH;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state switch to High\n");
|
|
||||||
} else if (wifi_rssi < rssi_thresh) {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_LOW;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state switch to Low\n");
|
|
||||||
} else {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_STAY_MEDIUM;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state stay at Medium\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (wifi_rssi < rssi_thresh1) {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_MEDIUM;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state switch to Medium\n");
|
|
||||||
} else {
|
|
||||||
wifi_rssi_state = BTC_RSSI_STATE_STAY_HIGH;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], wifi RSSI state stay at High\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
coex_sta->pre_wifi_rssi_state[index] = wifi_rssi_state;
|
|
||||||
|
|
||||||
return wifi_rssi_state;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void halbtc8723b1ant_updatera_mask(struct btc_coexist *btcoexist,
|
static void halbtc8723b1ant_updatera_mask(struct btc_coexist *btcoexist,
|
||||||
bool force_exec, u32 dis_rate_mask)
|
bool force_exec, u32 dis_rate_mask)
|
||||||
|
@ -515,202 +333,6 @@ static void halbtc8723b1ant_update_bt_link_info(struct btc_coexist *btcoexist)
|
||||||
bt_link_info->hid_only = false;
|
bt_link_info->hid_only = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 halbtc8723b1ant_action_algorithm(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
|
|
||||||
bool bt_hs_on = false;
|
|
||||||
u8 algorithm = BT_8723B_1ANT_COEX_ALGO_UNDEFINED;
|
|
||||||
u8 numdiffprofile = 0;
|
|
||||||
|
|
||||||
btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on);
|
|
||||||
|
|
||||||
if (!bt_link_info->bt_link_exist) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], No BT link exists!!!\n");
|
|
||||||
return algorithm;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bt_link_info->sco_exist)
|
|
||||||
numdiffprofile++;
|
|
||||||
if (bt_link_info->hid_exist)
|
|
||||||
numdiffprofile++;
|
|
||||||
if (bt_link_info->pan_exist)
|
|
||||||
numdiffprofile++;
|
|
||||||
if (bt_link_info->a2dp_exist)
|
|
||||||
numdiffprofile++;
|
|
||||||
|
|
||||||
if (numdiffprofile == 1) {
|
|
||||||
if (bt_link_info->sco_exist) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO only\n");
|
|
||||||
algorithm = BT_8723B_1ANT_COEX_ALGO_SCO;
|
|
||||||
} else {
|
|
||||||
if (bt_link_info->hid_exist) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = HID only\n");
|
|
||||||
algorithm = BT_8723B_1ANT_COEX_ALGO_HID;
|
|
||||||
} else if (bt_link_info->a2dp_exist) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = A2DP only\n");
|
|
||||||
algorithm = BT_8723B_1ANT_COEX_ALGO_A2DP;
|
|
||||||
} else if (bt_link_info->pan_exist) {
|
|
||||||
if (bt_hs_on) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = PAN(HS) only\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_PANHS;
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = PAN(EDR) only\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_PANEDR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (numdiffprofile == 2) {
|
|
||||||
if (bt_link_info->sco_exist) {
|
|
||||||
if (bt_link_info->hid_exist) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO + HID\n");
|
|
||||||
algorithm = BT_8723B_1ANT_COEX_ALGO_HID;
|
|
||||||
} else if (bt_link_info->a2dp_exist) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO + A2DP ==> SCO\n");
|
|
||||||
algorithm = BT_8723B_1ANT_COEX_ALGO_SCO;
|
|
||||||
} else if (bt_link_info->pan_exist) {
|
|
||||||
if (bt_hs_on) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO + PAN(HS)\n");
|
|
||||||
algorithm = BT_8723B_1ANT_COEX_ALGO_SCO;
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO + PAN(EDR)\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (bt_link_info->hid_exist &&
|
|
||||||
bt_link_info->a2dp_exist) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = HID + A2DP\n");
|
|
||||||
algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
|
|
||||||
} else if (bt_link_info->hid_exist &&
|
|
||||||
bt_link_info->pan_exist) {
|
|
||||||
if (bt_hs_on) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = HID + PAN(HS)\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = HID + PAN(EDR)\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
|
|
||||||
}
|
|
||||||
} else if (bt_link_info->pan_exist &&
|
|
||||||
bt_link_info->a2dp_exist) {
|
|
||||||
if (bt_hs_on) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = A2DP + PAN(HS)\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS;
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = A2DP + PAN(EDR)\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (numdiffprofile == 3) {
|
|
||||||
if (bt_link_info->sco_exist) {
|
|
||||||
if (bt_link_info->hid_exist &&
|
|
||||||
bt_link_info->a2dp_exist) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO + HID + A2DP ==> HID\n");
|
|
||||||
algorithm = BT_8723B_1ANT_COEX_ALGO_HID;
|
|
||||||
} else if (bt_link_info->hid_exist &&
|
|
||||||
bt_link_info->pan_exist) {
|
|
||||||
if (bt_hs_on) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO + HID + PAN(HS)\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO + HID + PAN(EDR)\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
|
|
||||||
}
|
|
||||||
} else if (bt_link_info->pan_exist &&
|
|
||||||
bt_link_info->a2dp_exist) {
|
|
||||||
if (bt_hs_on) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO + A2DP + PAN(HS)\n");
|
|
||||||
algorithm = BT_8723B_1ANT_COEX_ALGO_SCO;
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO + A2DP + PAN(EDR) ==> HID\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (bt_link_info->hid_exist &&
|
|
||||||
bt_link_info->pan_exist &&
|
|
||||||
bt_link_info->a2dp_exist) {
|
|
||||||
if (bt_hs_on) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = HID + A2DP + PAN(HS)\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = HID + A2DP + PAN(EDR)\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (numdiffprofile >= 3) {
|
|
||||||
if (bt_link_info->sco_exist) {
|
|
||||||
if (bt_link_info->hid_exist &&
|
|
||||||
bt_link_info->pan_exist &&
|
|
||||||
bt_link_info->a2dp_exist) {
|
|
||||||
if (bt_hs_on) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], Error!!! BT Profile = SCO + HID + A2DP + PAN(HS)\n");
|
|
||||||
} else {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST,
|
|
||||||
DBG_LOUD,
|
|
||||||
"[BTCoex], BT Profile = SCO + HID + A2DP + PAN(EDR)==>PAN(EDR)+HID\n");
|
|
||||||
algorithm =
|
|
||||||
BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return algorithm;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void btc8723b1ant_set_sw_pen_tx_rate_adapt(struct btc_coexist *btcoexist,
|
static void btc8723b1ant_set_sw_pen_tx_rate_adapt(struct btc_coexist *btcoexist,
|
||||||
bool low_penalty_ra)
|
bool low_penalty_ra)
|
||||||
{
|
{
|
||||||
|
@ -1407,64 +1029,6 @@ static void halbtc8723b1ant_ps_tdma(struct btc_coexist *btcoexist,
|
||||||
coex_dm->pre_ps_tdma = coex_dm->cur_ps_tdma;
|
coex_dm->pre_ps_tdma = coex_dm->cur_ps_tdma;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool halbtc8723b1ant_is_common_action(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
bool commom = false, wifi_connected = false;
|
|
||||||
bool wifi_busy = false;
|
|
||||||
|
|
||||||
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED,
|
|
||||||
&wifi_connected);
|
|
||||||
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
|
|
||||||
|
|
||||||
if (!wifi_connected &&
|
|
||||||
BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE == coex_dm->bt_status) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Wifi non connected-idle + BT non connected-idle!!\n");
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, false);
|
|
||||||
commom = true;
|
|
||||||
} else if (wifi_connected &&
|
|
||||||
(BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE ==
|
|
||||||
coex_dm->bt_status)) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Wifi connected + BT non connected-idle!!\n");
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, false);
|
|
||||||
commom = true;
|
|
||||||
} else if (!wifi_connected &&
|
|
||||||
(BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE ==
|
|
||||||
coex_dm->bt_status)) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Wifi non connected-idle + BT connected-idle!!\n");
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, false);
|
|
||||||
commom = true;
|
|
||||||
} else if (wifi_connected &&
|
|
||||||
(BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE ==
|
|
||||||
coex_dm->bt_status)) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Wifi connected + BT connected-idle!!\n");
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, false);
|
|
||||||
commom = true;
|
|
||||||
} else if (!wifi_connected &&
|
|
||||||
(BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE !=
|
|
||||||
coex_dm->bt_status)) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Wifi non connected-idle + BT Busy!!\n");
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, false);
|
|
||||||
commom = true;
|
|
||||||
} else {
|
|
||||||
if (wifi_busy)
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Wifi Connected-Busy + BT Busy!!\n");
|
|
||||||
else
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Wifi Connected-Idle + BT Busy!!\n");
|
|
||||||
|
|
||||||
commom = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return commom;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void btc8723b1ant_tdma_dur_adj_for_acl(struct btc_coexist *btcoexist,
|
static void btc8723b1ant_tdma_dur_adj_for_acl(struct btc_coexist *btcoexist,
|
||||||
u8 wifi_status)
|
u8 wifi_status)
|
||||||
{
|
{
|
||||||
|
@ -1700,66 +1264,6 @@ static void halbtc8723b1ant_power_save_state(struct btc_coexist *btcoexist,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************
|
|
||||||
*
|
|
||||||
* Software Coex Mechanism start
|
|
||||||
*
|
|
||||||
***************************************************/
|
|
||||||
/* SCO only or SCO+PAN(HS) */
|
|
||||||
static void halbtc8723b1ant_action_sco(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void halbtc8723b1ant_action_hid(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*A2DP only / PAN(EDR) only/ A2DP+PAN(HS) */
|
|
||||||
static void halbtc8723b1ant_action_a2dp(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void halbtc8723b1ant_action_a2dp_pan_hs(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void halbtc8723b1ant_action_pan_edr(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* PAN(HS) only */
|
|
||||||
static void halbtc8723b1ant_action_pan_hs(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAN(EDR)+A2DP */
|
|
||||||
static void halbtc8723b1ant_action_pan_edr_a2dp(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void halbtc8723b1ant_action_pan_edr_hid(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* HID+A2DP+PAN(EDR) */
|
|
||||||
static void btc8723b1ant_action_hid_a2dp_pan_edr(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void halbtc8723b1ant_action_hid_a2dp(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
halbtc8723b1ant_sw_mechanism(btcoexist, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
*
|
*
|
||||||
* Non-Software Coex Mechanism start
|
* Non-Software Coex Mechanism start
|
||||||
|
@ -1840,11 +1344,8 @@ static void halbtc8723b1ant_action_wifi_connected_bt_acl_busy(
|
||||||
struct btc_coexist *btcoexist,
|
struct btc_coexist *btcoexist,
|
||||||
u8 wifi_status)
|
u8 wifi_status)
|
||||||
{
|
{
|
||||||
u8 bt_rssi_state;
|
|
||||||
|
|
||||||
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
|
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
|
||||||
|
|
||||||
bt_rssi_state = halbtc8723b1ant_bt_rssi_state(btcoexist, 2, 28, 0);
|
|
||||||
|
|
||||||
if (bt_link_info->hid_only) { /*HID */
|
if (bt_link_info->hid_only) { /*HID */
|
||||||
btc8723b1ant_act_bt_sco_hid_only_busy(btcoexist, wifi_status);
|
btc8723b1ant_act_bt_sco_hid_only_busy(btcoexist, wifi_status);
|
||||||
|
@ -1857,12 +1358,6 @@ static void halbtc8723b1ant_action_wifi_connected_bt_acl_busy(
|
||||||
halbtc8723b1ant_coex_table_with_type(btcoexist,
|
halbtc8723b1ant_coex_table_with_type(btcoexist,
|
||||||
NORMAL_EXEC, 2);
|
NORMAL_EXEC, 2);
|
||||||
coex_dm->auto_tdma_adjust = false;
|
coex_dm->auto_tdma_adjust = false;
|
||||||
} else if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
|
|
||||||
(bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
|
|
||||||
btc8723b1ant_tdma_dur_adj_for_acl(btcoexist,
|
|
||||||
wifi_status);
|
|
||||||
halbtc8723b1ant_coex_table_with_type(btcoexist,
|
|
||||||
NORMAL_EXEC, 1);
|
|
||||||
} else { /*for low BT RSSI */
|
} else { /*for low BT RSSI */
|
||||||
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
||||||
true, 11);
|
true, 11);
|
||||||
|
@ -2109,75 +1604,6 @@ static void halbtc8723b1ant_action_wifi_connected(struct btc_coexist *btcoexist)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void btc8723b1ant_run_sw_coex_mech(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
u8 algorithm = 0;
|
|
||||||
|
|
||||||
algorithm = halbtc8723b1ant_action_algorithm(btcoexist);
|
|
||||||
coex_dm->cur_algorithm = algorithm;
|
|
||||||
|
|
||||||
if (!halbtc8723b1ant_is_common_action(btcoexist)) {
|
|
||||||
switch (coex_dm->cur_algorithm) {
|
|
||||||
case BT_8723B_1ANT_COEX_ALGO_SCO:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = SCO\n");
|
|
||||||
halbtc8723b1ant_action_sco(btcoexist);
|
|
||||||
break;
|
|
||||||
case BT_8723B_1ANT_COEX_ALGO_HID:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = HID\n");
|
|
||||||
halbtc8723b1ant_action_hid(btcoexist);
|
|
||||||
break;
|
|
||||||
case BT_8723B_1ANT_COEX_ALGO_A2DP:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = A2DP\n");
|
|
||||||
halbtc8723b1ant_action_a2dp(btcoexist);
|
|
||||||
break;
|
|
||||||
case BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = A2DP+PAN(HS)\n");
|
|
||||||
halbtc8723b1ant_action_a2dp_pan_hs(btcoexist);
|
|
||||||
break;
|
|
||||||
case BT_8723B_1ANT_COEX_ALGO_PANEDR:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = PAN(EDR)\n");
|
|
||||||
halbtc8723b1ant_action_pan_edr(btcoexist);
|
|
||||||
break;
|
|
||||||
case BT_8723B_1ANT_COEX_ALGO_PANHS:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = HS mode\n");
|
|
||||||
halbtc8723b1ant_action_pan_hs(btcoexist);
|
|
||||||
break;
|
|
||||||
case BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = PAN+A2DP\n");
|
|
||||||
halbtc8723b1ant_action_pan_edr_a2dp(btcoexist);
|
|
||||||
break;
|
|
||||||
case BT_8723B_1ANT_COEX_ALGO_PANEDR_HID:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = PAN(EDR)+HID\n");
|
|
||||||
halbtc8723b1ant_action_pan_edr_hid(btcoexist);
|
|
||||||
break;
|
|
||||||
case BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = HID+A2DP+PAN\n");
|
|
||||||
btc8723b1ant_action_hid_a2dp_pan_edr(btcoexist);
|
|
||||||
break;
|
|
||||||
case BT_8723B_1ANT_COEX_ALGO_HID_A2DP:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = HID+A2DP\n");
|
|
||||||
halbtc8723b1ant_action_hid_a2dp(btcoexist);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Action algorithm = coexist All Off!!\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
coex_dm->pre_algorithm = coex_dm->cur_algorithm;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void halbtc8723b1ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
|
static void halbtc8723b1ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
|
||||||
{
|
{
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
||||||
|
@ -2186,7 +1612,6 @@ static void halbtc8723b1ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
|
||||||
bool increase_scan_dev_num = false;
|
bool increase_scan_dev_num = false;
|
||||||
bool bt_ctrl_agg_buf_size = false;
|
bool bt_ctrl_agg_buf_size = false;
|
||||||
u8 agg_buf_size = 5;
|
u8 agg_buf_size = 5;
|
||||||
u8 wifi_rssi_state = BTC_RSSI_STATE_HIGH;
|
|
||||||
u32 wifi_link_status = 0;
|
u32 wifi_link_status = 0;
|
||||||
u32 num_of_wifi_link = 0;
|
u32 num_of_wifi_link = 0;
|
||||||
|
|
||||||
|
@ -2239,9 +1664,6 @@ static void halbtc8723b1ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
|
||||||
halbtc8723b1ant_limited_tx(btcoexist, NORMAL_EXEC, 0, 0, 0, 0);
|
halbtc8723b1ant_limited_tx(btcoexist, NORMAL_EXEC, 0, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
if (wifi_connected) {
|
if (wifi_connected) {
|
||||||
wifi_rssi_state =
|
|
||||||
halbtc8723b1ant_wifi_rssi_state(btcoexist,
|
|
||||||
1, 2, 30, 0);
|
|
||||||
halbtc8723b1ant_limited_tx(btcoexist,
|
halbtc8723b1ant_limited_tx(btcoexist,
|
||||||
NORMAL_EXEC, 1, 1, 1, 1);
|
NORMAL_EXEC, 1, 1, 1, 1);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2263,8 +1685,6 @@ static void halbtc8723b1ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
|
||||||
halbtc8723b1ant_limited_rx(btcoexist, NORMAL_EXEC, false,
|
halbtc8723b1ant_limited_rx(btcoexist, NORMAL_EXEC, false,
|
||||||
bt_ctrl_agg_buf_size, agg_buf_size);
|
bt_ctrl_agg_buf_size, agg_buf_size);
|
||||||
|
|
||||||
btc8723b1ant_run_sw_coex_mech(btcoexist);
|
|
||||||
|
|
||||||
btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on);
|
btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hs_on);
|
||||||
|
|
||||||
if (coex_sta->c2h_bt_inquiry_page) {
|
if (coex_sta->c2h_bt_inquiry_page) {
|
||||||
|
@ -2375,12 +1795,6 @@ static void halbtc8723b1ant_init_hw_config(struct btc_coexist *btcoexist,
|
||||||
halbtc8723b1ant_coex_table_with_type(btcoexist, FORCE_EXEC, 0);
|
halbtc8723b1ant_coex_table_with_type(btcoexist, FORCE_EXEC, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void halbtc8723b1ant_wifi_off_hw_cfg(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
/* set wlan_act to low */
|
|
||||||
btcoexist->btc_write_1byte(btcoexist, 0x76e, 0x4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************
|
/**************************************************************
|
||||||
* work around function start with wa_halbtc8723b1ant_
|
* work around function start with wa_halbtc8723b1ant_
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
|
@ -2703,7 +2117,6 @@ void ex_halbtc8723b1ant_ips_notify(struct btc_coexist *btcoexist, u8 type)
|
||||||
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 0);
|
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 0);
|
||||||
halbtc8723b1ant_coex_table_with_type(btcoexist,
|
halbtc8723b1ant_coex_table_with_type(btcoexist,
|
||||||
NORMAL_EXEC, 0);
|
NORMAL_EXEC, 0);
|
||||||
halbtc8723b1ant_wifi_off_hw_cfg(btcoexist);
|
|
||||||
} else if (BTC_IPS_LEAVE == type) {
|
} else if (BTC_IPS_LEAVE == type) {
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
||||||
"[BTCoex], IPS LEAVE notify\n");
|
"[BTCoex], IPS LEAVE notify\n");
|
||||||
|
@ -3091,7 +2504,6 @@ void ex_halbtc8723b1ant_halt_notify(struct btc_coexist *btcoexist)
|
||||||
|
|
||||||
halbtc8723b1ant_SetAntPath(btcoexist, BTC_ANT_PATH_BT, false, true);
|
halbtc8723b1ant_SetAntPath(btcoexist, BTC_ANT_PATH_BT, false, true);
|
||||||
|
|
||||||
halbtc8723b1ant_wifi_off_hw_cfg(btcoexist);
|
|
||||||
halbtc8723b1ant_ignore_wlan_act(btcoexist, FORCE_EXEC, true);
|
halbtc8723b1ant_ignore_wlan_act(btcoexist, FORCE_EXEC, true);
|
||||||
|
|
||||||
halbtc8723b1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE,
|
halbtc8723b1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE,
|
||||||
|
@ -3117,7 +2529,6 @@ void ex_halbtc8723b1ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state)
|
||||||
0x0, 0x0);
|
0x0, 0x0);
|
||||||
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 0);
|
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 0);
|
||||||
halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
|
halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
|
||||||
halbtc8723b1ant_wifi_off_hw_cfg(btcoexist);
|
|
||||||
} else if (BTC_WIFI_PNP_WAKE_UP == pnp_state) {
|
} else if (BTC_WIFI_PNP_WAKE_UP == pnp_state) {
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
||||||
"[BTCoex], Pnp notify to WAKE UP\n");
|
"[BTCoex], Pnp notify to WAKE UP\n");
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -670,51 +670,6 @@ static u8 halbtc8821a1ant_action_algorithm(struct btc_coexist *btcoexist)
|
||||||
return algorithm;
|
return algorithm;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void halbtc8821a1ant_set_bt_auto_report(struct btc_coexist *btcoexist,
|
|
||||||
bool enable_auto_report)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
u8 h2c_parameter[1] = {0};
|
|
||||||
|
|
||||||
h2c_parameter[0] = 0;
|
|
||||||
|
|
||||||
if (enable_auto_report)
|
|
||||||
h2c_parameter[0] |= BIT0;
|
|
||||||
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT FW auto report : %s, FW write 0x68 = 0x%x\n",
|
|
||||||
(enable_auto_report ? "Enabled!!" : "Disabled!!"),
|
|
||||||
h2c_parameter[0]);
|
|
||||||
|
|
||||||
btcoexist->btc_fill_h2c(btcoexist, 0x68, 1, h2c_parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void halbtc8821a1ant_bt_auto_report(struct btc_coexist *btcoexist,
|
|
||||||
bool force_exec,
|
|
||||||
bool enable_auto_report)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], %s BT Auto report = %s\n",
|
|
||||||
(force_exec ? "force to" : ""), ((enable_auto_report) ?
|
|
||||||
"Enabled" : "Disabled"));
|
|
||||||
coex_dm->cur_bt_auto_report = enable_auto_report;
|
|
||||||
|
|
||||||
if (!force_exec) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], pre_bt_auto_report = %d, cur_bt_auto_report = %d\n",
|
|
||||||
coex_dm->pre_bt_auto_report,
|
|
||||||
coex_dm->cur_bt_auto_report);
|
|
||||||
|
|
||||||
if (coex_dm->pre_bt_auto_report == coex_dm->cur_bt_auto_report)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
halbtc8821a1ant_set_bt_auto_report(btcoexist, coex_dm->cur_bt_auto_report);
|
|
||||||
|
|
||||||
coex_dm->pre_bt_auto_report = coex_dm->cur_bt_auto_report;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void btc8821a1ant_set_sw_pen_tx_rate(struct btc_coexist *btcoexist,
|
static void btc8821a1ant_set_sw_pen_tx_rate(struct btc_coexist *btcoexist,
|
||||||
bool low_penalty_ra)
|
bool low_penalty_ra)
|
||||||
{
|
{
|
||||||
|
@ -1333,196 +1288,6 @@ static bool halbtc8821a1ant_is_common_action(struct btc_coexist *btcoexist)
|
||||||
return common;
|
return common;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void btc8821a1ant_tdma_dur_adj(struct btc_coexist *btcoexist,
|
|
||||||
u8 wifi_status)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
static long up, dn, m, n, wait_count;
|
|
||||||
/*0: no change, +1: increase WiFi duration, -1: decrease WiFi duration*/
|
|
||||||
long result;
|
|
||||||
u8 retry_count = 0, bt_info_ext;
|
|
||||||
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], TdmaDurationAdjustForAcl()\n");
|
|
||||||
|
|
||||||
if ((BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN ==
|
|
||||||
wifi_status) ||
|
|
||||||
(BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SCAN ==
|
|
||||||
wifi_status) ||
|
|
||||||
(BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT ==
|
|
||||||
wifi_status)) {
|
|
||||||
if (coex_dm->cur_ps_tdma != 1 &&
|
|
||||||
coex_dm->cur_ps_tdma != 2 &&
|
|
||||||
coex_dm->cur_ps_tdma != 3 &&
|
|
||||||
coex_dm->cur_ps_tdma != 9) {
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 9);
|
|
||||||
coex_dm->tdma_adj_type = 9;
|
|
||||||
|
|
||||||
up = 0;
|
|
||||||
dn = 0;
|
|
||||||
m = 1;
|
|
||||||
n = 3;
|
|
||||||
result = 0;
|
|
||||||
wait_count = 0;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!coex_dm->auto_tdma_adjust) {
|
|
||||||
coex_dm->auto_tdma_adjust = true;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], first run TdmaDurationAdjust()!!\n");
|
|
||||||
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
/*============*/
|
|
||||||
up = 0;
|
|
||||||
dn = 0;
|
|
||||||
m = 1;
|
|
||||||
n = 3;
|
|
||||||
result = 0;
|
|
||||||
wait_count = 0;
|
|
||||||
} else {
|
|
||||||
/*accquire the BT TRx retry count from BT_Info byte2*/
|
|
||||||
retry_count = coex_sta->bt_retry_cnt;
|
|
||||||
bt_info_ext = coex_sta->bt_info_ext;
|
|
||||||
result = 0;
|
|
||||||
wait_count++;
|
|
||||||
|
|
||||||
if (retry_count == 0) {
|
|
||||||
/* no retry in the last 2-second duration*/
|
|
||||||
up++;
|
|
||||||
dn--;
|
|
||||||
|
|
||||||
if (dn <= 0)
|
|
||||||
dn = 0;
|
|
||||||
|
|
||||||
if (up >= n) {
|
|
||||||
/* if (retry count == 0) for 2*n seconds ,
|
|
||||||
* make WiFi duration wider
|
|
||||||
*/
|
|
||||||
wait_count = 0;
|
|
||||||
n = 3;
|
|
||||||
up = 0;
|
|
||||||
dn = 0;
|
|
||||||
result = 1;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Increase wifi duration!!\n");
|
|
||||||
}
|
|
||||||
} else if (retry_count <= 3) {
|
|
||||||
/* <=3 retry in the last 2-second duration*/
|
|
||||||
up--;
|
|
||||||
dn++;
|
|
||||||
|
|
||||||
if (up <= 0)
|
|
||||||
up = 0;
|
|
||||||
|
|
||||||
if (dn == 2) {
|
|
||||||
/* if retry count< 3 for 2*2 seconds,
|
|
||||||
* shrink wifi duration
|
|
||||||
*/
|
|
||||||
if (wait_count <= 2)
|
|
||||||
m++; /* avoid bounce in two levels */
|
|
||||||
else
|
|
||||||
m = 1;
|
|
||||||
|
|
||||||
if (m >= 20) {
|
|
||||||
/* m max value is 20, max time is 120 s,
|
|
||||||
* recheck if adjust WiFi duration.
|
|
||||||
*/
|
|
||||||
m = 20;
|
|
||||||
}
|
|
||||||
n = 3*m;
|
|
||||||
up = 0;
|
|
||||||
dn = 0;
|
|
||||||
wait_count = 0;
|
|
||||||
result = -1;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Decrease wifi duration for retryCounter<3!!\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* retry count > 3, if retry count > 3 happens once,
|
|
||||||
* shrink WiFi duration
|
|
||||||
*/
|
|
||||||
if (wait_count == 1)
|
|
||||||
m++; /* avoid bounce in two levels */
|
|
||||||
else
|
|
||||||
m = 1;
|
|
||||||
/* m max value is 20, max time is 120 second,
|
|
||||||
* recheck if adjust WiFi duration.
|
|
||||||
*/
|
|
||||||
if (m >= 20)
|
|
||||||
m = 20;
|
|
||||||
|
|
||||||
n = 3*m;
|
|
||||||
up = 0;
|
|
||||||
dn = 0;
|
|
||||||
wait_count = 0;
|
|
||||||
result = -1;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], Decrease wifi duration for retryCounter>3!!\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == -1) {
|
|
||||||
if ((BT_INFO_8821A_1ANT_A2DP_BASIC_RATE(bt_info_ext)) &&
|
|
||||||
((coex_dm->cur_ps_tdma == 1) ||
|
|
||||||
(coex_dm->cur_ps_tdma == 2))) {
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 9);
|
|
||||||
coex_dm->tdma_adj_type = 9;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 1) {
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 9);
|
|
||||||
coex_dm->tdma_adj_type = 9;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 9) {
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 11);
|
|
||||||
coex_dm->tdma_adj_type = 11;
|
|
||||||
}
|
|
||||||
} else if (result == 1) {
|
|
||||||
if ((BT_INFO_8821A_1ANT_A2DP_BASIC_RATE(bt_info_ext)) &&
|
|
||||||
((coex_dm->cur_ps_tdma == 1) ||
|
|
||||||
(coex_dm->cur_ps_tdma == 2))) {
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 9);
|
|
||||||
coex_dm->tdma_adj_type = 9;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 11) {
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 9);
|
|
||||||
coex_dm->tdma_adj_type = 9;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 9) {
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 2);
|
|
||||||
coex_dm->tdma_adj_type = 2;
|
|
||||||
} else if (coex_dm->cur_ps_tdma == 2) {
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
|
||||||
true, 1);
|
|
||||||
coex_dm->tdma_adj_type = 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/*no change*/
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], ********** TDMA(on, %d) **********\n",
|
|
||||||
coex_dm->cur_ps_tdma);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (coex_dm->cur_ps_tdma != 1 &&
|
|
||||||
coex_dm->cur_ps_tdma != 2 &&
|
|
||||||
coex_dm->cur_ps_tdma != 9 &&
|
|
||||||
coex_dm->cur_ps_tdma != 11) {
|
|
||||||
/* recover to previous adjust type*/
|
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist,
|
|
||||||
NORMAL_EXEC, true,
|
|
||||||
coex_dm->tdma_adj_type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void btc8821a1ant_ps_tdma_check_for_pwr_save(struct btc_coexist *btcoex,
|
static void btc8821a1ant_ps_tdma_check_for_pwr_save(struct btc_coexist *btcoex,
|
||||||
bool new_ps_state)
|
bool new_ps_state)
|
||||||
{
|
{
|
||||||
|
@ -1599,74 +1364,11 @@ static void halbtc8821a1ant_coex_under_5g(struct btc_coexist *btcoexist)
|
||||||
halbtc8821a1ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 5);
|
halbtc8821a1ant_limited_rx(btcoexist, NORMAL_EXEC, false, false, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void halbtc8821a1ant_action_wifi_only(struct btc_coexist *btcoexist)
|
/***********************************************
|
||||||
{
|
*
|
||||||
halbtc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
|
* Software Coex Mechanism start
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 9);
|
*
|
||||||
}
|
***********************************************/
|
||||||
|
|
||||||
static void btc8821a1ant_mon_bt_en_dis(struct btc_coexist *btcoexist)
|
|
||||||
{
|
|
||||||
struct rtl_priv *rtlpriv = btcoexist->adapter;
|
|
||||||
static bool pre_bt_disabled;
|
|
||||||
static u32 bt_disable_cnt;
|
|
||||||
bool bt_active = true, bt_disabled = false;
|
|
||||||
|
|
||||||
/* This function check if bt is disabled*/
|
|
||||||
|
|
||||||
if (coex_sta->high_priority_tx == 0 &&
|
|
||||||
coex_sta->high_priority_rx == 0 &&
|
|
||||||
coex_sta->low_priority_tx == 0 &&
|
|
||||||
coex_sta->low_priority_rx == 0) {
|
|
||||||
bt_active = false;
|
|
||||||
}
|
|
||||||
if (coex_sta->high_priority_tx == 0xffff &&
|
|
||||||
coex_sta->high_priority_rx == 0xffff &&
|
|
||||||
coex_sta->low_priority_tx == 0xffff &&
|
|
||||||
coex_sta->low_priority_rx == 0xffff) {
|
|
||||||
bt_active = false;
|
|
||||||
}
|
|
||||||
if (bt_active) {
|
|
||||||
bt_disable_cnt = 0;
|
|
||||||
bt_disabled = false;
|
|
||||||
btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_DISABLE,
|
|
||||||
&bt_disabled);
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT is enabled !!\n");
|
|
||||||
} else {
|
|
||||||
bt_disable_cnt++;
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], bt all counters = 0, %d times!!\n",
|
|
||||||
bt_disable_cnt);
|
|
||||||
if (bt_disable_cnt >= 2) {
|
|
||||||
bt_disabled = true;
|
|
||||||
btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_DISABLE,
|
|
||||||
&bt_disabled);
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT is disabled !!\n");
|
|
||||||
halbtc8821a1ant_action_wifi_only(btcoexist);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (pre_bt_disabled != bt_disabled) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT is from %s to %s!!\n",
|
|
||||||
(pre_bt_disabled ? "disabled" : "enabled"),
|
|
||||||
(bt_disabled ? "disabled" : "enabled"));
|
|
||||||
pre_bt_disabled = bt_disabled;
|
|
||||||
if (bt_disabled) {
|
|
||||||
btcoexist->btc_set(btcoexist, BTC_SET_ACT_LEAVE_LPS,
|
|
||||||
NULL);
|
|
||||||
btcoexist->btc_set(btcoexist, BTC_SET_ACT_NORMAL_LPS,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*=============================================*/
|
|
||||||
/**/
|
|
||||||
/* Software Coex Mechanism start*/
|
|
||||||
/**/
|
|
||||||
/*=============================================*/
|
|
||||||
|
|
||||||
/* SCO only or SCO+PAN(HS)*/
|
/* SCO only or SCO+PAN(HS)*/
|
||||||
static void halbtc8821a1ant_action_sco(struct btc_coexist *btcoexist)
|
static void halbtc8821a1ant_action_sco(struct btc_coexist *btcoexist)
|
||||||
|
@ -1788,10 +1490,8 @@ static void btc8821a1ant_act_wifi_con_bt_acl_busy(struct btc_coexist *btcoexist,
|
||||||
return;
|
return;
|
||||||
} else if (bt_link_info->a2dp_only) {
|
} else if (bt_link_info->a2dp_only) {
|
||||||
/*A2DP*/
|
/*A2DP*/
|
||||||
if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
|
if ((bt_rssi_state != BTC_RSSI_STATE_HIGH) &&
|
||||||
(bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
|
(bt_rssi_state != BTC_RSSI_STATE_STAY_HIGH)) {
|
||||||
btc8821a1ant_tdma_dur_adj(btcoexist, wifi_status);
|
|
||||||
} else {
|
|
||||||
/*for low BT RSSI*/
|
/*for low BT RSSI*/
|
||||||
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
halbtc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC,
|
||||||
true, 11);
|
true, 11);
|
||||||
|
@ -2814,14 +2514,6 @@ void ex_halbtc8821a1ant_bt_info_notify(struct btc_coexist *btcoexist,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if (BT_AUTO_REPORT_ONLY_8821A_1ANT == 0)
|
|
||||||
if (!(coex_sta->bt_info_ext & BIT4)) {
|
|
||||||
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
|
|
||||||
"[BTCoex], BT ext info bit4 check, set BT to enable Auto Report!!\n");
|
|
||||||
halbtc8821a1ant_bt_auto_report(btcoexist,
|
|
||||||
FORCE_EXEC, true);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check BIT2 first ==> check if bt is under inquiry or page scan*/
|
/* check BIT2 first ==> check if bt is under inquiry or page scan*/
|
||||||
|
@ -2984,14 +2676,7 @@ void ex_halbtc8821a1ant_periodical(struct btc_coexist *btcoexist)
|
||||||
#if (BT_AUTO_REPORT_ONLY_8821A_1ANT == 0)
|
#if (BT_AUTO_REPORT_ONLY_8821A_1ANT == 0)
|
||||||
halbtc8821a1ant_query_bt_info(btcoexist);
|
halbtc8821a1ant_query_bt_info(btcoexist);
|
||||||
halbtc8821a1ant_monitor_bt_ctr(btcoexist);
|
halbtc8821a1ant_monitor_bt_ctr(btcoexist);
|
||||||
btc8821a1ant_mon_bt_en_dis(btcoexist);
|
|
||||||
#else
|
#else
|
||||||
if (halbtc8821a1ant_Is_wifi_status_changed(btcoexist) ||
|
|
||||||
coex_dm->auto_tdma_adjust) {
|
|
||||||
if (coex_sta->special_pkt_period_cnt > 2)
|
|
||||||
halbtc8821a1ant_run_coexist_mechanism(btcoexist);
|
|
||||||
}
|
|
||||||
|
|
||||||
coex_sta->special_pkt_period_cnt++;
|
coex_sta->special_pkt_period_cnt++;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue