All of lore.kernel.org
 help / color / mirror / Atom feed
From: <pkshih@realtek.com>
To: <kvalo@codeaurora.org>, <tony0620emma@gmail.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH 05/11] rtw88: coex: add the mechanism for RF4CE
Date: Wed, 11 Nov 2020 10:21:02 +0800	[thread overview]
Message-ID: <20201111022108.9834-6-pkshih@realtek.com> (raw)
In-Reply-To: <20201111022108.9834-1-pkshih@realtek.com>

From: Ching-Te Ku <ku920601@realtek.com>

Add the related coexistence mechanism about RF4CE and WLAN connected
flag to decide control packet is whether higher or normal priority.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/coex.c | 33 ++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/coex.c b/drivers/net/wireless/realtek/rtw88/coex.c
index 961a9dafa969..ca44ŒÍø\b2b38 100644
--- a/drivers/net/wireless/realt8Il\bc4dc/coe|.c
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
@@ -1390,6 +1390,31 @@ static void rtw_coex_action_freerun(struct rtw_dev *rtwdev)
 	rtw_coex_tdma(rtwdev, false, 100);
 }
 
+static void rtw_coex_action_rf4ce(struct rtw_dev *rtwdev)
+{
+	struct rtw_efuse *efuse = &rtwdev->efuse;
+	struct rtw_chip_info *chip = rtwdev->chip;
+	u8 table_case, tdma_case;
+
+	rtw_dbg(rtwdev, RTW_DBG_COEX, "[BTCoex], %s()\n", __func__);
+
+	rtw_coex_set_ant_path(rtwdev, false, COEX_SET_ANT_2G);
+	rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]);
+
+	if (efuse->share_ant) {
+		/* Shared-Ant */
+		table_case = 9;
+		tdma_case = 16;
+	} else {
+		/* Non-Shared-Ant */
+		table_case = 100;
+		tdma_case = 100;
+	}
+
+	rtw_coex_table(rtwdev, false, table_case);
+	rtw_coex_tdma(rtwdev, false, tdma_case);
+}
+
 static void rtw_coex_action_bt_whql_test(struct rtw_dev *rtwdev)
 {
 	struct rtw_efuse *efuse = &rtwdev->efuse;
@@ -2180,6 +2205,7 @@ static void rtw_coex_run_coex(struct rtw_dev *rtwdev, u8 reason)
 	struct rtw_coex *coex = &rtwdev->coex;
 	struct rtw_coex_dm *coex_dm = &coex->dm;
 	struct rtw_coex_stat *coex_stat = &coex->stat;
+	bool rf4ce_en = false;
 
 	lockdep_assert_held(&rtwdev->mutex);
 
@@ -2235,7 +2261,12 @@ static void rtw_coex_run_coex(struct rtw_dev *rtwdev, u8 reason)
 	coex_stat->wl_coex_mode = COEX_WLINK_2G1PORT;
 	rtw_coex_write_scbd(rtwdev, COEX_SCBD_FIX2M, false);
 	if (coex_stat->bt_disabled) {
-		rtw_coex_action_wl_only(rtwdev);
+		if (coex_stat->wl_connected && rf4ce_en)
+			rtw_coex_action_rf4ce(rtwdev);
+		else if (!coex_stat->wl_connected)
+			rtw_coex_action_wl_not_connected(rtwdev);
+		else
+			rtw_coex_action_wl_only(rtwdev);
 		goto exit;
 	}
 
-- 
2.21.0


  parent reply	other threads:[~2020-11-11  2:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11  2:20 [PATCH 00/11] rtw88: coex: fix and update settings to enhance coex performance pkshih
2020-11-11  2:20 ` [PATCH 01/11] rtw88: coex: update TDMA settings for different beacon interval pkshih
2020-11-11  8:34   ` Kalle Valo
2020-11-12  2:23     ` Pkshih
2020-11-11  2:20 ` [PATCH 02/11] rtw88: coex: remove unnecessary feature/function pkshih
2020-11-11  8:35   ` Kalle Valo
2020-11-12  2:25     ` Pkshih
2020-11-11  2:21 ` [PATCH 03/11] rtw88: coex: add write scoreboard action when WLAN in critical procedure pkshih
2020-11-11  2:21 ` [PATCH 04/11] rtw88: coex: Add force flag for coexistence table function pkshih
2020-11-11  2:21 ` pkshih [this message]
2020-11-11  2:21 ` [PATCH 06/11] rtw88: coex: update the TDMA parameter when leave LPS pkshih
2020-11-11  2:21 ` [PATCH 07/11] rtw88: coex: Change antenna setting to enhance free-run performance pkshih
2020-11-11  2:21 ` [PATCH 08/11] rtw88: coex: fix BT performance drop during initial/power-on step pkshih
2020-11-11  8:37   ` Kalle Valo
2020-11-12  2:24     ` Pkshih
2020-11-11  2:21 ` [PATCH 09/11] rtw88: coex: remove write scan bit to scoreboard in scan and connect notify pkshih
2020-11-11  2:21 ` [PATCH 10/11] rtw88: coex: remove unnecessary WLAN slot extend pkshih
2020-11-11  2:21 ` [PATCH 11/11] rtw88: coex: change the decode method from firmware pkshih

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=20201111022108.9834-6-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=tony0620emma@gmail.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.