Linux wireless drivers development
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <owen.hsiao@realtek.com>, <echuang@realtek.com>,
	<henchy.chen@realtek.com>, <phhuang@realtek.com>,
	<kevin_yang@realtek.com>
Subject: [PATCH rtw-next 07/14] wifi: rtw89: 8922d: update BB wrapper RFSI ctrl to v5
Date: Wed, 26 Aug 2026 14:40:54 +0800	[thread overview]
Message-ID: <20260826064101.58892-8-pkshih@realtek.com> (raw)
In-Reply-To: <20260826064101.58892-1-pkshih@realtek.com>

Update the BB wrapper RFSI control configuration tables for RTL8922D
variants to v5. The major change is to define qam_th[] per band to
optimize performance for RTL8922D_CID7090 variant, and others variants
keep to use the same values for both bands.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/phy.h      |  2 +-
 drivers/net/wireless/realtek/rtw89/phy_be.c   |  9 +++++----
 drivers/net/wireless/realtek/rtw89/rtw8922d.c | 15 +++++++++------
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/phy.h b/drivers/net/wireless/realtek/rtw89/phy.h
index 977cc680ee08..7bbda2ba5b5c 100644
--- a/drivers/net/wireless/realtek/rtw89/phy.h
+++ b/drivers/net/wireless/realtek/rtw89/phy.h
@@ -631,8 +631,8 @@ struct rtw89_bb_wrap_common_data {
 		} cim3k;
 		u32 rfsi_ct_opt[2];
 		u8 pb_tb;
+		u8 qam_th[3];
 	} bands[RFSI_CTRL_BAND_NUM];
-	u8 qam_th[3];
 };
 
 struct rtw89_bb_wrap_common_data_gen2 {
diff --git a/drivers/net/wireless/realtek/rtw89/phy_be.c b/drivers/net/wireless/realtek/rtw89/phy_be.c
index a8fdf22e06c8..b94754d38673 100644
--- a/drivers/net/wireless/realtek/rtw89/phy_be.c
+++ b/drivers/net/wireless/realtek/rtw89/phy_be.c
@@ -732,6 +732,7 @@ void rtw89_phy_bb_wrap_set_rfsi_bandedge_ch(struct rtw89_dev *rtwdev,
 EXPORT_SYMBOL(rtw89_phy_bb_wrap_set_rfsi_bandedge_ch);
 
 static void rtw89_phy_bb_wrap_tx_rfsi_qam_comp_th_init(struct rtw89_dev *rtwdev,
+						       const struct rtw89_chan *chan,
 						       enum rtw89_mac_idx mac_idx)
 {
 	const struct rtw89_bb_wrap_data *d = rtwdev->phy_info.bb_wrap_data;
@@ -740,9 +741,9 @@ static void rtw89_phy_bb_wrap_tx_rfsi_qam_comp_th_init(struct rtw89_dev *rtwdev,
 	if (!d || !d->common)
 		return;
 
-	th0 = d->common->qam_th[0];
-	th1 = d->common->qam_th[1];
-	th2 = d->common->qam_th[2];
+	th0 = d->common->bands[chan->rfsi_band].qam_th[0];
+	th1 = d->common->bands[chan->rfsi_band].qam_th[1];
+	th2 = d->common->bands[chan->rfsi_band].qam_th[2];
 
 	/* TH0 */
 	rtw89_write32_idx(rtwdev, R_QAM_TH0_BE4, B_QAM_TH0_0_BE4, th0, mac_idx);
@@ -1222,7 +1223,7 @@ void rtw89_phy_bb_wrap_tx_rfsi_ctrl_init_by_chan(struct rtw89_dev *rtwdev,
 						 const struct rtw89_chan *chan,
 						 u8 mac_idx)
 {
-	rtw89_phy_bb_wrap_tx_rfsi_qam_comp_th_init(rtwdev, mac_idx);
+	rtw89_phy_bb_wrap_tx_rfsi_qam_comp_th_init(rtwdev, chan, mac_idx);
 	rtw89_phy_bb_wrap_tx_rfsi_qam_comp_th_gen2_init(rtwdev, mac_idx);
 	rtw89_phy_bb_wrap_tx_rfsi_qam_comp_th_gen3_init(rtwdev, chan, mac_idx);
 	rtw89_phy_bb_wrap_tx_rfsi_scenario_def(rtwdev, chan, mac_idx);
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922d.c b/drivers/net/wireless/realtek/rtw89/rtw8922d.c
index 4d779ebf6121..5f910163163f 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922d.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922d.c
@@ -347,14 +347,15 @@ static const struct rtw89_bb_wrap_common_data rtw8922d_bb_wrap_common_data_7025
 		.rfsi_ct_opt = {_8nibble(2, 2, 2, 2, 1, 1, 1, 1),
 				_8nibble(2, 2, 2, 2, 1, 1, 1, 1)},
 		.pb_tb = 3,
+		.qam_th = {RFSI_BPSK, RFSI_QPSK, RFSI_256QAM},
 	},
 	[RFSI_CTRL_BAND_2GHZ] = {
 		.cim3k = {CIM3K_ON, CIM3K_ON, CIM3K_ENABLE, CIM3K_ENABLE},
 		.rfsi_ct_opt = {_8nibble(2, 2, 2, 2, 1, 1, 1, 1),
 				_8nibble(2, 2, 2, 2, 1, 1, 1, 1)},
 		.pb_tb = 0,
+		.qam_th = {RFSI_BPSK, RFSI_QPSK, RFSI_256QAM},
 	}},
-	.qam_th = {RFSI_BPSK, RFSI_QPSK, RFSI_256QAM},
 };
 
 static const struct rtw89_bb_wrap_common_data rtw8922d_bb_wrap_common_data_7090 = {
@@ -364,14 +365,15 @@ static const struct rtw89_bb_wrap_common_data rtw8922d_bb_wrap_common_data_7090
 		.rfsi_ct_opt = {_8nibble(2, 2, 2, 2, 1, 1, 1, 1),
 				_8nibble(2, 2, 2, 2, 1, 1, 1, 1)},
 		.pb_tb = 0,
+		.qam_th = {RFSI_BPSK, RFSI_QPSK, RFSI_256QAM},
 	},
 	[RFSI_CTRL_BAND_2GHZ] = {
 		.cim3k = {CIM3K_ON, CIM3K_ON, CIM3K_ENABLE, CIM3K_ENABLE},
 		.rfsi_ct_opt = {_8nibble(2, 2, 2, 2, 1, 1, 1, 1),
 				_8nibble(2, 2, 2, 2, 1, 1, 1, 1)},
 		.pb_tb = 0,
+		.qam_th = {RFSI_QPSK, RFSI_16QAM, RFSI_256QAM},
 	}},
-	.qam_th = {RFSI_BPSK, RFSI_QPSK, RFSI_256QAM},
 };
 
 static const struct rtw89_bb_wrap_common_data rtw8922d_bb_wrap_common_data_7090_rfe38 = {
@@ -381,14 +383,15 @@ static const struct rtw89_bb_wrap_common_data rtw8922d_bb_wrap_common_data_7090_
 		.rfsi_ct_opt = {_8nibble(2, 2, 2, 2, 1, 1, 1, 1),
 				_8nibble(2, 2, 2, 2, 1, 1, 1, 1)},
 		.pb_tb = 0,
+		.qam_th = {RFSI_QPSK, RFSI_16QAM, RFSI_256QAM},
 	},
 	[RFSI_CTRL_BAND_2GHZ] = {
 		.cim3k = {CIM3K_ON, CIM3K_ON, CIM3K_ENABLE, CIM3K_ENABLE},
 		.rfsi_ct_opt = {_8nibble(2, 2, 2, 2, 1, 1, 1, 1),
 				_8nibble(2, 2, 2, 2, 1, 1, 1, 1)},
 		.pb_tb = 0,
+		.qam_th = {RFSI_QPSK, RFSI_16QAM, RFSI_256QAM},
 	}},
-	.qam_th = {RFSI_QPSK, RFSI_16QAM, RFSI_256QAM},
 };
 
 static const
