From 6af738bb71e3b836d12da26ca59c24acfd7b4668 Mon Sep 17 00:00:00 2001 From: Om Prakash Tripathi Date: Tue, 22 Aug 2017 15:46:38 +0530 Subject: [PATCH] qcacmn: Init average rssi with frames rssi on receipt Initialize average rssi with instantaneous rssi in util_scan_unpack_beacon_frame intead of marking it as DUMMY. Change-Id: Ie2fd577feeb46d61915c6974d8c627acb31e8b81 CRs-Fixed: 2096979 --- umac/scan/core/src/wlan_scan_cache_db.c | 8 ++++---- umac/scan/dispatcher/src/wlan_scan_utils_api.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/umac/scan/core/src/wlan_scan_cache_db.c b/umac/scan/core/src/wlan_scan_cache_db.c index 89409933df80..31a1b001ba8d 100644 --- a/umac/scan/core/src/wlan_scan_cache_db.c +++ b/umac/scan/core/src/wlan_scan_cache_db.c @@ -425,12 +425,12 @@ static void scm_delete_duplicate_entry(struct scan_dbs *scan_db, /* If elapsed time since last rssi update for this * entry is smaller than a thresold, calculate a * running average of the RSSI values. - * Otherwise last RSSI is more representive of the - * signal strength. + * Otherwise new frames RSSI is more representive + * of the signal strength. */ time_gap = - scan_entry->rssi_timestamp - - scan_params->rssi_timestamp; + scan_params->scan_entry_time - + scan_entry->rssi_timestamp; if (time_gap > WLAN_RSSI_AVERAGING_TIME) scan_params->avg_rssi = WLAN_RSSI_IN(scan_params->rssi_raw); diff --git a/umac/scan/dispatcher/src/wlan_scan_utils_api.c b/umac/scan/dispatcher/src/wlan_scan_utils_api.c index 48a2f73c5726..2f77884430af 100644 --- a/umac/scan/dispatcher/src/wlan_scan_utils_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_utils_api.c @@ -595,7 +595,7 @@ util_scan_unpack_beacon_frame(uint8_t *frame, (le16toh(*(uint16_t *)hdr->i_seq) >> WLAN_SEQ_SEQ_SHIFT); scan_entry->rssi_raw = rx_param->rssi; - scan_entry->avg_rssi = WLAN_RSSI_DUMMY_MARKER; + scan_entry->avg_rssi = WLAN_RSSI_IN(scan_entry->rssi_raw); scan_entry->tsf_delta = rx_param->tsf_delta; /* store jiffies */