wlan: Add BSS status caching
Add BSS status caching to get the BSS Information
when disconnect happens
Change-Id: I41b74700b161277bc454d8bb8978f4e1e92faea8
CRs-fixed: 2079789
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index b1402b9..64c1826 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -13912,6 +13912,7 @@
int status = 0;
hdd_wext_state_t *pWextState;
hdd_context_t *pHddCtx;
+ hdd_station_ctx_t *hdd_sta_ctx;
v_U32_t roamId;
tCsrRoamProfile *pRoamProfile;
eCsrAuthType RSNAuthType;
@@ -13920,6 +13921,7 @@
pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
+ hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
status = wlan_hdd_validate_context(pHddCtx);
if (status)
@@ -16160,6 +16162,7 @@
tANI_U8 MCSRates[SIZE_OF_BASIC_MCS_SET];
tANI_U32 MCSLeng = SIZE_OF_BASIC_MCS_SET;
tANI_U16 maxRate = 0;
+ int8_t snr = 0;
tANI_U16 myRate;
tANI_U16 currentRate = 0;
tANI_U8 maxSpeedMCS = 0;
@@ -16204,6 +16207,9 @@
rate_flags = pAdapter->hdd_stats.ClassA_stat.tx_rate_flags;
wlan_hdd_get_rssi(pAdapter, &sinfo->signal);
+ wlan_hdd_get_snr(pAdapter, &snr);
+ pHddStaCtx->conn_info.signal = sinfo->signal;
+ pHddStaCtx->conn_info.noise = pHddStaCtx->conn_info.signal - snr;
sinfo->filled |= STATION_INFO_SIGNAL;
/*overwrite rate_flags if MAX link-speed need to be reported*/
@@ -16592,6 +16598,8 @@
sinfo->rx_packets = pAdapter->hdd_stats.summary_stat.rx_frm_cnt;
sinfo->filled |= STATION_INFO_RX_PACKETS;
+ vos_mem_copy(&pHddStaCtx->conn_info.txrate,
+ &sinfo->txrate, sizeof(sinfo->txrate));
if (rate_flags & eHAL_TX_RATE_LEGACY)
hddLog(LOG1, FL("Reporting RSSI:%d legacy rate %d pkt cnt tx %d rx %d"),
sinfo->signal, sinfo->txrate.legacy, sinfo->tx_packets,