Skip to contentSkip to conversation

wifi: rtw89: fix CTS transmission issue with center frequency deviation

PATCH In review Ping-Ke Shih 1 participant 3 messages Apr 23, 2024 – Apr 29, 2024 Realtek wireless driver (rtw89)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/2 wifi: rtw89: fix CTS transmission issue with center frequency deviation

From: Kuan-Chung Chen <[email protected]>

The CTS cannot be received by the peer due to center frequency deviation. This issue can be solved by correct settings to transmit proper CTS.

---
 drivers/net/wireless/realtek/rtw89/mac.c    | 5 +++++
 drivers/net/wireless/realtek/rtw89/mac_be.c | 5 +++++
 2 files changed, 10 insertions(+)
drivers/net/wireless/realtek/rtw89/mac.c +5 -0
index 8b34044f7a8a..b78b110ac7b2 100644
@@ -3644,6 +3644,7 @@ static int set_host_rpr_ax(struct rtw89_dev *rtwdev)
 
 static int trx_init_ax(struct rtw89_dev *rtwdev)
 {
+	enum rtw89_core_chip_id chip_id = rtwdev->chip->chip_id;
 	enum rtw89_qta_mode qta_mode = rtwdev->mac.qta_mode;
 	int ret;
 
@@ -3687,6 +3688,10 @@ static int trx_init_ax(struct rtw89_dev *rtwdev)
 		return ret;
 	}
 
+	if (chip_id == RTL8852C)
+		rtw89_write32_clr(rtwdev, R_AX_RSP_CHK_SIG,
+				  B_AX_RSP_STATIC_RTS_CHK_SERV_BW_EN);
+
 	return 0;
 }
 
drivers/net/wireless/realtek/rtw89/mac_be.c +5 -0
index f16467377eab..934bdf3b398f 100644
@@ -1751,6 +1751,7 @@ static int set_host_rpr_be(struct rtw89_dev *rtwdev)
 
 static int trx_init_be(struct rtw89_dev *rtwdev)
 {
+	enum rtw89_core_chip_id chip_id = rtwdev->chip->chip_id;
 	enum rtw89_qta_mode qta_mode = rtwdev->mac.qta_mode;
 	int ret;
 
@@ -1794,6 +1795,10 @@ static int trx_init_be(struct rtw89_dev *rtwdev)
 		return ret;
 	}
 
+	if (chip_id == RTL8922A)
+		rtw89_write32_clr(rtwdev, R_BE_RSP_CHK_SIG,
+				  B_BE_RSP_STATIC_RTS_CHK_SERV_BW_EN);
+
 	return 0;
 }
 
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 2/2 wifi: rtw89: 8852b: update hardware parameters for RFE type 5

RFE type 5 of 8852B is a type of hardware module, which can use different external components, so update register settings accordingly.

---
 drivers/net/wireless/realtek/rtw89/reg.h      |  3 +++
 drivers/net/wireless/realtek/rtw89/rtw8852b.c | 12 ++++++++++++
 2 files changed, 15 insertions(+)
drivers/net/wireless/realtek/rtw89/reg.h +3 -0
index 0c0d3c84b178..01cbd0312102 100644
@@ -235,6 +235,9 @@
 
 #define R_AX_SPSANA_ON_CTRL1 0x0224
 
+#define R_AX_SPS_ANA_ON_CTRL2 0x0228
+#define RTL8852B_RFE_05_SPS_ANA 0x4A82
+
 #define R_AX_WLAN_XTAL_SI_CTRL 0x0270
 #define B_AX_WL_XTAL_SI_CMD_POLL BIT(31)
 #define B_AX_BT_XTAL_SI_ERR_FLAG BIT(30)
drivers/net/wireless/realtek/rtw89/rtw8852b.c +12 -0
index 85908c55baa9..9b8f1d06512e 100644
@@ -390,6 +390,14 @@ static const struct rtw89_btc_fbtc_mreg rtw89_btc_8852b_mon_reg[] = {
 static const u8 rtw89_btc_8852b_wl_rssi_thres[BTC_WL_RSSI_THMAX] = {70, 60, 50, 40};
 static const u8 rtw89_btc_8852b_bt_rssi_thres[BTC_BT_RSSI_THMAX] = {50, 40, 30, 20};
 
+static void rtw8852b_pwr_sps_ana(struct rtw89_dev *rtwdev)
+{
+	struct rtw89_efuse *efuse = &rtwdev->efuse;
+
+	if (efuse->rfe_type == 0x5)
+		rtw89_write16(rtwdev, R_AX_SPS_ANA_ON_CTRL2, RTL8852B_RFE_05_SPS_ANA);
+}
+
 static int rtw8852b_pwr_on_func(struct rtw89_dev *rtwdev)
 {
 	u32 val32;
@@ -522,6 +530,10 @@ static int rtw8852b_pwr_off_func(struct rtw89_dev *rtwdev)
 	u32 val32;
 	u32 ret;
 
+	/* Only do once during probe stage after reading efuse */
+	if (!test_bit(RTW89_FLAG_PROBE_DONE, rtwdev->flags))
+		rtw8852b_pwr_sps_ana(rtwdev);
+
 	ret = rtw89_mac_write_xtal_si(rtwdev, XTAL_SI_ANAPAR_WL, XTAL_SI_RFC2RF,
 				      XTAL_SI_RFC2RF);
 	if (ret)
Signature · 1 line
2.25.1
author maintainer
#2 lore raw
In reply to Ping-Ke Shih
Quoted 8 lines · Ping-Ke Shih

From: Kuan-Chung Chen <[email protected]>

The CTS cannot be received by the peer due to center frequency deviation. This issue can be solved by correct settings to transmit proper CTS.

2 patch(es) applied to rtw-next branch of rtw.git, thanks.

7be73dc106a9 wifi: rtw89: fix CTS transmission issue with center frequency deviation 3ef60f44830a wifi: rtw89: 8852b: update hardware parameters for RFE type 5

---
https://github.com/pkshih/rtw.git