From: Chih-Kang Chang gary.chang@realtek.com
[ Upstream commit e156d2ab36d7e47aec36845705e4ecb1e4e89976 ]
The header v2 of ppdu status is optional, If it is not enabled, the RX path must be obtained from IE00 or IE01. Append the IE00 part.
Signed-off-by: Chih-Kang Chang gary.chang@realtek.com Signed-off-by: Ping-Ke Shih pkshih@realtek.com Link: https://patch.msgid.link/20250915065213.38659-5-pkshih@realtek.com Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES – the change plugs a real regression in the rtw89 Wi‑Fi stack and is safe to carry to stable.
- When the PPDU “header v2” block is absent, `phy_ppdu->hdr_2_en` stays 0 (`drivers/net/wireless/realtek/rtw89/core.c:1977`), so we must populate `phy_ppdu->rx_path_en` from the legacy PHY information elements. Before this patch, the common CCK parser (`core.c:1900-1912`) never touched `rx_path_en`, leaving it at 0 for CCK frames. - Downstream users assume `rx_path_en` is valid. For Wi‑Fi 7 hardware, `rtw8922a_convert_rpl_to_rssi()` zeros every RSSI/FD sample whenever the bitmask is 0 (`drivers/net/wireless/realtek/rtw89/rtw8922a.c:2722-2735`). That produces bogus ~‑110 dBm signals, breaks per-chain reporting, and interferes with antenna-diversity decisions in monitor mode or diagnostics whenever firmware omits header v2 (which the commit message notes is optional). - The fix simply mirrors the existing OFDM logic by extracting the same 4‑bit mask out of IE00 (`le32_get_bits(ie->w3, …)` in `core.c:1910-1912`) and adds the matching mask definition (`drivers/net/wireless/realtek/rtw89/txrx.h:575`). Header‑v2 users are untouched because the assignment is gated on `!hdr_2_en`, preserving the newer path (`core.c:1958-1963`). - The bug originated with frequency-domain RSSI support in `c9ac071e30ba4` (first in v6.12-rc1), so all kernels carrying that commit (and therefore the BE/8922A RSSI conversion) will suffer the wrong RSSI without this fix. No additional dependencies were introduced afterward.
Given the clear user-visible malfunction, the very small and self- contained change, and the fact that it only restores parity with the already-supported OFDM path, this is an excellent candidate for stable backporting. Recommended follow-up is simply to ensure the prerequisite `c9ac071e30ba4` (and later header-length fix `640c27b2e0c50`) are present before applying.
drivers/net/wireless/realtek/rtw89/core.c | 4 ++++ drivers/net/wireless/realtek/rtw89/txrx.h | 1 + 2 files changed, 5 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index 0f7a467671ca8..2cebea10cb99b 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -1844,6 +1844,10 @@ static void rtw89_core_parse_phy_status_ie00(struct rtw89_dev *rtwdev,
tmp_rpl = le32_get_bits(ie->w0, RTW89_PHY_STS_IE00_W0_RPL); phy_ppdu->rpl_avg = tmp_rpl >> 1; + + if (!phy_ppdu->hdr_2_en) + phy_ppdu->rx_path_en = + le32_get_bits(ie->w3, RTW89_PHY_STS_IE00_W3_RX_PATH_EN); }
static void rtw89_core_parse_phy_status_ie00_v2(struct rtw89_dev *rtwdev, diff --git a/drivers/net/wireless/realtek/rtw89/txrx.h b/drivers/net/wireless/realtek/rtw89/txrx.h index ec01bfc363da3..307b22ae13b2a 100644 --- a/drivers/net/wireless/realtek/rtw89/txrx.h +++ b/drivers/net/wireless/realtek/rtw89/txrx.h @@ -572,6 +572,7 @@ struct rtw89_phy_sts_ie00 { } __packed;
#define RTW89_PHY_STS_IE00_W0_RPL GENMASK(15, 7) +#define RTW89_PHY_STS_IE00_W3_RX_PATH_EN GENMASK(31, 28)
struct rtw89_phy_sts_ie00_v2 { __le32 w0;