]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use 6 GHz default noise when estimating 6 GHz SNR
authorKaidong Wang <kaidong@chromium.org>
Mon, 28 Aug 2023 23:58:32 +0000 (23:58 +0000)
committerJouni Malinen <j@w1.fi>
Sat, 28 Oct 2023 10:14:24 +0000 (13:14 +0300)
wpa_supplicant underestimates 6 GHz SNR as it assumes 2 GHz default
noise in the estimation.

Use 6 GHz default noise when estimating 6 GHz SNR.

Signed-off-by: Kaidong Wang <kaidong@chromium.org>
wpa_supplicant/events.c

index f205b91d5ed0f620fb8d2752d98f81c5d5470921..9c308a5a34638c1e4bea6b303215b313cee23554 100644 (file)
@@ -1963,9 +1963,15 @@ static void wpa_supplicant_rsn_preauth_scan_results(
 
 static int wpas_get_snr_signal_info(u32 frequency, int avg_signal, int noise)
 {
-       if (noise == WPA_INVALID_NOISE)
-               noise = IS_5GHZ(frequency) ? DEFAULT_NOISE_FLOOR_5GHZ :
-                       DEFAULT_NOISE_FLOOR_2GHZ;
+       if (noise == WPA_INVALID_NOISE) {
+               if (IS_5GHZ(frequency)) {
+                       noise = DEFAULT_NOISE_FLOOR_5GHZ;
+               } else if (is_6ghz_freq(frequency)) {
+                       noise = DEFAULT_NOISE_FLOOR_6GHZ;
+               } else {
+                       noise = DEFAULT_NOISE_FLOOR_2GHZ;
+               }
+       }
        return avg_signal - noise;
 }