From d064902a663454485dbfe487da7feb0b9f14274d Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Mon, 4 May 2020 12:52:00 +0530 Subject: [PATCH] qcacld-3.0: Update disconnect rssi on every disconnect rssi event Currently there is a check to validate if the station is in associated state or not in the hdd lost link cp stats info cb, There is a race condition where if the disconnection happens from ap in that case the callback gets invoked before the connection state in the station context gets updated and thus the rssi on disconnect is not updated. To address above issue remove the check to validate the station state and update the rssi on disconnect irrespective of the state of the connection. Change-Id: I9cc6a08cdf0a1081adfde7a9423a665bc977cffc CRs-Fixed: 2678667 --- .../target_if/cp_stats/src/target_if_mc_cp_stats.c | 4 ++++ core/hdd/src/wlan_hdd_stats.c | 14 ++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/components/target_if/cp_stats/src/target_if_mc_cp_stats.c b/components/target_if/cp_stats/src/target_if_mc_cp_stats.c index bd6f65981f4b..39b8390852a8 100644 --- a/components/target_if/cp_stats/src/target_if_mc_cp_stats.c +++ b/components/target_if/cp_stats/src/target_if_mc_cp_stats.c @@ -317,6 +317,10 @@ static QDF_STATUS target_if_cp_stats_extract_vdev_summary_stats( dat_snr = vdev_stats.vdev_snr.dat_snr; ev->vdev_summary_stats[i].vdev_id = vdev_stats.vdev_id; + cp_stats_debug("vdev %d SNR bcn: %d data: %d", + ev->vdev_summary_stats[i].vdev_id, bcn_snr, + dat_snr); + for (j = 0; j < 4; j++) { ev->vdev_summary_stats[i].stats.tx_frm_cnt[j] = vdev_stats.tx_frm_cnt[j]; diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 23380b2cfa29..273f731ea859 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -6216,7 +6216,6 @@ static void hdd_lost_link_cp_stats_info_cb(void *stats_ev) struct hdd_adapter *adapter; struct stats_event *ev = stats_ev; uint8_t i; - struct hdd_station_ctx *sta_ctx; if (wlan_hdd_validate_context(hdd_ctx)) return; @@ -6229,16 +6228,11 @@ static void hdd_lost_link_cp_stats_info_cb(void *stats_ev) hdd_debug("invalid adapter"); continue; } - sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - if ((sta_ctx) && - (eConnectionState_Associated != - sta_ctx->conn_info.conn_state)) { - adapter->rssi_on_disconnect = + adapter->rssi_on_disconnect = ev->vdev_summary_stats[i].stats.rssi; - hdd_debug("rssi on disconnect %d for " QDF_MAC_ADDR_STR, - adapter->rssi_on_disconnect, - QDF_MAC_ADDR_ARRAY(adapter->mac_addr.bytes)); - } + hdd_debug("rssi %d for " QDF_MAC_ADDR_STR, + adapter->rssi_on_disconnect, + QDF_MAC_ADDR_ARRAY(adapter->mac_addr.bytes)); } }