From: Kaidong Wang Date: Mon, 28 Aug 2023 23:58:32 +0000 (+0000) Subject: Use 6 GHz default noise when estimating 6 GHz SNR X-Git-Tag: hostap_2_11~921 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2563edb8c5271762a73a00fd3a245a1aac4f16cd;p=thirdparty%2Fhostap.git Use 6 GHz default noise when estimating 6 GHz SNR 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 --- diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index f205b91d5..9c308a5a3 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -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; }