rtlwifi: btcoex: 23b 1ant: Setup register for BT WHCK test
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 19 May 2017 15:59:34 +0000 (10:59 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 24 May 2017 13:49:20 +0000 (16:49 +0300)
If BT is under WHCK, we enter a special mode.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry 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: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.h

index 9509bf4a463509f2e3e46d431cb378001b47dabc..4279678502d93290106ba3b44cff5b0b22916229 100644 (file)
@@ -1701,6 +1701,18 @@ static void halbtc8723b1ant_monitor_bt_enable_disable(struct btc_coexist
  *     Non-Software Coex Mechanism start
  *
  *****************************************************/
+
+static void halbtc8723b1ant_action_bt_whck_test(struct btc_coexist *btcoexist)
+{
+       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, 0);
+}
+
 static void halbtc8723b1ant_action_wifi_multiport(struct btc_coexist *btcoexist)
 {
        halbtc8723b1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE,
@@ -2074,6 +2086,13 @@ static void halbtc8723b1ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
                return;
        }
 
+       if (coex_sta->bt_whck_test) {
+               RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
+                        "[BTCoex], wifi is under IPS !!!\n");
+               halbtc8723b1ant_action_bt_whck_test(btcoexist);
+               return;
+       }
+
        if (coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_BUSY ||
            coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_SCO_BUSY ||
            coex_dm->bt_status == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
@@ -2883,6 +2902,12 @@ void ex_halbtc8723b1ant_bt_info_notify(struct btc_coexist *btcoexist,
                                 "0x%02x, ", tmp_buf[i]);
        }
 
+       /* if 0xff, it means BT is under WHCK test */
+       if (bt_info == 0xff)
+               coex_sta->bt_whck_test = true;
+       else
+               coex_sta->bt_whck_test = false;
+
        if (rsp_source != BT_INFO_SRC_8723B_1ANT_WIFI_FW) {
                coex_sta->bt_retry_cnt = /* [3:0] */
                        coex_sta->bt_info_c2h[rsp_source][2] & 0xf;
index 1cac98e3cc85459faf45bd808cca71d3e7f5ef13..47b7091591466e11d3903f11c422be3e064d9f97 100644 (file)
@@ -162,6 +162,7 @@ struct coex_sta_8723b_1ant {
        bool c2h_bt_info_req_sent;
        u8 bt_info_c2h[BT_INFO_SRC_8723B_1ANT_MAX][10];
        u32 bt_info_c2h_cnt[BT_INFO_SRC_8723B_1ANT_MAX];
+       bool bt_whck_test;
        bool c2h_bt_inquiry_page;
        bool c2h_bt_remote_name_req;
        u8 bt_retry_cnt;