Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH rtw-next] wifi: rtw89: do RA association again when the station RSSI is known
@ 2026-11-08 13:17 acio
  2026-11-11  3:22 ` Ping-Ke Shih
  0 siblings, 1 reply; 3+ messages in thread
From: acio @ 2026-11-08 13:17 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: linux-wireless, Vincent Schurink

From: Vincent Schurink <spam@acio.nl>

When a station associates to an AP, the AP does not know the RSSI of
the station yet. Thus, rtw89_phy_ra_assoc() sends init_rate_lv 0 to the
firmware. With this value, the firmware RA of RTL8922A uses 20 MHz and
VHT-MCS 2 for the station. The firmware RA does not try a higher rate,
also when the PER is 0. On an 80 MHz AP, the TCP throughput to the
station stays at approximately 35 Mbit/s.

Set a flag when the RSSI is not known at the RA association. When the
RSSI is known, the periodic RA update does the RA association again.

Tested on RTL8912AU (RTL8922A, USB) in AP mode with hostapd 2.10 and
VHT 80 MHz. The client is an Intel Meteor Lake CNVi (iwlwifi) at
-45 dBm.
Before: TX rate VHT-MCS 2 at 20 MHz, TCP 35 Mbit/s.
After: TX rate VHT-MCS 7 to 9 at 80 MHz, TCP 186 to 320 Mbit/s.

Signed-off-by: Vincent Schurink <spam@acio.nl>
---
 drivers/net/wireless/realtek/rtw89/core.h |  1 +
 drivers/net/wireless/realtek/rtw89/phy.c  | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
index 0d893b992a4..ca5f2aced33 100644
--- a/drivers/net/wireless/realtek/rtw89/core.h
+++ b/drivers/net/wireless/realtek/rtw89/core.h
@@ -4711,6 +4711,7 @@ struct rtw89_sta_link {
 	struct rtw89_vif_link *rtwvif_link;
 	struct rtw89_ra_info ra;
 	struct rtw89_ra_report ra_report;
+	bool ra_rssi_unknown;
 	int max_agg_wait;
 	u8 prev_rssi;
 	struct ewma_rssi avg_rssi;
diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
index 795920b899d..96660b781a5 100644
--- a/drivers/net/wireless/realtek/rtw89/phy.c
+++ b/drivers/net/wireless/realtek/rtw89/phy.c
@@ -717,6 +717,19 @@ void rtw89_phy_rate_pattern_vif(struct rtw89_dev *rtwdev,
 static void rtw89_phy_ra_update_sta_iter(void *data, struct ieee80211_sta *sta)
 {
 	struct rtw89_dev *rtwdev = (struct rtw89_dev *)data;
+	struct rtw89_sta *rtwsta = sta_to_rtwsta(sta);
+	struct rtw89_sta_link *rtwsta_link;
+	unsigned int link_id;
+	u8 rssi;
+
+	rtw89_sta_for_each_link(rtwsta, rtwsta_link, link_id) {
+		if (!rtwsta_link->ra_rssi_unknown)
+			continue;
+
+		rssi = ewma_rssi_read(&rtwsta_link->avg_rssi) >> RSSI_FACTOR;
+		if (rssi > 1)
+			rtw89_phy_ra_assoc(rtwdev, rtwsta_link);
+	}
 
 	rtw89_phy_ra_update_sta(rtwdev, sta, IEEE80211_RC_SUPP_RATES_CHANGED);
 }
@@ -755,6 +768,7 @@ void rtw89_phy_ra_assoc(struct rtw89_dev *rtwdev, struct rtw89_sta_link *rtwsta_
 		ra->init_rate_lv = 3;
 	else
 		ra->init_rate_lv = 0;
+	rtwsta_link->ra_rssi_unknown = rssi <= 1;
 	ra->upd_all = 1;
 	rtw89_debug(rtwdev, RTW89_DBG_RA,
 		    "ra assoc: macid = %d, mode = %d, bw = %d, nss = %d, lv = %d",
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-12  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-08 13:17 [PATCH rtw-next] wifi: rtw89: do RA association again when the station RSSI is known acio
2026-11-11  3:22 ` Ping-Ke Shih
2026-11-12  7:58   ` V. S.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox