浏览代码

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
Shashikala Prabhu 5 年之前
父节点
当前提交
cccf40f12b
共有 1 个文件被更改,包括 2 次插入12 次删除
  1. 2 12
      umac/scan/dispatcher/inc/wlan_scan_utils_api.h

+ 2 - 12
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);
 }
 
 /**