[PATCH] Use 6 GHz default noise when estimating 6 GHz SNR
kaidong at chromium.org
kaidong at chromium.org
Mon Aug 28 16:58:32 PDT 2023
From: Kaidong Wang <kaidong at chromium.org>
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 at chromium.org>
---
wpa_supplicant/events.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 41e25f077..13ca31726 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1962,9 +1962,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;
}
--
2.42.0.rc2.253.gd59a3bf2b4-goog
More information about the Hostap
mailing list