]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
rtlwifi: btcoex: 23b 2ant: turn off ps and tdma mechanism when in concurrent mode
authorYan-Hsuan Chuang <yhchuang@realtek.com>
Tue, 4 Apr 2017 16:50:04 +0000 (11:50 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 13 Apr 2017 14:08:39 +0000 (17:08 +0300)
When wifi is in concurrent mode, we can not distinguish if it is the
real PS or just a fake one by sending null data, so we turn it off
in case of miracast scenario.

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>
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h

index 16a4a5c4f02409b901b8950a071d3291fe1b2c5d..654886598482c5abe551cec95219b349a855fe7e 100644 (file)
@@ -3168,10 +3168,29 @@ static void btc8723b2ant_action_hid_a2dp(struct btc_coexist *btcoexist)
        }
 }
 
+static void btc8723b2ant_action_wifi_multi_port(struct btc_coexist *btcoexist)
+{
+       btc8723b2ant_fw_dac_swing_lvl(btcoexist, NORMAL_EXEC, 6);
+       btc8723b2ant_dec_bt_pwr(btcoexist, NORMAL_EXEC, 0);
+
+       /* sw all off */
+       btc8723b2ant_sw_mechanism(btcoexist, false, false, false, false);
+
+       /* hw all off */
+       btc8723b2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
+
+       btc8723b2ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
+       btc8723b2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 1);
+}
+
 static void btc8723b2ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
 {
        struct rtl_priv *rtlpriv = btcoexist->adapter;
        u8 algorithm = 0;
+       u32 num_of_wifi_link = 0;
+       u32 wifi_link_status = 0;
+       struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
+       bool miracast_plus_bt = false;
 
        RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
                 "[BTCoex], RunCoexistMechanism()===>\n");
@@ -3203,6 +3222,33 @@ static void btc8723b2ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
                }
        }
 
+       /* 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);
+               btc8723b2ant_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",
index d7ba6ad1e66f9bd2855a09c8b6bc9603ebd0b175..022658cafbcae72d1de2d8319f112ed93211f62b 100644 (file)
@@ -249,6 +249,7 @@ enum btc_set_type {
        BTC_SET_BL_TO_REJ_AP_AGG_PKT,
        BTC_SET_BL_BT_CTRL_AGG_SIZE,
        BTC_SET_BL_INC_SCAN_DEV_NUM,
+       BTC_SET_BL_MIRACAST_PLUS_BT,
 
        /* type u1Byte */
        BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON,