]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rtw89: 8852a: report average RSSI to avoid unnecessary scanning
authorPo-Hao Huang <phhuang@realtek.com>
Tue, 19 Aug 2025 03:44:26 +0000 (11:44 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Tue, 26 Aug 2025 01:15:39 +0000 (09:15 +0800)
8852A uses single antenna during power save, when the loss
between two antennas is too large, previous logic induces
greater RSSI variation. Report the average beacon RSSI for
connected AP to get more stable RSSI and less unnecessary scanning.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250819034428.26307-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/rtw8852a.c

index 1d85607e942430ee74d26f814ac13cddead60365..d4200246eeccab63d96a1a1589cbf4be673dac40 100644 (file)
@@ -2109,10 +2109,17 @@ static void rtw8852a_query_ppdu(struct rtw89_dev *rtwdev,
 {
        u8 path;
        u8 *rx_power = phy_ppdu->rssi;
+       u8 raw;
+
+       if (!status->signal) {
+               if (phy_ppdu->to_self)
+                       raw = ewma_rssi_read(&rtwdev->phystat.bcn_rssi);
+               else
+                       raw = max(rx_power[RF_PATH_A], rx_power[RF_PATH_B]);
+
+               status->signal = RTW89_RSSI_RAW_TO_DBM(raw);
+       }
 
-       if (!status->signal)
-               status->signal = RTW89_RSSI_RAW_TO_DBM(max(rx_power[RF_PATH_A],
-                                                          rx_power[RF_PATH_B]));
        for (path = 0; path < rtwdev->chip->rf_path_num; path++) {
                status->chains |= BIT(path);
                status->chain_signal[path] = RTW89_RSSI_RAW_TO_DBM(rx_power[path]);