Commit 5ae40d99 authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

rtlwifi: btcoex: 23b 1ant: check more cases when bt is queing

If bt is queing, we need to set the packet priority properly.
Originally we only consider if wifi was connected or not, but now we
also consider if bt is under abnormal scan or wifi is scanning, roaming
or linking, and set the coex table.
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent c34e42aa
...@@ -1732,35 +1732,56 @@ static void halbtc8723b1ant_action_bt_inquiry(struct btc_coexist *btcoexist) ...@@ -1732,35 +1732,56 @@ static void halbtc8723b1ant_action_bt_inquiry(struct btc_coexist *btcoexist)
{ {
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info; struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
bool wifi_connected = false, ap_enable = false; bool wifi_connected = false, ap_enable = false;
bool wifi_busy = false, bt_busy = false;
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE,
&ap_enable); &ap_enable);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED, btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED,
&wifi_connected); &wifi_connected);
btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
btcoexist->btc_set(btcoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bt_busy);
if (!wifi_connected) { if (coex_sta->bt_abnormal_scan) {
halbtc8723b1ant_power_save_state(btcoexist, halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 33);
BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 7);
} else if (!wifi_connected && !coex_sta->wifi_is_high_pri_task) {
halbtc8723b1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE,
0x0, 0x0);
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 8); halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 8);
halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2); halbtc8723b1ant_set_ant_path(btcoexist, BTC_ANT_PATH_PTA,
} else if (bt_link_info->sco_exist || bt_link_info->hid_only) { NORMAL_EXEC, false, false);
/* SCO/HID-only busy */ halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
} else if (bt_link_info->sco_exist || bt_link_info->hid_exist ||
bt_link_info->a2dp_exist) {
/* SCO/HID/A2DP busy */
halbtc8723b1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, halbtc8723b1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE,
0x0, 0x0); 0x0, 0x0);
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 32); if (coex_sta->c2h_bt_remote_name_req)
halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1); halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true,
} else { 33);
if (ap_enable) else
halbtc8723b1ant_power_save_state(btcoexist, halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true,
BTC_PS_WIFI_NATIVE, 32);
halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 4);
} else if (bt_link_info->pan_exist || wifi_busy) {
halbtc8723b1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE,
0x0, 0x0); 0x0, 0x0);
if (coex_sta->c2h_bt_remote_name_req)
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true,
33);
else else
halbtc8723b1ant_power_save_state(btcoexist, halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true,
BTC_PS_LPS_ON, 32);
0x50, 0x4);
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 30); halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 4);
halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 1); } else {
halbtc8723b1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE,
0x0, 0x0);
halbtc8723b1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 8);
halbtc8723b1ant_set_ant_path(btcoexist, BTC_ANT_PATH_PTA,
NORMAL_EXEC, false, false);
halbtc8723b1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 7);
} }
} }
......
...@@ -148,6 +148,7 @@ struct coex_sta_8723b_1ant { ...@@ -148,6 +148,7 @@ struct coex_sta_8723b_1ant {
bool pan_exist; bool pan_exist;
bool bt_hi_pri_link_exist; bool bt_hi_pri_link_exist;
u8 num_of_profile; u8 num_of_profile;
bool bt_abnormal_scan;
bool under_lps; bool under_lps;
bool under_ips; bool under_ips;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment