From d0922e4b677239892654bc9f5360b6857e8604e1 Mon Sep 17 00:00:00 2001 From: Bapiraju Alla Date: Tue, 18 May 2021 23:08:26 +0530 Subject: [PATCH] qcacld-3.0: Don't set SURVEY_INFO_NOISE_DBM when noise floor is zero Currently host is sending noise floor as 0, even if channel info event is not received from FW. This is stopping user space derive noise floor information from other parameters like bandwidth. To address this, do not set SURVEY_INFO_NOISE_DBM flag if the noise floor is 0. Change-Id: Icffdde6bce762c750200b4f1eefd17818780150e CRs-Fixed: 2949905 --- core/hdd/src/wlan_hdd_stats.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index d774b04d9df9..c1c6b7498cd6 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -5739,7 +5739,10 @@ static bool wlan_fill_survey_result(struct survey_info *survey, int opfreq, survey->channel = channels; survey->noise = chan_info->noise_floor; - survey->filled = SURVEY_INFO_NOISE_DBM; + survey->filled = 0; + + if (chan_info->noise_floor) + survey->filled |= SURVEY_INFO_NOISE_DBM; if (opfreq == chan_info->freq) survey->filled |= SURVEY_INFO_IN_USE; @@ -5770,7 +5773,10 @@ static bool wlan_fill_survey_result(struct survey_info *survey, int opfreq, survey->channel = channels; survey->noise = chan_info->noise_floor; - survey->filled = SURVEY_INFO_NOISE_DBM; + survey->filled = 0; + + if (chan_info->noise_floor) + survey->filled |= SURVEY_INFO_NOISE_DBM; if (opfreq == chan_info->freq) survey->filled |= SURVEY_INFO_IN_USE;