All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Yan-Hsuan Chuang <yhchuang@realtek.com>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Pkshih <pkshih@realtek.com>, Birming Chiu <birming@realtek.com>,
	Shaofu <shaofu@realtek.com>, Steven Ting <steventing@realtek.com>
Subject: [PATCH 12/14] rtlwifi: btcoex: 21a 1ant: monitor bt profiling when scan
Date: Mon, 10 Apr 2017 11:23:08 -0500	[thread overview]
Message-ID: <20170410162310.7515-13-Larry.Finger@lwfinger.net> (raw)
In-Reply-To: <20170410162310.7515-1-Larry.Finger@lwfinger.net>

From: Yan-Hsuan Chuang <yhchuang@realtek.com>

When wifi is scanning and not connected, set the tdma and coex table
properly to control the priority of the packets to make the wifi bt
coexistence operate smoothly

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>
---
 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c    | 29 ++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
index 6b08051614eb..eab04c2bdd3d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
@@ -1481,9 +1481,34 @@ static void btc8821a1ant_action_hid_a2dp(struct btc_coexist *btcoexist)
 static
 void btc8821a1ant_action_wifi_multi_port(struct btc_coexist *btcoexist)
 {
+	struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
+
 	btc8821a1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
-	btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 8);
-	btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
+	/* tdma and coex table */
+	if (coex_dm->bt_status == BT_8821A_1ANT_BT_STATUS_ACL_BUSY) {
+		if (bt_link_info->a2dp_exist) {
+			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 14);
+			btc8821a1ant_coex_table_with_type(btcoexist,
+							  NORMAL_EXEC, 1);
+		} else if (bt_link_info->a2dp_exist &&
+			   bt_link_info->pan_exist) {
+			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 8);
+			btc8821a1ant_coex_table_with_type(btcoexist,
+							  NORMAL_EXEC, 4);
+		} else {
+			btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 20);
+			btc8821a1ant_coex_table_with_type(btcoexist,
+							  NORMAL_EXEC, 4);
+		}
+	} else if ((coex_dm->bt_status == BT_8821A_1ANT_BT_STATUS_SCO_BUSY) ||
+		   (BT_8821A_1ANT_BT_STATUS_ACL_SCO_BUSY ==
+		    coex_dm->bt_status)) {
+		btc8821a1ant_act_bt_sco_hid_only_busy(btcoexist,
+				BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SCAN);
+	} else {
+		btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 8);
+		btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
+	}
 }
 
 static
-- 
2.12.0

  parent reply	other threads:[~2017-04-10 16:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 16:22 [PATCH 00/14] rtlwifi: btcoex: Fixes for rtl8821ae 1ant code Larry Finger
2017-04-10 16:22 ` [PATCH 01/14] rtlwifi: btcoex: 21a 1ant: fw settings for softap mode Larry Finger
2017-04-13 14:11   ` [01/14] " Kalle Valo
2017-04-10 16:22 ` [PATCH 02/14] rtlwifi: btcoex: 21a 1ant: add function to check wifi status Larry Finger
2017-04-10 16:22 ` [PATCH 03/14] rtlwifi: btcoex: 21a 1ant: coex table setting for new fw Larry Finger
2017-04-10 16:23 ` [PATCH 04/14] rtlwifi: btcoex: 21a 1ant: mask profile bit for connect-ilde Larry Finger
2017-04-10 16:23 ` [PATCH 05/14] rtlwifi: btcoex: 21a 1ant: remove setting for 2 antennas Larry Finger
2017-04-10 16:23 ` [PATCH 06/14] rtlwifi: btcoex: 21a 1ant: set antenna control path for PTA Larry Finger
2017-04-10 16:23 ` [PATCH 07/14] rtlwifi: btcoex: 21a 1ant: add multi port action for miracast and P2P Larry Finger
2017-04-10 16:23 ` [PATCH 08/14] rtlwifi: btcoex: 21a 1ant: action when associating/authenticating Larry Finger
2017-04-10 16:23 ` [PATCH 09/14] rtlwifi: btcoex: 21a 1ant: If wifi only, do not initiate coex mechanism Larry Finger
2017-04-10 16:23 ` [PATCH 10/14] rtlwifi: btcoex: 21a 1ant: move bt_disabled to global struct Larry Finger
2017-04-10 16:23 ` [PATCH 11/14] rtlwifi: btcoex: 21a 1ant: consider more cases when bt inquiry Larry Finger
2017-04-10 16:23 ` Larry Finger [this message]
2017-04-10 16:23 ` [PATCH 13/14] rtlwifi: btcoex: 21a 1ant: do not switch antenna when wifi is under 5G channel Larry Finger
2017-04-10 16:23 ` [PATCH 14/14] rtlwifi: btcoex: 21a 1ant: avoid LPS/IPS mismatch for pnp notify Larry Finger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170410162310.7515-13-Larry.Finger@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=birming@realtek.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=shaofu@realtek.com \
    --cc=steventing@realtek.com \
    --cc=yhchuang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.