From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <ku920601@realtek.com>
Subject: [PATCH rtw-next 04/10] wifi: rtw89: coex: Extend bt_slot_req for dual MAC wifi
Date: Wed, 24 Jun 2026 11:39:35 +0800 [thread overview]
Message-ID: <20260624033941.45918-5-pkshih@realtek.com> (raw)
In-Reply-To: <20260624033941.45918-1-pkshih@realtek.com>
From: Ching-Te Ku <ku920601@realtek.com>
This variable is for asking driver occupied Bluetooth traffic slot while
wifi is running at multi-port mode. Example like station + AP. The time
slot is separated by wifi driver under these wifi modes. And to ensure
Bluetooth performance, Coex will advice the Bluetooth slot length to
driver. And each MAC is able to run multi-port mode, so extend the
variable's index.
Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/coex.c | 24 +++++++++++------------
drivers/net/wireless/realtek/rtw89/coex.h | 2 +-
drivers/net/wireless/realtek/rtw89/core.h | 2 +-
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c
index e4662e7b74e0..659028edccfa 100644
--- a/drivers/net/wireless/realtek/rtw89/coex.c
+++ b/drivers/net/wireless/realtek/rtw89/coex.c
@@ -975,8 +975,8 @@ static void _reset_btc_var(struct rtw89_dev *rtwdev, u8 type)
}
btc->policy_len = 0;
- btc->bt_req_len = 0;
-
+ btc->bt_req_len[RTW89_PHY_0] = 0;
+ btc->bt_req_len[RTW89_PHY_1] = 0;
btc->dm.coex_info_map = BTC_COEX_INFO_ALL;
btc->dm.wl_tx_limit.tx_time = BTC_MAX_TX_TIME_DEF;
btc->dm.wl_tx_limit.tx_retry = BTC_MAX_TX_RETRY_DEF;
@@ -1994,10 +1994,10 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
/* Check diff time between real BT slot and EBT/E5G slot */
if (dm->tdma_now.type == CXTDMA_OFF &&
dm->tdma_now.ext_ctrl == CXECTL_EXT &&
- btc->bt_req_len != 0) {
+ btc->bt_req_len[RTW89_PHY_0] != 0) {
bt_slot_real = le16_to_cpu(pcysta->v3.cycle_time.tavg[CXT_BT]);
- if (btc->bt_req_len > bt_slot_real) {
- diff_t = btc->bt_req_len - bt_slot_real;
+ if (btc->bt_req_len[RTW89_PHY_0] > bt_slot_real) {
+ diff_t = btc->bt_req_len[RTW89_PHY_0] - bt_slot_real;
_chk_btc_err(rtwdev, BTC_DCNT_BT_SLOT_DRIFT, diff_t);
}
}
@@ -2038,11 +2038,11 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
/* Check diff time between real BT slot and EBT/E5G slot */
if (dm->tdma_now.type == CXTDMA_OFF &&
dm->tdma_now.ext_ctrl == CXECTL_EXT &&
- btc->bt_req_len != 0) {
+ btc->bt_req_len[RTW89_PHY_0] != 0) {
bt_slot_real = le16_to_cpu(pcysta->v4.cycle_time.tavg[CXT_BT]);
- if (btc->bt_req_len > bt_slot_real) {
- diff_t = btc->bt_req_len - bt_slot_real;
+ if (btc->bt_req_len[RTW89_PHY_0] > bt_slot_real) {
+ diff_t = btc->bt_req_len[RTW89_PHY_0] - bt_slot_real;
_chk_btc_err(rtwdev, BTC_DCNT_BT_SLOT_DRIFT, diff_t);
}
}
@@ -2083,7 +2083,7 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
_chk_btc_err(rtwdev, BTC_DCNT_WL_SLOT_DRIFT, diff_t);
/* Check diff time between real BT slot and EBT/E5G slot */
- bt_slot_set = btc->bt_req_len;
+ bt_slot_set = btc->bt_req_len[RTW89_PHY_0];
bt_slot_real = le16_to_cpu(pcysta->v5.cycle_time.tavg[CXT_BT]);
diff_t = 0;
if (dm->tdma_now.type == CXTDMA_OFF &&
@@ -5861,7 +5861,7 @@ static void _action_wl_2g_scc_v1(struct rtw89_dev *rtwdev)
dm->wl_scc.ebt_null = 0;
policy_type = BTC_CXP_OFFE_2GISOB;
} else if (bt->link_info.a2dp_desc.exist &&
- dur < btc->bt_req_len) {
+ dur < btc->bt_req_len[RTW89_PHY_0]) {
dm->wl_scc.ebt_null = 1; /* tx null at EBT */
policy_type = BTC_CXP_OFFE_2GBWMIXB2;
} else if (bt->link_info.a2dp_desc.exist ||
@@ -5934,7 +5934,7 @@ static void _action_wl_2g_scc_v2(struct rtw89_dev *rtwdev)
dm->wl_scc.ebt_null = 0;
policy_type = BTC_CXP_OFFE_2GISOB;
} else if (bt->link_info.a2dp_desc.exist &&
- dur < btc->bt_req_len) {
+ dur < btc->bt_req_len[RTW89_PHY_0]) {
dm->wl_scc.ebt_null = 1; /* tx null at EBT */
policy_type = BTC_CXP_OFFE_2GBWMIXB2;
} else if (bt->link_info.a2dp_desc.exist ||
@@ -9694,7 +9694,7 @@ static int _show_dm_info(struct rtw89_dev *rtwdev, char *buf, size_t bufsz)
" %-15s : wl_tx_limit[en:%d/max_t:%dus/max_retry:%d], bt_slot_reg:%d-TU, bt_scan_rx_low_pri:%d\n",
"[dm_ctrl]", dm->wl_tx_limit.enable,
dm->wl_tx_limit.tx_time,
- dm->wl_tx_limit.tx_retry, btc->bt_req_len,
+ dm->wl_tx_limit.tx_retry, btc->bt_req_len[RTW89_PHY_0],
bt->scan_rx_low_pri);
return p - buf;
diff --git a/drivers/net/wireless/realtek/rtw89/coex.h b/drivers/net/wireless/realtek/rtw89/coex.h
index ea2c1e5d70f5..6ac14611607c 100644
--- a/drivers/net/wireless/realtek/rtw89/coex.h
+++ b/drivers/net/wireless/realtek/rtw89/coex.h
@@ -329,7 +329,7 @@ static inline u16 rtw89_coex_query_bt_req_len(struct rtw89_dev *rtwdev,
{
struct rtw89_btc *btc = &rtwdev->btc;
- return btc->bt_req_len;
+ return btc->bt_req_len[phy_idx];
}
static inline u32 rtw89_get_antpath_type(u8 phy_map, u8 type)
diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
index 0abbde6a2013..13fa7f574e91 100644
--- a/drivers/net/wireless/realtek/rtw89/core.h
+++ b/drivers/net/wireless/realtek/rtw89/core.h
@@ -3390,7 +3390,7 @@ struct rtw89_btc {
struct wiphy_work dhcp_notify_work;
struct wiphy_work icmp_notify_work;
- u32 bt_req_len;
+ u32 bt_req_len[RTW89_PHY_NUM];
u8 policy[RTW89_BTC_POLICY_MAXLEN];
u8 ant_type;
--
2.25.1
next prev parent reply other threads:[~2026-06-24 3:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 3:39 [PATCH rtw-next 00/10] wifi: rtw89: coex: update BT coexistence to support dual BT for RTL8922D Ping-Ke Shih
2026-06-24 3:39 ` [PATCH rtw-next 01/10] wifi: rtw89: coex: force to exit Wi-Fi LPS while Bluetooth profile exist Ping-Ke Shih
2026-06-24 3:39 ` [PATCH rtw-next 02/10] wifi: rtw89: coex: offset current BT info to BT0 for dual BT configuration Ping-Ke Shih
2026-06-24 3:39 ` [PATCH rtw-next 03/10] wifi: rtw89: coex: Move wifi related counters to wifi info Ping-Ke Shih
2026-06-24 3:39 ` Ping-Ke Shih [this message]
2026-06-24 3:39 ` [PATCH rtw-next 05/10] wifi: rtw89: coex: Move Bluetooth related counters to BT info Ping-Ke Shih
2026-06-24 3:39 ` [PATCH rtw-next 06/10] wifi: rtw89: coex: Refine third party module related coexistence Ping-Ke Shih
2026-06-24 3:39 ` [PATCH rtw-next 07/10] wifi: rtw89: coex: Add TX/RX RF parameter format version 9 Ping-Ke Shih
2026-06-24 3:39 ` [PATCH rtw-next 08/10] wifi: rtw89: coex: Renaming drvinfo_type to drvinfo_ver Ping-Ke Shih
2026-06-24 3:39 ` [PATCH rtw-next 09/10] wifi: rtw89: coex: Add Wi-Fi firmware 0.35.94.1 support for RTL8922D Ping-Ke Shih
2026-06-24 3:39 ` [PATCH rtw-next 10/10] wifi: rtw89: coex: Add RTL8922D chip string Ping-Ke Shih
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=20260624033941.45918-5-pkshih@realtek.com \
--to=pkshih@realtek.com \
--cc=ku920601@realtek.com \
--cc=linux-wireless@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox