rtlwifi: btcoex: 21a 2ant: add multiport action for p2p/miracast

For p2p/miracast, the wifi may have multiple ports for different roles.
Under this, we need extra settings for turning off the tdma and proper
coex table parameters.

We monnitor the number of links on a port to determine if it is for
p2p/miracast or not.

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:
Yan-Hsuan Chuang 2017-04-15 15:31:53 -05:00 committed by Kalle Valo
parent 137cc90f09
commit 0fcad45bdb
1 changed files with 47 additions and 0 deletions

View File

@ -3495,11 +3495,31 @@ static void btc8821a2ant_action_hid_a2dp(struct btc_coexist *btcoexist)
}
}
static void btc8821a2ant_action_wifi_multi_port(struct btc_coexist *btcoexist)
{
btc8821a2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
btc8821a2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
/* sw all off */
btc8821a2ant_sw_mechanism1(btcoexist, false, false, false, false);
btc8821a2ant_sw_mechanism2(btcoexist, false, false, false, 0x18);
/* hw all off */
btc8821a2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
btc8821a2ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
btc8821a2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 1);
}
static void btc8821a2ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
{
struct rtl_priv *rtlpriv = btcoexist->adapter;
struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
bool wifi_under_5g = false;
u8 algorithm = 0;
u32 num_of_wifi_link = 0;
u32 wifi_link_status = 0;
bool miracast_plus_bt = false;
if (btcoexist->manual_control) {
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
@ -3525,6 +3545,33 @@ static void btc8821a2ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
return;
}
/* for P2P */
btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_LINK_STATUS,
&wifi_link_status);
num_of_wifi_link = wifi_link_status >> 16;
if ((num_of_wifi_link >= 2) ||
(wifi_link_status & WIFI_P2P_GO_CONNECTED)) {
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
"############# [BTCoex], Multi-Port num_of_wifi_link = %d, wifi_link_status = 0x%x\n",
num_of_wifi_link, wifi_link_status);
if (bt_link_info->bt_link_exist)
miracast_plus_bt = true;
else
miracast_plus_bt = false;
btcoexist->btc_set(btcoexist, BTC_SET_BL_MIRACAST_PLUS_BT,
&miracast_plus_bt);
btc8821a2ant_action_wifi_multi_port(btcoexist);
return;
}
miracast_plus_bt = false;
btcoexist->btc_set(btcoexist, BTC_SET_BL_MIRACAST_PLUS_BT,
&miracast_plus_bt);
coex_dm->cur_algorithm = algorithm;
RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
"[BTCoex], Algorithm = %d\n", coex_dm->cur_algorithm);