From b1f35df0b0626bdcbcc2db96dc35f3f001dfef7c Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Mon, 16 Apr 2018 12:19:01 +0800 Subject: [PATCH] qcacld-3.0: update the adapter->rssi from fw Currently, sta's adapter.rssi does not reset when disconnect with the previous ap and for new connection there might be no valid rssi so it will get 0 when hdd_get_station_statistics_cb or hdd_get_rssi_cb is invoking. Then it uses the previous ap's rssi for the new conneciton. Per the code logic, it is ok to set adapter.rssi with 0 value. Because it invokes hdd_get_rssi_snr_by_bssid to get the rssi & snr when issue happens. Change-Id: I737cfcf16d58501546f2fceab06ed1e5418e7b06 CRs-Fixed: 2199782 --- core/hdd/src/wlan_hdd_stats.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 67212a92f8df..50ff71ff5cca 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -3971,18 +3971,17 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, wlan_hdd_get_station_stats(adapter); - if (adapter->hdd_stats.summary_stat.rssi) - adapter->rssi = adapter->hdd_stats.summary_stat.rssi; + adapter->rssi = adapter->hdd_stats.summary_stat.rssi; + snr = adapter->hdd_stats.summary_stat.snr; /* for new connection there might be no valid previous RSSI */ if (!adapter->rssi) { hdd_get_rssi_snr_by_bssid(adapter, sta_ctx->conn_info.bssId.bytes, - &adapter->rssi, NULL); + &adapter->rssi, &snr); } sinfo->signal = adapter->rssi; - snr = adapter->hdd_stats.summary_stat.snr; hdd_debug("snr: %d, rssi: %d", adapter->hdd_stats.summary_stat.snr, adapter->hdd_stats.summary_stat.rssi); @@ -5061,12 +5060,8 @@ QDF_STATUS wlan_hdd_get_rssi(struct hdd_adapter *adapter, int8_t *rssi_value) } else { /* update the adapter with the fresh results */ priv = hdd_request_priv(request); - /* - * update rssi only if its valid else return previous - * valid rssi. - */ - if (priv->rssi) - adapter->rssi = priv->rssi; + + adapter->rssi = priv->rssi; /* * for new connection there might be no valid previous