summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Kumar Dhanotiya <adhanoti@codeaurora.org>2018-03-15 19:44:04 +0530
committerAshish Kumar Dhanotiya <adhanoti@codeaurora.org>2018-03-22 17:10:56 +0530
commit51ee8321c2da5caa7ec21fa5ccb7bc717461b3ed (patch)
treeb1f3deeaa496da9dc68fcf526d4b04ccf1611448
parenta8b2647cb8da3b051b4b52e95eab424a8e01f73c (diff)
qcacld-2.0: Cache last connection info
Prima to qcacld-2.0 Propagation Currently last connection info is not getting cached, so when GETBSSINFO command comes information is extracted from current conn_info which does not contain all the information required as this information is cleared after disconnection. To address this issue cache the connection info before clearing it. Change-Id: I3ec13264f97e7a4d0dc4699b463074062d087e82 CRs-Fixed: 2206502
-rw-r--r--CORE/HDD/inc/wlan_hdd_assoc.h8
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h2
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c13
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c119
4 files changed, 76 insertions, 66 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_assoc.h b/CORE/HDD/inc/wlan_hdd_assoc.h
index 3a73e5ef169c..193c924a19e9 100644
--- a/CORE/HDD/inc/wlan_hdd_assoc.h
+++ b/CORE/HDD/inc/wlan_hdd_assoc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -230,12 +230,6 @@ typedef struct connection_info_s
/** holds assoc fail reason */
int32_t assoc_status_code;
- /** holds last SSID info */
- tCsrSSIDInfo last_ssid;
-
- /** holds last auth type */
- eCsrAuthType last_auth_type;
-
/* ptk installed state */
bool ptk_installed;
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index b761d524b03f..c786dfbb696e 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -801,6 +801,8 @@ struct hdd_station_ctx
/**Connection information*/
connection_info_t conn_info;
+ connection_info_t cache_conn_info;
+
roaming_info_t roam_info;
#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 36ce907ddfe4..8b51856adf47 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -815,6 +815,9 @@ static void hdd_save_bss_info(hdd_adapter_t *adapter,
} else {
hdd_sta_ctx->conn_info.conn_flag.vht_op_present = false;
}
+ /* Cache last connection info */
+ vos_mem_copy(&hdd_sta_ctx->cache_conn_info, &hdd_sta_ctx->conn_info,
+ sizeof(connection_info_t));
}
static void
@@ -871,15 +874,11 @@ hdd_connSaveConnectInfo(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo,
pHddStaCtx->conn_info.ucEncryptionType = encryptType;
pHddStaCtx->conn_info.authType = pRoamInfo->u.pConnectedProfile->AuthType;
- pHddStaCtx->conn_info.last_auth_type = pHddStaCtx->conn_info.authType;
pHddStaCtx->conn_info.operationChannel = pRoamInfo->u.pConnectedProfile->operationChannel;
// Save the ssid for the connection
vos_mem_copy( &pHddStaCtx->conn_info.SSID.SSID, &pRoamInfo->u.pConnectedProfile->SSID, sizeof( tSirMacSSid ) );
- vos_mem_copy(&pHddStaCtx->conn_info.last_ssid.SSID,
- &pRoamInfo->u.pConnectedProfile->SSID,
- sizeof(tSirMacSSid));
// Save dot11mode in which STA associated to AP
pHddStaCtx->conn_info.dot11Mode = pRoamInfo->u.pConnectedProfile->dot11Mode;
@@ -1481,10 +1480,10 @@ static void hdd_print_bss_info(hdd_station_ctx_t *hdd_sta_ctx)
hddLog(VOS_TRACE_LEVEL_INFO, "dot11mode: %d",
hdd_sta_ctx->conn_info.dot11Mode);
hddLog(VOS_TRACE_LEVEL_INFO, "AKM: %d",
- hdd_sta_ctx->conn_info.last_auth_type);
+ hdd_sta_ctx->cache_conn_info.authType);
hddLog(VOS_TRACE_LEVEL_INFO, "ssid: %.*s",
- hdd_sta_ctx->conn_info.last_ssid.SSID.length,
- hdd_sta_ctx->conn_info.last_ssid.SSID.ssId);
+ hdd_sta_ctx->cache_conn_info.SSID.SSID.length,
+ hdd_sta_ctx->cache_conn_info.SSID.SSID.ssId);
hddLog(VOS_TRACE_LEVEL_INFO, "roam count: %d",
hdd_sta_ctx->conn_info.roam_count);
hddLog(VOS_TRACE_LEVEL_INFO, "ant_info: %d",
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index b2f0821c08d1..439c7902bc42 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -13866,17 +13866,17 @@ static int32_t hdd_add_tx_bitrate(struct sk_buff *skb,
if (!nla_attr)
goto fail;
/* cfg80211_calculate_bitrate will return 0 for mcs >= 32 */
- txrate.flags = hdd_sta_ctx->conn_info.txrate.flags;
- txrate.mcs = hdd_sta_ctx->conn_info.txrate.mcs;
- txrate.legacy = hdd_sta_ctx->conn_info.txrate.legacy;
- txrate.nss = hdd_sta_ctx->conn_info.txrate.nss;
+ txrate.flags = hdd_sta_ctx->cache_conn_info.txrate.flags;
+ txrate.mcs = hdd_sta_ctx->cache_conn_info.txrate.mcs;
+ txrate.legacy = hdd_sta_ctx->cache_conn_info.txrate.legacy;
+ txrate.nss = hdd_sta_ctx->cache_conn_info.txrate.nss;
bitrate = cfg80211_calculate_bitrate(&txrate);
- hdd_sta_ctx->conn_info.txrate.flags = txrate.flags;
- hdd_sta_ctx->conn_info.txrate.mcs = txrate.mcs;
- hdd_sta_ctx->conn_info.txrate.legacy = txrate.legacy;
- hdd_sta_ctx->conn_info.txrate.nss = txrate.nss;
+ hdd_sta_ctx->cache_conn_info.txrate.flags = txrate.flags;
+ hdd_sta_ctx->cache_conn_info.txrate.mcs = txrate.mcs;
+ hdd_sta_ctx->cache_conn_info.txrate.legacy = txrate.legacy;
+ hdd_sta_ctx->cache_conn_info.txrate.nss = txrate.nss;
/* report 16-bit bitrate only if we can */
bitrate_compat = bitrate < (1UL << 16) ? bitrate : 0;
@@ -13891,7 +13891,7 @@ static int32_t hdd_add_tx_bitrate(struct sk_buff *skb,
goto fail;
}
if (nla_put_u8(skb, NL80211_RATE_INFO_VHT_NSS,
- hdd_sta_ctx->conn_info.txrate.nss)) {
+ hdd_sta_ctx->cache_conn_info.txrate.nss)) {
hddLog(LOGE, FL("put fail nss"));
goto fail;
}
@@ -13918,7 +13918,7 @@ static int32_t hdd_add_sta_info(struct sk_buff *skb,
if (!nla_attr)
goto fail;
if (nla_put_u8(skb, NL80211_STA_INFO_SIGNAL,
- (hdd_sta_ctx->conn_info.signal + 100))) {
+ (hdd_sta_ctx->cache_conn_info.signal + 100))) {
hddLog(LOGE, FL("put fail signal"));
goto fail;
}
@@ -13948,9 +13948,9 @@ static int32_t hdd_add_survey_info(struct sk_buff *skb,
if (!nla_attr)
goto fail;
if (nla_put_u32(skb, NL80211_SURVEY_INFO_FREQUENCY,
- hdd_sta_ctx->conn_info.freq) ||
+ hdd_sta_ctx->cache_conn_info.freq) ||
nla_put_u8(skb, NL80211_SURVEY_INFO_NOISE,
- (hdd_sta_ctx->conn_info.noise + 100))) {
+ (hdd_sta_ctx->cache_conn_info.noise + 100))) {
hddLog(LOGE, FL("put fail noise"));
goto fail;
}
@@ -13979,11 +13979,14 @@ hdd_add_link_standard_info(struct sk_buff *skb,
goto fail;
if (nla_put(skb,
NL80211_ATTR_SSID,
- hdd_sta_ctx->conn_info.last_ssid.SSID.length,
- hdd_sta_ctx->conn_info.last_ssid.SSID.ssId)) {
+ hdd_sta_ctx->cache_conn_info.SSID.SSID.length,
+ hdd_sta_ctx->cache_conn_info.SSID.SSID.ssId)) {
hddLog(LOGE, FL("put fail ssid"));
goto fail;
}
+ if (nla_put(skb, NL80211_ATTR_MAC, VOS_MAC_ADDR_SIZE,
+ hdd_sta_ctx->cache_conn_info.bssId))
+ goto fail;
if (hdd_add_survey_info(skb, hdd_sta_ctx, NL80211_ATTR_SURVEY_INFO))
goto fail;
if (hdd_add_sta_info(skb, hdd_sta_ctx, NL80211_ATTR_STA_INFO))
@@ -14011,17 +14014,17 @@ hdd_add_ap_standard_info(struct sk_buff *skb,
nla_attr = nla_nest_start(skb, idx);
if (!nla_attr)
goto fail;
- if (hdd_sta_ctx->conn_info.conn_flag.vht_present)
+ if (hdd_sta_ctx->cache_conn_info.conn_flag.vht_present)
if (nla_put(skb, NL80211_ATTR_VHT_CAPABILITY,
- sizeof(hdd_sta_ctx->conn_info.vht_caps),
- &hdd_sta_ctx->conn_info.vht_caps)) {
+ sizeof(hdd_sta_ctx->cache_conn_info.vht_caps),
+ &hdd_sta_ctx->cache_conn_info.vht_caps)) {
hddLog(LOGE, FL("put fail vht cap"));
goto fail;
}
- if (hdd_sta_ctx->conn_info.conn_flag.ht_present)
+ if (hdd_sta_ctx->cache_conn_info.conn_flag.ht_present)
if (nla_put(skb, NL80211_ATTR_HT_CAPABILITY,
- sizeof(hdd_sta_ctx->conn_info.ht_caps),
- &hdd_sta_ctx->conn_info.ht_caps)) {
+ sizeof(hdd_sta_ctx->cache_conn_info.ht_caps),
+ &hdd_sta_ctx->cache_conn_info.ht_caps)) {
hddLog(LOGE, FL("put fail ht cap"));
goto fail;
}
@@ -14049,28 +14052,33 @@ static int hdd_get_station_info(hdd_context_t *hdd_ctx,
hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
nl_buf_len = NLMSG_HDRLEN;
- nl_buf_len += sizeof(hdd_sta_ctx->conn_info.last_ssid.SSID.length) +
- sizeof(hdd_sta_ctx->conn_info.freq) +
- sizeof(hdd_sta_ctx->conn_info.noise) +
- sizeof(hdd_sta_ctx->conn_info.signal) +
+ nl_buf_len += sizeof(hdd_sta_ctx->
+ cache_conn_info.SSID.SSID.length) +
+ VOS_MAC_ADDR_SIZE +
+ sizeof(hdd_sta_ctx->cache_conn_info.freq) +
+ sizeof(hdd_sta_ctx->cache_conn_info.noise) +
+ sizeof(hdd_sta_ctx->cache_conn_info.signal) +
(sizeof(uint32_t) * 2) +
- sizeof(hdd_sta_ctx->conn_info.txrate.nss) +
- sizeof(hdd_sta_ctx->conn_info.roam_count) +
- sizeof(hdd_sta_ctx->conn_info.last_auth_type) +
- sizeof(hdd_sta_ctx->conn_info.dot11Mode);
- if (hdd_sta_ctx->conn_info.conn_flag.vht_present)
- nl_buf_len += sizeof(hdd_sta_ctx->conn_info.vht_caps);
- if (hdd_sta_ctx->conn_info.conn_flag.ht_present)
- nl_buf_len += sizeof(hdd_sta_ctx->conn_info.ht_caps);
- if (hdd_sta_ctx->conn_info.conn_flag.hs20_present) {
- tmp_hs20 = (uint8_t *)&(hdd_sta_ctx->conn_info.hs20vendor_ie);
- nl_buf_len += (sizeof(hdd_sta_ctx->conn_info.hs20vendor_ie) -
- 1);
- }
- if (hdd_sta_ctx->conn_info.conn_flag.ht_op_present)
- nl_buf_len += sizeof(hdd_sta_ctx->conn_info.ht_operation);
- if (hdd_sta_ctx->conn_info.conn_flag.vht_op_present)
- nl_buf_len += sizeof(hdd_sta_ctx->conn_info.vht_operation);
+ sizeof(hdd_sta_ctx->cache_conn_info.txrate.nss) +
+ sizeof(hdd_sta_ctx->cache_conn_info.roam_count) +
+ sizeof(hdd_sta_ctx->cache_conn_info.authType) +
+ sizeof(hdd_sta_ctx->cache_conn_info.dot11Mode);
+ if (hdd_sta_ctx->cache_conn_info.conn_flag.vht_present)
+ nl_buf_len += sizeof(hdd_sta_ctx->cache_conn_info.vht_caps);
+ if (hdd_sta_ctx->cache_conn_info.conn_flag.ht_present)
+ nl_buf_len += sizeof(hdd_sta_ctx->cache_conn_info.ht_caps);
+ if (hdd_sta_ctx->cache_conn_info.conn_flag.hs20_present) {
+ tmp_hs20 = (uint8_t *)&hdd_sta_ctx->
+ cache_conn_info.hs20vendor_ie;
+ nl_buf_len += (sizeof(hdd_sta_ctx->
+ cache_conn_info.hs20vendor_ie) - 1);
+ }
+ if (hdd_sta_ctx->cache_conn_info.conn_flag.ht_op_present)
+ nl_buf_len += sizeof(hdd_sta_ctx->
+ cache_conn_info.ht_operation);
+ if (hdd_sta_ctx->cache_conn_info.conn_flag.vht_op_present)
+ nl_buf_len += sizeof(hdd_sta_ctx->
+ cache_conn_info.vht_operation);
skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy, nl_buf_len);
@@ -14090,33 +14098,35 @@ static int hdd_get_station_info(hdd_context_t *hdd_ctx,
goto fail;
}
if (nla_put_u32(skb, INFO_ROAM_COUNT,
- hdd_sta_ctx->conn_info.roam_count) ||
+ hdd_sta_ctx->cache_conn_info.roam_count) ||
nla_put_u32(skb, INFO_AKM,
hdd_convert_auth_type(
- hdd_sta_ctx->conn_info.last_auth_type)) ||
+ hdd_sta_ctx->cache_conn_info.authType)) ||
nla_put_u32(skb, WLAN802_11_MODE,
hdd_convert_dot11mode(
- hdd_sta_ctx->conn_info.dot11Mode))) {
+ hdd_sta_ctx->cache_conn_info.dot11Mode))) {
hddLog(LOGE, FL("put fail roam_count, etc."));
goto fail;
}
- if (hdd_sta_ctx->conn_info.conn_flag.ht_op_present)
+ if (hdd_sta_ctx->cache_conn_info.conn_flag.ht_op_present)
if (nla_put(skb, HT_OPERATION,
- (sizeof(hdd_sta_ctx->conn_info.ht_operation)),
- &hdd_sta_ctx->conn_info.ht_operation)) {
+ (sizeof(hdd_sta_ctx->cache_conn_info.ht_operation)),
+ &hdd_sta_ctx->cache_conn_info.ht_operation)) {
hddLog(LOGE, FL("put fail HT oper"));
goto fail;
}
- if (hdd_sta_ctx->conn_info.conn_flag.vht_op_present)
+ if (hdd_sta_ctx->cache_conn_info.conn_flag.vht_op_present)
if (nla_put(skb, VHT_OPERATION,
- (sizeof(hdd_sta_ctx->conn_info.vht_operation)),
- &hdd_sta_ctx->conn_info.vht_operation)) {
+ (sizeof(hdd_sta_ctx->
+ cache_conn_info.vht_operation)),
+ &hdd_sta_ctx->cache_conn_info.vht_operation)) {
hddLog(LOGE, FL("put fail VHT oper"));
goto fail;
}
- if (hdd_sta_ctx->conn_info.conn_flag.hs20_present)
+ if (hdd_sta_ctx->cache_conn_info.conn_flag.hs20_present)
if (nla_put(skb, AP_INFO_HS20_INDICATION,
- (sizeof(hdd_sta_ctx->conn_info.hs20vendor_ie) - 1),
+ (sizeof(hdd_sta_ctx->
+ cache_conn_info.hs20vendor_ie) - 1),
tmp_hs20 + 1)) {
hddLog(LOGE, FL("put fail HS20 IND"));
goto fail;
@@ -26352,8 +26362,10 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
wlan_hdd_get_rssi(pAdapter, &sinfo->signal);
wlan_hdd_get_snr(pAdapter, &snr);
pHddStaCtx->conn_info.signal = sinfo->signal;
+ pHddStaCtx->cache_conn_info.signal = sinfo->signal;
pHddStaCtx->conn_info.noise =
pHddStaCtx->conn_info.signal - snr;
+ pHddStaCtx->cache_conn_info.noise = pHddStaCtx->conn_info.noise;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
sinfo->filled |= STATION_INFO_SIGNAL;
#else
@@ -26829,6 +26841,9 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
pHddStaCtx->conn_info.txrate.mcs = sinfo->txrate.mcs;
pHddStaCtx->conn_info.txrate.legacy = sinfo->txrate.legacy;
pHddStaCtx->conn_info.txrate.nss = sinfo->txrate.nss;
+ vos_mem_copy(&pHddStaCtx->cache_conn_info.txrate,
+ &pHddStaCtx->conn_info.txrate,
+ sizeof(pHddStaCtx->conn_info.txrate));
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
sinfo->filled |= STATION_INFO_TX_BITRATE |