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
2019-11-28 14:40:26 +05:30
зафіксовано nshrivas
джерело c20cb89340
коміт cccf40f12b

Переглянути файл

@@ -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);
}
/**