From cccf40f12b4193fed6deb119ede22c41c3a69e90 Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Thu, 28 Nov 2019 14:40:26 +0530 Subject: [PATCH] qcacmn: Return correct RSSI value from util_scan_entry_rssi() RSSI in the scan entry is a negative value. It was converted to positive value and if the converted value is greater than WLAN_RSSI_DUMMY_MARKER (has positive value 295), util_scan_entry_rssi() was returning 0 to the caller. util_scan_entry_rssi() is used for printing RSSI value. Since RSSI is saved as a negative value and caller expects it as a negative value, return a negative RSSI value from util_scan_entry_rssi(). Change-Id: Ifdeb88dfa42a6927ff29670429d846ff071e9c59 CRs-Fixed: 2576129 --- umac/scan/dispatcher/inc/wlan_scan_utils_api.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/umac/scan/dispatcher/inc/wlan_scan_utils_api.h b/umac/scan/dispatcher/inc/wlan_scan_utils_api.h index 93429163620c..a43a3b58c7d2 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_utils_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_utils_api.h @@ -266,20 +266,10 @@ util_scan_entry_reset_timestamp(struct scan_cache_entry *scan_entry) * * Return: rssi */ -static inline uint8_t +static inline int32_t util_scan_entry_rssi(struct scan_cache_entry *scan_entry) { - uint32_t rssi = WLAN_RSSI_OUT(scan_entry->avg_rssi); - /* - * An entry is in the BSS list means we've received at least one beacon - * from the corresponding AP, so the rssi must be initialized. - * - * If the RSSI is not initialized, return 0 (i.e. RSSI == Noise Floor). - * Once se_avgrssi field has been initialized, ATH_RSSI_OUT always - * returns values that fit in an 8-bit variable - * (RSSI values are typically 0-90). - */ - return (rssi >= WLAN_RSSI_DUMMY_MARKER) ? 0 : (uint8_t) rssi; + return WLAN_RSSI_OUT(scan_entry->avg_rssi); } /**