@@ -474,7 +477,7 @@ static const struct rtw89_bb_wrap_data rtw8922d_bb_wrap_data_7090_default = {
 	},
 	[RFSI_CTRL_BAND_2GHZ] = {
 		.qam_comp_th0 = {0x4000, 0x4400, 0x4500, 0, 0, 0, 0, 0, 0, 0},
-		.qam_comp_th1 = {_10qam_comp_code(0x4000, 0x4400, 0x4500, 0, 0,
+		.qam_comp_th1 = {_10qam_comp_code(0x4000, 0x4400, 0x4600, 0, 0,
 						  0, 0, 0, 0, 0)},
 		.qam_comp_th2 = {_10qam_comp_code(0x4000, 0x4400, 0x4400, 0, 0,
 						  0, 0, 0, 0, 0)},
@@ -492,7 +495,7 @@ static const struct rtw89_bb_wrap_data rtw8922d_bb_wrap_data_7090_rfe38 = {
 	.bands = {
 	[RFSI_CTRL_BAND_5_6GHZ] = {
 		.qam_comp_th0 = {0x4000, 0x4400, 0x4500, 0, 0, 0, 0, 0, 0, 0},
-		.qam_comp_th1 = {_10qam_comp_code(0x4000, 0x4400, 0x4500, 0,
+		.qam_comp_th1 = {_10qam_comp_code(0x4000, 0x4400, 0x4600, 0,
 						  0, 0, 0, 0, 0, 0)},
 		.qam_comp_th2 = {_10qam_comp_code(0x4000, 0x4400, 0x4400, 0,
 						  0, 0, 0, 0, 0, 0)},
@@ -502,7 +505,7 @@ static const struct rtw89_bb_wrap_data rtw8922d_bb_wrap_data_7090_rfe38 = {
 	},
 	[RFSI_CTRL_BAND_2GHZ] = {
 		.qam_comp_th0 = {0x4000, 0x4400, 0x4500, 0, 0, 0, 0, 0, 0, 0},
-		.qam_comp_th1 = {_10qam_comp_code(0x4000, 0x4400, 0x4400, 0, 0,
+		.qam_comp_th1 = {_10qam_comp_code(0x4000, 0x4400, 0x4700, 0, 0,
 						  0, 0, 0, 0, 0)},
 		.qam_comp_th2 = {_10qam_comp_code(0x4000, 0x4400, 0x4400, 0, 0,
 						  0, 0, 0, 0, 0)},
-- 
2.25.1


  parent reply	other threads:[~2026-08-26  6:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26  6:40 [PATCH rtw-next 00/14] wifi: rtw89: update RTL8922D capabilities and settings, and enable P2P device Ping-Ke Shih
2026-08-26  6:40 ` [PATCH rtw-next 01/14] wifi: rtw89: 8922de: add low latency quirk for Valve device Ping-Ke Shih
2026-08-26  6:40 ` [PATCH rtw-next 02/14] wifi: rtw89: 8922d: disable VCORE for thermal protection by default Ping-Ke Shih
2026-08-26  6:40 ` [PATCH rtw-next 03/14] wifi: rtw89: allow two station interfaces in SCC Ping-Ke Shih
2026-08-26  6:40 ` [PATCH rtw-next 04/14] wifi: rtw89: 8922d: update BB wrapper RFSI ctrl to v4 Ping-Ke Shih
2026-08-26  6:40 ` [PATCH rtw-next 05/14] wifi: rtw89: 8922d: set BB wrapper settings according to operating channel Ping-Ke Shih
2026-08-26  6:40 ` [PATCH rtw-next 06/14] wifi: rtw89: 8922d: move conditionally disabled TX shape to common flow Ping-Ke Shih
2026-08-26  6:40 ` Ping-Ke Shih [this message]
2026-08-26  6:40 ` [PATCH rtw-next 08/14] wifi: rtw89: 8922d: send RFE type to firmware Ping-Ke Shih
2026-08-26  6:40 ` [PATCH rtw-next 09/14] wifi: rtw89: 8922d: bypass RX IQK when scan Ping-Ke Shih
2026-08-26  6:40 ` [PATCH rtw-next 10/14] wifi: rtw89: 8922d: correct selection of CCK rate circuit Ping-Ke Shih
2026-08-26  6:40 ` [PATCH rtw-next 11/14] wifi: rtw89: chan: introduce helper and refine active list iteration Ping-Ke Shih
2026-08-26  6:40 ` [PATCH rtw-next 12/14] wifi: rtw89: regd: check only active vifs when recalculating 6 GHz power type Ping-Ke Shih
2026-08-26  6:41 ` [PATCH rtw-next 13/14] wifi: rtw89: skip tracking things when entity is paused Ping-Ke Shih
2026-08-26  6:41 ` [PATCH rtw-next 14/14] wifi: rtw89: add p2p device declaration 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=20260826064101.58892-8-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=echuang@realtek.com \
    --cc=henchy.chen@realtek.com \
    --cc=kevin_yang@realtek.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=owen.hsiao@realtek.com \
    --cc=phhuang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox